LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

NI Vision Development Shape Detection does not detect rectangles but quadrangles!

I need to find the best rectangle around the object (block) I'm measuring. This block can have some tolerances, so opposite edges may not be exactly parallel to each other. I tried to use the Shape Detection VI from the Vision Development Module to find a rectangle fitting around the blok but it turns out that the found quadrangle does not have perpendicular edges, but that's exactly what I need!

 

The graph output of my findings.The graph output of my findings.

In this image, the linear function represent the rectangle found. As you can easily recognise, the left edge is not parallel to the right edge.

 

 

Does anyone have an idea how to realise this?

Thank you!

0 Kudos
Message 1 of 6
(2,763 Views)

Hi Dani,

would you have some raw data for us to work on? I can't recognize whether your raw data is just 4 points, or already a reactangle...

Thanks,

Niko

Niko NR
Systems Engineer, National Instruments
0 Kudos
Message 2 of 6
(2,697 Views)

I'm measuring blocks which often do not have parallel edges, like the following:

LastImage.png

I need to get the best rectangle (perpendicular edged but minimum distance between computed rect and object contour) around the object.

0 Kudos
Message 3 of 6
(2,677 Views)

I think you may have a missing parameter in the fourth function of your Block Diagram.  [My apologies to my colleagues who cannot properly "guess", or "make up", what the Block Diagram looks like -- maybe the_dani will attach the VI or VIs in question, possibly even the entire Project by compressing the folder containing the code and attaching the resulting .ZIP file, but otherwise, feel free to send in your Best Guess at how to improve the Block Diagram ...].

 

Bob Schor

0 Kudos
Message 4 of 6
(2,673 Views)

You are contradicting yourself when you say that the rectangle's opposite edges may not be parallel, but the corners have to be perpendicular.  If the opposite edges aren't parallel how can all of the corners be perpendicular?  

0 Kudos
Message 5 of 6
(2,669 Views)

Oh yeah, sorry!

 

This is the VI which detects the shape and extracts my contour!

0 Kudos
Message 6 of 6
(2,662 Views)