06-10-2010 10:14 AM
Hi!
I'm working on an application in VB.net. I woudl like to use GrayMorphology() with a structuring element of 40x40pixels. Here is what I do:
Dim struct As New NationalInstruments.CWIMAQControls.CWIMAQStructuringElement
struct.SetSize(40, 40)
Vision.GrayMorphology(Image1, Image2, CWIMAQControls.CWIMAQGrayMorphOperations.cwimaqGrayMorphClose, ElemStruct)
previously i do Image2.BorderWidth = 22
the closing does not work.
Thanks.
06-10-2010 11:58 AM - edited 06-10-2010 12:00 PM
In LabVIEW it works.
I'm not expert in VB, but I guess that Image2.BorderWidth = 22 may not really (means physically) set the border width.
Look for the function named "ImageBorderSize" or something like that.
In additional, all elemenths (or some) in Structuring Element should be equal to 1. If all of them are zeroes, then nothing will be changed in image.
Andrey.
06-10-2010 08:16 PM
Sometimes the structuring element needs odd dimensions. Even dimensions confuse it since there is no center pixel.
Bruce
06-11-2010 03:15 AM
I found the solution!
The border width has not to be defined on the destination image but only on the source image.
For information, Image.borderWidth works fine.
Thanks for your reply!