Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

CWmachinevision.CountAndMeasureObjects using polygon as search rectangle

Hi, 

I need to search for objects within a polygon (irregular shape). The CWMachineVision's CountAndMeasureObjects method uses rotated rectangle as a search area. When I have an irregular polygon as a search area which method do I use? I know, I can use the irregular area as a mask and then take the entire area as rectangle,but I was looking for a more direct approach. Any help will be appreciated.

 

Second question: The help document for NI Vision for Visual Basic states that source code for CWMachineVision is included in NI Vision for Visual Basic. I have NI Vision Development Module and cannot locate the source code. Should I have access to the source code? If so, can someone point to where the source code is?

 

Thanks in advance,

Ekramul Majid 

 

0 Kudos
Message 1 of 2
(3,176 Views)

Hi ekramul,

 

 The Count and Measure Objects VI is meant for rectangular search areas so your Mask idea may be the best option.

 

 On your second point, the source code you are speaking of is the source code for the cwmv.ocx ActiveX control.

Stephen Meserve
National Instruments
Message 2 of 2
(3,141 Views)