Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Convert Contour to ROI

Hi Guys:

 

        I'm using IMAQ Extract Contour VI to get the contour points, is there anyway to conert thoese points to ROI , so that i can extract the

area from the image ?

 

       1.jpg

0 Kudos
Message 1 of 8
(4,987 Views)

What you probably want to do is create a mask from the controur.  This produces a binary image, with every pixel inside the contour receiving a value of 1, and everything outside receiving a value of 0.  Now you can take this binary image, and multiply it by the original.  The result image will contain only those pixels that are inside the mask.  All others will be 0.

 

If the original image is not 8-Bit, you will need to cast your binary image to whatever bit depth you need.

 

If you really need an ROI, you can use the Mask to ROI VI to get this.

Machine Vision, Robotics, Embedded Systems, Surveillance

www.movimed.com - Custom Imaging Solutions
0 Kudos
Message 2 of 8
(4,977 Views)

This can work for You:

 

2013-09-24 19-58-41.jpg

 

This is good example about ROIs:

http://zone.ni.com/devzone/cda/epd/p/id/5249

0 Kudos
Message 3 of 8
(4,974 Views)

Thank you guys for the great help!

0 Kudos
Message 4 of 8
(4,967 Views)

Could you upload the vi you shows in attachement ?

i can't find it from the examples

0 Kudos
Message 5 of 8
(4,965 Views)

 

I tried , seems like the ROI is invalid.

 

无标题.jpg

0 Kudos
Message 6 of 8
(4,961 Views)
Message 7 of 8
(4,958 Views)

Thank you guys for the details and examples... It helped me a lot in my project...

Into the pursuit...
Maverick
0 Kudos
Message 8 of 8
(3,785 Views)