CN-115311242-B - Industrial camera image sharpening method, device, equipment and storage medium
Abstract
The invention discloses an industrial camera image sharpening method, device, equipment and storage medium, which comprises the steps of carrying out sharpening processing on the edge weight of an input original image enhanced image to obtain a preliminary sharpening layer for highlighting the image edge and an edge layer for reflecting the image edge; and the FPGA performs noise reduction sharpening weight treatment on the denoising edge layer and then performs weighted fusion with the preliminary sharpening layer to form a sharpened image which is sharpened only to the edge. The method removes isolated noise points by utilizing edge judgment, further removes poisson noise and Gaussian noise, further reduces the influence of noise on a sharpening result by weighting fusion, and improves the image sharpening effect.
Inventors
- ZHANG XUERUI
- SHAO YUNFENG
- CAO GUIPING
- DONG NING
Assignees
- 合肥埃科光电科技股份有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20220816
Claims (5)
- 1. An industrial camera image sharpening method is characterized by comprising the following steps, The method comprises the steps of obtaining a preliminary sharpening layer for highlighting an image edge and an edge layer for reflecting the image edge through sharpening the edge weight of an input original image enhanced image; identifying and removing a noise area according to a gray level change standard of a pixel point of the noise edge area; judging the number of pixels which are larger than a threshold value by using N multiplied by N small squares taking the current pixel point in the edge layer as the center, wherein N is an odd number and is smaller than or equal to 9, judging the edge point as 0 if the number of pixels which are larger than the threshold value is smaller than N, judging the edge point as 1 if the number of pixels which are larger than the threshold value is larger than or equal to N, and selecting pixel block edge identification to obtain a denoising edge layer; after the noise-reduced sharpening weight treatment of the denoising edge layer, the denoising edge layer is subjected to weighted fusion with the preliminary sharpening layer to form a sharpened image which is sharpened only to the edge; The weighted fusion algorithm is that R=Sx (1-B) +AxB, wherein S is an original image, R is a sharpened image which only sharpens edges, A is a preliminary sharpening layer, and B is the denoising edge layer.
- 2. The industrial camera image sharpening method according to claim 1, characterized in that said threshold is calculated by means of an adaptive threshold, in particular comprising: Dividing the edge layer into N multiplied by N small blocks, calculating the gray standard deviation of each small block, sorting the standard deviations, selecting the gray values of the standard deviations arranged in the first half, and calculating the average value as a threshold value.
- 3. An image sharpening device, comprising: the image sharpening module sharpens the original image to obtain a primarily sharpened image layer and an edge image layer; the noise removing module is used for judging edge points of the edge image layer, and giving noise removing treatment of the fixed value of the central pixel of the region according to the gray level change degree of the pixel of the region to obtain a denoising edge image layer; identifying and removing a noise area according to a gray level change standard of a pixel point of the noise edge area; judging the number of pixels which are larger than a threshold value by using N multiplied by N small squares taking the current pixel point in the edge layer as the center, wherein N is an odd number and is smaller than or equal to 9, judging the edge point as 0 if the number of pixels which are larger than the threshold value is smaller than N, judging the edge point as 1 if the number of pixels which are larger than the threshold value is larger than or equal to N, and selecting pixel block edge identification to obtain a denoising edge layer; The image fusion module is used for carrying out weighted fusion on the original image, the preliminary sharpening image layer and the denoising edge image layer to obtain a sharpened image which is sharpened only by edges; The weighted fusion algorithm is that R=Sx (1-B) +AxB, wherein S is an original image, R is a sharpened image which only sharpens edges, A is a preliminary sharpening layer, and B is the denoising edge layer.
- 4. A computer device is characterized by comprising a processor and a memory, The memory is used for storing a computer program; the processor is configured to execute a computer program stored on the memory to implement the image sharpening method according to claim 1 or 2.
- 5. A storage medium, characterized in that the image sharpening method according to claim 1 or 2 is enabled when a program in the storage medium is executed by a processor.
Description
Industrial camera image sharpening method, device, equipment and storage medium Technical Field The present invention relates to the field of image processing technologies, and in particular, to a method, an apparatus, a device, and a storage medium for sharpening an industrial camera image. Background For the original image from the image sensor, poisson noise and gaussian noise are generally carried, and the noise is sharpened together by a common USM sharpening algorithm to cause the image information to be lost, so that the image sensor needs to be improved so as to only strengthen edges and not strengthen the noise. Because of problems such as improper lens and focal length, transition pixels often exist at the edge of an original picture shot by a camera sensor, and a sharpening algorithm can be used for reducing the number of the transition pixels. Conventional image sharpening algorithms have template operators such as laplace operator and USM sharpening algorithm, which can enhance the edge information of the image, but also enhance noise, and because the camera resources are limited, the complex sharpening algorithm cannot be applied to remove noise, so that a simple sharpening algorithm is required to enhance only the edges. The existing approach closest to the present invention is CN103763460a, which determines edge points directly from the difference between the current pixel and surrounding pixels, and the magnitude of enhancement of all edge points is fixed, without taking gaussian noise and edge aliasing into account. The existing general USM sharpening algorithm extracts image high-frequency information through gaussian filtering or differential operator, then obtains sharpening result by adding weighted high-frequency components to original image, they often do not consider gaussian noise and poisson noise problems of the image, and the noise is sharpened while sharpening edges. Disclosure of Invention The invention provides an industrial camera image sharpening method which can at least solve one of the technical problems. In order to achieve the above purpose, the present invention adopts the following technical scheme: An industrial camera image sharpening method, comprising: Sharpening the edge weight of the enhanced image of the input original image to obtain a preliminary sharpening layer for highlighting the edge of the image and an edge layer for reflecting the edge of the image; the method comprises the steps of giving a fixed value of a central pixel of an area to an edge layer for noise removal according to the gray level change degree of the pixel of the area to obtain a denoising edge layer; The denoising edge image layer is subjected to noise reduction sharpening weight treatment and then is subjected to weighted fusion with the preliminary sharpening image layer to form a sharpened image which is sharpened only to the edge; Further, according to the gray level change standard of the pixel points of the noise edge area, the noise area is identified and removed, so that the edge identification of the pixel block is selected, the FPGA filters the noise points according to the edge identification result, and the edge judgment is carried out on the obtained mask to remove poisson noise and Gaussian noise. The pixel point gray level change standard of the noise edge area is whether the pixel value of a certain position is far higher than the surrounding pixel value, if so, the noise point is the noise point. And further, carrying out weighted fusion on the original image, the preliminary sharpening layer and the denoising edge layer to obtain a sharpened image with only edge sharpening. Further, the step of weighted fusion is to determine the number of pixels greater than a threshold by using n×n (where N is an odd number and N is less than or equal to 9) small squares with the current pixel point in the edge layer as a center. Further, the weighted fusion algorithm comprises R=S (1-B) +A+B, wherein S is an original image, R is a sharpened image which only sharpens edges, A is a preliminary sharpening layer, and B is the denoising edge layer. Further, the edge recognition comprises logic for judging the edge point to be 0 if the number of pixels larger than the threshold value is smaller than N, and judging the edge point to be 1 if the number of pixels larger than the threshold value is larger than or equal to N. The invention also discloses an image sharpening device, which comprises: The image sharpening module is used for sharpening the original image to obtain a primarily sharpened image layer and the edge image layer; the noise removing module is used for judging edge points of the edge image layer, and giving noise removing treatment of the fixed value of the central pixel of the region according to the gray level change degree of the pixel of the region to obtain a denoising edge image layer; And the image fusion module is used for carrying out weighted fusion on the origi