I posted a question about an error I was getting doing a particle filter operation some days ago on the VB forum and got no response so I am reposting here under Vision. 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 f
ile
PARTICLE FILTER
The following 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?"