Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

Fill Holes and Particle Filter Error

I posted a question about an error I was getting doing a particle filter operation some days ago and got no response from this forum. To illustrate the problem I have attached some VB code to show the error described below under PARTICLE FILTER.

I have also found another problem with filling holes in a Binary image, which is also illustrated in this code. When I try to fill holes on my binary image it turns the whole image black! I have tried thresholding before the operation, inverting the image etc, with no luck! All I get is a fully black image! Again this code pretty much follows the example given in the documentation!


All the files for the sample code are in one attached zip file

PARTICLE FILTER
The followi
ng code is given in the IMAQ Vision documentation for conducting a particle filter

Dim i As New CWIMAQImage
Dim data As New CWIMAQParticleFilterData
' Select particles that contain less than 100 pixels or
' more than 300 pixels and remove them.
data.Add
data(1).Parameter = cwimaqParticleArea
data(1).MinValue = 100
data(1).MaxValue = 300
data(1).Exclude = True
' Perform the particle filter operation and
' store the result in i
CWIMAQVision1.ParticleFilter CWIMAQViewer1.Image, i, data, True


However it generates the following error for me when doing this on a binary image.
Run time error ‘438’ - Object does not support this property or method which is generated by the line in the code
data(1).MinValue = 100
same is also true for the line
data(1).MaxValue = 300
but not
data(1).Exclude = True
Has the syntax been changed from that in the documentation?
0 Kudos
Message 1 of 2
(2,911 Views)
You will probably have better luck posting your question on the Vision discussion forum here.

Regards,
TonyH
0 Kudos
Message 2 of 2
(2,911 Views)