Image definition evaluation method, device and electronic equipment
Patent Information
- Application Number
- CN202411143143.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-20
- Publication Date
- 2026-10-09
- Estimated Expiration
- 2044-08-20
AI Technical Summary
然而,这些专利文件仍然存在一些局限性
Smart Images

Figure CN119151871B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to an image sharpness evaluation method, apparatus, and electronic device, belonging to the field of image processing technology. Background Technology
[0002] As a precision optical device, the microscope is widely used in various fields.
[0003] When acquiring images using a microscope, automatic focusing of the sample is necessary, and the autofocus technology directly affects the overall quality of the acquired images. The core of autofocus technology is the image sharpness evaluation algorithm. This algorithm evaluates the images acquired during the defocus-focus-defocus process, and the position corresponding to the peak sharpness evaluation value is considered the optimal focus position.
[0004] Currently, the most commonly used image sharpness evaluation functions in autofocus can be categorized into frequency domain functions, spatial domain functions, and statistical functions. Frequency domain functions include Fourier transform, discrete cosine transform, and wavelet transform. These functions have high sensitivity but are computationally intensive, making them unsuitable for fast focusing of high-resolution images. Spatial domain functions include Tenengrad / Sobel functions, Brenner functions, Laplacian functions, and their variants. Statistical functions include entropy functions, range functions, and Vollaths functions. In scenes with high contrast and good signal-to-noise ratio, the above evaluation methods all exhibit the characteristics of unimodality, monotonicity, and high sensitivity. However, when the contrast between the focused target and the background is low, the evaluation curve tends to lose these characteristics.
[0005] In recent years, many patents have proposed improved image sharpness evaluation methods. For example, Patent Document 1 (Application No. 201810424740.6) discloses a method and apparatus for evaluating the sharpness of white blood cell images, and Patent Document 2 (Application No. 201911232590.X) discloses a method and system for detecting the sharpness of microscopic images, as well as computer equipment. However, these patent documents still have some limitations. For example, Patent 1 uses the Tenengrad function as the sharpness evaluation function, which can distinguish the sharpest image, but still has local extrema in terms of unimodality; while Patent 2 uses at least two evaluation functions to improve the efficiency of sharpness evaluation, but this method is still a sharpness evaluation method based on global pixels and does not consider the influence of background gradient values on the evaluation results. Summary of the Invention
[0006] To address one of the aforementioned technical problems, this disclosure provides an image sharpness evaluation method, apparatus, and electronic device.
[0007] According to one aspect of this disclosure, an image sharpness evaluation method is provided, comprising:
[0008] Obtain the image to be evaluated;
[0009] Color components are extracted from the image to be evaluated to obtain multiple color sub-channel images; each color sub-channel image is associated with a color.
[0010] Extract the luminance component from the image to be evaluated to obtain a color luminance value sub-image related to color, wherein the color luminance value sub-image corresponds one-to-one with the color sub-channel image;
[0011] A judgment threshold is obtained based on the color brightness value sub-image, and the color brightness value sub-image is divided 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] Based on the mapping relationship between the pixels in the first pixel set and the second pixel set and the color sub-channel image, the sharpness calculation weight of each pixel in the color sub-channel image is obtained.
[0013] The sharpness features of the color sub-channel image are obtained by calculating weights based on the sharpness of each pixel in the color sub-channel image.
[0014] The sharpness features of each color sub-channel image are weighted and calculated to obtain the sharpness evaluation value of the image to be evaluated.
[0015] According to at least one embodiment of the image sharpness evaluation method of this disclosure, color components are obtained from the image to be evaluated, resulting in multiple color sub-channel images; including:
[0016] Extract each color component from the image to be evaluated in color order to obtain the first color sub-channel image, the second color sub-channel image, the third color sub-channel image, and the fourth color sub-channel image; wherein, the image to be evaluated is a Bayer format image.
[0017] An image sharpness evaluation method according to at least one embodiment of the present disclosure extracts a luminance component from an image to be evaluated to obtain a color-related luminance value sub-image; including:
[0018] Extract the luminance component of the image to be evaluated, and obtain the first color luminance value sub-image, the second color luminance value sub-image, the third color luminance value sub-image, and the fourth color luminance value sub-image in color order.
[0019] According to at least one embodiment of the image sharpness evaluation method of this disclosure, the judgment threshold includes the average brightness of the color brightness value sub-image.
[0020] According to at least one embodiment of the image sharpness evaluation method of this disclosure, the sharpness features of the color sub-channel image are obtained based on the color sub-channel image and the sharpness calculation weights of each pixel of the color sub-channel image; including:
[0021] Divide the color sub-channel image into (2s+1)*(2s+1) image blocks, where s is greater than or equal to 1;
[0022] Using the image patch located at the center of the color sub-channel image as the origin, the coordinates of each image patch are obtained; and the Gaussian weight of each image patch is obtained based on the coordinates of each image patch.
[0023] The gradient value of a pixel is obtained by calculating the grayscale value of each pixel in each image block.
[0024] The first sharpness estimate of the image block is obtained by calculating the weight of each pixel in each image block and the sharpness corresponding to that pixel;
[0025] The second sharpness estimate is obtained based on the grayscale value of each pixel in each image block;
[0026] The first and second sharpness estimates are weighted and calculated to obtain the overall sharpness estimate of each image block.
[0027] The sharpness features of the color sub-channel image are obtained by combining the Gaussian weights of each image patch with the overall sharpness estimate.
[0028] According to at least one embodiment of the image sharpness evaluation method of this disclosure, obtaining the gradient value of a pixel based on the grayscale value of each pixel 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] Where L(x, y) is the gradient value of pixel (x, y); f(x, y) is the gray value of pixel (x, y); f(x, y+1), f(x, y-1), f(x-1, y), and f(x+1, y) are the gray values of the pixels above, below, to the left, and to the right of pixel (x, y), respectively.
[0031] According to at least one embodiment of the image sharpness evaluation method of this disclosure, a first sharpness estimate of an image block is obtained based on the gradient value of each pixel in each image block and the sharpness calculation weight corresponding to that pixel; including:
[0032]
[0033] in, t(x, y) represents the first sharpness estimate of the k-th image patch; m represents the number of pixels in the length direction of the k-th image patch, and n represents the number of pixels in the width direction of the k-th image patch; (x, y) represents the pixel in the k-th image patch; t(x, y) represents the sharpness calculation weight corresponding to the pixel (x, y); L(x, y) represents the gradient value corresponding to the pixel (x, y).
[0034] According to at least one embodiment of the image sharpness evaluation method of this disclosure, a weighted calculation is performed on a first sharpness estimate and a second sharpness estimate to obtain an overall sharpness estimate for each image block; including:
[0035]
[0036] Where k represents the sequence number of the image patch; This represents the first sharpness estimate of the k-th image patch; denoted as the second sharpness estimate of the k-th image patch; a is the weight corresponding to the first sharpness estimate of the k-th image patch; b is the weight corresponding to the second sharpness estimate of the k-th image patch.
[0037] According to another aspect of this disclosure, an image sharpness evaluation apparatus is provided, comprising:
[0038] An image acquisition module for acquiring images to be evaluated;
[0039] The color sub-channel image acquisition module is used to extract color components from the image to be evaluated and obtain multiple color sub-channel images; wherein each color sub-channel image is associated with a color.
[0040] The color brightness value sub-image acquisition module is used to extract the brightness component from the image to be evaluated in order to obtain a color brightness value sub-image related to color, wherein the color brightness value sub-image corresponds one-to-one with the color sub-channel image.
[0041] The judgment module obtains a judgment threshold based on 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 the average brightness of the color brightness value sub-image;
[0042] The sharpness calculation weight acquisition module obtains the sharpness calculation weight of each pixel in the color sub-channel image based on the mapping relationship between the pixels in the first pixel set and the second pixel set and the color sub-channel image.
[0043] A sharpness feature acquisition module obtains the sharpness features of the color sub-channel image based on the color sub-channel image and the sharpness weights of each pixel in the color sub-channel image.
[0044] The evaluation value acquisition module is used to perform weighted calculations on the sharpness features of each color sub-channel image and obtain the evaluation value of the sharpness of the image to be evaluated.
[0045] According to another aspect of this disclosure, an electronic device is provided, comprising:
[0046] Memory, the memory storing execution instructions; and
[0047] The processor executes the execution instructions stored in the memory, causing the processor to perform the image sharpness evaluation method described above. Attached Figure Description
[0048] The accompanying drawings illustrate exemplary embodiments of the present disclosure and, together with the description thereof, 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 This is a flowchart illustrating an image sharpness evaluation method according to one embodiment of the present disclosure.
[0050] Figure 2 This is a structural schematic diagram of an image to be evaluated according to one embodiment of the present disclosure.
[0051] Figure 3 This is a schematic diagram of the segmentation of a color subchannel image according to one embodiment of the present disclosure.
[0052] Figure 4 This is a schematic diagram of the Gaussian weights of image blocks in a color subchannel image according to one embodiment of the present disclosure.
[0053] Figure 5 This is a schematic block diagram of an image sharpness evaluation device implemented using a processor, according to one embodiment of the present disclosure. Detailed Implementation
[0054] The present disclosure will now be described in further detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the scope of the disclosure. Furthermore, it should be noted that, for ease of description, only the parts relevant to the present disclosure are shown in the accompanying drawings.
[0055] It should be noted that, where there is no conflict, the embodiments and features described in this disclosure can be combined with each other. The technical solutions of this disclosure will now be described in detail with reference to the accompanying drawings and embodiments.
[0056] Unless otherwise stated, the exemplary implementations / embodiments shown are to be understood as providing exemplary features of various details that provide ways in which the technical concepts of this disclosure can be implemented in practice. Therefore, unless otherwise stated, the features of various implementations / embodiments may be additionally combined, separated, interchanged and / or rearranged without departing from the technical concepts of this disclosure.
[0057] The use of crosshairs and / or shading in the accompanying drawings is generally used to clarify the boundaries between adjacent components. Thus, unless otherwise stated, the presence or absence of crosshairs or shading does not convey or indicate any preference or requirement for the specific material, material properties, dimensions, proportions, commonalities between the illustrated components, or any other characteristics, properties, etc., of the components. Furthermore, in the accompanying drawings, the dimensions and relative dimensions of components may be exaggerated for clarity and / or descriptive purposes. When exemplary embodiments can be implemented differently, a specific process sequence may be performed in a different order than that described. For example, two consecutively described processes may be performed substantially simultaneously or in the reverse order of their description. Furthermore, the same reference numerals denote the same components.
[0058] When a component is referred to as being "on" or "above" another component, "connected to," or "joined to" another component, the component may be directly on, directly connected to, or directly joined to the other component, or there may be intermediate components. However, when a component is referred to as being "directly on" another component, "directly connected to," or "directly joined to" another component, there are no intermediate components. Therefore, the term "connection" can refer to a physical connection, an electrical connection, etc., and may or may not have intermediate components.
[0059] The terminology used herein is for the purpose of describing particular embodiments and is not intended to be limiting. As used herein, unless the context clearly indicates otherwise, the singular forms “a” and “the” are intended to include the plural forms as well. Furthermore, when the terms “comprising” and / or “including” and variations thereof are used in this specification, it indicates the presence of the stated features, integrals, steps, operations, parts, components, and / or groups thereof, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, parts, components, and / or groups thereof. It should also be noted that, as used herein, the terms “substantially,” “about,” and other similar terms are used as approximate terms rather than as terms of degree, thus explaining the inherent biases in measurements, calculated values, and / or provided values that would be recognized by one of ordinary skill in the art.
[0060] The image sharpness evaluation method disclosed herein can be applied to the image sharpness evaluation apparatus disclosed herein, which can be configured on a terminal device. The terminal device can be a mobile terminal, such as a mobile phone, tablet computer, personal digital assistant, or other hardware device with various operating systems.
[0061] The following text combines Figures 1 to 5 The image sharpness evaluation method and image sharpness evaluation device disclosed herein are described in detail.
[0062] Figure 1 This is a flowchart illustrating an image sharpness evaluation method according to one embodiment of the present disclosure.
[0063] like Figure 1 As shown, the image sharpness evaluation method disclosed herein may include:
[0064] S110. Obtain the image to be evaluated;
[0065] S120. Extract color components from the image to be evaluated to obtain multiple color sub-channel images; wherein each color sub-channel image is associated with a color.
[0066] S130. Extract the luminance component from the image to be evaluated to obtain a color luminance value sub-image related to color, wherein the color luminance value sub-image corresponds one-to-one with the color sub-channel image.
[0067] S140. Obtain a judgment threshold based on the color brightness value sub-image, and divide the color brightness value sub-image into at least a first pixel set and a second pixel set based on the judgment threshold; wherein, the judgment threshold is related to the average brightness of the color brightness value sub-image;
[0068] S150. Based on the mapping relationship between the pixels in the first pixel set and the second pixel set and the color sub-channel image, obtain the sharpness calculation weight of each pixel in the color sub-channel image.
[0069] S160. Obtain the sharpness features of the color sub-channel image by calculating the weights based on the sharpness of each pixel in the color sub-channel image.
[0070] S170. Perform a weighted calculation on the sharpness features of each color sub-channel image and obtain the sharpness evaluation value of the image to be evaluated.
[0071] The image processing method of this disclosure will be explained in detail below with specific examples.
[0072] Figure 2 This is a structural schematic diagram 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 this disclosure can be a Bayer format image. Preferably, the image to be evaluated can be a microscopic image acquired by a microscope or a raw image acquired by a camera. The microscopic image or the raw image can be stored in Bayer format, and the image sharpness evaluation method of this disclosure can evaluate the sharpness of these images.
[0074] exist Figure 2 In the Bayer image shown, each pixel can be represented by a color array. This color array includes one data point (R) representing red, two data points (G1 and G2) representing green, and one data point (B) representing blue.
[0075] Therefore, in S120, color components can be obtained from the image to be evaluated according to the color arrangement order in the color array, and multiple color sub-channel images can be obtained through these color components.
[0076] Specifically, with Figure 2 For example, this 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) based on the image to be evaluated. The first color sub-channel image represents red; the second color sub-channel image represents green (i.e., green 1); the third color sub-channel image represents green (i.e., green 2); and the fourth color sub-channel image represents blue. In other words, the image sharpness evaluation method of this disclosure, based on the structure of a Bayer format image, splits the green component of the image to be evaluated into two color sub-channel images.
[0077] Therefore, the image sharpness evaluation method disclosed herein simplifies the subsequent processing by splitting the image to be evaluated according to color, and improves the accuracy of image sharpness evaluation.
[0078] In this disclosure, since each pixel corresponds to a color array, 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 this 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 their length and width are the same.
[0079] In other words, for a Bayer image with the color arrangement order RGGB, extract the pixels in odd-numbered rows and odd-numbered columns to form the R sub-channel image, extract the pixels in odd-numbered rows and even-numbered columns to form the G1 sub-channel image, extract the pixels in even-numbered rows and odd-numbered columns to form the G2 sub-channel image, and extract the pixels in even-numbered rows and even-numbered columns to form the B sub-channel image.
[0080] In some embodiments, a color brightness value sub-image can be obtained through step S130.
[0081] In this disclosure, due to the special structure of Bayer images, it is impossible to directly extract the luminance component from Bayer images using the RGB-YUV conversion formula; therefore, the following luminance component extraction method is adopted in this embodiment.
[0082] For the red and blue component positions of pixel location (x, y) in the Bayer image, the formula for calculating the extracted luminance component value is as follows:
[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] Where (x,y) is the pixel position, r(x,y) represents the color value of the red (first color) channel at pixel position (x,y); b(x,y) represents the color value of the blue (fourth color) channel at pixel position (x,y); g1(x,y) represents the color value of the green (second color) channel at pixel position (x,y); and g2(x,y) represents the color value of the green (third color) channel at pixel position (x,y).
[0086] Additionally, 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, fixed values can be used for padding.
[0087] Thus, the first color brightness value sub-image (R) and the fourth color brightness value sub-image (B) can be obtained.
[0088] The green component position at pixel location (x, y) in the Bayer image is determined by the following formula:
[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 luminance value sub-image and the color sub-channel image disclosed herein can be set in a one-to-one correspondence. Furthermore, the color luminance value sub-image and the color sub-channel image have the same size, that is, the color luminance value sub-image and the color sub-channel image have the same number of pixels, and their 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 sharpness evaluation method of this disclosure can process these four color brightness value sub-images separately.
[0093] Specifically, a judgment threshold corresponding to each color brightness value sub-image is obtained. 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 based on the four color brightness value sub-images. These four judgment thresholds can be: a judgment threshold related to the first color (R), a judgment threshold related to the second color (G1), a judgment threshold related to the third color (G2), and a judgment threshold related to the fourth color (B). In this disclosure, these four judgment thresholds can be the same or different.
[0095] Next, the color brightness value sub-image that generates 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 can also be called the foreground pixels, and the second pixel set can also be called the background pixels.
[0096] Specifically, when the pixel value of a pixel in the color brightness value sub-image is less than the judgment threshold, the pixel is judged as a foreground pixel; when the pixel value of a pixel in the color brightness value sub-image is greater than or equal to the judgment threshold, the pixel is judged as a background pixel.
[0097] In some embodiments, after obtaining the foreground and background pixels, the foreground and background pixels can be set to different weights.
[0098] Specifically, in the color brightness value sub-image, a first weight is set for the pixels corresponding to the foreground pixels; a second weight is set for the pixels corresponding to the background pixels; where both the first and second weights are weights for sharpness calculation.
[0099] Meanwhile, 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, the sharpness calculation weight for the pixel (x,y) of the color sub-channel image is as follows:
[0100]
[0101] In the formula, t(x,y) is the sharpness 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 pixel (x,y) in the color brightness value sub-image; and T is the judgment threshold. In a preferred embodiment, t1 is greater than t2, that is, by setting a larger weight for the foreground pixels, the influence of complex backgrounds on image sharpness evaluation can be reduced.
[0102] In this disclosure, t1 and t2 can be preset values, and neither t1 nor t2 is 0.
[0103] At this point, the sharpness calculation weights of each pixel in each color sub-channel image can be obtained.
[0104] In some embodiments, each color sub-channel image can be used as an input image to obtain the sharpness features of each color channel.
[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 can be 2, thus the color sub-channel image can be divided into 25 image blocks, in which case the number of image blocks is the same along the length and width directions of the color sub-channel image.
[0106] The size of the image patch can be m*n, meaning the image patch has m pixels in the length direction and n pixels in the width direction, where m and n are natural numbers, which can be the same or different.
[0107] Using the image patch located at the center of the color sub-channel image as the origin, the coordinates of each image patch are obtained; and the Gaussian weight of each image patch is obtained based on the coordinates of each image patch.
[0108] Specifically, the Gaussian weight w k It can be calculated using the following formula:
[0109]
[0110] In the formula, i and j are the coordinates of the image patch; σ is the standard deviation; and k is the index of the image patch, with a value greater than or equal to 1 and less than or equal to the total number of image patches. In a specific embodiment, such as... Figure 3 As shown, the total number of image blocks is 25, and k can be an integer from 1 to 25 (inclusive).
[0111] Furthermore, the image sharpness evaluation method disclosed herein also obtains a first sharpness estimate of an image block through the following steps: obtaining the gradient value of a pixel based on the grayscale value of each pixel in each image block; and calculating the weight of the image block based on the gradient value of each pixel in each image block and the sharpness corresponding to that pixel.
[0112] Specifically, the gradient value L(x, y) of each pixel in the image patch is calculated using 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); where L(x,y) is the gradient value of pixel (x,y); f(x,y) is the gray value of pixel (x,y); and f(x,y+1), f(x,y-1), f(x-1,y), and f(x+1,y) are the gray values of the pixels above, below, to the left, and to the right of pixel (x,y), respectively.
[0114] In one specific embodiment, when f(x, y+1), f(x, y-1), f(x+1, y), and f(x-1, y) are pixels outside the image block, they are filled with preset values.
[0115] Then, the first sharpness estimate of the k-th image patch is calculated according to the following formula.
[0116] In step S160, a second sharpness estimate can also be obtained based on the grayscale values of each pixel in each image block; that is, a second sharpness estimate can be obtained for each image block k.
[0117] Specifically, the second sharpness estimate can be obtained using the following formula:
[0118]
[0119] Similarly, when f(x+2, y) is a pixel outside the image patch, a preset value can be used for filling.
[0120] The first and second sharpness estimates are weighted to obtain the overall sharpness estimate for each image patch.
[0121] Specifically, the overall sharpness estimate S of the k-th image patch k It can be calculated using the following formula:
[0122]
[0123] Where 'a' is the first sharpness estimate. The weights, b is the second sharpness estimate S k 2 The weights are determined by the following: where a and b can be set to preset values such that a and b are greater than or equal to 0.
[0124] Finally, the sharpness features of the color sub-channel image are obtained based on the Gaussian weights of each image block and the overall sharpness estimate.
[0125] Specifically, the sharpness feature S of the color sub-channel image coarse It can be calculated using the following formula:
[0126]
[0127] S170. Perform a weighted calculation on the sharpness features of each color sub-channel image and obtain the sharpness evaluation value of the image to be evaluated.
[0128] In some embodiments, in S170, the evaluation value S of the sharpness of the image to be evaluated can 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 The sharpness feature corresponding to the first color sub-channel image; w r S represents the weight of the sharpness evaluation value corresponding to the first color sub-channel image; g1 The sharpness feature corresponding to the second color sub-channel image; w g1 S represents the weight of the sharpness evaluation value corresponding to the second color sub-channel image; g2 The sharpness feature corresponding to the third color sub-channel image; w g2 S represents the weight of the sharpness evaluation value corresponding to the third color sub-channel image; b The sharpness feature corresponding to the fourth color sub-channel image; w b The weight of the sharpness 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 sharpness evaluation method disclosed herein combines multiple image sharpness evaluation functions, thereby avoiding the shortcomings of each function and leveraging their respective advantages. Simultaneously, by extracting the foreground pixels of the image to be evaluated and assigning them higher weights, the influence of complex backgrounds on image sharpness evaluation is reduced. Furthermore, by dividing the image into blocks and assigning higher weights to the central blocks, the image sharpness evaluation method disclosed herein can improve the accuracy of sharpness calculation.
[0133] The image sharpness evaluation method disclosed herein can obtain the sharpness evaluation value of real-time Bayer images when used, and has good real-time performance. It is suitable for fast autofocus of microscope cameras, conforms to the unimodal characteristics, has high sensitivity and real-time performance.
[0134] Figure 5 This is a schematic block diagram of an image sharpness evaluation device implemented using a processor, according to one embodiment of the present disclosure.
[0135] The image sharpness evaluation apparatus may include corresponding modules that perform one or more steps in the flowchart described above. Therefore, each or more steps in the flowchart may be performed by a corresponding module, and the apparatus may include one or more of these modules. A module may be one or more hardware modules specifically configured to perform a corresponding step, or implemented by a processor configured to perform a corresponding step, or stored in a computer-readable medium for implementation by a processor, or implemented through some combination thereof.
[0136] The hardware structure of the image sharpness evaluation apparatus of this disclosure can be implemented using a bus architecture. The bus architecture can include any number of interconnect buses and bridges, depending on the specific application and overall design constraints of the hardware. Bus 1100 connects various circuits including one or more processors 1200, memory 1300, and / or hardware modules. Bus 1100 can also connect various other circuits 1400 such as peripheral devices, voltage regulators, power management circuits, external antennas, etc.
[0137] Bus 1100 can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Component (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of representation, only one connection line is used in this diagram, but this does not imply that there is only one bus or only one type of bus.
[0138] Any process or method description in the flowcharts or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more executable instructions for implementing a particular logical function or process, and the scope of the preferred embodiments of this disclosure includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as will be understood by those skilled in the art to which embodiments of this disclosure pertain. The processor performs the various methods and processes described above. For example, the method embodiments of this disclosure may be implemented as software programs tangibly contained in a machine-readable medium, such as memory. In some embodiments, part or all of the software program may be loaded and / or installed via memory and / or a communication interface. When the software program is loaded into memory and executed by the processor, one or more steps of the methods described above may be performed. Alternatively, in other embodiments, the processor may be configured to perform one of the methods described above by any other suitable means (e.g., by means of firmware).
[0139] The logic and / or steps represented in the flowchart or otherwise described herein may be specifically implemented in any readable storage medium for use by, or in conjunction with, an instruction execution system, apparatus or device (such as a computer-based system, a processor-included system or other system that can fetch and execute instructions from, an instruction execution system, apparatus or device).
[0140] For the purposes of this specification, a "readable storage medium" can be any means capable of containing, storing, communicating, propagating, or transmitting a program for use by or in conjunction with an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of readable storage media include: an electrical connection having one or more wires (electronic device), a portable computer disk drive (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and programmable read-only memory (EPROM or flash memory), fiber optic devices, and portable read-only memory (CDROM). Furthermore, a readable storage medium can even be paper or other suitable media on which a program can be printed, since a program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in memory.
[0141] It should be understood that various parts of this disclosure can be implemented in hardware, software, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
[0142] Those skilled in the art will understand that all or part of the steps of the methods described above can be implemented by a program instructing related hardware. The program can be stored in a readable storage medium, and when executed, the program includes one or a combination of the steps of the method implementation.
[0143] Furthermore, the functional units in the various embodiments of this disclosure can be integrated into a single processing module, or each unit can exist physically separately, or two or more units can be integrated into a single module. The integrated module can be implemented in hardware or as a software functional module. If the integrated module is implemented as a software functional module and sold or used as an independent product, it can also be stored in a readable storage medium. The storage medium can 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 sharpness 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 sharpness calculation weight acquisition module 1010, a sharpness feature acquisition module 1012, and an evaluation value acquisition module 1014.
[0145] The image acquisition module 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 color brightness value sub-images related to the color, wherein each color brightness value sub-image corresponds one-to-one with the color sub-channel image; the judgment module 1008 obtains a judgment threshold based on the color brightness value sub-images, and divides the color brightness value sub-images into at least a first pixel set and a second image based on the judgment threshold. The set of pixels; wherein the judgment threshold is related to the average brightness of the color brightness value sub-image; the sharpness calculation weight acquisition module 1010 obtains the sharpness calculation weight of each pixel in the color sub-channel image according to the mapping relationship between the pixels in the first pixel set and the second pixel set and the color sub-channel image; the sharpness feature acquisition module 1012 obtains the sharpness feature of the color sub-channel image according to the color sub-channel image and the sharpness calculation weight of each pixel in the color sub-channel image; the evaluation value acquisition module 1014 is used to perform weighted calculation on the sharpness features of each color sub-channel image and obtain the sharpness evaluation value of the image to be evaluated.
[0146] The image to be evaluated in this disclosure can be a Bayer format image. Preferably, the image to be evaluated can be a microscopic image acquired by a microscope or a raw image acquired by a camera. The microscopic image or the raw image can be stored in Bayer format, and the image sharpness evaluation method of this disclosure can evaluate the sharpness of these images.
[0147] exist Figure 2In the Bayer image shown, each pixel can be represented by a color array. This color array includes one data point (R) representing red, two data points (G1 and G2) representing green, and one data point (B) representing blue.
[0148] Therefore, color components can be obtained from the image to be evaluated according to the color arrangement order in the color array, and multiple color sub-channel images can be obtained through these color components.
[0149] Specifically, with Figure 2 For example, this 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) based on the image to be evaluated. The first color sub-channel image represents red; the second color sub-channel image represents green (i.e., green 1); the third color sub-channel image represents green (i.e., green 2); and the fourth color sub-channel image represents blue. In other words, the image sharpness evaluation method of this disclosure, based on the structure of a Bayer format image, splits the green component of the image to be evaluated into two color sub-channel images.
[0150] Therefore, the image sharpness evaluation method disclosed herein simplifies the subsequent processing by splitting the image to be evaluated according to color, and improves the accuracy of image sharpness evaluation.
[0151] In this disclosure, since each pixel corresponds to a color array, 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 this 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 their length and width are the same.
[0152] In other words, for a Bayer image with the color arrangement order RGGB, extract the pixels in odd-numbered rows and odd-numbered columns to form the R sub-channel image, extract the pixels in odd-numbered rows and even-numbered columns to form the G1 sub-channel image, extract the pixels in even-numbered rows and odd-numbered columns to form the G2 sub-channel image, and extract the pixels in even-numbered rows and even-numbered columns to form the B sub-channel image.
[0153] In this disclosure, due to the special structure of Bayer images, it is impossible to directly extract the luminance component from Bayer images using the RGB-YUV conversion formula; therefore, the following luminance component extraction method is adopted in this embodiment.
[0154] For the red and blue component positions of pixel location (x, y) in the Bayer image, the formula for calculating the extracted luminance component value is as follows:
[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] Where (x,y) is the pixel position, r(x,y) represents the color value of the red (first color) channel at pixel position (x,y); b(x,y) represents the color value of the blue (fourth color) channel at pixel position (x,y); g1(x,y) represents the color value of the green (second color) channel at pixel position (x,y); and g2(x,y) represents the color value of the green (third color) channel at pixel position (x,y).
[0158] Additionally, 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, fixed values can be used for padding.
[0159] Thus, the first color brightness value sub-image (R) and the fourth color brightness value sub-image (B) can be obtained.
[0160] The green component position at pixel location (x, y) in the Bayer image is determined by the following formula:
[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 luminance value sub-image and the color sub-channel image disclosed herein can be set in a one-to-one correspondence. Furthermore, the color luminance value sub-image and the color sub-channel image have the same size, that is, the color luminance value sub-image and the color sub-channel image have the same number of pixels, and their length and width are also the same.
[0164] In some embodiments, each color brightness value sub-image is processed separately. That is, the image sharpness evaluation method of this disclosure can process these four color brightness value sub-images separately.
[0165] Specifically, a judgment threshold corresponding to each color brightness value sub-image is obtained. 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 based on the four color brightness value sub-images. These four judgment thresholds can be: a judgment threshold related to the first color (R), a judgment threshold related to the second color (G1), a judgment threshold related to the third color (G2), and a judgment threshold related to the fourth color (B). In this disclosure, these four judgment thresholds can be the same or different.
[0167] Next, the color brightness value sub-image that generates 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 can also be called the foreground pixels, and the second pixel set can also be called the background pixels.
[0168] Specifically, when the pixel value of a pixel in the color brightness value sub-image is less than the judgment threshold, the pixel is judged as a foreground pixel; when the pixel value of a pixel in the color brightness value sub-image is greater than or equal to the judgment threshold, the pixel is judged as a background pixel.
[0169] In some embodiments, after obtaining the foreground and background pixels, the foreground and background pixels can be set to different weights.
[0170] Specifically, in the color brightness value sub-image, a first weight is set for the pixels corresponding to the foreground pixels; a second weight is set for the pixels corresponding to the background pixels; where both the first and second weights are weights for sharpness calculation.
[0171] Meanwhile, 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, the sharpness calculation weight for the pixel (x,y) of the color sub-channel image is as follows:
[0172]
[0173] In the formula, t(x,y) is the sharpness 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 pixel (x,y) in the color brightness value sub-image; and T is the judgment threshold. In a preferred embodiment, t1 is greater than t2, that is, by setting a larger weight for the foreground pixels, the influence of complex backgrounds on image sharpness evaluation can be reduced.
[0174] In this disclosure, t1 and t2 can be preset values, and neither t1 nor t2 is 0.
[0175] At this point, the sharpness calculation weights of each pixel in each color sub-channel image can be obtained.
[0176] In some embodiments, each color sub-channel image can be used as an input image to obtain the sharpness features of each color channel.
[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 can be 2, thus the color sub-channel image can be divided into 25 image blocks, in which case the number of image blocks is the same along the length and width directions of the color sub-channel image.
[0178] The size of the image patch can be m*n, meaning the image patch has m pixels in the length direction and n pixels in the width direction, where m and n are natural numbers, which can be the same or different.
[0179] Using the image patch located at the center of the color sub-channel image as the origin, the coordinates of each image patch are obtained; and the Gaussian weight of each image patch is obtained based on the coordinates of each image patch.
[0180] Specifically, the Gaussian weight w k It can be calculated using the following formula:
[0181]
[0182] In the formula, i and j are the coordinates of the image patch; σ is the standard deviation; and k is the index of the image patch, with a value greater than or equal to 1 and less than or equal to the total number of image patches. In a specific embodiment, such as... Figure 3 As shown, the total number of image blocks is 25, and k can be an integer from 1 to 25 (inclusive).
[0183] Furthermore, the image sharpness evaluation method disclosed herein also obtains a first sharpness estimate of an image block through the following steps: obtaining the gradient value of a pixel based on the grayscale value of each pixel in each image block; and calculating the weight of the image block based on the gradient value of each pixel in each image block and the sharpness corresponding to that pixel.
[0184] Specifically, the gradient value L(x,y) of each pixel in the image patch is calculated using 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 pixel (x,y); f(x,y) is the gray value of pixel (x,y); and f(x,y+1), f(x,y-1), f(x-1,y), and f(x+1,y) are the gray values of the pixels above, below, to the left, and to the right of pixel (x,y), respectively.
[0186] In one specific embodiment, when f(x,y+1), f(x,y-1), f(x+1,y), and f(x-1,y) are pixels outside the image block, they are filled with preset values.
[0187] Then, the first sharpness estimate of the k-th image patch is calculated according to the following formula.
[0188] In this disclosure, a second sharpness estimate can also be obtained based on the grayscale values of each pixel in each image block; that is, a second sharpness estimate can be obtained for each image block k.
[0189] Specifically, the second sharpness estimate can be obtained using the following formula:
[0190]
[0191] Similarly, when f(x+2,y) is a pixel outside the image patch, a preset value can be used for filling.
[0192] The first and second sharpness estimates are weighted to obtain the overall sharpness estimate for each image patch.
[0193] Specifically, the overall sharpness estimate S of the k-th image patch k It can be calculated using the following formula:
[0194]
[0195] Where 'a' is the first sharpness estimate. The weight of b is the second sharpness estimate. The weights are determined by the following: where a and b can be set to preset values such that a and b are greater than or equal to 0.
[0196] Finally, the sharpness features of the color sub-channel image are obtained based on the Gaussian weights of each image block and the overall sharpness estimate.
[0197] Specifically, the sharpness feature S of the color sub-channel image coarse It can be calculated using the following formula:
[0198]
[0199] In some embodiments, the image sharpness evaluation value S can be calculated using 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 The sharpness feature corresponding to the first color sub-channel image; w r S represents the weight of the sharpness evaluation value corresponding to the first color sub-channel image; g1 The sharpness feature corresponding to the second color sub-channel image; w g1 S represents the weight of the sharpness evaluation value corresponding to the second color sub-channel image; g2 The sharpness feature corresponding to the third color sub-channel image; w g2 S represents the weight of the sharpness evaluation value corresponding to the third color sub-channel image; b The sharpness feature corresponding to the fourth color sub-channel image; w b The weight of the sharpness 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 sharpness evaluation method disclosed herein combines multiple image sharpness evaluation functions, thereby avoiding the shortcomings of each function and leveraging their respective advantages. Simultaneously, by extracting the foreground pixels of the image to be evaluated and assigning them higher weights, the influence of complex backgrounds on image sharpness evaluation is reduced. Furthermore, by dividing the image into blocks and assigning higher weights to the central blocks, the image sharpness evaluation method disclosed herein can improve the accuracy of sharpness calculation.
[0204] The image sharpness evaluation method disclosed herein can obtain the sharpness evaluation value of real-time Bayer images when used, and has good real-time performance. It is suitable for fast autofocus of microscope cameras, conforms to the unimodal characteristics, has high sensitivity and real-time performance.
[0205] This disclosure also provides an electronic device, including: a memory storing execution instructions; and a processor or other hardware module executing the execution instructions stored in the memory, causing the processor or other hardware module to perform the above-described method.
[0206] This disclosure also provides a readable storage medium storing executable instructions that, when executed by a processor, are used to implement the above-described method.
[0207] Those skilled in the art should understand that the above embodiments are merely for illustrating the present disclosure and are not intended to limit the scope of the disclosure. Those skilled in the art can make other changes or modifications based on the above disclosure, and these changes or modifications still fall within the scope of the present disclosure.
Claims
1. A method for evaluating image sharpness, characterized in that, include: Obtain the image to be evaluated; Color components are extracted from the image to be evaluated to obtain multiple color sub-channel images; each color sub-channel image is associated with a color. Extract the luminance component from the image to be evaluated to obtain a color luminance value sub-image related to color, wherein the color luminance value sub-image corresponds one-to-one with the color sub-channel image; A judgment threshold is obtained based on the color brightness value sub-image, and the color brightness value sub-image is divided 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; Based on the mapping relationship between the pixels in the first pixel set and the second pixel set and the color sub-channel image, the sharpness calculation weight of each pixel in the color sub-channel image is obtained. The sharpness feature of the color sub-channel image is obtained by calculating the weights based on the sharpness of each pixel in the color sub-channel image; wherein, the first set of pixels is the foreground pixels and the second set of pixels is the background pixels. The sharpness features of each color sub-channel image are weighted and calculated to obtain the sharpness evaluation value of the image to be evaluated. The process involves obtaining the sharpness features of a color sub-channel image based on the sharpness weights of its pixels and the image itself. This includes: dividing the color sub-channel image into (2s+1)*(2s+1) image blocks, where s is greater than or equal to 1; obtaining the coordinates of each image block using the image block at the center of the color sub-channel image as the origin; obtaining the Gaussian weight of each image block based on its coordinates; obtaining the gradient value of each pixel in each image block based on its grayscale value; calculating the weights of each pixel in each image block based on its gradient value and the corresponding sharpness to obtain a first sharpness estimate; obtaining a second sharpness estimate based on the grayscale value of each pixel in each image block; weighting the first and second sharpness estimates to obtain an overall sharpness estimate for each image block; and obtaining the sharpness features of the color sub-channel image based on the Gaussian weight of each image block and the overall sharpness estimate. The gradient value of a pixel is obtained by considering the grayscale value of each pixel in each image block, including: in, For pixels The gradient value; For pixels grayscale value; , , , Each pixel The grayscale values of the pixels above, below, to the left, and to the right; Specifically, the first sharpness estimate of an image block is obtained by calculating weights based on the gradient values of each pixel in each image block and the sharpness corresponding to that pixel; including: ; in, This represents the first sharpness estimate of the k-th image patch; m represents the number of pixels in the length direction of the k-th image patch, and n represents the number of pixels in the width direction of the k-th image patch; This represents the pixel in the k-th image block; Represents pixels The corresponding resolution calculation weights; Represents pixels The corresponding gradient value.
2. The image sharpness 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: Extract each color component from the image to be evaluated in color order to obtain the first color sub-channel image, the second color sub-channel image, the third color sub-channel image, and the fourth color sub-channel image; wherein, the image to be evaluated is a Bayer format image.
3. The image sharpness evaluation method according to claim 2, characterized in that, Extract the luminance component from the image to be evaluated to obtain a color-related luminance value sub-image; including: Extract the luminance component of the image to be evaluated, and obtain the first color luminance value sub-image, the second color luminance value sub-image, the third color luminance value sub-image, and the fourth color luminance value sub-image in color order.
4. The image sharpness 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 sharpness evaluation method according to claim 1, characterized in that, The first and second sharpness estimates are weighted and calculated to obtain the overall sharpness estimate of each image block. include: ; Where k represents the sequence number of the image patch; This represents the first sharpness estimate of the k-th image patch; This represents the second sharpness estimate of the k-th image patch; is the weight corresponding to the first sharpness estimate of the k-th image patch; b is the weight corresponding to the second sharpness estimate of the k-th image patch.
6. An image sharpness evaluation device, characterized in that, include: An image acquisition module for acquiring images to be evaluated; The color sub-channel image acquisition module is used to extract color components from the image to be evaluated and obtain multiple color sub-channel images; wherein each color sub-channel image is associated with a color. The color brightness value sub-image acquisition module is used to extract the brightness component from the image to be evaluated in order to obtain a color brightness value sub-image related to color, wherein the color brightness value sub-image corresponds one-to-one with the color sub-channel image. The judgment module obtains a judgment threshold based on 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 the average brightness of the color brightness value sub-image; The sharpness calculation weight acquisition module obtains the sharpness calculation weight of each pixel in the color sub-channel image based on the mapping relationship between the pixels in the first pixel set and the second pixel set and the color sub-channel image; wherein, the first pixel set is the foreground pixels and the second pixel set is the background pixels; A sharpness feature acquisition module obtains the sharpness features of the color sub-channel image based on the color sub-channel image and the sharpness weights of each pixel in the color sub-channel image. The evaluation value acquisition module is used to perform weighted calculations on the sharpness features of each color sub-channel image and obtain the evaluation value of the sharpness of the image to be evaluated. The process involves obtaining the sharpness features of a color sub-channel image based on the sharpness weights of its pixels and the image itself. This includes: dividing the color sub-channel image into (2s+1)*(2s+1) image blocks, where s is greater than or equal to 1; obtaining the coordinates of each image block using the image block at the center of the color sub-channel image as the origin; obtaining the Gaussian weight of each image block based on its coordinates; obtaining the gradient value of each pixel in each image block based on its grayscale value; calculating the weights of each pixel in each image block based on its gradient value and the corresponding sharpness to obtain a first sharpness estimate; obtaining a second sharpness estimate based on the grayscale value of each pixel in each image block; weighting the first and second sharpness estimates to obtain an overall sharpness estimate for each image block; and obtaining the sharpness features of the color sub-channel image based on the Gaussian weight of each image block and the overall sharpness estimate. The gradient value of a pixel is obtained by considering the grayscale value of each pixel in each image block, including: in, For pixels The gradient value; For pixels grayscale value; , , , Each pixel The grayscale values of the pixels above, below, to the left, and to the right; Specifically, the first sharpness estimate of an image block is obtained by calculating weights based on the gradient values of each pixel in each image block and the sharpness corresponding to that pixel; including: ; in, This represents the first sharpness estimate of the k-th image patch; m represents the number of pixels in the length direction of the k-th image patch, and n represents the number of pixels in the width direction of the k-th image patch; This represents the pixel in the k-th image block; Represents pixels The corresponding resolution calculation weights; Represents pixels The corresponding gradient value.
7. An electronic device, characterized in that, include: The memory stores execution instructions; as well as A processor that executes the execution instructions stored in the memory, causing the processor to perform the image sharpness evaluation method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Method and device for evaluating white blood cell image definition
CN108682008A
Method and apparatus for evaluating the sharpness of microscopic images
CN111062916B
Bayer-pattern CFA image demosaicking method based on non-local mean
CN102663719A
Image enhancement method
CN111612700A