Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

How to using ROI Region to Image Threshold (by NI Vision)?.

I use C# and NI Vision development 2010 sp1,

I want to set ROI Region to Image Threshold

ex:

1.JPG

 

But,Thresold function must use VisionImag to Computing, as below parameter1 & parameter2...

public static  void Threshold(
   
VisionImage source,
   
VisionImage destination,
   
Range range,
   
bool replaceValue,
   
double newValue
);

 

Now I just can Extract a new VisionImage to Threshold, and ImageToImage the new VisionImage to Origin VisionImage,

but it just can use a retangle to Extract Image,

How can I to use RotatedRectangle, Oval or Polygon ROI to achieve my function??

0 Kudos
Message 1 of 2
(4,206 Views)

I use LabVIEW, but the same steps are required:

 

1.  Create a copy of the image

2.  Threshold the copy

3.  Convert the thresholded copy to the same image type as the original (U8, I16, etc)

4.  Make out everything but the ROI on the copy

5.  Take the original image and mask out only the ROI

6.  Add the two images.

7.  Add an overlay of the ROI (convert ROI to rectangle and use rectangle for overlay)

 

This should work for non-rectangle ROIs too.

0 Kudos
Message 2 of 2
(3,982 Views)