HOperatorSet.GrayDilationRect(img, out img, 2, 2); HObject regionCenter; HOperatorSet.GenRectangle1(out regionCenter, 2, 2, 2, 2); HTuple tMean, tmp; HOperatorSet.Intensity(regionCenter, img, out tMean, out tmp); tMean为0 中间3*3任意一格的灰度设置成1,则(2,2)的灰度变成1。 byt...
在HDevelop中 dev_update_off() read_image (Image, 'D:/bb/tu/1.jpg') rgb1_to_gray(Image,Image1) *将RGB图像转换为灰度图像 gray_dilation_rect (Image1, ImageMa
gray_dilation_rect— Determine the maximum gray value within a rectangle. Signature Description gray_dilation_rectcalculates the maximum gray value of the input imageImagewithin a rectangular mask of size (MaskHeight,MaskWidth) for each image point. The resulting image is returned inImageMax. If ...
ReadImage(&ho_Image, "D:/bb/tu/1.jpg"); Rgb1ToGray(ho_Image, &ho_Image1); //将RGB图像转换为灰度图像 GrayDilationRect(ho_Image1, &ho_ImageMax, 5, 5); //图像膨胀-->效果:增加亮部,减少暗 //参数1:灰度值图像 //参数2:输出图像 //参数3和参数4:结构元的宽和高部 GetImageSize(ho...
barr[5 * i + j] = (0 == i * j * (i - 4) * (j - 4)) ? (byte)1 : (byte)0; } } var img = WHCSHalCon.Base.CreateByteImage(barr, 5); HOperatorSet.GrayDilationRect(img, out img, 2, 2); HObject regionCenter; ...
gray_dilation_rect calculates the maximum gray value of the input image Image within a rectangular mask of size (MaskHeight, MaskWidth) for each image point. The resulting image is returned in ImageMax. If the parameters MaskHeight or MaskWidth are even, they are changed to the next larger...