Spot Region Detection Method, Device, Equipment and Medium in Target Visible Light Image
By defining the multi-scale attribute threshold criterion function, the pixel grayscale threshold of the spot area is calculated, and the problem of spot area detection under complex lighting and long-distance conditions is solved, high-precision spot area detection is achieved, and the accuracy of camera parameter calibration is improved.
Patent Information
- Application Number
- CN202310342993.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-31
- Publication Date
- 2025-07-29
- Estimated Expiration
- 2043-03-31
AI Technical Summary
Traditional threshold segmentation methods are difficult to adapt to spot area detection under complex lighting and long-distance conditions, resulting in a reduction in the accuracy of camera parameter calibration.
Define the multi-scale attribute threshold criterion function, calculate the pixel grayscale threshold of the spot area by collecting the pixel grayscale value range and the number of pixels of the target image, and use the pixel grayscale threshold to detect the spot area.
High-precision and robust spot area detection under complex lighting and long-distance conditions, improving the accuracy of camera parameter calibration.
Smart Images

Figure CN116342568B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and specifically to a method, device, equipment and medium for detecting a light spot area in a visible light image of a target Background Technique
[0002] In the field of modern industrial measurement, visual measurement has received more and more attention due to its advantages such as precision and non-contact. Among them, the accurate detection of the light spot image of a light-emitting diode target will directly affect the accuracy of camera parameter calibration in a large-scale scene.
[0003] The light intensity distribution in the light spot image belongs to a typical pulse distribution. The part with a larger light intensity value is the light spot area, and the part with a smaller intensity value belongs to the background part. Therefore, the threshold segmentation method is usually used to detect the light spot area in the light-emitting diode light spot image. However, in traditional threshold segmentation methods, such as the Otsu threshold segmentation method and the iterative threshold segmentation method, they are relatively sensitive to the scale transformation of the light spot, and thus it is difficult to adapt to the detection of the light spot area in complex illumination and long-distance imaging environments.
[0004] At the same time, in actual engineering applications, due to factors such as long shooting distance, changes in light intensity and angle in the measurement scene, the light spot area corresponding to the light-emitting diode in the imaging process often exhibits multi-scale attributes, which increases the difficulty and error of detecting the light spot area in the light-emitting diode light spot image, and reduces the accuracy of camera parameter calibration in a large-scale scene.
[0005] In view of this, it is necessary to design a threshold segmentation method suitable for the multi-scale attributes of light spots. Summary of the Invention
[0006] In order to meet the requirements of visible light image light spot detection under complex illumination and long-distance conditions, the present invention discloses a method, device, equipment and medium for detecting a light spot area in a visible light image of a target. This method can detect the light spot image area from the target image captured by a visible light camera under outdoor long-distance and changing illumination conditions, and has the characteristics of high precision and strong robustness.
[0007] The technical solution for achieving the invention purpose is as follows: A method for detecting a light spot area in a visible light image of a target includes:
[0008] S1. Define a multi-scale attribute threshold criterion function;
[0009] S2. Collect a target image, obtain the series range of pixel gray values in the target image, and extract the number of pixels of each level of pixel gray value;
[0010] S3. Calculate the pixel gray threshold for detecting the light spot area in the target image according to the multi-scale attribute threshold criterion function and the number of pixels of each level of pixel gray value in the target image;
[0011] S4. Detect the target image based on the pixel gray - level threshold, and obtain the part of the target image where the pixel gray - level value level is greater than or equal to the pixel gray - level threshold. This part is the light - spot area of the target image.
[0012] In one embodiment, in the above step S1, the definition of the multi - scale attribute threshold criterion function includes:
[0013] S11. Define the range of the pixel gray - level value levels in the target visible - light image;
[0014] S12. Define the pixel segmentation value, and segment the target visible - light image into a target part and a background part according to the pixel segmentation value;
[0015] S13. Obtain the number of pixels of each level of pixel gray - level value in the target visible - light image;
[0016] S14. Calculate the pixel gray - level value probability, the pixel gray - level value average, the pixel gray - level value variance of the background part and the target part respectively, and the pixel gray - level value probability ratio between the background part and the target part;
[0017] S15. Obtain the multi - scale attribute threshold criterion function based on the pixel gray - level value probability, the pixel gray - level value average, the pixel gray - level value variance, and the pixel gray - level value probability ratio.
[0018] In one embodiment, the formula of the multi - scale attribute threshold criterion function is: where T is the pixel segmentation value, and δ 2 (T) is the criterion function value; w0 is the pixel gray - level value probability of the background part; w1 is the pixel gray - level value probability of the target part; μ0 is the average pixel gray - level value of the background part; μ1 is the average pixel gray - level value of the target part; is the pixel gray - level value variance of the target part; is the pixel gray - level value variance of the background part; α is the pixel gray - level value probability ratio between the background part and the target part.
[0019] In one embodiment, in the above step S4, calculating the pixel gray - level threshold of the light - spot area in the detected target image based on the multi - scale attribute threshold criterion function and the number of pixels of each level of pixel gray - level value includes:
[0020] Within the range of the pixel gray - level value levels in the target image, determine the pixel gray - level value level corresponding to the maximum criterion function value as the pixel gray - level threshold.
[0021] The present invention also provides a device for detecting the light - spot area in a target visible - light image, including:
[0022] An image acquisition module, configured to collect a target image;
[0023] An image processing module, configured to obtain the series range of pixel gray values in a target image and extract the number of pixels of each level of pixel gray value;
[0024] A pixel threshold calculation module, configured to calculate the pixel gray threshold for detecting the light spot area in the target image according to the multi-scale attribute threshold criterion function and the number of pixels of each level of pixel gray value in the target image;
[0025] A light spot area detection module, configured to detect the target image according to the pixel gray threshold, and obtain the part of the target image where the series of pixel gray values is greater than or equal to the pixel gray threshold, and this part is the light spot area of the target image.
[0026] The present invention also provides a computer device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the above-mentioned light spot area detection method is implemented to solve the technical problems of difficult detection and large error in the light spot area in the image.
[0027] The present invention also provides a computer-readable storage medium, which stores a computer program for executing the above-mentioned light spot area detection method to solve the technical problems of difficult detection and large error in the light spot area in the image.
[0028] Compared with the prior art, the beneficial effect of the present invention is that: the designed light spot area detection method of the present invention is applicable to the detection requirements of the light spot area in visible light images under complex lighting and long-distance conditions, and can accurately detect the light spot area in the visible light image to solve the problem of low detection accuracy of the light spot area caused by long distance and light change. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments.
[0030] Figure 1 It is a flowchart of the light spot area detection method in the target visible light image in the specific implementation manner;
[0031] Figure 2 It is a schematic diagram of the detection result of the light spot area in the target array visible light image in the specific implementation manner;
[0032] Figure 3 It is a schematic diagram of the computer device in the specific implementation manner;
[0033] Figure 4 It is a structural block diagram of the light spot area detection device in the target visible light image in the specific implementation manner;
[0034] Among them, 101 is the image acquisition module; 102 is the image processing module; 103 is the pixel threshold calculation module; 104 is the light spot area detection module; 201 is the memory; 202 is the processor. Detailed implementation mode
[0035] The present invention will be further described below in conjunction with specific embodiments, and the advantages and features of the present invention will become clearer as the description progresses. However, these embodiments are merely exemplary and do not constitute any limitation to the scope of the present invention. Those skilled in the art should understand that without departing from the spirit and scope of the present invention, modifications or substitutions can be made to the details and forms of the technical solutions of the present invention, but such modifications and substitutions all fall within the protection scope of the present invention.
[0036] This detailed implementation mode provides a method for detecting the light spot area in the target visible light image. Refer to Figure 1 As shown, the method includes:
[0037] S1. Define a multi-scale attribute threshold criterion function;
[0038] S2. Collect the target image, obtain the series range of pixel gray values in the target image, and extract the number of pixels of each level of pixel gray values;
[0039] S3. Calculate the pixel gray threshold for detecting the light spot area in the target image according to the multi-scale attribute threshold criterion function and the number of pixels of each level of pixel gray values in the target image;
[0040] S4. Detect the target image according to the pixel gray threshold, and obtain the part of the target image where the series of pixel gray values is greater than or equal to the pixel gray threshold. This part is the light spot area of the target image.
[0041] In one embodiment, in the above step S1, the definition of the multi-scale attribute threshold criterion function includes:
[0042] S11. Define the series range of pixel gray values in the target visible light image as 1 to m - 1, where m is a natural number greater than 1;
[0043] S12. Define the pixel segmentation value T, and divide the target visible light image into a target part and a background part according to the pixel segmentation value T. The series range of pixel gray values of the background part is C0 = {0 to T - 1}, and the series range of pixel gray values of the target part is C1 = {T to m - 1};
[0044] S13. Obtain the number of pixels of each level of pixel gray values in the target visible light image. For example, the number of pixels of the i-th level of pixel gray values can be expressed as n i ;
[0045] S14. Calculate the probability of pixel gray values, the average value of pixel gray values, the variance of pixel gray values, and the probability ratio of pixel gray values between the background part and the target part respectively.
[0046] Among them, the total number of pixels N is The probability of each level of pixel gray value is Based on the total number of pixels and the probability of each level of pixel gray value, the probability of pixel gray values of the background part and the target part can be calculated. Specifically, the calculation formula for the probability of pixel gray values w0 of the background part is The calculation formula for the probability of pixel gray values w1 of the target part is
[0047] The calculation formula for the average value of pixel gray values μ0 of the background part is The calculation formula for the average value of pixel gray values μ1 of the target part is
[0048] The average value μ of all pixel gray values in the target visible light image is μ = w0μ0 + w1μ1. From this, the variance of pixel gray values of the background part and the target part can be calculated. Specifically, the variance of pixel gray values of the background part The calculation formula is The variance of pixel gray values of the target part The calculation formula is The calculation formula for the probability ratio α of pixel gray values between the background part and the target part is
[0049] S15. Obtain a multi-scale attribute threshold criterion function based on the probability of pixel gray values, the average value of pixel gray values, the variance of pixel gray values, and the probability ratio of pixel gray values.
[0050] In this embodiment, when designing the multi-scale attribute threshold criterion function, various statistical information between the background part and the target part is comprehensively considered. Therefore, when the pixel value scale of the target part changes, the influence of the change in the spot area scale on the calculation of the pixel segmentation value can be greatly reduced.
[0051] In one embodiment, the formula of the multi-scale attribute threshold criterion function is: Among them, T is the pixel segmentation value, and δ 2 (T) is the criterion function value; w0 is the probability of pixel gray values of the background part; w1 is the probability of pixel gray values of the target part; μ0 is the average value of pixel gray values of the background part; μ1 is the average value of pixel gray values of the target part; is the variance of pixel gray values of the target part; is the variance of pixel gray values of the background part; α is the probability ratio of pixel gray values between the background part and the target part.
[0052] In one embodiment, in the above step S4, calculating the pixel gray threshold of the light spot area in the detected target image according to the multi-scale attribute threshold criterion function and the number of pixels of each level of pixel gray value includes:
[0053] Within the range of the number of levels of pixel gray values in the target image, determine the pixel gray value level corresponding to the maximum value of the criterion function as the pixel gray threshold.
[0054] Specifically, taking the target visible light image of the above levels 1 to m - 1 as an example of the target image, when determining the pixel segmentation value T, select a value within 1 to m - 1, calculate the value of the criterion function according to the formula of the multi-scale attribute threshold criterion function, and the selected value corresponding to the maximum value of the criterion function is the pixel segmentation value T, and then the pixel gray threshold is obtained.
[0055] In this specific embodiment, in a site with a depth of 30 m, a field of view width of 8 m, and a space height range of 4.5 m, the visible light camera Computar M2518 - MPV is used to take pictures of the light-emitting diode target array. The target array is a 5×3 circular backlight calibration board, the white circular spots on the calibration board are circular, the center distance between two adjacent circles is 140 mm, the diameter of the circles is fixed and the same, and its light emission is white visible light. The above method is used to detect the light spot area of the target array visible light image obtained by taking pictures to verify the above method. The results are shown in Figure 2 As shown, the white part in the figure is the light spot area, and the black is the background part, and the light spot area in the image can be accurately obtained.
[0056] In this embodiment, a computer device is provided, as Figure 3 shown, including a memory 201, a processor 202, and a computer program stored on the memory 201 and executable on the processor 202. When the processor 202 executes the computer program, the above-mentioned arbitrary detection method is implemented.
[0057] Specifically, the computer device can be a computer terminal, a server, or a similar computing device.
[0058] In this embodiment, a computer-readable storage medium is provided, and the computer-readable storage medium stores a computer program for executing the above-mentioned arbitrary detection method.
[0059] Specifically, a computer-readable storage medium includes permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. The information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer-readable storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette tapes, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information accessible by a computing device. As defined herein, computer-readable storage media do not include transitory computer-readable media, such as modulated data signals and carrier waves.
[0060] Based on the same inventive concept, an embodiment of the present invention also provides a detection device for the light spot area in the target visible light image, as described in the following embodiments. Since the principle of the detection device for solving the problem is similar to the above detection method, the implementation of the detection device can refer to the implementation of the above detection method, and the repeated parts will not be described again. As used hereinafter, the term "unit" or "module" can be a combination of software and / or hardware that can implement a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware is also possible and contemplated.
[0061] Figure 4 is a structural block diagram of a detection device for the light spot area in the target visible light image disclosed in this specific embodiment, see Figure 4 As shown, the device includes:
[0062] An image acquisition module 101, configured to acquire a target image;
[0063] An image processing module 102, configured to obtain the series range of pixel gray values in the target image and extract the number of pixels of each level of pixel gray values;
[0064] A pixel threshold calculation module 103, configured to calculate the pixel gray threshold for detecting the light spot area in the target image according to the multi-scale attribute threshold criterion function and the number of pixels of each level of pixel gray values in the target image;
[0065] A light spot area detection module 104, configured to detect the target image according to the pixel gray threshold, and obtain the part of the target image where the series of pixel gray values is greater than or equal to the pixel gray threshold, and this part is the light spot area of the target image.
[0066] The detection method and device for the light spot area disclosed in the embodiments of the present invention achieve the following technical effects. It can meet the requirements for detecting the light spot area in visible light images under complex lighting and long-distance conditions, and can accurately detect the light spot area in visible light images to solve the problem of low accuracy in detecting the light spot area due to long distance and light change.
[0067] The above are only the preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention shall be included in the protection scope of the present invention.
[0068] In addition, it should be understood that although this specification is described according to embodiments, not every embodiment only contains an independent technical solution. This narrative way of the specification is only for clarity. Those skilled in the art should regard the specification as a whole, and the technical solutions in each embodiment can also be appropriately combined to form other embodiments that can be understood by those skilled in the art.
Claims
1. A method for detecting a light spot area in a target visible light image, characterized in that, Including: Define a multi-scale attribute threshold criterion function, including: defining the range of the gray level of pixels in the visible light image of the target as 1 to m-1, where m is a natural number greater than 1; defining a pixel segmentation value T, and segmenting the visible light image of the target into a target part and a background part according to the pixel segmentation value T, where the range of the gray level of pixels in the background part is , and the range of the gray level of pixels in the target part is ; obtaining the number of pixels with each gray level in the visible light image of the target ; calculating the pixel gray level probability, the average pixel gray level, the variance of the pixel gray level of the background part and the target part respectively, and the ratio of the pixel gray level probability of the background part to the target part. Among them, the total number of pixels N is , and the probability of each gray level of pixels is ; calculating the pixel gray level probability of the background part and the target part according to the total number of pixels and the probability of each gray level of pixels. The calculation formula for the pixel gray level probability w0 of the background part is , and the calculation formula for the pixel gray level probability w1 of the target part is ; the calculation formula for the average pixel gray level μ0 of the background part is ; the calculation formula for the average pixel gray level μ1 of the target part is ; the average value μ of all pixel gray levels in the visible light image of the target is , and the variance of the pixel gray level of the background part The calculation formula is ; the variance of the pixel gray level of the target part The calculation formula is ; the ratio of the pixel gray level probability of the background part to the target part The calculation formula is ; obtaining a multi-scale attribute threshold criterion function according to the pixel gray level probability, the average pixel gray level, the variance of the pixel gray level, and the ratio of the pixel gray level probability. The formula of the multi-scale attribute threshold criterion function is: , where T is the pixel segmentation value, is the criterion function value; w0 is the pixel gray level probability of the background part; w1 is the pixel gray level probability of the target part; μ0 is the average pixel gray level of the background part; μ1 is the average pixel gray level of the target part; is the variance of the pixel gray level of the target part; is the variance of the pixel gray level of the background part; is the ratio of the pixel gray level probability of the background part to the target part; Collect a target image, obtain the range of the levels of pixel gray values in the target image, and extract the number of pixels of each level of pixel gray value; According to the multi-scale attribute threshold criterion function and the number of pixels of each level of pixel gray value in the target image, calculate the pixel gray threshold for detecting the light spot area in the target image; Detect the target image according to the pixel gray threshold, and obtain the part of the target image where the level of pixel gray value is greater than or equal to the pixel gray threshold. This part is the light spot area of the target image, including: within the range of the levels of pixel gray values in the target image, determine the level of pixel gray value corresponding to the maximum value of the multi-scale attribute threshold criterion function as the pixel gray threshold.
2. A spot area detection device in a target visible light image, characterized in that, For performing light spot area detection by the light spot area detection method for the target visible light image described in claim 1, the device includes: An image acquisition module for collecting a target image; An image processing module for obtaining the range of the levels of pixel gray values in the target image and extracting the number of pixels of each level of pixel gray value; A pixel threshold calculation module for calculating the pixel gray threshold for detecting the light spot area in the target image according to the multi-scale attribute threshold criterion function and the number of pixels of each level of pixel gray value in the target image; A light spot area detection module for detecting the target image according to the pixel gray threshold and obtaining the part of the target image where the level of pixel gray value is greater than or equal to the pixel gray threshold. This part is the light spot area of the target image.
3. A computer device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the light spot area detection method described in claim 1.
4. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program for executing the light spot area detection method described in claim 1.
Citation Information
Patent Citations
Salient target detection method based on heuristic boundary optimization
CN114862891A
Aggregate morphology characterization method and system based on improved Otsu method
CN115239907A