RH file conversion - file-conversion

I need to extract the design from a Right Hemisphere 3D file (contains design and sop) to .STEP/ .STL / .fbx.
We could open the RH file in Deep View but could not convert it to the .STEP/.STL/.fbx format.

Related

Can I do deep learning if the image size of the paired images is different?

How to write a deep learning program, 1000 pictures of 29001 * 499 learn the corresponding 1000 pictures of 29001 * 936, so that the former has more information.
I tried the srcnn algorithm, but the generated. h5 file is too large. Is there any other algorithm I can use

How to convert depth or/and point cloud data (.dat file) to OpenCV Mat object using c++?

I have a camera TI opt 8241 with resolution 320 x 240. I get a .dat file which consists of the depth and intensity values in as (z,I) and point cloud data as (x,y,z,I).
Download Depth and Intensity data
Download Point cloud data
I need to display this data as an image(Mat object) in OpenCv using c++. How can I do that?
In Matlab I could display it by using following program
fileID= fopen('DepthFrameData.dat','r');
A1=fscanf(fileID,'%f ; %f \n',[2 76800]);
mat = vec2mat(A1(1,:),320);

audio waveform to Integer sequence

I need to create an Integer Sequence from an Audio file. I was checking the waveform libraries as that draw a linear graph. But I am searching for the key information, What is the source of the integer that is used to draw the graph ? is it amplitude ? frequency ? or something else ? There are libraries available but I need to know what unit of information I need to extract to have a data that I can feed to a graph. However drawing a graph is not my objective. I just want that raw integer array.
Of course, it's the amplitudes what you need to get a wave oscillogram, and it's the way PCM data are stored in wav files, for example (data which come directly after the file header). Note that there are 8-bit and 16-bit formats, the latter may be also big-endian or little-endian depending on the byte order (just to keep you aware of it).
Audio is simply a curve - when you plot it with time across the X axis then Y axis is amplitude - similar to plotting a sin math function - each point on the curve is a number which gets stored in the audio file - WAV format this number typically is a 16 bit unsigned integer - so ignoring the 44 byte header - the rest of the file is just a sequence of these integer numbers. When this curve varies up and down quickly over time the frequency is higher than if the curve varies more slowly over time. If you download the audio workbench application : Audacity you can view this curve of any audio file (WAV, mp3,...)

Using the libsndfile library to read a WAV file in C++

I am using libsndfile in C++ to read a WAV file. There are two points I don't understand:
How can I get the "Bits per sample" value for the WAV file in question? I read the documentation at the website http://www.mega-nerd.com/libsndfile/api.html, but I didn't find a member for "Bits per sample" in the SF_INFO struct.
Using the WAV file, how can I create the data to use to draw vectors for describing the sound data, read by function sf_readf_float() in library sndfile.h? Is there any method to do this?
The format field will give you the BPS. For e.g.: SF_FORMAT_PCM_16.
The sf_readf_float will convert the sample into the -1.0 to 1.0 range no matter the bps of the input sound. You only have to take care that about the audio channels. If the audio has 2 channels and you read 4 floats, you will have:
sample-1 of left channel
sample-1 of right channel
sample-2 of left channel
sample-2 of right channel
Then, to draw the point you must convert the [-1.0;1.0] to the viewport height. For e.g. if viewport is at Y=20 and the height is 300px, the formula is:
PY = (int)(20.0 + (sample_value / 2.0 + 0.5) * 300.0);

jpegtran.exe not correctly rotating image

I have a freshly compiled libjpeg version 9 and tried running jpegtran.exe in command line with the arguments:
.\jpegtran.exe -rotate 180 -outfile test_output1.jpg testimg.jpg
testimg.jpg: test_output1.jpg:
As you can see it does rotate the image but it clips it and it's not put together correctly. The usage.txt file that comes with the package isn't totally up to date because I had to use the -outfile switch instead of what it says:
jpegtran uses a command line syntax similar to cjpeg or djpeg. On
Unix-like systems, you say:
jpegtran [switches] [inputfile] >outputfile
On most non-Unix systems, you say:
jpegtran [switches] inputfile outputfile
where both the input and output files are JPEG
files.
To specify the coded JPEG representation used in the output file,
jpegtran accepts a subset of the switches recognized by cjpeg:
-optimize Perform optimization of entropy encoding parameters.
-progressive Create progressive JPEG file.
-arithmetic Use arithmetic coding.
-restart N Emit a JPEG restart marker every N MCU rows, or every N MCU blocks if "B" is attached to the number.
-scans file Use the scan script given in the specified text file.
See the previous discussion of cjpeg for more details about these
switches. If you specify none of these switches, you get a plain
baseline-JPEG output file. The quality setting and so forth are
determined by the input file.
The image can be losslessly transformed by giving one of these
switches:
-flip horizontal Mirror image horizontally (left-right).
-flip vertical Mirror image vertically (top-bottom).
-rotate 90 Rotate image 90 degrees clockwise.
-rotate 180 Rotate image 180 degrees.
-rotate 270 Rotate image 270 degrees clockwise (or 90 ccw).
-transpose Transpose image (across UL-to-LR axis).
-transverse Transverse transpose (across UR-to-LL axis).
Oddly enough (or maybe not), if I execute .\jpegtran.exe -rotate 180 -outfile test_output2.jpg test_output1.jpg I get the original image back without any clipping issues. It's flipping the clipped parts but just not lining it up right with the rest of the image.
test_output2.jpg:
I get the same result by executing jpegtran.exe -rotate 90 twice.
Also, I tried it on a larger .jpg file which resulted in the same issue but the file size was 18KB smaller for the output. I imagine the issue is related to this.
Edit - I also found this blurb which seems to describe the problem:
jpegtran's default behavior when transforming an odd-size image is
designed to preserve exact reversibility and mathematical consistency
of the transformation set. As stated, transpose is able to flip the
entire image area. Horizontal mirroring leaves any partial iMCU
column at the right edge untouched, but is able to flip all rows of
the image. Similarly, vertical mirroring leaves any partial iMCU row
at the bottom edge untouched, but is able to flip all columns. The
other transforms can be built up as sequences of transpose and flip
operations; for consistency, their actions on edge pixels are defined
to be the same as the end result of the corresponding
transpose-and-flip sequence.
The -trim switch works, if you can call it that, and trims out the disorganized data but the image is smaller and lost data.
test_output5.jpg:
Adding the -perfect switch which supposedly stops the above from happening results in this: transformation is not perfect for output and no image.
So is it not possible to losslessly rotate a .jpg? I could, myself, go into paint and reconstruct the original image by simply moving the edge lines into their correct place. Is there a method to do this within libjpeg?
A lossless rotation works with whole DCT blocks contained within the JPEG file. These blocks are always 8x8 or 16x16 pixels (depending on the compression downsampling settings). The file contains a width and height so the extra pixels can be thrown away when the image is decoded, but there's no way to move the clipping from the right/bottom edge to the left/top edge. The software is doing the best it can with an impossible problem.
As you've discovered the way around this problem is to make the width and height evenly divisible by 16. You'll find that images from cameras for example will have this property.