Options
XY coordinates of an outline
Hi. I need to extract the X and Y coordinates of the outline of my image for Elliptical Fourier analysis. How do I do this?
0
Answers
If your are interested in the shape Fourier analysis, you may look at the build in Premier's Fourier Descriptor measurement. There are several posts on the forum that show how to use it:
http://forums.mediacy.com/discussion/103/how-to-use-fourier-descriptor-for-object-shape-classification/p1
http://forums.mediacy.com/discussion/103/how-to-use-fourier-descriptor-for-object-shape-classification/p1
http://forums.mediacy.com/discussion/125/can-i-get-the-fourier-descriptor-coefficients-for-an-object-outline-without-using-macro-code/p1
You can also find more info on Fourier Descriptor in the Image-Pro Premier Automation Help.
Regards,
Yuri
Thanks,
Eimear
Here is the project. Use PrintOutlineCoordinates to print coordinates to the output window.
Yuri
1. When the data points are plotted around the outline there are some gaps where no data point is picked up why is this?
2. How do I manipulate how the xy coordinates are exported to excel? I want the data as two columns, x and y as opposed to a single row.
3. Can I apply a smoothing factor during the process, the pixel connectivity value is used was 8?
Thanks
2. You can change the output format of the coordinates on line 40. Use this code to print it into 2 columns:
s+=vbCrLf For Each p As SINGLEPOINT In points s+=p.x.ToString("F2") & vbTab & p.y.ToString("F2") & vbCrLf Next
3. You can apply smoothing during Count, use Smoothing parameter in the Segmentation options group of the Measurement options panel.
Yuri
Eimear
Outlines created by Count start from the left pixel on the top line of the object and go clockwise. Outlines are circular arrays and if you need different "standard location" then you should find the index of the point closest to that location and start from there.
You can also rotate the image, so the "standard location" will be on the top and count again.
BTW, shape normalization by size, orientation and outline starting point is implemented in Fourier Descriptor, so you may check again the demo project (macro DemoFourierDescriptor) to see how it works:
http://forums.mediacy.com/discussion/103/how-to-use-fourier-descriptor-for-object-shape-classification/p1
Check the code starting from line 71 in Module2.vb, it creates normalized object outline:
Yuri