High-magnification light source uniformity detection method and system

By pre-processing, segmentation processing and uniformity coefficient calculation of the projected spot image of high-magnification light source equipment, the problems of low detection efficiency and inaccurate uniformity coefficient in the prior art are solved, and more accurate and efficient light source uniformity detection is achieved.

CN119714800AActive Publication Date: 2025-03-28GOLD MEDAL LAB
View PDF 10 Cites 0 Cited by

Patent Information

Application Number
CN202411777284.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-05
Publication Date
2025-03-28
Estimated Expiration
2044-12-05

AI Technical Summary

Technical Problem

The existing high-magnification light source uniformity detection methods are inefficient and costly, and the uniformity coefficient obtained by spot image analysis cannot accurately reflect the actual uniformity of the light source.

Method used

By obtaining the light spot image of the high-magnification light source device, pre-processing and segmentation processing, calculating the light intensity and light area, obtaining the grayscale distribution curve, and calculating the light source uniformity coefficient with the calibration parameters to determine whether the light source meets the preset standards.

Benefits of technology

The accuracy and efficiency of light source uniformity detection is improved, the one-sidedness and limitations of a single uniformity coefficient are avoided, and the uniformity of high-magnification light sources can be more accurately reflected.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119714800A_ABST
    Figure CN119714800A_ABST
Patent Text Reader

Abstract

The invention discloses a high-magnification light source uniformity detection method and system, and relates to the technical field of image processing, and the method comprises the steps: obtaining a light spot image which is projected to a target plane by high-magnification light source equipment according to a set target light source, and carrying out the preprocessing of the light spot image; carrying out segmentation processing on the preprocessed light spot image; determining the illumination intensity and the illumination area of the light spot image to calculate a first light source uniformity coefficient; acquiring a corresponding gray level distribution curve based on the light spot image to determine a light spot gray level parameter; calculating a second light source uniformity coefficient based on the light spot gray scale parameter in combination with the calibration parameter, and calculating a target light source uniformity coefficient based on the first light source uniformity coefficient and the second light source uniformity coefficient; and determining whether the light source uniformity of the high-magnification light source equipment reaches a preset standard based on the target light source uniformity coefficient. According to the invention, whether the currently projected high-magnification light source reaches the required uniformity standard or not can be better judged.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing, and in particular to a high-magnification light source uniformity detection method and system. Background Art

[0002] High-magnification light source equipment refers to light source equipment that can provide sufficient brightness and stability. It is usually used in high-magnification microscopes. In order to ensure that the image of the object observed in the microscope is clear enough, it is necessary to perform uniformity detection on the projected light source of the high-magnification light source equipment. In the current high-magnification light source uniformity detection, relevant personnel are usually arranged to use a brightness meter to perform point-by-point measurements in the light source irradiation area, but this method has low efficiency in detecting light source uniformity, and the labor cost is too high. In response to this, various companies have gradually adopted the method of analyzing the spot image projected by the high-magnification light source to perform light source uniformity detection. At present, the uniformity coefficient of the light source is usually determined based on the spot brightness data analyzed from the spot image, so as to detect whether the light source provided by the high-magnification light source equipment meets the required uniformity standard. However, the uniformity coefficient of the light source obtained by this method has great limitations and cannot accurately and comprehensively reflect the actual uniformity of the high-magnification light source, resulting in the inability to accurately judge whether the currently projected high-magnification light source meets the required uniformity standard. Summary of the invention

[0003] The purpose of the present invention is to overcome the deficiencies of the prior art. The present invention provides a high-magnification light source uniformity detection method and system, which can better determine whether the currently projected high-magnification light source meets the required uniformity standard.

[0004] In order to solve the above technical problems, the present invention provides a method for detecting uniformity of a high-magnification light source, the method comprising:

[0005] Acquire a spot image projected by a high-magnification light source device onto a target plane according to a set target light source, and preprocess the spot image to obtain a preprocessed spot image;

[0006] Performing segmentation processing on the preprocessed spot image to obtain a segmented spot image;

[0007] Determine the illumination intensity and illumination area of ​​the spot image after segmentation processing, and calculate the first light source uniformity coefficient of the target light source of the high-magnification light source device based on the illumination intensity and illumination area;

[0008] Acquire a corresponding grayscale distribution curve based on the spot image after segmentation processing, and determine the spot grayscale parameter based on the grayscale distribution curve;

[0009] Calculating a second light source uniformity coefficient based on the light spot grayscale parameter combined with a calibration parameter, and calculating a target light source uniformity coefficient based on the first light source uniformity coefficient and the second light source uniformity coefficient;

[0010] Based on the target light source uniformity coefficient, it is determined whether the light source uniformity of the high-magnification light source device reaches a preset standard.

[0011] Optionally, preprocessing the spot image to obtain a preprocessed spot image includes:

[0012] Performing grayscale processing on the light spot image to obtain a grayscale light spot image;

[0013] Performing denoising on the grayscale light spot image to obtain a denoised grayscale light spot image;

[0014] The grayscale spot image after denoising is subjected to image enhancement processing to obtain a preprocessed spot image.

[0015] Optionally, the performing segmentation processing on the pre-processed spot image to obtain the segmented spot image includes:

[0016] Setting an image pixel neighborhood for the preprocessed spot image, and calculating the grayscale mean and image entropy value of the image pixel neighborhood;

[0017] Extracting color feature components from the preprocessed spot image to obtain target color feature components;

[0018] Setting a segmentation threshold based on the target color feature component, grayscale mean and image entropy value;

[0019] The preprocessed spot image is segmented using an adaptive threshold segmentation algorithm based on the segmentation threshold to obtain a segmented spot image.

[0020] Optionally, determining the illumination intensity and illumination area of ​​the spot image after segmentation processing includes:

[0021] Performing bit stratification on the light spot image after the segmentation process to obtain a light spot image after bit stratification;

[0022] Calculate the statistical value of the target pixel in the spot image after bit layering, and calculate the light intensity based on the statistical value of the target pixel;

[0023] The light spot image after the segmentation process is subjected to pixel-level classification to obtain the illumination area.

[0024] Optionally, the calculating a first light source uniformity coefficient of a target light source of the high-magnification light source device based on the light intensity and the light area includes:

[0025] Inputting the illumination intensity and illumination area into a feedforward neural network to perform brightness distribution analysis to obtain a brightness distribution analysis result;

[0026] A first light source uniformity coefficient of the target light source of the high-magnification light source device is calculated based on the brightness distribution analysis result.

[0027] Optionally, acquiring a corresponding grayscale distribution curve based on the spot image after segmentation processing, and determining the spot grayscale parameter based on the grayscale distribution curve includes:

[0028] Setting a plurality of rectangular frames, and determining the grayscale value of the edge image of the spot image after segmentation processing based on the plurality of rectangular frames;

[0029] Generating a corresponding grayscale distribution curve based on the grayscale value, and generating a light spot grayscale histogram based on the grayscale distribution curve;

[0030] The slope parameter of the light spot grayscale histogram is calculated, and the light spot grayscale parameter is determined based on the slope parameter.

[0031] Optionally, the calculating the uniformity coefficient of the second light source based on the light spot grayscale parameter combined with a calibration parameter includes:

[0032] Calculating the centroid of the light spot based on the light intensity and the light area, and calculating the brightness of the light spot area based on the centroid of the light spot;

[0033] Generate a calibration matrix using a preset grayscale matrix based on the calibration parameters;

[0034] The second light source uniformity coefficient is calculated based on the light spot area brightness and the light spot grayscale parameters combined with the calibration matrix.

[0035] Optionally, calculating a target light source uniformity coefficient based on the first light source uniformity coefficient and the second light source uniformity coefficient includes:

[0036] Obtaining weight coefficients corresponding to the uniformity coefficient of the first light source and the uniformity coefficient of the second light source;

[0037] A target light source uniformity coefficient is calculated based on the first light source uniformity coefficient and the second light source uniformity coefficient in combination with a corresponding weight coefficient.

[0038] Optionally, the determining whether the light source uniformity of the high-magnification light source device meets a preset standard based on the target light source uniformity coefficient includes:

[0039] Calculating a target difference between the target light source uniformity coefficient and the standard light source uniformity coefficient;

[0040] Determine whether the target difference is within a preset allowable range, and if the target difference is within the preset allowable range, determine that the light source uniformity of the high-magnification light source device reaches a preset standard;

[0041] If the target difference is not within the preset allowable range, it is determined that the light source uniformity of the high-magnification light source device does not meet the preset standard.

[0042] In addition, the present invention also provides a high-magnification light source uniformity detection system, the system comprising:

[0043] The light spot image preprocessing module is used to obtain the light spot image projected by the high-magnification light source device to the target plane according to the set target light source, and preprocess the light spot image to obtain the preprocessed light spot image;

[0044] Image segmentation module: used to segment the pre-processed spot image to obtain the segmented spot image;

[0045] A first light source uniformity coefficient calculation module: used to determine the illumination intensity and illumination area of ​​the spot image after segmentation processing, and calculate the first light source uniformity coefficient of the target light source of the high-magnification light source device based on the illumination intensity and illumination area;

[0046] Light spot grayscale parameter module: used to obtain the corresponding grayscale distribution curve based on the light spot image after segmentation processing, and determine the light spot grayscale parameter based on the grayscale distribution curve;

[0047] A target light source uniformity coefficient calculation module: used to calculate the second light source uniformity coefficient based on the light spot grayscale parameter combined with the calibration parameter, and calculate the target light source uniformity coefficient based on the first light source uniformity coefficient and the second light source uniformity coefficient;

[0048] Light source uniformity judgment module: used to determine whether the light source uniformity of the high-magnification light source device meets the preset standard based on the target light source uniformity coefficient.

[0049] In an embodiment of the present invention, a segmentation threshold is set according to the target color feature component, grayscale mean and image entropy value obtained from the preprocessed spot image to perform segmentation processing on the spot image, which can improve the accuracy of image segmentation and the efficiency of subsequent image analysis. The first light source uniformity coefficient of the target light source of the high-magnification light source device is calculated based on the light intensity and the illumination area, and the intensity uniformity of the light source range can be clarified. The corresponding grayscale distribution curve is obtained according to the spot image after segmentation processing to determine the spot grayscale parameter, and the second light source uniformity coefficient is calculated according to the spot grayscale parameter combined with the calibration parameter. The target light source uniformity coefficient is calculated based on the first light source uniformity coefficient and the second light source uniformity coefficient, so that the obtained target light source uniformity coefficient is more in line with the actual situation, avoiding the one-sidedness and limitations brought by the uniformity detection of a single light source uniformity coefficient, and can more accurately reflect the uniformity of the high-magnification light source, and better judge whether the currently projected high-magnification light source meets the required uniformity standard. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0051] Figure 1 is a schematic flow chart of a high-magnification light source uniformity detection method in an embodiment of the present invention;

[0052] Figure 2 is a flow chart of a high-magnification light source uniformity detection method in another embodiment of the present invention;

[0053] Figure 3 It is a schematic diagram of the structure of the high-magnification light source uniformity detection system in an embodiment of the present invention. DETAILED DESCRIPTION

[0054] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0055] Embodiment 1

[0056] See also Figure 1 , Figure 1: is a flow chart of a method for detecting uniformity of a high-magnification light source in an embodiment of the present invention, the method comprising:

[0057] S11: acquiring a spot image projected by a high-magnification light source device onto a target plane according to a set target light source, and preprocessing the spot image to obtain a preprocessed spot image;

[0058] In the specific implementation process of the present invention, the preprocessing of the spot image to obtain the preprocessed spot image includes: grayscale processing of the spot image to obtain a grayscale spot image; denoising of the grayscale spot image to obtain a denoised grayscale spot image; image enhancement processing of the denoised grayscale spot image to obtain a preprocessed spot image.

[0059] Specifically, the high-magnification light source device can be a light source device used in a microscope device. The light source parameters commonly used in the microscope device are used as the target light source to set the high-magnification light source device. The set high-magnification light source device projects a light spot onto the target plane, and the camera device collects a light spot image onto the target plane. The light spot image is grayed, and the values ​​of the three primary color components of the pixel points in the light spot image are arithmetic averaged to obtain the gray value of the pixel point to gray the light spot image, thereby obtaining a grayed light spot image. The grayed light spot image is denoised, and a pixel point is randomly selected from the grayed light spot image, and the pixel point is used as the center point to obtain the neighborhood of the center point, and the gray values ​​of the pixels in the neighborhood are sorted, and the middle value is taken as the new value of the gray scale of the center pixel. According to the new value, the grayed light spot image is filtered using a preset window to obtain the grayed light spot image after denoising. The grayscale spot image after denoising is subjected to image enhancement processing, and the image enhancement processing includes image edge enhancement and spatial filtering of image pixels. After completing the image enhancement processing, the pre-processed spot image can be obtained.

[0060] S12: performing segmentation processing on the pre-processed spot image to obtain a segmented spot image;

[0061] In the specific implementation process of the present invention, the segmentation processing of the preprocessed spot image to obtain the spot image after segmentation processing includes: setting an image pixel neighborhood for the preprocessed spot image, and calculating the grayscale mean and image entropy value of the image pixel neighborhood; extracting color feature components of the preprocessed spot image to obtain target color feature components; setting a segmentation threshold based on the target color feature components, grayscale mean and image entropy value; and segmenting the preprocessed spot image using an adaptive threshold segmentation algorithm based on the segmentation threshold to obtain the spot image after segmentation processing.

[0062] Specifically, the image pixel neighborhood is set for the preprocessed spot image, and the grayscale mean and image entropy value of the image pixel neighborhood are calculated. The grayscale mean is calculated according to the grayscale value of each pixel in the image pixel neighborhood, and the image entropy value of the image pixel neighborhood is calculated according to the entropy calculation formula. The color feature component of the preprocessed spot image is extracted, the mean of all pixels in the preprocessed spot image is calculated to obtain the target mean, and the pixel matrix is ​​generated according to the target mean. The color vector angle matrix and the color Euclidean distance matrix of the pixel matrix are calculated, and the first horizontal and vertical change matrix of the color vector angle matrix and the second horizontal and vertical change matrix of the color Euclidean distance matrix are obtained. The target color feature component is constructed according to the first horizontal and vertical change matrix and the second horizontal and vertical change matrix, so that a more comprehensive color feature component can be obtained. The segmentation threshold is set based on the target color feature component, the grayscale mean and the image entropy value, and the segmentation threshold is determined according to the target color feature component, the grayscale mean and the image entropy value and their corresponding ratio. Based on the segmentation threshold, the preprocessed spot image is segmented using an adaptive threshold segmentation algorithm, and each pixel in the preprocessed spot image is compared with the segmentation threshold. If the pixel value is greater than or equal to the segmentation threshold, it is divided into a target area; if the pixel value is less than the segmentation threshold, it is divided into a background area, so as to segment the preprocessed spot image and obtain a segmented spot image.

[0063] S13: determining the illumination intensity and illumination area of ​​the spot image after segmentation processing, and calculating a first light source uniformity coefficient of the target light source of the high-magnification light source device based on the illumination intensity and illumination area;

[0064] In the specific implementation process of the present invention, the determination of the illumination intensity and illumination area of ​​the spot image after segmentation processing includes: performing bit stratification on the spot image after segmentation processing to obtain the spot image after bit stratification; calculating the statistical value of the target pixel points in the spot image after bit stratification, and calculating the illumination intensity based on the statistical value of the target pixel points; performing pixel-level classification on the spot image after segmentation processing to obtain the illumination area.

[0065] Furthermore, the method of calculating the first light source uniformity coefficient of the target light source of the high-magnification light source device based on the light intensity and the light area includes: inputting the light intensity and the light area into a feedforward neural network to perform brightness distribution analysis to obtain a brightness distribution analysis result; and calculating the first light source uniformity coefficient of the target light source of the high-magnification light source device based on the brightness distribution analysis result.

[0066] Specifically, the spot image after the segmentation process is bit-layered, and the preset number of bit layers with the lowest number of layers is selected as the low-bit layer, that is, the pixel value of the image is split into different binary bit planes, each bit plane contains the bit information of the corresponding pixel in the image, and the pixel grayscale value of each bit layer is only set to 0 and 255, so as to obtain the spot image after the bit layering. The statistical value of the target pixel in the spot image after the bit layering is calculated, that is, the number of pixel points with a pixel value of 255 in the spot image after the bit layering is counted, which is the statistical value, and the light intensity is calculated based on the statistical value of the target pixel point, and the light intensity is calculated by the statistical value of the target pixel point through the preset light intensity calculation formula. The spot image after the segmentation process is pixel-level classified, the spot image after the segmentation process is feature extracted to obtain a feature map, the feature map is linearly interpolated to obtain a feature map after the linear interpolation process, and the softmax function is used to assign pixel category labels to the feature map after the linear interpolation process to obtain the light source contour, and the illuminated area is calculated according to the pixel points in the light source contour. The illumination intensity and illumination area are input into a feedforward neural network for brightness distribution analysis. The feedforward neural network is composed of multiple layers of computing units, each computing unit is interconnected in a feedforward manner, and each neural unit in each layer of computing units is directly connected to the neural unit of the next layer to obtain a brightness distribution analysis result. Based on the brightness distribution analysis result, the first light source uniformity coefficient of the target light source of the high-power light source device is calculated. The brightness distribution of each light source area can be known through the brightness distribution analysis result, so that the first light source uniformity coefficient of the target light source of the high-power light source device can be determined.

[0067] S14: acquiring a corresponding grayscale distribution curve based on the light spot image after segmentation processing, and determining a light spot grayscale parameter based on the grayscale distribution curve;

[0068] In the specific implementation process of the present invention, the corresponding grayscale distribution curve is obtained based on the spot image after segmentation processing, and the spot grayscale parameters are determined based on the grayscale distribution curve, including: setting a number of rectangular frames, and determining the grayscale value of the edge image of the spot image after segmentation processing based on the number of rectangular frames; generating a corresponding grayscale distribution curve based on the grayscale value, and generating a spot grayscale histogram based on the grayscale distribution curve; calculating the slope parameter of the spot grayscale histogram, and determining the spot grayscale parameter based on the slope parameter.

[0069] Specifically, a number of rectangular frames are set, each of which has the same size, and the grayscale value of the edge image of the spot image after segmentation processing is determined based on the number of rectangular frames. The edge image is determined according to the acquired light source contour, and each rectangular frame obtains the grayscale value of the corresponding area in the edge image. A corresponding grayscale distribution curve is generated based on the grayscale value, and a distribution curve is drawn according to the grayscale value of each area acquired by each rectangular frame to obtain a corresponding grayscale distribution curve, and a spot grayscale histogram is generated based on the grayscale distribution curve, and a spot grayscale histogram is generated using the grayscale distribution curve through the cv2.calcHist() function. The slope parameter of the spot grayscale histogram is calculated, that is, the slope of the grayscale distribution in the spot grayscale histogram is calculated, which reflects the change trend of the grayscale frequency, and the spot grayscale parameter is determined based on the slope parameter.

[0070] S15: calculating a second light source uniformity coefficient based on the light spot grayscale parameter combined with a calibration parameter, and calculating a target light source uniformity coefficient based on the first light source uniformity coefficient and the second light source uniformity coefficient;

[0071] In the specific implementation process of the present invention, the second light source uniformity coefficient is calculated based on the light spot grayscale parameters combined with the calibration parameters, including: calculating the light spot centroid based on the light intensity and the illumination area, and calculating the light spot area brightness based on the light spot centroid; generating a calibration matrix based on the calibration parameters using a preset grayscale matrix; calculating the second light source uniformity coefficient based on the light spot area brightness and the light spot grayscale parameters combined with the calibration matrix.

[0072] Furthermore, the calculation of the target light source uniformity coefficient based on the first light source uniformity coefficient and the second light source uniformity coefficient includes: obtaining weight coefficients corresponding to the first light source uniformity coefficient and the second light source uniformity coefficient; and calculating the target light source uniformity coefficient based on the first light source uniformity coefficient and the second light source uniformity coefficient combined with the corresponding weight coefficients.

[0073] Specifically, the centroid of the light spot is calculated based on the illumination intensity and illumination area, the coordinate values ​​of each pixel in the spot image after segmentation processing on the X-axis and Y-axis are obtained, the connected area is marked according to the coordinate value and illumination intensity, the centroid of the light spot image is calculated according to the illumination area, the centroid of the light spot is calculated using the geometric distance algorithm according to the marked connected area and the center, and the brightness of the light spot area is calculated based on the centroid of the light spot, and a number of annular areas are selected with the centroid of the light spot as the center of the circle, and the brightness parameters of each annular area are calculated, that is, the brightness of the light spot area is calculated. Based on the calibration parameters, a calibration matrix is ​​generated using a preset grayscale matrix, a matrix consistent with the number of pixels of the calibration image is obtained, that is, the calibration parameters are set, and all data in the matrix consistent with the number of pixels of the calibration image is set to the standard grayscale value to generate a standard matrix, and a calibration matrix is ​​generated according to the standard matrix and the preset grayscale matrix. The calibration matrix can effectively correct the deviation of the brightness of the light spot area and the grayscale parameters of the light spot. The uniformity coefficient of the second light source is calculated based on the brightness of the light spot area and the grayscale parameters of the light spot in combination with the calibration matrix, so that the uniformity coefficient of the second light source obtained is more accurate. Obtain the weight coefficients corresponding to the first light source uniformity coefficient and the second light source uniformity coefficient. Different light source uniformity coefficients correspond to different weight coefficients, and the corresponding weight coefficients can be matched in the database. Calculate the target light source uniformity coefficient based on the first light source uniformity coefficient and the second light source uniformity coefficient combined with the corresponding weight coefficient, thereby avoiding the one-sidedness and limitations brought by a single light source uniformity coefficient, and making the obtained target light source uniformity coefficient more in line with the actual situation.

[0074] S16: Determine whether the light source uniformity of the high-magnification light source device reaches a preset standard based on the target light source uniformity coefficient.

[0075] In the specific implementation process of the present invention, the determination of whether the light source uniformity of the high-magnification light source device meets the preset standard based on the target light source uniformity coefficient includes: calculating the target difference between the target light source uniformity coefficient and the standard light source uniformity coefficient; judging whether the target difference is within the preset allowable range, if the target difference is within the preset allowable range, judging that the light source uniformity of the high-magnification light source device meets the preset standard; if the target difference is not within the preset allowable range, judging that the light source uniformity of the high-magnification light source device does not meet the preset standard.

[0076] Specifically, the target difference between the uniformity coefficient of the target light source and the uniformity coefficient of the standard light source is calculated. The uniformity coefficient of the standard light source is a standard value of the uniformity of the high-magnification light source obtained through a large number of experiments. It is judged whether the target difference is within the preset allowable range. If the target difference is within the preset allowable range, it is judged that the uniformity of the light source of the high-magnification light source device meets the preset standard. At the same time, the uniformity level of the target light source projected by the high-magnification light source device can be judged according to the target difference. Different target differences correspond to different uniformity levels. If the target difference is not within the preset allowable range, it is judged that the uniformity of the light source of the high-magnification light source device does not meet the preset standard.

[0077] In an embodiment of the present invention, a segmentation threshold is set according to the target color feature component, grayscale mean and image entropy value obtained from the preprocessed spot image to perform segmentation processing on the spot image, which can improve the accuracy of image segmentation and the efficiency of subsequent image analysis. The first light source uniformity coefficient of the target light source of the high-magnification light source device is calculated based on the light intensity and the illumination area, and the intensity uniformity of the light source range can be clarified. The corresponding grayscale distribution curve is obtained according to the spot image after segmentation processing to determine the spot grayscale parameter, and the second light source uniformity coefficient is calculated according to the spot grayscale parameter combined with the calibration parameter. The target light source uniformity coefficient is calculated based on the first light source uniformity coefficient and the second light source uniformity coefficient, so that the obtained target light source uniformity coefficient is more in line with the actual situation, avoiding the one-sidedness and limitations brought by the uniformity detection of a single light source uniformity coefficient, and can more accurately reflect the uniformity of the high-magnification light source, and better judge whether the currently projected high-magnification light source meets the required uniformity standard.

[0078] Embodiment 2

[0079] See also Figure 2 , Figure 2 : is a flow chart of a method for detecting uniformity of a high-magnification light source in another embodiment of the present invention, the method comprising:

[0080] S201: Acquire a spot image projected by a high-magnification light source device onto a target plane according to a set target light source, and preprocess the spot image to obtain a preprocessed spot image;

[0081] In the specific implementation process of the present invention, the high-magnification light source device can be a light source device used in a microscope device. The light source parameters commonly used in the microscope device are used as the target light source to set the high-magnification light source device. The set high-magnification light source device projects a light spot onto the target plane, and the camera device collects a light spot image onto the target plane. The light spot image is grayed, and the values ​​of the three primary color components of the pixel points in the light spot image are arithmetic averaged to obtain the gray value of the pixel point to gray the light spot image and obtain a grayed light spot image. The grayed light spot image is denoised, and a pixel point is randomly selected from the grayed light spot image, and the pixel point is used as the center point to obtain the neighborhood of the center point, and the gray values ​​of the pixels in the neighborhood are sorted, and the middle value is taken as the new value of the gray scale of the center pixel. According to the new value, the grayed light spot image is filtered using a preset window to obtain the grayed light spot image after denoising. The grayscale spot image after denoising is subjected to image enhancement processing, and the image enhancement processing includes image edge enhancement and spatial filtering of image pixels. After completing the image enhancement processing, the pre-processed spot image can be obtained.

[0082] S202: Setting an image pixel neighborhood for the preprocessed spot image, and calculating a grayscale mean and an image entropy value of the image pixel neighborhood;

[0083] In the specific implementation process of the present invention, an image pixel neighborhood is set for the preprocessed spot image, and the grayscale mean and image entropy value of the image pixel neighborhood are calculated. The grayscale mean is calculated according to the grayscale value of each pixel in the image pixel neighborhood, and the image entropy value of the image pixel neighborhood is calculated according to the entropy value calculation formula.

[0084] S203: extracting color feature components from the preprocessed spot image to obtain target color feature components;

[0085] In the specific implementation process of the present invention, color feature components are extracted from the preprocessed spot image, the mean of all pixels in the preprocessed spot image is calculated to obtain the target mean, a pixel matrix is ​​generated according to the target mean, the color vector angle matrix and the color Euclidean distance matrix of the pixel matrix are calculated, the first horizontal and vertical change matrix of the color vector angle matrix and the second horizontal and vertical change matrix of the color Euclidean distance matrix are obtained, and the target color feature components are constructed according to the first horizontal and vertical change matrix and the second horizontal and vertical change matrix, so that a more comprehensive color feature component can be obtained.

[0086] S204: Setting a segmentation threshold based on the target color feature component, grayscale mean and image entropy value;

[0087] In the specific implementation process of the present invention, the segmentation threshold is set based on the target color feature component, grayscale mean and image entropy value, and the segmentation threshold is determined according to the target color feature component, grayscale mean and image entropy value and their corresponding ratio.

[0088] S205: performing segmentation processing on the preprocessed spot image by using an adaptive threshold segmentation algorithm based on the segmentation threshold to obtain a segmented spot image;

[0089] In the specific implementation process of the present invention, the preprocessed spot image is segmented based on the segmentation threshold using an adaptive threshold segmentation algorithm, and each pixel in the preprocessed spot image is compared with the segmentation threshold. If the pixel value is greater than or equal to the segmentation threshold, it is divided into a target area; if the pixel value is less than the segmentation threshold, it is divided into a background area, so as to segment the preprocessed spot image and obtain a segmented spot image.

[0090] S206: Determine the illumination intensity and illumination area of ​​the spot image after segmentation processing, and calculate a first light source uniformity coefficient of the target light source of the high-magnification light source device based on the illumination intensity and illumination area;

[0091] In the specific implementation process of the present invention, the spot image after the segmentation process is bit-layered, and the preset number of bit layers with the lowest number of layers are selected as the low-bit layer, that is, the pixel value of the image is split into different binary bit planes, each bit plane contains the bit information of the corresponding pixel in the image, and the pixel grayscale value of each bit layer is only set to 0 and 255, so as to obtain the spot image after the bit layering. The statistical value of the target pixel points in the spot image after the bit layering is calculated, that is, the number of pixel points with a pixel value of 255 in the spot image after the bit layering is counted, that is, the statistical value, and the light intensity is calculated based on the statistical value of the target pixel points, and the light intensity is calculated by the statistical value of the target pixel points through the preset light intensity calculation formula. The spot image after the segmentation process is pixel-level classified, the feature extraction of the spot image after the segmentation process is performed to obtain a feature map, the feature map is linearly interpolated to obtain a feature map after the linear interpolation process, and the softmax function is used to assign pixel category labels to the feature map after the linear interpolation process to obtain the light source contour, and the illumination area is calculated according to the pixel points in the light source contour. The illumination intensity and illumination area are input into a feedforward neural network for brightness distribution analysis. The feedforward neural network is composed of multiple layers of computing units, each computing unit is interconnected in a feedforward manner, and each neural unit in each layer of computing units is directly connected to the neural unit of the next layer to obtain a brightness distribution analysis result. Based on the brightness distribution analysis result, the first light source uniformity coefficient of the target light source of the high-power light source device is calculated. The brightness distribution of each light source area can be known through the brightness distribution analysis result, so that the first light source uniformity coefficient of the target light source of the high-power light source device can be determined.

[0092] S207: acquiring a corresponding grayscale distribution curve based on the segmented spot image, and determining a grayscale parameter of the spot based on the grayscale distribution curve;

[0093] In the specific implementation process of the present invention, a number of rectangular frames are set, each of which has the same size, and the grayscale value of the edge image of the spot image after segmentation processing is determined based on the number of rectangular frames, and the edge image is determined according to the acquired light source contour, and each rectangular frame obtains the grayscale value of the corresponding area in the edge image. Based on the grayscale value, a corresponding grayscale distribution curve is generated, and the distribution curve is drawn according to the grayscale value of each area acquired by each rectangular frame to obtain the corresponding grayscale distribution curve, and a spot grayscale histogram is generated based on the grayscale distribution curve, and the grayscale distribution curve is used to generate a spot grayscale histogram through the cv2.calcHist() function. The slope parameter of the spot grayscale histogram is calculated, that is, the slope of the grayscale distribution in the spot grayscale histogram is calculated, which reflects the change trend of the grayscale frequency, and the spot grayscale parameter is determined based on the slope parameter.

[0094] S208: Calculating the centroid of the light spot based on the light intensity and the light area, and calculating the brightness of the light spot area based on the centroid of the light spot; generating a calibration matrix using a preset gray matrix based on the calibration parameters;

[0095] In the specific implementation process of the present invention, the centroid of the light spot is calculated based on the illumination intensity and illumination area, the coordinate values ​​of each pixel in the spot image after segmentation on the X-axis and Y-axis are obtained, the connected area is marked according to the coordinate value and the illumination intensity, the center of gravity of the spot image is calculated according to the illumination area, the centroid of the light spot is calculated using the geometric distance algorithm according to the marked connected area and the center, and the brightness of the spot area is calculated based on the centroid of the light spot, and a number of annular areas are selected with the centroid of the light spot as the center of the circle, and the brightness parameters of each annular area are calculated, that is, the brightness of the spot area is calculated. Based on the calibration parameters, a calibration matrix is ​​generated using a preset grayscale matrix, a matrix consistent with the number of pixels of the calibration image is obtained, that is, the calibration parameters, a standard grayscale value is set, all data in the matrix consistent with the number of pixels of the calibration image is set to the standard grayscale value, a standard matrix is ​​generated, and a calibration matrix is ​​generated according to the standard matrix and the preset grayscale matrix. The calibration matrix can effectively correct the deviation of the brightness of the spot area and the grayscale parameters of the spot.

[0096] S209: calculating a second light source uniformity coefficient based on the light spot area brightness and the light spot grayscale parameters in combination with the calibration matrix, and calculating a target light source uniformity coefficient based on the first light source uniformity coefficient and the second light source uniformity coefficient;

[0097] In the specific implementation process of the present invention, the uniformity coefficient of the second light source is calculated based on the brightness of the light spot area and the grayscale parameters of the light spot combined with the calibration matrix, so that the obtained uniformity coefficient of the second light source is more accurate. The weight coefficients corresponding to the uniformity coefficients of the first light source and the second light source are obtained. Different light source uniformity coefficients correspond to different weight coefficients, and the corresponding weight coefficients can be matched in the database. The uniformity coefficient of the target light source is calculated based on the uniformity coefficient of the first light source and the uniformity coefficient of the second light source combined with the corresponding weight coefficients, thereby avoiding the one-sidedness and limitations brought by the uniformity coefficient of a single light source, so that the uniformity coefficient of the target light source obtained is more in line with the actual situation.

[0098] S210: Determine whether the light source uniformity of the high-magnification light source device meets a preset standard based on the target light source uniformity coefficient.

[0099] In the specific implementation process of the present invention, the target difference between the uniformity coefficient of the target light source and the uniformity coefficient of the standard light source is calculated. The uniformity coefficient of the standard light source is the standard value of the uniformity of the high-magnification light source obtained through a large number of experiments. It is judged whether the target difference is within the preset allowable range. If the target difference is within the preset allowable range, it is judged that the uniformity of the light source of the high-magnification light source device meets the preset standard. At the same time, the uniformity level of the target light source projected by the high-magnification light source device can be judged according to the target difference. Different target differences correspond to different uniformity levels. If the target difference is not within the preset allowable range, it is judged that the uniformity of the light source of the high-magnification light source device does not meet the preset standard.

[0100] In an embodiment of the present invention, a segmentation threshold is set according to the target color feature component, grayscale mean and image entropy value obtained from the preprocessed spot image to perform segmentation processing on the spot image, which can improve the accuracy of image segmentation and the efficiency of subsequent image analysis. The first light source uniformity coefficient of the target light source of the high-magnification light source device is calculated based on the light intensity and the illumination area, and the intensity uniformity of the light source range can be clarified. The corresponding grayscale distribution curve is obtained according to the spot image after segmentation processing to determine the spot grayscale parameter, and the second light source uniformity coefficient is calculated according to the spot grayscale parameter combined with the calibration parameter. The target light source uniformity coefficient is calculated based on the first light source uniformity coefficient and the second light source uniformity coefficient, so that the obtained target light source uniformity coefficient is more in line with the actual situation, avoiding the one-sidedness and limitations brought by the uniformity detection of a single light source uniformity coefficient, and can more accurately reflect the uniformity of the high-magnification light source, and better judge whether the currently projected high-magnification light source meets the required uniformity standard.

[0101] Embodiment 3

[0102] See also Figure 3 , Figure 3 : is a schematic diagram of the structure of a high-magnification light source uniformity detection system in an embodiment of the present invention, the system comprising:

[0103] The spot image preprocessing module 31 is used to obtain the spot image projected by the high-magnification light source device to the target plane according to the set target light source, and preprocess the spot image to obtain the preprocessed spot image;

[0104] Image segmentation module 32: used to segment the pre-processed spot image to obtain a segmented spot image;

[0105] The first light source uniformity coefficient calculation module 33 is used to determine the illumination intensity and illumination area of ​​the spot image after segmentation processing, and calculate the first light source uniformity coefficient of the target light source of the high-magnification light source device based on the illumination intensity and illumination area;

[0106] The light spot grayscale parameter module 34 is used to obtain the corresponding grayscale distribution curve based on the light spot image after segmentation processing, and determine the light spot grayscale parameter based on the grayscale distribution curve;

[0107] The target light source uniformity coefficient calculation module 35 is used to calculate the second light source uniformity coefficient based on the light spot grayscale parameter combined with the calibration parameter, and calculate the target light source uniformity coefficient based on the first light source uniformity coefficient and the second light source uniformity coefficient;

[0108] The light source uniformity determination module 36 is used to determine whether the light source uniformity of the high-magnification light source device meets a preset standard based on the target light source uniformity coefficient.

[0109] In the specific implementation process of the present invention, the specific implementation method of the system item can refer to the implementation method of the above-mentioned method item, which will not be repeated here.

[0110] In an embodiment of the present invention, a segmentation threshold is set according to the target color feature component, grayscale mean and image entropy value obtained from the preprocessed spot image to perform segmentation processing on the spot image, which can improve the accuracy of image segmentation and the efficiency of subsequent image analysis. The first light source uniformity coefficient of the target light source of the high-magnification light source device is calculated based on the light intensity and the illumination area, and the intensity uniformity of the light source range can be clarified. The corresponding grayscale distribution curve is obtained according to the spot image after segmentation processing to determine the spot grayscale parameter, and the second light source uniformity coefficient is calculated according to the spot grayscale parameter combined with the calibration parameter. The target light source uniformity coefficient is calculated based on the first light source uniformity coefficient and the second light source uniformity coefficient, so that the obtained target light source uniformity coefficient is more in line with the actual situation, avoiding the one-sidedness and limitations brought by the uniformity detection of a single light source uniformity coefficient, and can more accurately reflect the uniformity of the high-magnification light source, and better judge whether the currently projected high-magnification light source meets the required uniformity standard.

[0111] A person skilled in the art may understand that all or part of the steps in the various methods of the above embodiments may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the storage medium may include: a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc.

[0112] In addition, the above is a detailed introduction to a high-magnification light source uniformity detection method and system provided in an embodiment of the present invention. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for general technical personnel in this field, according to the idea of ​​the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. A high-magnification light source uniformity detection method, characterized in that: The method comprises: Acquire a spot image projected by a high-magnification light source device onto a target plane according to a set target light source, and preprocess the spot image to obtain a preprocessed spot image; Performing segmentation processing on the preprocessed spot image to obtain a segmented spot image; Determine the illumination intensity and illumination area of ​​the spot image after segmentation processing, and calculate the first light source uniformity coefficient of the target light source of the high-magnification light source device based on the illumination intensity and illumination area; Acquire a corresponding grayscale distribution curve based on the spot image after segmentation processing, and determine the spot grayscale parameter based on the grayscale distribution curve; Calculating a second light source uniformity coefficient based on the light spot grayscale parameter combined with a calibration parameter, and calculating a target light source uniformity coefficient based on the first light source uniformity coefficient and the second light source uniformity coefficient; Based on the target light source uniformity coefficient, it is determined whether the light source uniformity of the high-magnification light source device reaches a preset standard.

2. The high-magnification light source uniformity detection method according to claim 1, characterized in that: The preprocessing of the spot image to obtain the preprocessed spot image includes: Performing grayscale processing on the light spot image to obtain a grayscale light spot image; Performing denoising on the grayscale light spot image to obtain a denoised grayscale light spot image; The grayscale spot image after denoising is subjected to image enhancement processing to obtain a preprocessed spot image.

3. The high-magnification light source uniformity detection method according to claim 1, characterized in that: The step of segmenting the pre-processed spot image to obtain the segmented spot image includes: Setting an image pixel neighborhood for the preprocessed spot image, and calculating the grayscale mean and image entropy value of the image pixel neighborhood; Extracting color feature components from the preprocessed spot image to obtain target color feature components; Setting a segmentation threshold based on the target color feature component, grayscale mean and image entropy value; The preprocessed spot image is segmented using an adaptive threshold segmentation algorithm based on the segmentation threshold to obtain a segmented spot image.

4. The high-magnification light source uniformity detection method according to claim 1, characterized in that: The step of determining the illumination intensity and illumination area of ​​the spot image after segmentation processing comprises: Performing bit stratification on the light spot image after the segmentation process to obtain a light spot image after bit stratification; Calculate the statistical value of the target pixel in the spot image after bit layering, and calculate the light intensity based on the statistical value of the target pixel; The light spot image after the segmentation process is subjected to pixel-level classification to obtain the illumination area.

5. The high-magnification light source uniformity detection method according to claim 1, characterized in that: The step of calculating a first light source uniformity coefficient of a target light source of the high-magnification light source device based on the light intensity and the light area includes: Inputting the illumination intensity and illumination area into a feedforward neural network to perform brightness distribution analysis to obtain a brightness distribution analysis result; A first light source uniformity coefficient of the target light source of the high-magnification light source device is calculated based on the brightness distribution analysis result.

6. The high-magnification light source uniformity detection method according to claim 1, characterized in that: The step of acquiring a corresponding grayscale distribution curve based on the light spot image after segmentation processing, and determining the light spot grayscale parameter based on the grayscale distribution curve includes: Setting a plurality of rectangular frames, and determining the grayscale value of the edge image of the spot image after segmentation processing based on the plurality of rectangular frames; Generating a corresponding grayscale distribution curve based on the grayscale value, and generating a light spot grayscale histogram based on the grayscale distribution curve; The slope parameter of the light spot grayscale histogram is calculated, and the light spot grayscale parameter is determined based on the slope parameter.

7. The high-magnification light source uniformity detection method according to claim 1, characterized in that: The calculating the uniformity coefficient of the second light source based on the light spot grayscale parameter combined with the calibration parameter includes: Calculating the centroid of the light spot based on the light intensity and the light area, and calculating the brightness of the light spot area based on the centroid of the light spot; Generate a calibration matrix using a preset grayscale matrix based on the calibration parameters; The second light source uniformity coefficient is calculated based on the light spot area brightness and the light spot grayscale parameters combined with the calibration matrix.

8. The high-magnification light source uniformity detection method according to claim 1, characterized in that: The calculating the target light source uniformity coefficient based on the first light source uniformity coefficient and the second light source uniformity coefficient comprises: Obtaining weight coefficients corresponding to the uniformity coefficient of the first light source and the uniformity coefficient of the second light source; A target light source uniformity coefficient is calculated based on the first light source uniformity coefficient and the second light source uniformity coefficient in combination with a corresponding weight coefficient.

9. The high-magnification light source uniformity detection method according to claim 1, characterized in that: The determining whether the light source uniformity of the high-magnification light source device meets a preset standard based on the target light source uniformity coefficient includes: Calculating a target difference between the target light source uniformity coefficient and the standard light source uniformity coefficient; Determine whether the target difference is within a preset allowable range, and if the target difference is within the preset allowable range, determine that the light source uniformity of the high-magnification light source device reaches a preset standard; If the target difference is not within the preset allowable range, it is determined that the light source uniformity of the high-magnification light source device does not meet the preset standard.

10. A high-magnification light source uniformity detection system, characterized in that: The system comprises: The light spot image preprocessing module is used to obtain the light spot image projected by the high-magnification light source device to the target plane according to the set target light source, and preprocess the light spot image to obtain the preprocessed light spot image; Image segmentation module: used to segment the pre-processed spot image to obtain the segmented spot image; A first light source uniformity coefficient calculation module: used to determine the illumination intensity and illumination area of ​​the spot image after segmentation processing, and calculate the first light source uniformity coefficient of the target light source of the high-magnification light source device based on the illumination intensity and illumination area; Light spot grayscale parameter module: used to obtain the corresponding grayscale distribution curve based on the light spot image after segmentation processing, and determine the light spot grayscale parameter based on the grayscale distribution curve; A target light source uniformity coefficient calculation module: used to calculate the second light source uniformity coefficient based on the light spot grayscale parameter combined with the calibration parameter, and calculate the target light source uniformity coefficient based on the first light source uniformity coefficient and the second light source uniformity coefficient; Light source uniformity judgment module: used to determine whether the light source uniformity of the high-magnification light source device meets the preset standard based on the target light source uniformity coefficient.

Citation Information

Patent Citations

  • Unevenness inspection apparatus and unevenness inspection method

    CN102842276A

  • Luminance uniformity test method of dot-matrix light source

    CN104655403A

  • Hard endoscope luminous efficiency uniformity detection method

    CN106153300A

  • Method and system for detecting uniformity of light source

    CN109186941A

  • Defect detection method and detection system for curved surface object

    CN111344553A