CN113393405A - Image processing method, image processing device, image recognition system and storage medium - Google Patents

Image processing method, image processing device, image recognition system and storage medium Download PDF

Info

Publication number
CN113393405A
CN113393405A CN202110945785.XA CN202110945785A CN113393405A CN 113393405 A CN113393405 A CN 113393405A CN 202110945785 A CN202110945785 A CN 202110945785A CN 113393405 A CN113393405 A CN 113393405A
Authority
CN
China
Prior art keywords
image
source
source image
background
scale
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110945785.XA
Other languages
Chinese (zh)
Other versions
CN113393405B (en
Inventor
胡昌欣
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Casi Vision Technology Luoyang Co Ltd
Casi Vision Technology Beijing Co Ltd
Original Assignee
Casi Vision Technology Luoyang Co Ltd
Casi Vision Technology Beijing Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Casi Vision Technology Luoyang Co Ltd, Casi Vision Technology Beijing Co Ltd filed Critical Casi Vision Technology Luoyang Co Ltd
Priority to CN202110945785.XA priority Critical patent/CN113393405B/en
Publication of CN113393405A publication Critical patent/CN113393405A/en
Application granted granted Critical
Publication of CN113393405B publication Critical patent/CN113393405B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/70Denoising; Smoothing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/40Image enhancement or restoration using histogram techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20024Filtering details
    • G06T2207/20032Median filtering
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20172Image enhancement details
    • G06T2207/20182Noise reduction or smoothing in the temporal domain; Spatio-temporal filtering

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Image Processing (AREA)

Abstract

The application provides an image processing method, an image processing device, an identification system and a storage medium, wherein the method comprises the following steps: according to the target scale, a source image is subjected to image transformation through an iterative filtering-down sampling method, background reconstruction is performed through fixed window median filtering, and an up-sampling is performed according to the original scale of the source image, so that a background reconstruction image of the source image is obtained; performing pixel-by-pixel parallel operation on a source image and a background reconstructed image to obtain a difference value change image; performing histogram nonlinear operation on the difference value change image to obtain a nonlinear enhanced image of the difference value change image; performing pixel-by-pixel parallel operation on the background reconstructed image and the nonlinear enhanced image to obtain a dynamic smooth enhanced image; and (4) denoising the image aiming at the dynamic smooth enhanced image to obtain a self-adaptive dynamic smooth enhanced image. The method provided by the application improves the efficiency of enhancing the smooth filtering of the image, and further improves the accuracy of subsequent detection of the identification object.

Description

Image processing method, image processing device, image recognition system and storage medium
Technical Field
The present application relates to the field of image processing, and in particular, to an image processing method, an image processing apparatus, an image recognition system, and a storage medium.
Background
In optical detection, the contrast between the image background and the recognition object is the basis of image processing and target detection, and the image processing and the recognition object detection are affected by large background change, more noise and small contrast.
In the prior art, most algorithms can only solve a certain problem in image processing algorithms for image smooth enhancement, for example, a histogram equalization algorithm can only singly realize image enhancement; the average filtering algorithm can only realize image smoothing singly; the median filtering algorithm can only realize image filtering singly. Due to the fact that the research universality of the image processing algorithm is not strong, the problems of smoothing, filtering and enhancing of the image cannot be solved at the same time.
Disclosure of Invention
In view of the above, an object of the present application is to provide an image processing method, an image processing apparatus, an image recognition system and a storage medium, which are used to solve the problem of how to simultaneously solve the smoothing, filtering and enhancing of an image in the prior art. The efficiency of enhancing the smooth filtering of the image can be improved, and the accuracy of subsequent detection of the identification object is further improved.
In a first aspect, the present application provides an image processing method, including:
according to the target scale, performing image transformation on a source image by an iterative filtering-down sampling method to obtain a target scale image;
performing background reconstruction on the target scale image through fixed window median filtering to obtain a target scale image after background reconstruction;
for the target scale image after the background reconstruction, performing up-sampling according to the original scale of the source image to obtain a background reconstruction image of the source image;
performing pixel-by-pixel parallel operation on the source image and the background reconstructed image to obtain a difference value change image;
performing histogram nonlinear operation on the difference value change image to obtain a nonlinear enhanced image of the difference value change image;
performing pixel-by-pixel parallel operation on the background reconstructed image and the nonlinear enhanced image to obtain a dynamic smooth enhanced image;
and carrying out image denoising on the dynamic smooth enhanced image to obtain a self-adaptive dynamic smooth enhanced image so as to identify an identification object according to the self-adaptive dynamic smooth enhanced image.
In some embodiments, before the image transformation is performed on the source image by an iterative filtering-down sampling method according to the target scale to obtain the target scale image, the method further includes:
acquiring a source image, and judging whether the source image is a gray image or not;
and if the source image is not a gray image, graying the source image to obtain a grayed source image.
In some embodiments, the image transformation of the source image by the iterative filtering-down sampling method according to the target scale to obtain the target scale image includes:
carrying out small-window median filtering on the source image to obtain a filtered source image;
1/2 down-sampling is carried out on the filtered source image to obtain a reduced source image;
judging whether the scale corresponding to the reduced source image is larger than or equal to two times of the target scale;
if the scale corresponding to the reduced source image is larger than or equal to two times of the target scale, carrying out small-window median filtering and 1/2 downsampling on the reduced source image again;
if the scale corresponding to the reduced source image is smaller than twice of the target scale, carrying out small-window median filtering and target proportion downsampling on the reduced source image to obtain a target scale image; and the target proportion is the ratio of the target scale to the scale corresponding to the reduced source image.
In some embodiments, the performing, by using fixed window median filtering, background reconstruction on the target scale image to obtain a background-reconstructed target scale image includes:
determining the size of a fixed window according to the target dimension and the size of a target object;
and according to the size of the fixed window, performing background reconstruction on the target scale image through fixed window median filtering to obtain a target scale image after background reconstruction.
In some embodiments, the performing, for the target scale image after the background reconstruction, upsampling according to the original scale of the source image to obtain a background reconstructed image of the source image includes:
and for the target scale image after the background reconstruction, up-sampling the original scale of the source image through the nearest neighbor difference value to obtain a background reconstruction image of the source image.
In some embodiments, the performing, for the source image and the background reconstructed image, a pixel-by-pixel parallel operation to obtain a difference variation image includes:
performing pixel-by-pixel parallel operation on the source image and the background reconstructed image to obtain a gray difference value of the source image and the background reconstructed image;
performing linear transformation on the gray level difference value to obtain a gray level difference value after linear transformation;
and generating a difference value change image according to the gray difference value after the linear transformation.
In some embodiments, the performing a histogram nonlinear operation on the difference change image to obtain a nonlinear enhanced image of the difference change image includes:
obtaining a gray level histogram of the difference value change image through a histogram function aiming at the difference value change image;
and establishing a nonlinear change lookup table of the gray level histogram, and enhancing the difference value change image through the nonlinear change lookup table to obtain a nonlinear enhanced image of the difference value change image.
In some embodiments, the performing image denoising on the dynamic smooth enhanced image to obtain an adaptive dynamic smooth enhanced image includes:
and carrying out image denoising through small-window median filtering aiming at the dynamic smooth enhanced image to obtain a self-adaptive dynamic smooth enhanced image.
In a second aspect, the present application provides an image processing apparatus comprising:
the transformation module is used for carrying out image transformation on a source image by an iterative filtering-down sampling method according to a target scale to obtain a target scale image;
the background reconstruction module is used for performing background reconstruction on the target scale image through fixed window median filtering to obtain a target scale image after background reconstruction;
the up-sampling module is used for carrying out up-sampling on the target scale image after the background reconstruction according to the original scale of the source image to obtain a background reconstruction image of the source image;
the difference module is used for carrying out pixel-by-pixel parallel operation on the source image and the background reconstructed image to obtain a difference change image;
the operation module is used for carrying out histogram nonlinear operation on the difference value change image to obtain a nonlinear enhanced image of the difference value change image;
the smoothing module is used for carrying out pixel-by-pixel parallel operation on the background reconstructed image and the nonlinear enhanced image to obtain a dynamic smooth enhanced image;
and the denoising module is used for denoising the image aiming at the dynamic smooth enhanced image to obtain a self-adaptive dynamic smooth enhanced image so as to identify the identified object according to the self-adaptive dynamic smooth enhanced image.
In a third aspect, the present application provides a recognition system comprising a camera, an image processing device and a detection recognition device, wherein the image processing device is configured to implement the steps of the method according to any one of the first aspect.
In a fourth aspect, the present application provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, performs the steps of the method in any one of the above first aspects.
The image processing method comprises the steps of carrying out iterative filtering-downsampling on a source image to be converted into an image with a target size, carrying out background reconstruction through median filtering of a fixed window, restoring the original scale of the source image through upsampling to complete background reconstruction of the source image, carrying out pixel-by-pixel parallel operation on the source image and the background reconstructed image of the source image to obtain a difference value change image, carrying out image nonlinear enhancement through histogram nonlinear operation, carrying out pixel-by-pixel parallel operation on the background reconstructed image and the nonlinear enhanced image to carry out image dynamic smoothing, carrying out image filtering through image denoising on the dynamic smooth enhanced image, and obtaining a self-adaptive dynamic smooth enhanced image which is subjected to smoothing, filtering and enhancing. The image transformation mode of filtering-downsampling iteration is adopted, so that the method has the advantage of high denoising efficiency; the background reconstruction by utilizing the downsampling median filtering upsampling has the advantages of high calculation speed and smooth background; the nonlinear enhancement of the image by utilizing the difference value change has the advantage of insensitive illumination change; the adoption of the background reconstruction image and the nonlinear enhancement image for enhancing the denoising has the advantages of dynamic self-adaptive enhancement and stronger noise removal, thereby improving the efficiency of enhancing the smooth filtering of the image and further improving the accuracy of subsequent detection of the identified object. In order to make the aforementioned objects, features and advantages of the present application more comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained from the drawings without inventive effort.
Fig. 1 is a schematic flowchart of an image processing method according to an embodiment of the present application;
fig. 2 is a schematic diagram of a source image provided in an embodiment of the present application;
FIG. 3 is a schematic diagram of an adaptive dynamic smooth enhanced image according to an embodiment of the present application;
fig. 4 is a schematic flowchart of an iterative filtering-downsampling method according to an embodiment of the present application;
FIG. 5 is a logic diagram of a histogram linearity operation provided by an embodiment of the present application;
fig. 6 is a schematic structural diagram of an image processing apparatus according to an embodiment of the present application.
Fig. 7 is a schematic structural diagram of a computer device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all the embodiments. The components of the embodiments of the present application, generally described and illustrated in the figures herein, can be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present application, presented in the accompanying drawings, is not intended to limit the scope of the claimed application, but is merely representative of selected embodiments of the application. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present application without making any creative effort, shall fall within the protection scope of the present application.
In the prior art, an optical detection device needs to perform image preprocessing on a source image acquired by a camera in order to identify defects (for example, weak defects such as weak concave-convex points, weak scratches, weak bubbles, and the like), dirt, dust, and the like on a measured object, whereas in an existing image processing method, because an image processing algorithm for image smoothing enhancement does not consider research universality, smoothing, filtering, and enhancement of an image cannot be simultaneously solved, so that the difficulty of image processing is high, and the efficiency is low, the application aims to provide an image processing scheme capable of simultaneously solving smoothing, filtering, enhancement, and high efficiency of an image, and the method is specifically as follows:
an embodiment of the present application provides an image processing method, as shown in fig. 1, including the following steps:
s101, according to a target scale, performing image transformation on a source image by an iterative filtering-down sampling method to obtain a target scale image;
step S102, performing background reconstruction on the target scale image through fixed window median filtering to obtain a target scale image after background reconstruction;
step S103, performing up-sampling according to the original scale of the source image aiming at the target scale image after the background reconstruction to obtain a background reconstruction image of the source image;
step S104, aiming at the source image and the background reconstructed image, performing pixel-by-pixel parallel operation to obtain a difference value change image;
step S105, carrying out histogram nonlinear operation on the difference value change image to obtain a nonlinear enhanced image of the difference value change image;
step S106, performing pixel-by-pixel parallel operation on the background reconstructed image and the nonlinear enhanced image to obtain a dynamic smooth enhanced image;
and S107, carrying out image denoising on the dynamic smooth enhanced image to obtain a self-adaptive dynamic smooth enhanced image, and identifying an identification object according to the self-adaptive dynamic smooth enhanced image.
Specifically, after a source image is input, performing initial denoising and data volume compression on the source image by an iterative filtering-down sampling method until the obtained image conforms to a target scale, and taking the image as a target scale image; and performing background reconstruction on the target scale image through median filtering of a fixed window, and then restoring the target scale image after background reconstruction to the original size of the source image through upsampling to obtain a background reconstructed image of the source image. The method comprises the steps of iterative filtering down-sampling, background reconstruction and up-sampling, and the source image is subjected to rapid background reconstruction.
Secondly, carrying out gray value parallel operation on the source image and the background reconstructed image of the source image pixel by pixel to generate a difference value change image; and carrying out nonlinear enhancement by carrying out histogram nonlinear operation on the difference value change image to obtain a nonlinear enhancement image of the difference value change image.
And performing pixel-by-pixel parallel operation on the background reconstructed image and the nonlinear enhanced image to obtain a dynamic smooth enhanced image of the source image.
And finally, carrying out efficient denoising on the dynamic smooth enhanced image through small-window median filtering again to obtain a self-adaptive dynamic smooth enhanced image, namely the self-adaptive dynamic smooth enhanced image of the source image.
Taking fig. 2 as an example, after the image 2 is input as a source image, the adaptive dynamic smooth enhanced image shown in fig. 3 is obtained through iterative filtering-downsampling, fixed window median filtering, upsampling, difference change image generation, histogram nonlinear operation, dynamic smooth enhancement and small window median filtering.
In some embodiments, before the step S101, performing image transformation on the source image by using an iterative filtering-down-sampling method according to the target scale to obtain the target scale image, the method further includes:
step 108, acquiring a source image, and judging whether the source image is a gray image;
and step 109, if the source image is not a gray level image, graying the source image to obtain a grayed source image.
Specifically, the input image of the embodiment of the application is from a line-array camera image sensor or an area-array camera image sensor in a machine vision system, and therefore, the input source image may be a grayscale image or a color image. Since the subsequent image processing is performed on the gray scale value of each pixel of the source image, if a color image is input, the color image needs to be converted into a gray scale image before the subsequent operation is performed.
The color image can also be divided into channels for corresponding operation, illustratively, the color image is divided into an R channel, a G channel and a B channel based on RGB, and the color image is synthesized back after the three primary color channels are respectively subjected to subsequent self-adaptive dynamic smooth enhancement.
In some embodiments, the step S101, according to the target scale, performs image transformation on the source image by using an iterative filtering-down sampling method to obtain a target scale image, as shown in fig. 4, includes:
step S1011, carrying out small-window median filtering on the source image to obtain a filtered source image;
step S1012, performing 1/2 downsampling on the filtered source image to obtain a reduced source image;
step S1013, judging whether the corresponding scale of the reduced source image is larger than or equal to two times of the target scale;
step S1014, if the corresponding scale of the reduced source image is larger than or equal to two times of the target scale, carrying out small-window median filtering and 1/2 downsampling on the reduced source image again;
step S1015, if the corresponding scale of the reduced source image is smaller than twice the target scale, performing small-window median filtering and target ratio down-sampling on the reduced source image to obtain a target scale image; the target proportion is the ratio of the target scale to the scale corresponding to the reduced source image.
Specifically, the input source image generally contains interference noise, has a complex foreground defect, and the data volume of the source image acquired by the line-array camera image sensor or the area-array camera image sensor is large. Therefore, it is necessary to remove the interference noise and the influence of the foreground defect from the source image by the filtering-down sampling method, and reduce the data amount, so as to process the image quickly and efficiently while avoiding the interference noise and the influence of the complex foreground defect.
The filtering-down sampling method is divided into two steps of small window median filtering and down sampling. After a source image is input, performing small-window median filtering on the source image, taking the window size as 3 × 3 as an example, the small-window median filtering formula is as follows:
m(x,y)=median{f(x-k,y-l),k,l∈3} (1)
wherein m (x, y) is a median filtered image (i.e., a filtered source image) of 3 × 3 small windows, mean { } is a median filtering function, f (x, y) is the source image, k is the length of the filtering window, and l is the width of the filtering window.
Then 1/2 down-sampling the small window median filtered source image, the down-sampling formula is as follows:
Figure 124610DEST_PATH_IMAGE001
(2)
wherein s (X, Y) is a down-sampled image (i.e., a reduced source image), f (X, Y) is a source image (X =2X-a, Y = 2Y-a; here, the source image refers to a source image median filtered through a small window), and a is a constant. The down-sampled image has a size 1/2 of the size of the source image.
After image transformation is performed through once small-window median filtering and 1/2 downsampling, whether the scale corresponding to the reduced source image is larger than or equal to two times of the target scale needs to be judged.
If the corresponding scale of the reduced source image is larger than or equal to two times of the target scale, the small-window median filtering and 1/2 down-sampling are needed to be performed again, and the process is repeated until the corresponding scale of the finally obtained reduced source image is smaller than two times of the target scale.
If the scale corresponding to the reduced source image is smaller than twice the target scale, the ratio of the target scale to the scale corresponding to the reduced source image needs to be calculated to obtain the target ratio. Then, carrying out small-window median filtering once again, and downsampling the target proportion, wherein the downsampling formula of the target proportion is as follows:
Figure 47567DEST_PATH_IMAGE002
(3)
wherein s ist(x, y) is a down-sampled image of the target scale (i.e., target scale image), st-1(X, Y) is the image after the last 1/2 downsampling (X = nx-a, Y = ny-a), n is the inverse of the target ratio, and a is a constant. When n is equal to 1, that is, when the ratio of the target scale to the scale corresponding to the reduced source image is 1, the image after the last 1/2 downsampling may be directly confirmed as the target scale image.
In some embodiments, in step S102, performing background reconstruction on the target scale image through fixed window median filtering to obtain a target scale image after background reconstruction, including:
step a1, determining the size of a fixed window according to the target dimension and the size of a target object;
step a2, according to the size of the fixed window, performing background reconstruction on the target scale image through fixed window median filtering to obtain a target scale image after background reconstruction.
Specifically, some complex foreground defects still exist in the filtered and downsampled target scale image, and in order to stably and efficiently reconstruct the image background without the foreground defects, the background reconstruction is performed on the target scale image through the fixed window median filtering in the embodiment of the application. And rapidly realizing image background reconstruction on the transformed image by adopting a median filtering method with a preset fixed window size to obtain a background reconstructed image of the transformed image.
The size of the fixed window is determined according to the target dimension and the size of the target object to be detected after image processing. The target object refers to a cover plate, a camera and other products, some flaws may occur in the production process of the target object, and the flaws are identification objects for subsequent detection and identification. The fixed window median filter formula is as follows:
m’(x,y)=median{st(x-k’,y-l’),k’,l’∈W} (4)
wherein m ' (x, y) is a target scale image after background reconstruction, k ' is the length of a filtering window, l ' is the width of the filtering window, W is the size of a fixed window, mean { } is a median filtering function, stAnd (x, y) is the reduced source image.
And removing complex foreground defects stably and efficiently through fixed window median filtering to obtain a target scale image after background reconstruction.
In some embodiments, in step S103, for the target scale image after the background reconstruction, performing upsampling according to the original scale of the source image to obtain a background reconstructed image of the source image, including:
and for the target scale image after the background reconstruction, up-sampling the original scale of the source image through the nearest neighbor difference value to obtain a background reconstruction image of the source image.
Specifically, the target size image reconstructed through the background needs to be restored to the original scale of the source image, so as to obtain a background reconstructed image of the source image. The source image is restored by using the nearest neighbor difference value upsampling mode, and the nearest neighbor difference value upsampling formula is as follows:
u(x,y)=m’(Round(x/e),Round(y/e)) (5)
wherein u (x, y) is a background reconstructed image of the source image, Round () is a function rounded to the nearest integer, m' () is a target scale image after background reconstruction, e is an up-sampling magnification factor, the target scale image can be restored to the original scale of the source image after being magnified by e, i.e. e is the reciprocal of the total reduction factor of the iterative filtering-down-sampling performed in step S101, and the calculation formula is as follows:
Figure 357326DEST_PATH_IMAGE003
。 (6)
therefore, the rapid background reconstruction of the source image is completed by performing small-window median filtering and downsampling on the source image, then performing fixed-window median filtering, and finally performing nearest neighbor difference upsampling.
In some embodiments, in step S104, performing pixel-by-pixel parallel operation on the source image and the background reconstructed image to obtain a difference variation image, includes:
b1, performing pixel-by-pixel parallel operation on the source image and the background reconstructed image to obtain a gray difference value of the source image and the background reconstructed image;
step b2, carrying out linear transformation on the gray level difference value to obtain a gray level difference value after linear transformation;
and b3, generating a difference change image according to the gray level difference after the linear transformation.
Specifically, the gray level difference value of each corresponding pixel of the source image and the background reconstructed image is obtained by performing pixel-by-pixel gray level difference parallel operation on the source image and the background reconstructed image, and the gray level difference value formula is as follows:
v’x,y(x,y)=fx,y(x,y)-ux,y(x,y) (7)
wherein, v'x,y(x, y) is the gray level difference of the pixel at the coordinate (x, y) of the source image and the background reconstructed image, fx,y(x, y) is the gray value of the pixel at coordinate (x, y) in the background reconstructed image, ux,y(x, y) is the gray value of the pixel at coordinate (x, y) in the source image.
The gray difference interval obtained by calculation is [ -255,255], the gray difference interval is transformed to [0,255] through linear transformation, and the linear transformation formula is as follows:
Figure 428050DEST_PATH_IMAGE004
(8)
wherein v isx,y(x, y) is a linear-transformed gray scale difference value, v'x,y(x, y) is the gray level difference value of a pixel at the coordinate (x, y) of the source image and the background reconstructed image, Ceil (x) is the minimum integer not less than x, and floor (x) is the maximum integer not more than x.
Finally, according to the gray difference after linear transformation, generating difference change image v (x, y), vx,y(x, y) is the gray value of the pixel of the difference change image at the coordinates (x, y).
In some embodiments, the step S105 of performing a histogram nonlinear operation on the difference variation image to obtain a nonlinear enhanced image of the difference variation image includes:
step c1, obtaining a gray level histogram of the difference value change image through a histogram function aiming at the difference value change image;
and c2, establishing a nonlinear change lookup table of the gray histogram, and enhancing the difference change image through the nonlinear change lookup table to obtain a nonlinear enhanced image of the difference change image.
Specifically, as shown in fig. 5, a logic flow of the histogram nonlinear operation is as follows:
a) input v (x, y);
b) calculating a gray level histogram h (i, j);
c) establishing a nonlinear change lookup table of the gray level histogram, namely judging whether i is greater than or equal to 0;
if so, then
Figure 668407DEST_PATH_IMAGE005
; (9)
If not, then
Figure 508187DEST_PATH_IMAGE006
; (10)
d) Computing
Figure 988847DEST_PATH_IMAGE007
e) Judgment of
Figure 281288DEST_PATH_IMAGE007
Whether T is less than or equal to T;
if so, z (x, y) = 128;
if not, z (x, y) = l (v (x, y) -127.5).
In the following description of the logic flow, the histogram nonlinear operation first needs to find the gray level histogram of the difference value change image by the histogram function, and the formula is as follows:
h(i,j)=calcHist(v(x,y)) (11)
wherein v (x, y) is a gray level difference value after linear transformation, h (i, j) is a gray level histogram of the difference value change image, calcHist () is a histogram function, i is a gray level value in the difference value change image, and j is the number of pixels corresponding to the gray level value i.
Then, a nonlinear change lookup table of the gray level histogram is established through a nonlinear change lookup table formula, wherein the formula is as follows:
Figure 76069DEST_PATH_IMAGE008
(12)
wherein l (i) is a nonlinear transformation value with a gray value i, α is a first scale factor, the range of the first scale factor is [1,255], preferably 30, ceil (x) is a minimum integer not less than x, and floor (x) is a maximum integer not greater than x.
And finally, referring to a nonlinear change lookup table of the gray level histogram, carrying out nonlinear enhancement on the difference value change image to obtain a nonlinear enhancement image of the difference value change image, wherein the nonlinear enhancement formula is as follows:
Figure 770355DEST_PATH_IMAGE009
(13)
wherein z (x, y) is a non-linear enhanced image of the difference change image, T is a gray threshold, the gray threshold has a value range of [0,255], and can be given according to the background gray change, preferably 3, and v (x, y) is a gray difference after linear transformation.
According to the embodiment of the application, the non-linear enhancement image of the difference value change image is obtained by performing the histogram non-linear operation on the difference value change image, the non-linear enhancement image is obtained by not directly performing the histogram non-linear operation on the source image, and the problem that the background change of the whole image is large due to the fact that the imaging gray value of the source image is not uniform is solved.
In some embodiments, in the step S107, performing image denoising on the dynamic smooth enhanced image to obtain an adaptive dynamic smooth enhanced image, including:
and (3) carrying out image denoising through small-window median filtering aiming at the dynamic smooth enhanced image to obtain a self-adaptive dynamic smooth enhanced image.
Specifically, in step S106, pixel-by-pixel parallel computation is performed on the background reconstructed image and the non-linear enhanced image to obtain a dynamic smooth enhanced image, where the dynamic smooth enhanced image is obtained according to the following formula:
Figure 421917DEST_PATH_IMAGE010
(14)
wherein g' (x, y) is a dynamic smooth enhanced image, β is a second scale factor, the value range of the second scale factor is [0,255], preferably 1, z (x, y) is a nonlinear enhanced image of the difference change image, and u (x, y) is a background reconstructed image of the source image.
The obtained dynamic smooth enhanced image also contains some strong interference noise, in order to retain the real information of the dynamic smooth enhanced image and remove the strong interference noise quickly and efficiently, the method adopts 3 multiplied by 3 small window median filtering to denoise the dynamic smooth enhanced image to obtain the final self-adaptive dynamic smooth enhanced image, and the formula is as follows:
g(x,y)=median{g’(x-k”,y-l”),k”,l”∈3} (15)
wherein g (x, y) is the final adaptive dynamic smooth enhanced image, i.e. the adaptive dynamic smooth enhanced image, mean { } is the median filter function, g ' (x, y) is the dynamic smooth enhanced image, k ' is the length of the filter window, l ' is the width of the filter window, and 3 is the size of the filter window.
Corresponding to the above method embodiment, the present application further provides an image processing apparatus for implementing the above method of the present application, as shown in fig. 6, the apparatus includes:
the transformation module 30 is used for performing image transformation on the source image through an iterative filtering-down sampling method according to the target scale to obtain a target scale image;
the background reconstruction module 31 is configured to perform background reconstruction on the target scale image through fixed window median filtering to obtain a target scale image after background reconstruction;
an upsampling module 32, configured to perform upsampling on the target scale image after the background reconstruction according to the original scale of the source image to obtain a background reconstructed image of the source image;
a difference module 33, configured to perform pixel-by-pixel parallel operation on the source image and the background reconstructed image to obtain a difference change image;
an operation module 34, configured to perform histogram nonlinear operation on the difference value change image to obtain a nonlinear enhanced image of the difference value change image;
a smoothing module 35, configured to perform pixel-by-pixel parallel operation on the background reconstructed image and the nonlinear enhanced image to obtain a dynamic smooth enhanced image;
and a denoising module 36, configured to perform image denoising on the dynamic smooth enhanced image to obtain an adaptive dynamic smooth enhanced image, so as to perform identification of an identified object according to the adaptive dynamic smooth enhanced image.
For the specific description of the embodiment of the apparatus, reference may be made to the above-mentioned method embodiment and its extended embodiments, which are not described herein again.
Corresponding to an image processing method in fig. 1, an embodiment of the present application further provides an identification system, which includes a camera, a light source, a stage, a warning light, an image processing apparatus, a detection and identification apparatus, and a computer program stored in the image processing apparatus and executable on the image processing apparatus, where the image processing apparatus implements the image processing method when executing the computer program.
Specifically, after the target object is placed on the objective table illuminated by the light source, the camera acquires a source image and transmits the source image to the image processing device, the image processing device runs a stored computer program and executes the image processing method to process the source image and simultaneously realize smoothing, filtering and enhancing of the source image to obtain a self-adaptive dynamic smooth enhanced image, the image processing device transmits the self-adaptive dynamic smooth enhanced image to the detection and recognition device to recognize the target object, and if the target object is recognized, the warning lamp is turned on. The application provides an identification system, which solves the problem of how to simultaneously solve the problems of smoothness, filtering and enhancement of an image in image preprocessing before detection and identification in the prior art.
Corresponding to an image processing method in fig. 1, an embodiment of the present application further provides a computer device 400, as shown in fig. 7, the device includes a memory 401, a processor 402, and a computer program stored on the memory 401 and executable on the processor 402, wherein the processor 402 implements the image processing method when executing the computer program.
Specifically, the memory 401 and the processor 402 can be general memories and processors, which are not limited in particular, and when the processor 402 runs a computer program stored in the memory 401, the image processing method can be executed, so that the problem of how to simultaneously solve smoothing, filtering and enhancing of an image in the prior art is solved.
Corresponding to an image processing method in fig. 1, the present application further provides a computer-readable storage medium, on which a computer program is stored, and the computer program is executed by a processor to perform the steps of the image processing method.
Specifically, the storage medium can be a general storage medium, such as a mobile disk, a hard disk, and the like, when a computer program on the storage medium is run, the image processing method can be executed, and the problem of how to simultaneously solve smoothing, filtering, and enhancing of an image in the prior art is solved, the image processing method provided by the embodiment of the application performs iterative filtering-down-sampling on a source image to convert the source image into an image with a target size, performs background reconstruction through fixed window median filtering, then restores to the original scale of the source image through up-sampling, completes background reconstruction of the source image, performs pixel-by-pixel parallel operation on the background reconstructed images of the source image and the source image to obtain a difference value change image, performs image nonlinear enhancement through histogram nonlinear operation, and performs image dynamic smoothing through pixel-by-pixel parallel operation on the background reconstructed image and the nonlinear enhanced image, and carrying out image filtering by carrying out image denoising on the dynamic smooth enhanced image to obtain a self-adaptive dynamic smooth enhanced image which is subjected to smoothing, filtering and enhancing. The image processing method provided by the embodiment of the application improves the efficiency of enhancing the smooth filtering of the image, and further improves the accuracy of subsequent detection of the identified object.
Based on the configuration, the image transformation mode of filtering-downsampling iteration is adopted, and the method has the advantage of high denoising efficiency; the background reconstruction by utilizing the downsampling median filtering upsampling has the advantages of high calculation speed and smooth background; the nonlinear enhancement of the image by utilizing the difference value change has the advantage of insensitive illumination change; the adoption of the background reconstruction image and the nonlinear enhancement image for enhancing and denoising has the advantages of dynamic self-adaptive enhancement and stronger noise removal.
In the embodiments provided in the present application, it should be understood that the disclosed method and apparatus may be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one logical division, and there may be other divisions when actually implemented, and for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of devices or units through some communication interfaces, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments provided in the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus once an item is defined in one figure, it need not be further defined and explained in subsequent figures, and moreover, the terms "first", "second", "third", etc. are used merely to distinguish one description from another and are not to be construed as indicating or implying relative importance.
Finally, it should be noted that: the above-mentioned embodiments are only specific embodiments of the present application, and are used for illustrating the technical solutions of the present application, but not limiting the same, and the scope of the present application is not limited thereto, and although the present application is described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: any person skilled in the art can modify or easily conceive the technical solutions described in the foregoing embodiments or equivalent substitutes for some technical features within the technical scope disclosed in the present application; such modifications, changes or substitutions do not depart from the spirit and scope of the present disclosure, which should be construed in light of the above teachings. Are intended to be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (11)

1. An image processing method, comprising:
according to the target scale, performing image transformation on a source image by an iterative filtering-down sampling method to obtain a target scale image;
performing background reconstruction on the target scale image through fixed window median filtering to obtain a target scale image after background reconstruction;
for the target scale image after the background reconstruction, performing up-sampling according to the original scale of the source image to obtain a background reconstruction image of the source image;
performing pixel-by-pixel parallel operation on the source image and the background reconstructed image to obtain a difference value change image;
performing histogram nonlinear operation on the difference value change image to obtain a nonlinear enhanced image of the difference value change image;
performing pixel-by-pixel parallel operation on the background reconstructed image and the nonlinear enhanced image to obtain a dynamic smooth enhanced image;
and carrying out image denoising on the dynamic smooth enhanced image to obtain a self-adaptive dynamic smooth enhanced image so as to identify an identification object according to the self-adaptive dynamic smooth enhanced image.
2. The method of claim 1, wherein before said image transforming the source image by an iterative filtering-down sampling method according to the target scale to obtain the target scale image, further comprising:
acquiring a source image, and judging whether the source image is a gray image or not;
and if the source image is not a gray image, graying the source image to obtain a grayed source image.
3. The method of claim 1, wherein the image transformation of the source image by the iterative filtering-down sampling method according to the target scale to obtain the target scale image comprises:
carrying out small-window median filtering on the source image to obtain a filtered source image;
1/2 down-sampling is carried out on the filtered source image to obtain a reduced source image;
judging whether the scale corresponding to the reduced source image is larger than or equal to two times of the target scale;
if the scale corresponding to the reduced source image is larger than or equal to two times of the target scale, carrying out small-window median filtering and 1/2 downsampling on the reduced source image again;
if the scale corresponding to the reduced source image is smaller than twice of the target scale, carrying out small-window median filtering and target proportion downsampling on the reduced source image to obtain a target scale image; and the target proportion is the ratio of the target scale to the scale corresponding to the reduced source image.
4. The method of claim 1, wherein the performing background reconstruction on the target scale image through fixed window median filtering to obtain a background-reconstructed target scale image comprises:
determining the size of a fixed window according to the target dimension and the size of a target object;
and according to the size of the fixed window, performing background reconstruction on the target scale image through fixed window median filtering to obtain a target scale image after background reconstruction.
5. The method of claim 1, wherein the up-sampling according to the original scale of the source image for the target scale image after the background reconstruction to obtain the background reconstructed image of the source image comprises:
and for the target scale image after the background reconstruction, up-sampling the original scale of the source image through the nearest neighbor difference value to obtain a background reconstruction image of the source image.
6. The method of claim 1, wherein performing pixel-by-pixel parallel operations on the source image and the background reconstructed image to obtain a difference-variant image comprises:
performing pixel-by-pixel parallel operation on the source image and the background reconstructed image to obtain a gray difference value of the source image and the background reconstructed image;
performing linear transformation on the gray level difference value to obtain a gray level difference value after linear transformation;
and generating a difference value change image according to the gray difference value after the linear transformation.
7. The method of claim 1, wherein performing a histogram non-linear operation on the difference change image to obtain a non-linearly enhanced image of the difference change image comprises:
obtaining a gray level histogram of the difference value change image through a histogram function aiming at the difference value change image;
and establishing a nonlinear change lookup table of the gray level histogram, and enhancing the difference value change image through the nonlinear change lookup table to obtain a nonlinear enhanced image of the difference value change image.
8. The method of claim 1, wherein the performing image denoising on the dynamic smoothness enhanced image to obtain an adaptive dynamic smoothness enhanced image comprises:
and carrying out image denoising through small-window median filtering aiming at the dynamic smooth enhanced image to obtain a self-adaptive dynamic smooth enhanced image.
9. An image processing apparatus characterized by comprising:
the transformation module is used for carrying out image transformation on a source image by an iterative filtering-down sampling method according to a target scale to obtain a target scale image;
the background reconstruction module is used for performing background reconstruction on the target scale image through fixed window median filtering to obtain a target scale image after background reconstruction;
the up-sampling module is used for carrying out up-sampling on the target scale image after the background reconstruction according to the original scale of the source image to obtain a background reconstruction image of the source image;
the difference module is used for carrying out pixel-by-pixel parallel operation on the source image and the background reconstructed image to obtain a difference change image;
the operation module is used for carrying out histogram nonlinear operation on the difference value change image to obtain a nonlinear enhanced image of the difference value change image;
the smoothing module is used for carrying out pixel-by-pixel parallel operation on the background reconstructed image and the nonlinear enhanced image to obtain a dynamic smooth enhanced image;
and the denoising module is used for denoising the image aiming at the dynamic smooth enhanced image to obtain a self-adaptive dynamic smooth enhanced image so as to identify the identified object according to the self-adaptive dynamic smooth enhanced image.
10. An identification system comprising a camera, image processing means and detection identification means, characterized in that the image processing means are adapted to carry out the steps of the method according to any of the preceding claims 1-8.
11. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method according to any one of the claims 1 to 8.
CN202110945785.XA 2021-08-18 2021-08-18 Image processing method, image processing device, image recognition system and storage medium Active CN113393405B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110945785.XA CN113393405B (en) 2021-08-18 2021-08-18 Image processing method, image processing device, image recognition system and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110945785.XA CN113393405B (en) 2021-08-18 2021-08-18 Image processing method, image processing device, image recognition system and storage medium

Publications (2)

Publication Number Publication Date
CN113393405A true CN113393405A (en) 2021-09-14
CN113393405B CN113393405B (en) 2021-10-29

Family

ID=77622886

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110945785.XA Active CN113393405B (en) 2021-08-18 2021-08-18 Image processing method, image processing device, image recognition system and storage medium

Country Status (1)

Country Link
CN (1) CN113393405B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118172285A (en) * 2024-05-14 2024-06-11 浙江芯劢微电子股份有限公司 Image quality optimization method and device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101430759A (en) * 2008-12-04 2009-05-13 上海大学 Optimized recognition pretreatment method for human face
US20100142790A1 (en) * 2008-12-04 2010-06-10 New Medical Co., Ltd. Image processing method capable of enhancing contrast and reducing noise of digital image and image processing device using same
CN110706174A (en) * 2019-09-27 2020-01-17 集美大学 Image enhancement method, terminal equipment and storage medium
CN111353955A (en) * 2020-02-28 2020-06-30 广州市百果园信息技术有限公司 Image processing method, device, equipment and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101430759A (en) * 2008-12-04 2009-05-13 上海大学 Optimized recognition pretreatment method for human face
US20100142790A1 (en) * 2008-12-04 2010-06-10 New Medical Co., Ltd. Image processing method capable of enhancing contrast and reducing noise of digital image and image processing device using same
CN110706174A (en) * 2019-09-27 2020-01-17 集美大学 Image enhancement method, terminal equipment and storage medium
CN111353955A (en) * 2020-02-28 2020-06-30 广州市百果园信息技术有限公司 Image processing method, device, equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
林智欣: "基于双边滤波的二维动画图像多尺度细节增强方法", 《齐齐哈尔大学学报(自然科学版)》 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118172285A (en) * 2024-05-14 2024-06-11 浙江芯劢微电子股份有限公司 Image quality optimization method and device

Also Published As

Publication number Publication date
CN113393405B (en) 2021-10-29

Similar Documents

Publication Publication Date Title
JP4792109B2 (en) Image defect removal considering image features
CN102326379B (en) Method for removing blur from image
CN111598869B (en) Method, equipment and storage medium for detecting Mura of display screen
CN109523527A (en) The detection method in dirty region, device and electronic equipment in image
CN110866870B (en) Super-resolution processing method for amplifying medical image by any multiple
JP2009543162A (en) Method and apparatus for model-based anisotropic diffusion
Shajkofci et al. Semi-blind spatially-variant deconvolution in optical microscopy with local point spread function estimation by use of convolutional neural networks
CN113393405B (en) Image processing method, image processing device, image recognition system and storage medium
KR20140109801A (en) Method and apparatus for enhancing quality of 3D image
CN110728692A (en) Image edge detection method based on Scharr operator improvement
CN112686896B (en) Glass defect detection method based on frequency domain and space combination of segmentation network
CN117830134A (en) Infrared image enhancement method and system based on mixed filtering decomposition and image fusion
CN112435185A (en) Fuzzy pollen picture processing method and device and electronic equipment
CN104063864B (en) Image fuzziness assessment method based on quaternary phase congruency model
Wang et al. Kernel optimization for blind motion deblurring with image edge prior
Doshi et al. An evaluation of image enhancement techniques for capillary imaging
CN114994098A (en) Foreign matter detection method and device
Kosar et al. An overview of denoising methods for different types of noises present on graphic images
CN112070765B (en) Cloth detection method based on double-sided filtering combined improvement OTSU
CN113470028A (en) Chromosome karyotype image quality evaluation method, chromosome analyzer, and storage medium
CN107203976A (en) A kind of adaptive non-local mean denoising method and system detected based on noise
CN113674144A (en) Image processing method, terminal equipment and readable storage medium
CN111369491B (en) Image stain detection method, device, system and storage medium
Daniel et al. Retinal image enhancement using wavelet domain edge filtering and scaling
Vijaya et al. Bilateral filtering using modified fuzzy clustering for image denoising

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant