Image definition evaluation method and device and electronic equipment

By extracting the color and brightness components of the image, dividing the foreground and background, giving different weights, and performing image block processing, the problem of the characteristics of image clarity evaluation in the prior art is solved, and high accuracy and Real-time image clarity evaluation.

CN119151871AActive Publication Date: 2024-12-17QINGDAO NOVELBEAM TECH
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411143143.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-20
Publication Date
2024-12-17
Estimated Expiration
2044-08-20

AI Technical Summary

Technical Problem

When the contrast between the focus target and the background is low, the evaluation curve is prone to lose its characteristics of unimodality, monotonicity and high sensitivity, and fails to effectively consider the influence of background gradient values ​​on the evaluation results.

Method used

Extract the color components and brightness components of the image, obtain the judgment threshold through the color brightness value sub-image, divide the image into foreground and background pixel sets, assign different weights, and divide the image into image blocks to calculate Gaussian weights, combining gradient values ​​and clarity The weight is weighted to obtain the image definition evaluation value.

Benefits of technology

It improves the accuracy and real-time performance of image clarity evaluation, is suitable for fast autofocus of microscopes, conforms to unimodal characteristics and high sensitivity, and reduces the impact of complex backgrounds on evaluation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119151871A_ABST
    Figure CN119151871A_ABST
Patent Text Reader

Abstract

The invention provides an image definition evaluation method and device and electronic equipment. The image definition evaluation method disclosed by the invention comprises the following steps: extracting color components from an image to be evaluated to obtain a plurality of color sub-channel images; extracting a brightness component from the to-be-evaluated image to obtain a color brightness value sub-image related to the color; obtaining a judgment threshold according to the color brightness value sub-images, and at least dividing the color brightness value sub-images into a first pixel set and a second pixel set according to the judgment threshold; obtaining the definition calculation weight of each pixel point of the color sub-channel image; according to the color sub-channel image and the definition calculation weight of each pixel point of the color sub-channel image, obtaining the definition feature of the color sub-channel image; and carrying out weighted operation on the definition characteristics of the sub-channel images of each color, and obtaining an evaluation value of the definition of the to-be-evaluated image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to an image clarity evaluation method, device and electronic equipment, and belongs to the technical field of image processing. Background Art

[0002] As a precision optical device, microscope is widely used in various fields.

[0003] When collecting images using a microscope, it is necessary to automatically focus the sample. The autofocus technology is directly related to the overall quality of the collected image. The core of the autofocus technology is the image clarity evaluation algorithm. The image collected during the defocus-focus-defocus process is evaluated by the clarity evaluation algorithm. When the clarity evaluation value reaches the peak value, the corresponding position is identified as the best focus position.

[0004] At present, the most commonly used image clarity evaluation functions in autofocus can be divided into frequency domain functions, spatial domain functions, statistical functions, etc. Frequency domain functions include Fourier transform, discrete cosine transform, wavelet transform, etc. These functions have high sensitivity but large computational complexity and are not suitable for fast focusing of large-resolution images. Spatial domain functions include Tenengrad / Sobel function, Brenner function, Laplacian function, and variants of these functions; statistical functions include entropy function, range function, Vollaths function, etc. In scenes with high contrast and good signal-to-noise ratio, the above evaluation methods all meet the characteristics of unimodality, monotonicity, and high sensitivity, but when the contrast between the focus target and the background is low, the evaluation curve is prone to lose the above characteristics.

[0005] In recent years, many patents have proposed some improved methods for evaluating image clarity. For example, Patent Document 1 (Application No. 201810424740.6) discloses a method and device for evaluating the clarity of white blood cells, and Patent Document 2 (Application No. 201911232590.X) discloses a method and system for detecting the clarity of microscopic images, and a computer device. However, these patent documents still have some limitations. For example, the Tenengrad function is used as a clarity evaluation function in Patent 1. Although the clearest image can be distinguished, there are still local extreme points in terms of unimodality; Patent 2 uses at least two evaluation functions to improve the efficiency of clarity evaluation, but this method is still a clarity evaluation method based on global pixels, and does not consider the influence of the gradient value of the background on the evaluation results. Summary of the invention

[0006] In order to solve one of the above technical problems, the present disclosure provides an image clarity evaluation method, device and electronic device.

[0007] According to one aspect of the present disclosure, there is provided a method for evaluating image clarity, comprising:

[0008] Get the image to be evaluated;

[0009] Extracting color components from the image to be evaluated to obtain a plurality of color sub-channel images; wherein each color sub-channel image is associated with a color;

[0010] Extracting a brightness component from the image to be evaluated to obtain a color brightness value sub-image associated with the color, wherein the color brightness value sub-image corresponds one-to-one to the color sub-channel image;

[0011] Obtaining a judgment threshold according to the color brightness value sub-image, and dividing the color brightness value sub-image into at least a first pixel set and a second pixel set according to the judgment threshold; wherein the judgment threshold is related to the average brightness of the color brightness value sub-image;

[0012] Obtaining a definition calculation weight of each pixel of the color sub-channel image according to a mapping relationship between the pixels in the first pixel set and the second pixel set and the color sub-channel image;

[0013] Calculating weights according to the color sub-channel image and the clarity of each pixel of the color sub-channel image to obtain a clarity feature of the color sub-channel image;

[0014] The clarity features of each color sub-channel image are weighted and the evaluation value of the clarity of the image to be evaluated is obtained.

[0015] According to at least one embodiment of the present disclosure, a method for evaluating image clarity obtains color components from an image to be evaluated to obtain multiple color sub-channel images; comprising:

[0016] Each color component is extracted from the image to be evaluated according to the color arrangement order, and a first color sub-channel image, a second color sub-channel image, a third color sub-channel image and a fourth color sub-channel image are obtained; wherein the image to be evaluated is an image in a Bayer format.

[0017] According to at least one embodiment of the present disclosure, a method for evaluating image clarity extracts a brightness component from an image to be evaluated to obtain a color brightness value sub-image associated with a color; the method comprises:

[0018] The brightness component of the image to be evaluated is extracted, and a first color brightness value sub-image, a second color brightness value sub-image, a third color brightness value sub-image and a fourth color brightness value sub-image are obtained in the order of color arrangement.

[0019] According to the image clarity evaluation method of at least one embodiment of the present disclosure, the judgment threshold includes an average brightness of the color brightness value sub-image.

[0020] According to at least one embodiment of the present disclosure, the image clarity evaluation method obtains the clarity feature of the color sub-channel image by calculating the weight according to the clarity of the color sub-channel image and each pixel of the color sub-channel image; comprising:

[0021] Divide the color sub-channel image into (2s+1)*(2s+1) image blocks, where s is greater than or equal to 1;

[0022] Taking the image block located at the center of the color sub-channel image as the coordinate origin, the coordinates of each image block are obtained; and the Gaussian weight of each image block is obtained according to the coordinates of each image block;

[0023] Obtaining the gradient value of each pixel point according to the grayscale value of each pixel point in each image block;

[0024] Obtaining a first definition estimation value of the image block according to a gradient value of each pixel point in each image block and a definition calculation weight corresponding to the pixel point;

[0025] Obtaining a second definition estimation value according to the grayscale value of each pixel in each image block;

[0026] Performing a weighted operation on the first definition estimation value and the second definition estimation value to obtain an overall definition estimation value of each image block;

[0027] The clarity feature of the color sub-channel image is obtained according to the Gaussian weight of each image block and the overall clarity estimation value.

[0028] According to at least one embodiment of the image clarity evaluation method of the present disclosure, obtaining the gradient value of each pixel point according to the grayscale value of each pixel point in each image block includes:

[0029] L(x,y)=4f(x,y)-f(x,y+1)-f(x,y-1)-f(x+1,y)-f(x-1,y)

[0030] Among them, L(x, y) is the gradient value of the pixel point (x, y); f(x, y) is the grayscale value of the pixel point (x, y); f(x, y+1), f(x, y-1), f(x-1, y), and f(x+1, y) are the grayscale values ​​of the pixels above, below, to the left, and to the right of the pixel point (x, y), respectively.

[0031] According to at least one embodiment of the present disclosure, an image definition evaluation method is provided, wherein a first definition estimation value of an image block is obtained according to a gradient value of each pixel point in each image block and a definition calculation weight corresponding to the pixel point; the method comprises:

[0032]

[0033] in, represents the first clarity estimation value of the k-th image block; m represents the number of pixels in the length direction of the k-th image block, and n represents the number of pixels in the width direction of the k-th image block; (x, y) represents the pixel point in the k-th image block; t(x, y) represents the clarity calculation weight corresponding to the pixel point (x, y); L(x, y) represents the gradient value corresponding to the pixel point (x, y).

[0034] According to at least one embodiment of the present disclosure, the image clarity evaluation method performs a weighted operation on the first clarity estimation value and the second clarity estimation value to obtain the overall clarity estimation value of each image block; comprising:

[0035]

[0036] Where k represents the sequence number of the image block; represents the first definition estimation value of the k-th image block; represents the second definition estimation value of the k-th image block; a is the weight corresponding to the first definition estimation value of the k-th image block; b is the weight corresponding to the second definition estimation value of the k-th image block.

[0037] According to another aspect of the present disclosure, there is provided an image clarity evaluation device, comprising:

[0038] An image acquisition module to be evaluated, wherein the image acquisition module to be evaluated is used to acquire the image to be evaluated;

[0039] A color sub-channel image acquisition module, the color sub-channel image acquisition module is used to extract color components from the image to be evaluated to obtain a plurality of color sub-channel images; wherein each color sub-channel image is associated with a color;

[0040] A color brightness value sub-image acquisition module, which is used to extract brightness components from the image to be evaluated to obtain a color brightness value sub-image related to the color, wherein the color brightness value sub-image corresponds to the color sub-channel image one by one;

[0041] A judgment module, wherein the judgment module obtains a judgment threshold according to the color brightness value sub-image, and divides the color brightness value sub-image into at least a first pixel set and a second pixel set according to the judgment threshold; wherein the judgment threshold is related to an average brightness of the color brightness value sub-image;

[0042] A definition calculation weight acquisition module, wherein the definition calculation weight acquisition module obtains a definition calculation weight of each pixel point of the color sub-channel image according to a mapping relationship between the pixel points in the first pixel set and the second pixel set and the color sub-channel image;

[0043] A definition feature acquisition module, wherein the definition feature acquisition module calculates weights according to the color sub-channel image and the definition of each pixel point of the color sub-channel image to obtain the definition feature of the color sub-channel image;

[0044] The evaluation value acquisition module is used to perform weighted calculation on the clarity features of each color sub-channel image and obtain an evaluation value of the clarity of the image to be evaluated.

[0045] According to another aspect of the present disclosure, there is provided an electronic device, comprising:

[0046] a memory storing execution instructions; and

[0047] A processor executes the execution instructions stored in the memory, so that the processor executes the above-mentioned image clarity evaluation method. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] The accompanying drawings illustrate exemplary embodiments of the present disclosure and together with the description serve to explain the principles of the present disclosure. These drawings are included to provide a further understanding of the present disclosure and are incorporated in and constitute a part of this specification.

[0049] Figure 1 It is a flowchart of an image clarity evaluation method according to an embodiment of the present disclosure.

[0050] Figure 2 It is a schematic diagram of the structure of an image to be evaluated according to one embodiment of the present disclosure.

[0051] Figure 3 is a schematic diagram of the color sub-channel image blocks according to one embodiment of the present disclosure.

[0052] Figure 4 Schematic diagram of Gaussian weights of image blocks of a color sub-channel image according to one embodiment of the present disclosure.

[0053] Figure 5 It is a schematic block diagram of the structure of an image clarity evaluation device using a hardware implementation of a processor according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0054] The present disclosure is further described in detail below in conjunction with the accompanying drawings and implementations. It is understood that the specific implementations described herein are only used to explain the relevant content, rather than to limit the present disclosure. It should also be noted that, for ease of description, only the parts related to the present disclosure are shown in the accompanying drawings.

[0055] It should be noted that, in the absence of conflict, the embodiments and features of the embodiments in the present disclosure can be combined with each other. The technical solution of the present disclosure will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0056] Unless otherwise specified, the exemplary embodiments / embodiments shown will be understood as providing exemplary features of various details of some ways in which the technical concept of the present disclosure can be implemented in practice. Therefore, unless otherwise specified, the features of the various embodiments / embodiments can be combined, separated, interchanged and / or rearranged without departing from the technical concept of the present disclosure.

[0057] The use of cross-hatching and / or shading in the accompanying drawings is generally used to make the boundaries between adjacent components clear. As such, unless otherwise specified, the presence or absence of cross-hatching or shading does not convey or indicate any preference or requirement for the specific materials, material properties, dimensions, proportions, commonalities between the components shown, and / or any other characteristics, attributes, properties, etc. of the components. In addition, in the accompanying drawings, the sizes and relative sizes of the components may be exaggerated for clarity and / or descriptive purposes. When the exemplary embodiments can be implemented differently, the specific process sequence can be performed in a different order than described. For example, two successively described processes can be performed substantially simultaneously or in an order opposite to the described order. In addition, the same figure numbers represent the same components.

[0058] When a component is referred to as being "on" or "over," "connected to," or "coupled to" another component, the component may be directly on, directly connected to, or directly coupled to the other component, or intervening components may be present. However, when a component is referred to as being "directly on," "directly connected to," or "directly coupled to" another component, there are no intervening components. For this purpose, the term "connected" may refer to a physical connection, an electrical connection, etc., with or without intervening components.

[0059] The terms used herein are for the purpose of describing specific embodiments, and are not intended to be restrictive. As used herein, unless the context clearly indicates otherwise, the singular forms "one (kind, person)" and "said (the)" are also intended to include plural forms. In addition, when the terms "comprise" and / or "include" and their variations are used in this specification, it is explained that there are stated features, integral bodies, steps, operations, parts, assemblies and / or their groups, but it is not excluded that there are or add one or more other features, integral bodies, steps, operations, parts, assemblies and / or their groups. It should also be noted that, as used herein, the terms "substantially", "approximately" and other similar terms are used as approximate terms and not as degree terms, so that they are used to explain the inherent deviations of the measured values, calculated values ​​and / or the values ​​provided that will be recognized by those of ordinary skill in the art.

[0060] The image clarity evaluation method disclosed in the present invention can be applied to the image clarity evaluation device disclosed in the present invention, and the image clarity evaluation device can be configured on a terminal device. The terminal device can be a mobile terminal, such as a mobile phone, a tablet computer, a personal digital assistant, and other hardware devices with various operating systems.

[0061] Combined with the following Figures 1 to 5 The image clarity evaluation method, image clarity evaluation device, etc. disclosed in the present invention are described in detail.

[0062] Figure 1 It is a flowchart of an image clarity evaluation method according to an embodiment of the present disclosure.

[0063] like Figure 1 As shown, the image clarity evaluation method disclosed in the present invention may include:

[0064] S110, obtaining an image to be evaluated;

[0065] S120, extracting color components from the image to be evaluated to obtain a plurality of color sub-channel images; wherein each color sub-channel image is associated with a color;

[0066] S130, extracting brightness components from the image to be evaluated to obtain a color brightness value sub-image related to the color, wherein the color brightness value sub-image corresponds to the color sub-channel image one by one;

[0067] S140, obtaining a judgment threshold according to the color brightness value sub-image, and dividing the color brightness value sub-image into at least a first pixel set and a second pixel set according to the judgment threshold; wherein the judgment threshold is related to the average brightness of the color brightness value sub-image;

[0068] S150, obtaining a definition calculation weight of each pixel of the color sub-channel image according to a mapping relationship between the pixels in the first pixel set and the second pixel set and the color sub-channel image;

[0069] S160, obtaining a clarity feature of the color sub-channel image by calculating a weight according to the clarity of the color sub-channel image and each pixel of the color sub-channel image;

[0070] S170 , performing a weighted operation on the clarity features of the images of each color sub-channel, and obtaining an evaluation value of the clarity of the image to be evaluated.

[0071] The image processing method disclosed herein will be described in detail below with reference to specific examples.

[0072] Figure 2 It is a schematic diagram of the structure of an image to be evaluated according to one embodiment of the present disclosure.

[0073] like Figure 2 As shown, the image to be evaluated in the present disclosure may be an image in Bayer format. Preferably, the image to be evaluated may be a microscopic image acquired by a microscope, or an original image acquired by a camera, and the microscopic image or the original image may be stored in Bayer format, and the image clarity evaluation method of the present disclosure may evaluate the clarity of these images.

[0074] exist Figure 2 In the bayer image shown, each pixel can be represented by a color array including one data (R) representing red, two data (G1 and G2) representing green, and one data (B) representing blue.

[0075] Therefore, in S120, color components may be obtained from the image to be evaluated according to the color arrangement order in the color array, and a plurality of color sub-channel images may be further obtained through these color components.

[0076] Specifically, Figure 2 For example, the present disclosure can obtain a first color sub-channel image (R), a second color sub-channel image (G1), a third color sub-channel image (G2), and a fourth color sub-channel image (B) according to the image to be evaluated. Among them, the first color sub-channel image is a color sub-channel image representing red; the second color sub-channel image is a color sub-channel image representing green (i.e., green 1); the third color sub-channel image is a color sub-channel image representing green (i.e., green 2); and the fourth color sub-channel image is a color sub-channel image representing blue. In other words, the image clarity evaluation method disclosed in the present disclosure, according to the structure of the image in the bayer format, splits the green component of the image to be evaluated into two color sub-channel images.

[0077] Therefore, the image clarity evaluation method disclosed in the present invention facilitates subsequent processing and improves the accuracy of image clarity evaluation by splitting the image to be evaluated according to color.

[0078] In the present disclosure, since each pixel corresponds to a color array, accordingly, the first color sub-channel image (R), the second color sub-channel image (G1), the third color sub-channel image (G2) and the fourth color sub-channel image (B) obtained in the present disclosure all have the same size as the image to be evaluated, that is, these color sub-channel images have the same number of pixels as the image to be evaluated, and the length and width are the same.

[0079] In other words, for a Bayer image with a color arrangement order of RGGB, pixels in odd rows and odd columns are extracted to form an R subchannel image, pixels in odd rows and even columns are extracted to form a G1 subchannel image, pixels in even rows and odd columns are extracted to form a G2 subchannel image, and pixels in even rows and even columns are extracted to form a B subchannel image.

[0080] In some embodiments, the color brightness value sub-image can be obtained through step S130.

[0081] In the present disclosure, due to the special structure of the Bayer image, it is impossible to directly extract the brightness component from the Bayer image using the RGB-YUV conversion formula; the following brightness component extraction method is used in this embodiment:

[0082] For the red component position and blue component position of the pixel position (x, y) in the Bayer image, the calculation formula for the extracted brightness component value is:

[0083] I r (x,y)=(2(g1(x-1,y)+g1(x+1,y)+g2(x,y-1)+g2(x,y+1))+4r(x,y)-r(x-2,y)-r(x+2,y)-r(x,y-2)-r(x,y+2)) / 8

[0084] I b (x,y)=(2(g2(x-1,y)+g2(x+1,y)+g1(x,y-1)+g1(x,y+1))+4b(x,y)-b(x-2,y)-b(x+2,y)-b(x,y-2)-b(x,y+2)) / 8

[0085] Among them, (x, y) is the pixel position, r(x, y) represents the color value of the red (first color) channel of the pixel position (x, y); b(x, y) represents the color value of the blue (fourth color) channel of the pixel position (x, y); g1(x, y) represents the color value of the green (second color) channel of the pixel position (x, y); g2(x, y) represents the color value of the green (third color) channel of the pixel position (x, y).

[0086] In addition, when g1(x-1,y), g1(x+1,y), g2(x,y-1), g2(x,y+1), r(x-2,y), r(x+2,y), r(x,y-2), r(x,y+2), g2(x-1,y), g2(x+1,y), g1(x,y-1), g1(x,y+1), b(x-2,y), b(x+2,y), b(x,y-2), and b(x,y+2) are pixels outside the Bayer image, they can be filled with fixed values.

[0087] Thus, the first color brightness value sub-image (R) and the fourth color brightness value sub-image (B) can be obtained.

[0088] For the green component position of the pixel position (x, y) in the Bayer image, the following formula is used:

[0089] I g (x,y)=g(x,y);

[0090] To obtain the second color brightness value sub-image (G1) and the third color brightness value sub-image (G2).

[0091] Based on this, the color brightness value sub-image and the color sub-channel image of the present disclosure can be set in one-to-one correspondence. And the color brightness value sub-image and the color sub-channel image have the same size, that is, the color brightness value sub-image and the color sub-channel image have the same number of pixels, and the length and width are also the same.

[0092] In some embodiments, in S140, each color brightness value sub-image is processed separately. That is, the image clarity evaluation method disclosed in the present invention can process the four color brightness value sub-images separately.

[0093] Specifically, a judgment threshold corresponding to each color brightness value sub-image is obtained according to the color brightness value sub-image. In a preferred embodiment, the judgment threshold is the average brightness of the current color brightness value sub-image.

[0094] Generally speaking, four judgment thresholds can be obtained according to the four color brightness value sub-images, and the four judgment thresholds can be: a judgment threshold associated with the first color (R), a judgment threshold associated with the second color (G1), a judgment threshold associated with the third color (G2), and a judgment threshold associated with the fourth color (B). In the present disclosure, the four judgment thresholds can be the same or different.

[0095] Next, the color brightness value sub-image generating the judgment threshold is divided according to the judgment threshold, and a first pixel set and a second pixel set are obtained; wherein the first pixel set may also be referred to as foreground pixels, and the second pixel set may also be referred to as background pixels.

[0096] Specifically, when the pixel value of a pixel point in the color brightness value sub-image is less than the judgment threshold, the pixel point is judged as a foreground pixel; when the pixel value of a pixel point in the color brightness value sub-image is greater than or equal to the judgment threshold, the pixel point is judged as a background pixel.

[0097] In some embodiments, after the foreground pixels and the background pixels are obtained, the foreground pixels and the background pixels may be set to different weights.

[0098] Specifically, in the color brightness value sub-image, a first weight is set for the pixel points corresponding to the foreground pixels; a second weight is set for the pixel points corresponding to the background pixels; wherein the first weight and the second weight are both clarity calculation weights.

[0099] At the same time, since the color sub-channel image and the color brightness value sub-image have a one-to-one correspondence and have the same size and number of pixels, for the color sub-channel image, the clarity calculation weight of its pixel (x, y) is:

[0100]

[0101] Wherein, t(x,y) is the clarity calculation weight of a pixel in the color sub-channel image; t1 is the first weight; t2 is the second weight; f(x,y) is the value of the pixel (x,y) in the color brightness value sub-image; T is the judgment threshold. In a preferred embodiment, t1 is greater than t2, that is, by setting a larger weight for the foreground pixel, the influence of the complex background on the image clarity evaluation can be reduced.

[0102] In the present disclosure, t1 and t2 may be preset values, and both t1 and t2 are not 0.

[0103] At this time, the clarity calculation weight of each pixel in each color sub-channel image can be obtained.

[0104] In some embodiments, each color sub-channel image may be used as an input image, and the clarity feature of each color channel may be obtained.

[0105] Specifically, the color sub-channel image is divided into (2s+1)*(2s+1) image blocks, where s is greater than or equal to 1. In a specific embodiment, the value of s may be 2, so that the color sub-channel image can be divided into 25 image blocks, and at this time, the color sub-channel image has the same number of image blocks along the length direction and the width direction.

[0106] The size of the image block may be m*n, that is, the image block has m pixels in the length direction and n pixels in the width direction, wherein m and n are natural numbers, which may be the same or different.

[0107] The image block located at the center of the color sub-channel image is taken as the coordinate origin to obtain the coordinates of each image block; and the Gaussian weight of each image block is obtained according to the coordinates of each image block.

[0108] Specifically, the Gaussian weight w k It can be calculated by the following formula:

[0109]

[0110] Where i and j are the coordinates of the image block; σ is the standard deviation; k is the sequence number of the image block, which is greater than or equal to 1 and less than or equal to the total number of image blocks. Figure 3 As shown, the total number of image blocks is 25, and k can be an integer between 1 and 25 (including 1 and 25).

[0111] Moreover, the image clarity evaluation method disclosed in the present invention also obtains a first clarity estimation value of the image block through the following steps: obtaining a gradient value of each pixel point according to the grayscale value of the pixel point in each image block; and obtaining a first clarity estimation value of the image block according to the gradient value of each pixel point in each image block and the clarity calculation weight corresponding to the pixel point.

[0112] Specifically, the gradient value L(x, y) of the pixel in the image block is calculated by the following formula:

[0113] L(x, y) = 4f(x, y) - f(x, y+1) - f(x, y-1) - f(x+1, y) - f(x-1, y); wherein L(x, y) is the gradient value of the pixel (x, y); f(x, y) is the grayscale value of the pixel (x, y); f(x, y+1), f(x, y-1), f(x-1, y), and f(x+1, y) are the grayscale values ​​of the pixels above, below, to the left, and to the right of the pixel (x, y), respectively.

[0114] In a specific embodiment, when f(x, y+1), f(x, y-1), f(x+1, y) and f(x-1, y) are pixel points outside the image block, they are filled with preset values.

[0115] Then, the first definition estimation value of the kth image block is calculated according to the following formula:

[0116] In step S160, a second definition estimation value may also be obtained according to the grayscale value of each pixel in each image block; that is, a second definition estimation value may be obtained for each image block k.

[0117] Specifically, the second definition estimation value can be obtained by the following formula:

[0118]

[0119] Similarly, when f(x+2, y) is a pixel point outside the image block, it can be filled with a preset value.

[0120] The first definition estimation value and the second definition estimation value are weightedly calculated to obtain an overall definition estimation value of each image block.

[0121] Specifically, the overall clarity estimate S of the kth image block is k It can be calculated by the following formula:

[0122]

[0123] Where a is the first definition estimate The weight of b is the second clarity estimation value S k 2 Among them, a and b can be preset values, and make a and b greater than or equal to 0.

[0124] Finally, the clarity feature of the color sub-channel image is obtained according to the Gaussian weight of each image block and the overall clarity estimation value.

[0125] Specifically, the clarity feature S of the color subchannel image coarse It can be calculated by the following formula:

[0126]

[0127] S170 , performing a weighted operation on the clarity features of the images of each color sub-channel, and obtaining an evaluation value of the clarity of the image to be evaluated.

[0128] In some embodiments, in S170, the evaluation value S of the clarity of the image to be evaluated may be calculated by the following formula:

[0129] S=w r *S r +w g1 *S g1 +w g2 *S g2 +w b *S b .

[0130] Among them, S r is the clarity feature corresponding to the first color sub-channel image; w r is the weight of the clarity evaluation value corresponding to the first color sub-channel image; S g1 is the clarity feature corresponding to the second color sub-channel image; w g1 is the weight of the clarity evaluation value corresponding to the second color sub-channel image; S g2 is the clarity feature corresponding to the third color sub-channel image; w g2 is the weight of the clarity evaluation value corresponding to the third color sub-channel image; S b is the clarity feature corresponding to the fourth color sub-channel image; w b is the weight of the clarity evaluation value corresponding to the fourth color sub-channel image.

[0131] More preferably, w r +w g1 +w g2 +w b =1.

[0132] Therefore, the image clarity evaluation method disclosed in the present invention combines multiple image clarity evaluation functions, thereby avoiding the shortcomings of each evaluation function and giving play to their respective advantages; at the same time, by extracting the foreground pixels of the image to be evaluated and assigning a higher weight, the influence of the complex background on the image clarity evaluation is reduced. Moreover, the image clarity evaluation method disclosed in the present invention can improve the accuracy of clarity calculation by dividing the image into blocks and assigning a higher weight to the central block.

[0133] When used, the image clarity evaluation method disclosed in the present invention can obtain the clarity evaluation value of the real-time Bayer image, has good real-time performance, is suitable for fast automatic focusing of microscope cameras, conforms to the unimodal characteristics, has high sensitivity and is real-time.

[0134] Figure 5 It is a schematic block diagram of the structure of an image clarity evaluation device using a hardware implementation of a processor according to an embodiment of the present disclosure.

[0135] The image clarity evaluation device may include corresponding modules for executing each or several steps in the above flowchart. Therefore, each step or several steps in the above flowchart may be executed by the corresponding module, and the device may include one or more of these modules. The module may be one or more hardware modules specifically configured to execute the corresponding steps, or implemented by a processor configured to execute the corresponding steps, or stored in a computer-readable medium for implementation by a processor, or implemented by some combination.

[0136] The hardware structure of the image clarity evaluation device of the present disclosure can be implemented using a bus architecture. The bus architecture may include any number of interconnected buses and bridges, depending on the specific application and overall design constraints of the hardware. The bus 1100 connects various circuits including one or more processors 1200, memory 1300, and / or hardware modules together. The bus 1100 may also connect various other circuits 1400 such as peripherals, voltage regulators, power management circuits, external antennas, etc.

[0137] The bus 1100 may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Component (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the figure only uses one connecting line, but does not mean that there is only one bus or one type of bus.

[0138] Any process or method description in the flowchart or otherwise described herein can be understood as a module, fragment or portion of a code representing one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present disclosure includes other implementations, in which the functions may not be performed in the order shown or discussed, including performing the functions in a substantially simultaneous manner or in a reverse order according to the functions involved, which should be understood by a person skilled in the art of the present disclosure. The processor performs the various methods and processes described above. For example, the method implementation in the present disclosure can be implemented as a software program, which is tangibly contained in a machine-readable medium, such as a memory. In some embodiments, part or all of the software program can be loaded and / or installed via a memory and / or a communication interface. When the software program is loaded into the memory and executed by the processor, one or more steps in the method described above can be performed. Alternatively, in other embodiments, the processor can be configured to perform one of the above methods in any other appropriate manner (e.g., by means of firmware).

[0139] The logic and / or steps represented in the flowchart or otherwise described herein may be embodied in any readable storage medium for use by an instruction execution system, apparatus, or device (such as a computer-based system, a system including a processor, or other system that can fetch instructions from and execute instructions on an instruction execution system, apparatus, or device), or in combination with such instruction execution systems, apparatuses, or devices.

[0140] For the purposes of this specification, a "readable storage medium" may be any device that can contain, store, communicate, propagate or transmit a program for use with or in conjunction with an instruction execution system, device or apparatus. More specific examples of readable storage media (a non-exhaustive list) include the following: an electrical connection with one or more wirings (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and editable read-only memory (EPROM or flash memory), a fiber optic device, and a portable read-only memory (CDROM). In addition, the readable storage medium may even be paper or other suitable medium on which the program can be printed, since the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering or, if necessary, processing in another suitable manner, and then stored in a memory.

[0141] It should be understood that the various parts of the present disclosure can be implemented in hardware, software, or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented in software stored in a memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0142] A person skilled in the art may understand that all or part of the steps of implementing the above-mentioned implementation method may be completed by instructing related hardware through a program, and the program may be stored in a readable storage medium, which, when executed, includes one or a combination of the steps of the implementation method.

[0143] In addition, each functional unit in each embodiment of the present disclosure may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a readable storage medium. The storage medium may be a read-only memory, a disk or an optical disk, etc.

[0144] refer to Figure 5 According to one embodiment of the present disclosure, the image clarity evaluation device of the present disclosure includes an image acquisition module 1002 to be evaluated, a color sub-channel image acquisition module 1004, a color brightness value sub-image acquisition module 1006, a judgment module 1008, a clarity calculation weight acquisition module 1010, a clarity feature acquisition module 1012 and an evaluation value acquisition module 1014.

[0145] The image acquisition module to be evaluated is used to acquire the image to be evaluated; the color sub-channel image acquisition module 1004 is used to extract color components from the image to be evaluated to obtain multiple color sub-channel images; wherein each color sub-channel image is related to a color; the color brightness value sub-image acquisition module 1006 is used to extract brightness components from the image to be evaluated to obtain a color brightness value sub-image related to the color, wherein the color brightness value sub-image corresponds to the color sub-channel image one by one; the judgment module 1008 obtains a judgment threshold according to the color brightness value sub-image, and divides the color brightness value sub-image into at least a first pixel set and a second pixel set according to the judgment threshold. pixel set; wherein the judgment threshold is related to the average brightness of the color brightness value sub-image; the clarity calculation weight acquisition module 1010 obtains the clarity calculation weight of each pixel of the color sub-channel image according to the mapping relationship between the pixel points in the first pixel set and the second pixel set and the color sub-channel image; the clarity feature acquisition module 1012 obtains the clarity feature of the color sub-channel image according to the color sub-channel image and the clarity calculation weight of each pixel of the color sub-channel image; the evaluation value acquisition module 1014 is used to perform weighted operation on the clarity features of each color sub-channel image and obtain the evaluation value of the clarity of the image to be evaluated.

[0146] The image to be evaluated in the present disclosure may be an image in Bayer format. Preferably, the image to be evaluated may be a microscopic image acquired by a microscope, or an original image acquired by a camera, and the microscopic image or the original image may be stored in Bayer format, and the image clarity evaluation method of the present disclosure may evaluate the clarity of these images.

[0147] exist Figure 2In the bayer image shown, each pixel can be represented by a color array including one data (R) representing red, two data (G1 and G2) representing green, and one data (B) representing blue.

[0148] Thus, color components can be obtained from the image to be evaluated according to the color arrangement order in the color array, and a plurality of color sub-channel images can be further obtained through these color components.

[0149] Specifically, Figure 2 For example, the present disclosure can obtain a first color sub-channel image (R), a second color sub-channel image (G1), a third color sub-channel image (G2), and a fourth color sub-channel image (B) according to the image to be evaluated. Among them, the first color sub-channel image is a color sub-channel image representing red; the second color sub-channel image is a color sub-channel image representing green (i.e., green 1); the third color sub-channel image is a color sub-channel image representing green (i.e., green 2); and the fourth color sub-channel image is a color sub-channel image representing blue. In other words, the image clarity evaluation method disclosed in the present disclosure, according to the structure of the image in the bayer format, splits the green component of the image to be evaluated into two color sub-channel images.

[0150] Therefore, the image clarity evaluation method disclosed in the present invention facilitates subsequent processing and improves the accuracy of image clarity evaluation by splitting the image to be evaluated according to color.

[0151] In the present disclosure, since each pixel corresponds to a color array, accordingly, the first color sub-channel image (R), the second color sub-channel image (G1), the third color sub-channel image (G2) and the fourth color sub-channel image (B) obtained in the present disclosure all have the same size as the image to be evaluated, that is, these color sub-channel images have the same number of pixels as the image to be evaluated, and the length and width are the same.

[0152] In other words, for a Bayer image with a color arrangement order of RGGB, pixels in odd rows and odd columns are extracted to form an R subchannel image, pixels in odd rows and even columns are extracted to form a G1 subchannel image, pixels in even rows and odd columns are extracted to form a G2 subchannel image, and pixels in even rows and even columns are extracted to form a B subchannel image.

[0153] In the present disclosure, due to the special structure of the Bayer image, it is impossible to directly extract the brightness component from the Bayer image using the RGB-YUV conversion formula; the following brightness component extraction method is used in this embodiment:

[0154] For the red component position and blue component position of the pixel position (x, y) in the Bayer image, the calculation formula for the extracted brightness component value is:

[0155] I r (x,y)=(2(g1(x-1,y)+g1(x+1,y)+g2(x,y-1)+g2(x,y+1))+4r(x,y)-r(x-2,y)-r(x+2,y)-r(x,y-2)-r(x,y+2)) / 8

[0156] I b (x,y)=(2(g2(x-1,y)+g2(x+1,y)+g1(x,y-1)+g1(x,y+1))+4b(x,y)-b(x-2,y)-b(x+2,y)-b(x,y-2)-b(x,y+2)) / 8

[0157] Among them, (x, y) is the pixel position, r(x, y) represents the color value of the red (first color) channel of the pixel position (x, y); b(x, y) represents the color value of the blue (fourth color) channel of the pixel position (x, y); g1(x, y) represents the color value of the green (second color) channel of the pixel position (x, y); g2(x, y) represents the color value of the green (third color) channel of the pixel position (x, y).

[0158] In addition, when g1(x-1,y), g1(x+1,y), g2(x,y-1), g2(x,y+1), r(x-2,y), r(x+2,y), r(x,y-2), r(x,y+2), g2(x-1,y), g2(x+1,y), g1(x,y-1), g1(x,y+1), b(x-2,y), b(x+2,y), b(x,y-2), and b(x,y+2) are pixels outside the Bayer image, they can be filled with fixed values.

[0159] Thus, the first color brightness value sub-image (R) and the fourth color brightness value sub-image (B) can be obtained.

[0160] For the green component position of the pixel position (x, y) in the Bayer image, the following formula is used:

[0161] I g (x,y)=g(x,y);

[0162] To obtain the second color brightness value sub-image (G1) and the third color brightness value sub-image (G2).

[0163] Based on this, the color brightness value sub-image and the color sub-channel image of the present disclosure can be set in one-to-one correspondence. And the color brightness value sub-image and the color sub-channel image have the same size, that is, the color brightness value sub-image and the color sub-channel image have the same number of pixels, and the length and width are also the same.

[0164] In some embodiments, each color brightness value sub-image is processed separately. That is, the image clarity evaluation method disclosed in the present invention can process the four color brightness value sub-images separately.

[0165] Specifically, a judgment threshold corresponding to each color brightness value sub-image is obtained according to the color brightness value sub-image. In a preferred embodiment, the judgment threshold is the average brightness of the current color brightness value sub-image.

[0166] Generally speaking, four judgment thresholds can be obtained according to the four color brightness value sub-images, and the four judgment thresholds can be: a judgment threshold associated with the first color (R), a judgment threshold associated with the second color (G1), a judgment threshold associated with the third color (G2), and a judgment threshold associated with the fourth color (B). In the present disclosure, the four judgment thresholds can be the same or different.

[0167] Next, the color brightness value sub-image generating the judgment threshold is divided according to the judgment threshold, and a first pixel set and a second pixel set are obtained; wherein the first pixel set may also be referred to as foreground pixels, and the second pixel set may also be referred to as background pixels.

[0168] Specifically, when the pixel value of a pixel point in the color brightness value sub-image is less than the judgment threshold, the pixel point is judged as a foreground pixel; when the pixel value of a pixel point in the color brightness value sub-image is greater than or equal to the judgment threshold, the pixel point is judged as a background pixel.

[0169] In some embodiments, after the foreground pixels and the background pixels are obtained, the foreground pixels and the background pixels may be set to different weights.

[0170] Specifically, in the color brightness value sub-image, a first weight is set for the pixel points corresponding to the foreground pixels; a second weight is set for the pixel points corresponding to the background pixels; wherein the first weight and the second weight are both clarity calculation weights.

[0171] At the same time, since the color sub-channel image and the color brightness value sub-image have a one-to-one correspondence and have the same size and number of pixels, for the color sub-channel image, the clarity calculation weight of its pixel (x, y) is:

[0172]

[0173] Wherein, t(x,y) is the clarity calculation weight of a pixel in the color sub-channel image; t1 is the first weight; t2 is the second weight; f(x,y) is the value of the pixel (x,y) in the color brightness value sub-image; T is the judgment threshold. In a preferred embodiment, t1 is greater than t2, that is, by setting a larger weight for the foreground pixel, the influence of the complex background on the image clarity evaluation can be reduced.

[0174] In the present disclosure, t1 and t2 may be preset values, and both t1 and t2 are not 0.

[0175] At this time, the clarity calculation weight of each pixel in each color sub-channel image can be obtained.

[0176] In some embodiments, each color sub-channel image may be used as an input image, and the clarity feature of each color channel may be obtained.

[0177] Specifically, the color sub-channel image is divided into (2s+1)*(2s+1) image blocks, where s is greater than or equal to 1. In a specific embodiment, the value of s may be 2, so that the color sub-channel image can be divided into 25 image blocks, and at this time, the color sub-channel image has the same number of image blocks along the length direction and the width direction.

[0178] The size of the image block may be m*n, that is, the image block has m pixels in the length direction and n pixels in the width direction, wherein m and n are natural numbers, which may be the same or different.

[0179] The image block located at the center of the color sub-channel image is taken as the coordinate origin to obtain the coordinates of each image block; and the Gaussian weight of each image block is obtained according to the coordinates of each image block.

[0180] Specifically, the Gaussian weight w k It can be calculated by the following formula:

[0181]

[0182] Where i and j are the coordinates of the image block; σ is the standard deviation; k is the sequence number of the image block, which is greater than or equal to 1 and less than or equal to the total number of image blocks. Figure 3 As shown, the total number of image blocks is 25, and k can be an integer between 1 and 25 (including 1 and 25).

[0183] Moreover, the image clarity evaluation method disclosed in the present invention also obtains a first clarity estimation value of the image block through the following steps: obtaining a gradient value of each pixel point according to the grayscale value of the pixel point in each image block; and obtaining a first clarity estimation value of the image block according to the gradient value of each pixel point in each image block and the clarity calculation weight corresponding to the pixel point.

[0184] Specifically, the gradient value L(x,y) of the pixel in the image block is calculated by the following formula:

[0185] L(x,y)=4f(x,y)-f(x,y+1)-f(x,y-1)-f(x+1,y)-f(x-1,y); where L(x,y) is the gradient value of the pixel (x,y); f(x,y) is the grayscale value of the pixel (x,y); f(x,y+1), f(x,y-1), f(x-1,y), and f(x+1,y) are the grayscale values ​​of the pixels above, below, to the left, and to the right of the pixel (x,y), respectively.

[0186] In a specific embodiment, when f(x,y+1), f(x,y-1), f(x+1,y) and f(x-1,y) are pixel points outside the image block, they are filled with preset values.

[0187] Then, the first definition estimation value of the kth image block is calculated according to the following formula:

[0188] In the present disclosure, a second definition estimation value can also be obtained according to the grayscale value of each pixel in each image block; that is, a second definition estimation value can be obtained for each image block k.

[0189] Specifically, the second definition estimation value can be obtained by the following formula:

[0190]

[0191] Similarly, when f(x+2,y) is a pixel point outside the image block, it can be filled with a preset value.

[0192] The first definition estimation value and the second definition estimation value are weightedly calculated to obtain an overall definition estimation value of each image block.

[0193] Specifically, the overall clarity estimate S of the kth image block is k It can be calculated by the following formula:

[0194]

[0195] Where a is the first definition estimate The weight of b is the second clarity estimate Among them, a and b can be preset values, and make a and b greater than or equal to 0.

[0196] Finally, the clarity feature of the color sub-channel image is obtained according to the Gaussian weight of each image block and the overall clarity estimation value.

[0197] Specifically, the clarity feature S of the color subchannel image coarse It can be calculated by the following formula:

[0198]

[0199] In some embodiments, the evaluation value S of the clarity of the image to be evaluated can be calculated by the following formula:

[0200] S=w r *S r +w g1 *S g1 +w g2 *S g2 +w b *S b .

[0201] Among them, S r is the clarity feature corresponding to the first color sub-channel image; w r is the weight of the clarity evaluation value corresponding to the first color sub-channel image; S g1 is the clarity feature corresponding to the second color sub-channel image; w g1 is the weight of the clarity evaluation value corresponding to the second color sub-channel image; S g2 is the clarity feature corresponding to the third color sub-channel image; w g2 is the weight of the clarity evaluation value corresponding to the third color sub-channel image; S b is the clarity feature corresponding to the fourth color sub-channel image; w b is the weight of the clarity evaluation value corresponding to the fourth color sub-channel image.

[0202] More preferably, w r +w g1 +w g2 +w b =1.

[0203] Therefore, the image clarity evaluation method disclosed in the present invention combines multiple image clarity evaluation functions, thereby avoiding the shortcomings of each evaluation function and giving play to their respective advantages; at the same time, by extracting the foreground pixels of the image to be evaluated and assigning a higher weight, the influence of the complex background on the image clarity evaluation is reduced. Moreover, the image clarity evaluation method disclosed in the present invention can improve the accuracy of clarity calculation by dividing the image into blocks and assigning a higher weight to the central block.

[0204] When used, the image clarity evaluation method disclosed in the present invention can obtain the clarity evaluation value of the real-time Bayer image, has good real-time performance, is suitable for fast automatic focusing of microscope cameras, conforms to the unimodal characteristics, has high sensitivity and is real-time.

[0205] The present disclosure also provides an electronic device, including: a memory, the memory storing execution instructions; and a processor or other hardware module, the processor or other hardware module executes the execution instructions stored in the memory, so that the processor or other hardware module executes the above method.

[0206] The present disclosure also provides a readable storage medium, in which execution instructions are stored. When the execution instructions are executed by a processor, they are used to implement the above method.

[0207] Those skilled in the art should understand that the above embodiments are only for the purpose of clearly illustrating the present disclosure, and are not intended to limit the scope of the present disclosure. For those skilled in the art, other changes or modifications may be made based on the above disclosure, and these changes or modifications are still within the scope of the present disclosure.

Claims

1. A method for evaluating image clarity, characterized in that: include: Get the image to be evaluated; Extracting color components from the image to be evaluated to obtain a plurality of color sub-channel images; wherein each color sub-channel image is associated with a color; Extracting a brightness component from the image to be evaluated to obtain a color brightness value sub-image associated with the color, wherein the color brightness value sub-image corresponds one-to-one to the color sub-channel image; Obtaining a judgment threshold according to the color brightness value sub-image, and dividing the color brightness value sub-image into at least a first pixel set and a second pixel set according to the judgment threshold; wherein the judgment threshold is related to the average brightness of the color brightness value sub-image; Obtaining a definition calculation weight of each pixel of the color sub-channel image according to a mapping relationship between the pixels in the first pixel set and the second pixel set and the color sub-channel image; Calculating weights according to the color sub-channel image and the clarity of each pixel of the color sub-channel image to obtain a clarity feature of the color sub-channel image; The clarity features of each color sub-channel image are weighted and the evaluation value of the clarity of the image to be evaluated is obtained.

2. The image clarity evaluation method according to claim 1, characterized in that: Obtain color components from the image to be evaluated to obtain multiple color sub-channel images; including: Each color component is extracted from the image to be evaluated according to the color arrangement order, and a first color sub-channel image, a second color sub-channel image, a third color sub-channel image and a fourth color sub-channel image are obtained; wherein the image to be evaluated is an image in a Bayer format.

3. The image clarity evaluation method according to claim 2, characterized in that: Extracting the brightness component from the image to be evaluated to obtain a color brightness value sub-image related to the color; including: The brightness component of the image to be evaluated is extracted, and a first color brightness value sub-image, a second color brightness value sub-image, a third color brightness value sub-image and a fourth color brightness value sub-image are obtained in the order of color arrangement.

4. The image clarity evaluation method according to claim 1, characterized in that: The judgment threshold includes the average brightness of the color brightness value sub-image.

5. The image clarity evaluation method according to claim 1, characterized in that: The clarity feature of the color sub-channel image is obtained according to the color sub-channel image and the clarity calculation weight of each pixel of the color sub-channel image; including: Divide the color sub-channel image into (2s+1)*(2s+1) image blocks, where s is greater than or equal to 1; Taking the image block located at the center of the color sub-channel image as the coordinate origin, the coordinates of each image block are obtained; and the Gaussian weight of each image block is obtained according to the coordinates of each image block; Obtaining the gradient value of each pixel point according to the grayscale value of each pixel point in each image block; Obtaining a first definition estimation value of the image block according to a gradient value of each pixel point in each image block and a definition calculation weight corresponding to the pixel point; Obtaining a second definition estimation value according to the grayscale value of each pixel in each image block; Performing a weighted operation on the first definition estimation value and the second definition estimation value to obtain an overall definition estimation value of each image block; The clarity feature of the color sub-channel image is obtained according to the Gaussian weight of each image block and the overall clarity estimation value.

6. The image clarity evaluation method according to claim 5, characterized in that: The gradient value of each pixel point obtained according to the gray value of each pixel point in each image block includes: L(x,y)=4f(x,y)-f(x,y+1)-f(x,y-1)-f(x+1,y)-f(x-1,y) Among them, L(x,y) is the gradient value of the pixel point (x,y); f(x,y) is the grayscale value of the pixel point (x,y); f(x,y+1), f(x,y-1), f(x-1,y), and f(x+1,y) are the grayscale values ​​of the pixels above, below, to the left, and to the right of the pixel point (x,y), respectively.

7. The image clarity evaluation method according to claim 6, characterized in that: Obtaining a first definition estimation value of the image block according to the gradient value of each pixel point in each image block and the definition calculation weight corresponding to the pixel point; comprising: in, represents the first clarity estimation value of the k-th image block; m represents the number of pixels in the length direction of the k-th image block, and n represents the number of pixels in the width direction of the k-th image block; (x, y) represents the pixel point in the k-th image block; t(x, y) represents the clarity calculation weight corresponding to the pixel point (x, y); L(x, y) represents the gradient value corresponding to the pixel point (x, y).

8. The image clarity evaluation method according to claim 7, characterized in that: Performing a weighted operation on the first definition estimation value and the second definition estimation value to obtain an overall definition estimation value of each image block; include: Where k represents the sequence number of the image block; represents the first definition estimation value of the k-th image block; represents the second definition estimation value of the k-th image block; a is the weight corresponding to the first definition estimation value of the k-th image block; b is the weight corresponding to the second definition estimation value of the k-th image block.

9. An image clarity evaluation device, characterized in that: include: An image acquisition module to be evaluated, wherein the image acquisition module to be evaluated is used to acquire the image to be evaluated; A color sub-channel image acquisition module, the color sub-channel image acquisition module is used to extract color components from the image to be evaluated to obtain a plurality of color sub-channel images; wherein each color sub-channel image is associated with a color; A color brightness value sub-image acquisition module, which is used to extract brightness components from the image to be evaluated to obtain a color brightness value sub-image related to the color, wherein the color brightness value sub-image corresponds to the color sub-channel image one by one; A judgment module, wherein the judgment module obtains a judgment threshold according to the color brightness value sub-image, and divides the color brightness value sub-image into at least a first pixel set and a second pixel set according to the judgment threshold; wherein the judgment threshold is related to an average brightness of the color brightness value sub-image; A definition calculation weight acquisition module, wherein the definition calculation weight acquisition module obtains a definition calculation weight of each pixel point of the color sub-channel image according to a mapping relationship between the pixel points in the first pixel set and the second pixel set and the color sub-channel image; A definition feature acquisition module, wherein the definition feature acquisition module calculates weights according to the color sub-channel image and the definition of each pixel point of the color sub-channel image to obtain the definition feature of the color sub-channel image; The evaluation value acquisition module is used to perform weighted calculation on the clarity features of each color sub-channel image and obtain an evaluation value of the clarity of the image to be evaluated.

10. An electronic device, characterized in that: include: A memory storing execution instructions; as well as A processor, wherein the processor executes the execution instructions stored in the memory, so that the processor executes the image clarity evaluation method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Bayer-pattern CFA image demosaicking method based on non-local mean

    CN102663719A

  • Image enhancement method

    CN111612700A

  • Microscopic image definition detection method and system, and computer equipment

    CN114972108A