Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Contour.Area.Using IMAQ GetPointsOnContour.

Hello everybody. Sorry for my English(i'm from Russia)
This my question:
 
I want to calculat area(square) of contour. For do this i using IMAQ GetPointsOnContour, the object for testing- black circle on white background.
Why this this VI find not all pixels of object? How this VI choosing spot for stat? How can i do to that VI will find the whole contour of object?
May be i must rotate image and save coordinate system??
I hope you can undestand me.sorry for my english-)))):smileyhappy:
P.S.-The coordinates of pixels must consecutively!!!  find on contour.
 
Thank you.Have a nice day.
0 Kudos
Message 1 of 9
(4,737 Views)
Anyone?Nobody?....Smiley Sad
0 Kudos
Message 2 of 9
(4,715 Views)
Hello Shtempel,

Thank you for using National Instruments discussion forums.  After looking at the code you wrote it looks like are not ussing all the data that the Find Contour Edges returns.  The Edge Information cluster is actually an array of line segments.  Inside each line segments is another array of clusters of line coordinates.  So you simply need to extract all line segments and all line coordinates and then build them into a new array of points.  You are going to also have to filter out the line segments that it finds closest to the edge of the image.  I have attached your VI that I modified a little to show you how you can extract all the data. I also added a very rough kind of filter functionality that will only add the line segments if they have a high enough wait.  You will also have to revise your area algorithm.  Let me know if this is unclear.  Thanks and have a great day.

Regards,
Mark T
Applications Engineer
National Instruments
0 Kudos
Message 3 of 9
(4,689 Views)
You should take a look at "IMAQ Extract Curves" and "IMAQ Polygon Area". "IMAQ Extract Curves" is similar to GetPointsOnContour, but designed for unprocessed grayscale images, such as the one in the example you attached.

Hope that helps,
Kevin C.
0 Kudos
Message 4 of 9
(4,684 Views)
Thank you Mark T...but I have not 8.2 version of LabView....Maybe you can save it to  8.0 version?(I m very intresting whats you do with my algoritsm of calculation area.Im testing my algoritm in many polygon-"S=(1/2)Sum[Xi+X(i+1)]*[Yi+Y(i+1)]"(i......N-1) - prominent,concave-its working).
----------
KevinC - thank for your interst to my question.I can solve my problem with using MagicWand-I take point from Roi Descriptor...
-------------
And now I have new problem.(I novice in Vision)
I know area of polygon but in pixels...How can reform this in real area of object?Mabe I must take attitude of real area(on the assumption of i know yhis) and the area in pixels?
Please tell me what bloc i must using to solve this problem.
(Sorry for my English again Smiley Wink...)
0 Kudos
Message 5 of 9
(4,676 Views)
You should look at IMAQ Particle Analysis. It can be used along with the Calibration VIs. Look in the NI Vision Concepts Manual for more information. Chapter 3 will tell you more about Calibration, Part III (Chapters 8, 9, and 10) will give you more information about Particle Analysis.

The Vision Example found at "C:\Program Files\National Instruments\LabVIEW 8.0\examples\Vision\2. Functions\Calibration\Nonlinear Calibration Example.llb" provides a good overview of using those functions together.

Hope that helps,
Kevin C.
0 Kudos
Message 6 of 9
(4,666 Views)
Hello Shtempel,

Here is the 8.0 version of the VI.  I hope it helps.

Regards,
Mark T
Applications Engineer
National Instruments
0 Kudos
Message 7 of 9
(4,645 Views)
Hello. Mark T thank you.
I dont now why but now I cant create new theme in this forum....
 
But I have new question:
How can do fullscreen mode in image display? I trying using zoom for this but its not work correctly(zooming its-1,2,3,4,5....coefficient, i cant using 2.1,3.5-in exemple).
Sorry for my EnglishSmiley Wink
 
Thank you and have a nice day.
0 Kudos
Message 8 of 9
(4,618 Views)
Hello Shtempel,

I assume when you say "Fullscreen mode" you want the image to display over the entire screen.  The two functions you should look at are IMAQ Winddraw, IMAQ WindSize, and IMAQ WindSetup.  These functions display an image in another window with or with out scroll bars and without a menu.  You can use IMAQ WindSize to dispaly the window at the full resolution of the screen.  These functions should get you started.  Let me know if this is unclear.  Thanks and have a great day.

Regards,
Mark T
Applications Engineer
National Instruments
0 Kudos
Message 9 of 9
(4,605 Views)