MATLAB: Resolution of a MATLAB-created JPG

figureimage processingiminforesolution

I am using some previously developed image processing code in order to calculate some area moments of inertia. In order to use the previously developed code, I have to plot my cross section, save it as a jpg, then upload that file and run the code on it. One portion of the code looks for the resolution (mm/pixel) of the cross sections. Is there a way to calculate the resolution from just the iminfo and the known size in mm of the cross section?

Best Answer

In case you include the information about the resolution, you can get it via imfinfo (see e.g. http://www.mathworks.com/matlabcentral/answers/53909-how-can-i-find-the-resolution-of-an-image)
BUT why do you first save and then load the image? Also jpg is not a good format for graphs (you know these blurry artefacts close to hard edges such as lines). Whatever you do (except of investigating these artefacts, maybe) will be easier if you simply use the data you already have instead of saving it as image, loading the image and processing the data finally.