Halcon mean_image
时间: 2023-07-21 09:45:49 浏览: 162
In Halcon, the `mean_image` operator computes the local mean of an input image using a rectangular or circular mask. The operator takes two input images: the first is the input image for which the local mean needs to be computed, and the second is the mask image which defines the shape and size of the local region for computing the mean.
The syntax for the `mean_image` operator is as follows:
```
mean_image(Image, Mask, Mean)
```
where `Image` is the input image, `Mask` is the mask image, and `Mean` is the output image containing the local mean values computed using the specified mask.
For example, the following code computes the local mean of an image using a rectangular mask with a size of 9x9 pixels:
```
read_image(Image, 'my_image.jpg')
gen_rectangle1(Mask, 50, 50, 58, 58)
mean_image(Image, Mask, Mean)
```
In this code, `gen_rectangle1` is used to generate a rectangular mask centered at pixel coordinates (50, 50) with a width and height of 58 pixels, and then `mean_image` is used to compute the local mean of the input image `Image` using the specified mask.
阅读全文