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: |
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 |
In reply to this post by Gallus
Hi David,
one possiblity would be the following: - Convert it to grayscale (8 bit or 16 bit) - Invert it so that the lines correspond to large numbers - Draw a thick line* parallel to the axis such that there are only ticks below the line, not the long axis line * double click the line tool and enter e.g. 20 for the line width - Edit>Selection>Line To Area - Threshold such that you get the ticks completely, but no large area of the background (e.g. 20-255) - Set Measurements to include Center of Mass - Analyze Particles with 'Display Results" and "Clear Results" You will get a table with positions of all the ticks (XM, YM). For an axis along the x direction, save it and sort it by XM in a spread sheet. For the y axis, it will be sorted already. Since 'Center of Mass' takes brightness into account, the accuracy will be much better than the pixel discretization. You can automate it, record the commands while you do everything manually with Plugins>Macros>Record, and you get a macro (probably you have to place the line manually, everything else can be done in a macro). But don't forget that any distortions caused by the image acquisition will influence your result! E.g. a flat bed scanner images the direction perpendicular to the movement (usually parallel to the shorter side) with a lens, and that lens can induce distortions. Also there might be some elastic deformation of the ribbon that moves the carriage with the light source, lens and line sensor. So try your procedure with an accurate ruler first. Michael ________________________________________________________________ On Apr 29, 2015, at 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 |
Free forum by Nabble | Edit this page |