Converting .3DC + .DDS files into .OBJ + .MTL + .TGA - file

How would I go at converting .3DC + .DDS files into .OBJ + .MTL + .TGA?

This is actually very simple to do, this goes for mostly any file format but for this I'll be using .3DC file. Download 3D Object Converter, you'll have to pay a fee if you want the program to completely convert your object without removing every 5th quad or triangle. After you've done that open it and go into the menu and click batch convert. Add your file you want to convert change the options so that they suit you and choose the export for .obj Wavefront don't take any other type of .obj file format. You can find it near the end of the list. Then convert the file. And voila!
If your texture is in dds format or whatever and you want to change it to tga, just use an online picture converter.
After that amend the file.mtl and change to the correct texture it should call to.
And there you go!

Related

Issue with writeVideo/ VideoWriter MATLAB

I'm a beginner so sorry in advance for the mistakes.
I have a set of data from a camera recording saved in a 4D array with these dimensions (250x300x10603x12).
The first is the dimensions of the video (pixels). The 10603 are the FrameRatexTime. 12 are the subjects I recorded.
I extract one subject at a time for analysis in this way:
subj1 = data(:,:,:,1);
This brings me to an array containing the frames of subject 1, which I can display with implay.
Now I would like to write a video of this new array and save it in .avi format, I use this code:
v = VideoWriter('subj1.avi')
open(v)
writeVideo(v,subj1)
close(v)
but it keeps giving me this error
Error using VideoWriter/writeVideo (line 410) IMG must be an array of
either grayscale or RGB images.
In fact, looking at the shape of the array, there is nothing that points to a grayscale or RGB index. How can I get a .avi file in this case? Do I have to transform the array?
Why does it still display the video with implay?
clarification: the fact that I have to transform the array into an .avi file is because I will have to analyse it by exporting it to Python with OpenCv.
In fact, if I export the .mat file directly to Python, I can't get the list of Frames.
Matlab's documentation for writeVideo says that for a sequence of grayscale images like you have, it is expecting a "height-by-width-by-1-by-frames" array. You are only passing it "height-by-width-by-frames".
So, you need to reshape your subj1. Maybe try doing it like this:
newsubj = zeros(250, 300, 1, 10603)
newsubj(:,:,1,:) = subj1
and then save newsubj instead of subj1:
writeVideo(v,newsubj)
Finally, I think you may get some lossy compression when you save as an avi, so it may not be the best way to export it from Matlab and importing it to Python.

Imagemagick using metadata properties to mass rename images

I have got a ton of dicom files that I want to mass rename using their properties tags.
My question is, what is the syntax for taking a property tag(such as dcm:SeriesNumber) for every image and using it to rename the images in the directory?
I'm guessing it involves breaking it down to the relevant tag using -identify -verbose and then somehow passing that string over to the filename property?
Really would appreciate the help(using win10 command line).
Figured it out.
convert *.dcm -set filename:f "%[dcm:SeriesNumber]"_"%[dcm:AcquisitionNumber]" "%[filename:f].jpg"
the "" after filename:f hold the string that's going to represent the file name
[] brackets hold the metadata property, that you can chain by using % percentage sign which declares a new property

Intel's IPP to create images from arrays

I am working in C++ and I have a vector container of float values. I want to write an image file to disk where the pixel values of the image are the values from the array.For instance I have 40,000 values in my array and I want a 200x200 image file to be created in some format(the format is not very important, however, I would prefer something with lossless coding if possible). I would like to do this using Intel's libraries, IPP. Can somebody tell me which function would be most appropriate for my problem.(At present I'm sticking only to grayscale images.)
One way would be to just write it out as space delimited numbers in a file.raw, and load it with ImageJ. ImageJ will give you an option to specify width, height and bit-depth.
Second, one I have dome in the past, is (if you use Matlab too), use matlab engine commands to figure(data), and then used getframe/get(gcf) etc. to imwrite it to your fav. image format (Matlab has tons of them)

Cut a jpg file in C, (NOT crop)

i would like to know how can i cut a jpg file using a coordinates i want to retrieve using artoolkit and opencv, see:
Blob Detection
i want to retrieve coordinates of the white sheet and then use those coordinates to cut a jpg file I'm took before.
Find this but how can this help?
How to slice/cut an image into pieces
If you already have the coordinates, you might want to deskew the image first:
http://nuigroup.com/?ACT=28&fid=27&aid=1892_H6eNAaign4Mrnn30Au8d
This post uses cv::warpPerspective() to achieve that effect.
The references above use the C++ interface of OpenCV, but I'm sure you are capable of converting between the two.
Second, cutting a particular area of an image is known as extracting a Region Of Interest (ROI). The general procedure is: create a CvRect to define your ROI and then call cvSetImageROI() followed by cvSaveImage() to save it on the disk.
This post shares C code to achieve this task.

display mat file in matlab

I want to display mat file's content to see all the results. I know that I can load it and then double click on it the content are display in the workspace, this case happen when the mat file content few information but when I have mat file content information for more than 13000 record I can't display it. could please any one help me to find any way to display mat file as table?
thanks
I do not know the format of your data (multi-dimensional, structs, cell-arrays), but there is a function called "openvar" which can be very useful for these things.
Let's define a large random 500x500x10 3d-matrix:
large = rand(500,500,10);
This variable contains 2.5 million double-values and takes up close to 20MB of memory. Opening this in the variable editor by double click in the Workspace window on "large" will usually (atleast on my system) give the following message:
"Cannot display summaries of variables with more than 524288 elements."
But you can use the "openvar"-function to open certain parts:
openvar('large(:,:,1)'); %# pass the argument as a string.
This will open the first "layer" of matrices in your Variable Editor (a 500x500 matrix in this case). This is useful if you need to look into certain parts of a large variable.
Of course you can always define new variables that contain subsets of your larger variable:
less_large = large(:,:,1);
... and then open "less_large" in the variable editor by double clicking on it in the workspace-window. But sometimes the "openvar"-method is a bit faster/easier.
You have a few options. Starting from a clear workspace, you could load the mat file into the workspace. Anything now in the workspace is in the mat file. You can use the variable viewer or parse with scripts.
If you have the Simulink toolbox, you can use Simulink.saveVars to save the contents of the workspace to a human readable m-script that would generate the same contents. It's a shame that you need Simulink to do this, as this function has nothing to do with Simulink.
How about after loading the data, and use whos to display the variables in current workspace? Note that you may want to clear all the other variables before displaying them.

Resources