NI產品與技術 討論區

取消
顯示結果 
搜尋替代 
您的意思是: 

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 積分
1 條訊息(共 5 條)
6,704 檢視

Hi,

 

Did you try to use Vision Assistant first before you try going deep into the C# code?

Vision Assistant helps you to prototype the application and it is easier to use.

0 積分
2 條訊息(共 5 條)
6,690 檢視

Excuse me, I already have to try Vision Assistant,
but the threshold function of Vision Assistant only set gray level or autothreshold choice,
I can't set roi region to threshold.

I look for the help document, as below...
public static  void Threshold(
   VisionImage source,
   VisionImage destination,
   Range range,
   bool replaceValue,
   double newValue
);

public static Collection<ThresholdData> AutoThreshold(
   VisionImage source,
   VisionImage destination,
   int numberOfClasses,
   ThresholdMethod method,
   VisionImage mask
);

AutoThreshold function seem to use mask to achieve ROI region to threshold,
but I want to use manual threshold function that must use threshold function,
why threshold function have not mask parameter???

0 積分
3 條訊息(共 5 條)
6,681 檢視
解決方案
由主題作者所接受 yflin

Hi yflin,

 

I think this is what you want to do in the Vision Assistant.

You can check my attched script and image.

 

VA.png

 

0 積分
4 條訊息(共 5 條)
6,676 檢視

極度高興的表情

That's right.

It is my demand.

Thanks for your repply.

0 積分
5 條訊息(共 5 條)
6,664 檢視