Login  Register

Re: Assistance for distance measuring

Posted by Peter Haub on Apr 29, 2015; 11:01am
URL: http://imagej.273.s1.nabble.com/Assistance-for-distance-measuring-tp5012644p5012645.html

Hallo David,

you can try the Analyze/Plot Profile command via macro call.
An example can be found on:
http://rsb.info.nih.gov/ij/macros/GetProfileExample.txt

This will create and save the horizontal profile of a selected ROI.
You can extend the macro code to find the local maxima (minima).

You can improve the intensity contrast by converting your RGB image to
gray image, e.g. by application of RGBto16bit conversion (better than
direct RGBto8bit conversion).

So, you can simply test it by making a rectangular selection of the
vertical lines and running the macro code:

   run("16-bit");
   run("8-bit");
   run("Invert");

   run("Clear Results");
   profile = getProfile();
   for (i=0; i<profile.length; i++)
       setResult("Value", i, profile[i]);
   updateResults;

   // Plot profile
   Plot.create("Profile", "X", "Value", profile);

   // Save as spreadsheet compatible text file
   path = "c:\\test\\profile.csv";
   saveAs("Results", path);

I assume you are considering the image rotation on calculating the peak
distance.

Hope that helps,
Peter


On 29.04.2015 10:51, Gallus wrote:

> Dear ImageJ experts
>
> First of all, sorry if this is to basic for you...
>
> I’m working within a printing company and one of the issues we currently
> face, is the effect of distortion of an image. The image is printed in a
> creative way with high build printing plates. Thereby mechanical tolerances
> can force such distortion effects. In order to compensate this, we usually
> are printing mm scales or grids with a test form, which are later on
> manually (with a lens) measured. This data then is used as a compensation
> overlay in the prepress. For a single test print we have to measure up to
> 600 points (mm grid) which is VERY time consuming.
>
> After looking for a smarter solution, I found ImageJ on the web. Until now
> I’m using the *Multi-Point* tool to manually set the measure points onto the
> grid and get the coordinates out with *Analyze => Measure*. What I like to
> do now, is to automatically measure the grid / scale. Means to detect the
> edges along a vector and to measure the edges (multiple up to 600) against a
> zero base ( or relative distance).
>
> I tried to use *Analyze, Gels, Plot Lanes*. It delivers a Peak diagram, but
> I’m not able to automatically convert the peaks…
>
> Thank you in advance for any good idea / guide line.
> David
>
> PS. Example of grid:
> <http://imagej.1557.x6.nabble.com/file/n5012644/grid.png>
>
>
>
>
> --
> View this message in context: http://imagej.1557.x6.nabble.com/Assistance-for-distance-measuring-tp5012644.html
> Sent from the ImageJ mailing list archive at Nabble.com.
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html