Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

polygonal ROI

Hi
In my application i need to select the ROI which is polygonal how can i do that
basically what i want to do is like this
i have one blob which i need to cut at certain location the cutting pattern is selected from one of three predfined patterns (which are polygons) the selection depends on the blob size. basically i need to take the biggest pattern which fits inside the blob
 
can anybody help me out

Tushar Jambhekar
tushar@jambhekar.com

Jambhekar Automation Solutions
LabVIEW Consultancy, LabVIEW Training
Rent a LabVIEW Developer, My Blog

0 Kudos
Message 1 of 4
(3,529 Views)

I'm not sure if I understand the question, but I will give it a try.

It sounds like you want to select one of three shapes and place the ROI on the image.  To do this, I would store each ROI as a constant containing the vertices of the polygon.  You could probably draw the ROI on the screen and store it.  I would then setup three buttons, one for each ROI.  When the button is pressed, you set the current ROI equal to the predefined ROI.  You can then manipulate the ROI using the mouse to position it over your blob.

Does this answer your question?  If not, can you give a little more detail about what problem you are having?

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 2 of 4
(3,522 Views)
Let me explain my problem in more detail
Please see the attached picture it shows the blob which is my object and three templates which represent the dies.
now i need to cut my blob using one of the dies so as have object with that size
while cutting i want to give precedence to template 1 then template 2 and then template 3 (i.e. if template 1 is not fitting perfectly INSIDE the blob then try 2 and then 3 if none of the die fits properly then i reject the blob)
 
is my problem clear?

Tushar Jambhekar
tushar@jambhekar.com

Jambhekar Automation Solutions
LabVIEW Consultancy, LabVIEW Training
Rent a LabVIEW Developer, My Blog

0 Kudos
Message 3 of 4
(3,518 Views)
Okay, now I think I understand.  It sounds like you want to automate the process of selecting the largest polygon that fits.
 
I'm not sure the best way to do this.  My first thought is to find the area centroids of both the blob and the ROIs, and position the centroid of the ROI over the centroid of the blob.  You could quantify the image using the ROI as a mask (or something like that) to determine if all the pixels within the ROI are black.  If any are white, go to the next ROI.  You could also try some sort of shifting algorithm to see if you can shift the ROI away from the white parts until everything is black within the ROI.
 
I'm sure there are better methods of fitting the polygon within the blob, but I don't know what they are off the top of my head.
 
Bruce
Bruce Ammons
Ammons Engineering
0 Kudos
Message 4 of 4
(3,513 Views)