Method, System, Medium, Device and Terminal for Detecting Strong Light Region in Image
Through image chunking processing and PCA dimensionality reduction combined with machine learning image classifier, efficient and accurate detection of strong light areas is achieved, and the problems of difficult distinction between strong light images and complex calculations in the prior art are solved.
Patent Information
- Application Number
- CN202210148004.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-17
- Publication Date
- 2025-07-15
- Estimated Expiration
- 2042-02-17
AI Technical Summary
The prior art cannot effectively distinguish between strong and non-strong light images, resulting in unreliable results of the visual task processing of strong light images, and the traditional methods have high computational complexity and poor adaptability.
Image blocking processing is used to reduce dimensionality by combining PCA method, and machine learning image classifiers are used to detect strong light areas, including image preprocessing, block feature calculation, PCA dimensionality reduction and image classifier judgment.
It improves the accuracy and efficiency of bright light area detection, simplifies the calculation process, and enhances the adaptability and robustness of the model.
Smart Images

Figure CN114638785B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of image processing, and particularly relates to a method, system, medium, device and terminal for detecting strong light regions in images. Background Technique
[0002] In recent years, with the development of optoelectronic imaging technology, machine vision tasks such as image classification and target detection using optical images have received increasing attention. General optoelectronic detection systems are often affected by factors such as illumination changes and background interference. To ensure the effectiveness of image processing, clear images and complete targets are the prerequisites for visual processing tasks. However, in the actual process of image shooting, there are often many strong light interferences, such as sunlight, reflected strong light, interfering laser, car high beams, etc. When an ordinary camera shoots a strong light scene in an improper exposure mode, the obtained image often contains too many overexposed regions, resulting in the loss of effective information in the image. The disadvantages of the existing technology are that it cannot distinguish between strong light and non-strong light images, and the results of visual task processing on strong light images are often unreliable. Therefore, distinguishing between strong light and non-strong light images and locating strong light regions can, while solving the problem of image strong light detection, improve the effectiveness of subsequent image processing.
[0003] Through the above analysis, the problems and defects existing in the existing technology are: the existing technology cannot distinguish between strong light and non-strong light images, and the results of visual task processing on strong light images are often unreliable
[0004] The difficulty in solving the above problems and defects is: to select an intelligent image processing algorithm to save the computational cost and time cost of processing while ensuring the accuracy rate of strong light detection in the image.
[0005] The significance of solving the above problems and defects is: detecting strong light regions in images using traditional image processing techniques often requires traversing the gray values of each pixel in the image to complete the statistics of the overall image gray values, resulting in an increase in computational complexity. Traditional methods have poor adaptability to images in different scenarios. Therefore, it is necessary to adopt intelligent image processing algorithms to improve the adaptability and robustness of strong light detection methods in images. Summary of the Invention
[0006] Aiming at the problems existing in the existing technology, the present invention provides a method, system, medium, device and terminal for detecting strong light regions in images.
[0007] The present invention is implemented as follows. For a method for detecting strong light regions in an image, the method for detecting strong light regions in the image includes:
[0008] After preprocessing the image obtained by the camera to complete the normalization of pixel gray values, the image is block-processed, the gray value features of the image are calculated, and the PCA method is used to reduce the dimension of the image features; the image features are input into the image classifier model to determine the types of strong light and non-strong light in the image; for the images classified as strong light type, the position and size of the strong light area in the image are determined by using the gray feature information of the image blocks, and the detection and positioning of the strong light area in the image are completed.
[0009] Further, the method for detecting the strong light area in the image includes the following steps:
[0010] Step 1, the camera obtains the image data of the area to be detected;
[0011] Step 2, preprocess the obtained image to complete the normalization of the pixel gray values of the image. The normalization converts the gray values of the image to between 0 and 1, enabling the algorithm to adapt to more images with different gray levels.
[0012] Step 3, block-process the preprocessed image, calculate the gray value features of each image block, integrate them into the feature data of the entire image, and use the PCA method to reduce the dimension of the image features. After the dimension reduction process, the scale of the image feature data is greatly reduced, improving the calculation efficiency of the method.
[0013] Step 4, input the image feature values into the trained image classifier to complete the determination of the types of strong light and non-strong light in the image.
[0014] Step 5, for the images classified as strong light type, use the gray value feature information of the image blocks calculated after image block division to locate the strong light area in the image and indicate the position of the strong light area in the image.
[0015] Step 6, according to the detection results of the image type and the positioning results of the strong light area, perform the connected component detection of the strong light area in the image to determine the size of the strong light area and display relevant information on the image.
[0016] Further, the image in Step 1 includes images obtained by optoelectronic detection systems including visible light, infrared, and ultraviolet.
[0017] Further, the process of image block division and image feature calculation in Step 3 includes:
[0018] For the preprocessed image, perform block division, and evenly divide the image I with size [n, m] into M [k, k] image blocks. is an integer, and the divided image blocks are marked as I j (x, y), j = 1, 2,..., M, and calculate the following four image gray feature values for each image block, including:
[0019] The maximum value of the pixel gray value of the image block: f j1 =[I j (x, y)] max ;
[0020] The average value of the pixel gray value of the image block:
[0021] The proportion of pixels with saturated gray values in the image block:
[0022]
[0023] The proportion of pixels with gray values greater than 70% of the saturation value in the image block:
[0024]
[0025] Combined to form the gray feature vector F of each image block j ={f j1 , f j2 , f j3 , f j4}, j = 1, 2,..., M.
[0026] Furthermore, after completing the feature calculation of the image block, the gray feature vectors of each image block are integrated to form the feature vector of the entire image: F = {F1, F2,..., F j}, j = 1, 2,..., M; The principal component analysis method of PCA is used to perform dimensionality reduction processing on the feature vector and perform principal component analysis.
[0027] Furthermore, the training process of the image classifier in step four includes:
[0028] Perform pixel gray value normalization processing on the collected image samples, divide the image samples into training samples and test samples, and perform feature extraction after dividing the training sample set images into blocks;
[0029] Use the optimized multiple groups of training sample features as the input of the image classifier, train the classifier to obtain the corresponding image classifier, and use the test samples to test the trained image classifier to obtain the recognition rate of the classifier for strong light images.
[0030] Another object of the present invention is to provide a strong light area detection system in an image applying the strong light area detection method in the image, and the strong light area detection system in the image includes:
[0031] An image data acquisition module for the camera to acquire image data of the area to be detected;
[0032] An image preprocessing module, which is used to preprocess the acquired image and complete the normalization of the pixel gray values of the image;
[0033] An image block processing module, which is used to perform block processing on the preprocessed image, calculate the gray value features of each image block, integrate them into the feature data of the entire image, and perform dimensionality reduction processing on the image features using the PCA method;
[0034] An image type judgment module, which is used to input the image feature values into a trained image classifier to complete the determination of the strong light and non-strong light types of the image;
[0035] An image strong light area positioning module, which is used for the image classified as the strong light type, and uses the gray value feature information of the image blocks calculated after image block division to locate the strong light area of the image;
[0036] A connected component detection module, which is used to perform connected component detection on the strong light area of the image according to the detection result of the image type and the positioning result of the strong light area, determine the size of the strong light area, and display relevant information on the image.
[0037] Another object of the present invention is to provide a computer device, the computer device includes a memory and a processor, the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the following steps:
[0038] After preprocessing the image acquired by the camera to complete the normalization of the pixel gray values, perform block processing on the image, calculate the image gray value features, and perform dimensionality reduction processing on the image features using the PCA method; input the image features into the image classifier model to perform the determination of the strong light and non-strong light types of the image; for the image classified as the strong light type, use the gray feature information of the image blocks to determine the position and size of the strong light area of the image, and complete the detection and positioning of the strong light area in the image.
[0039] Another object of the present invention is to provide a computer-readable storage medium, storing a computer program, and when the computer program is executed by a processor, the processor executes the following steps:
[0040] After preprocessing the image acquired by the camera to complete the normalization of the pixel gray values, perform block processing on the image, calculate the image gray value features, and perform dimensionality reduction processing on the image features using the PCA method; input the image features into the image classifier model to perform the determination of the strong light and non-strong light types of the image; for the image classified as the strong light type, use the gray feature information of the image blocks to determine the position and size of the strong light area of the image, and complete the detection and positioning of the strong light area in the image.
[0041] Another object of the present invention is to provide an information data processing terminal for implementing the strong light area detection system in the image described above.
[0042] Combining all the above technical solutions, the advantages and positive effects of the present invention are as follows: The method for detecting strong light areas in an image provided by the present invention uses a machine learning image classification method to determine whether an image collected by a camera is a strong light or non-strong light type, and for an image classified as a strong light type, the gray-scale features of the image are used to locate the strong light area of the image.
[0043] Compared with the existing technologies, the present invention combines a machine learning image classification algorithm with a traditional image processing method to complete the detection of strong light images and the location of strong light areas in the images, and the accuracy and real-time performance of this method also meet the usage requirements in the actual environment.
[0044] Compared with the existing technologies, the beneficial effects of the present invention are as follows:
[0045] 1. The present invention proposes a method for detecting strong light areas in an image, which combines a machine learning image classification algorithm with a traditional image processing method, and while improving the detection efficiency and accuracy of strong light images, the location of strong light areas in the images is completed.
[0046] 2. The present invention uses an image block processing method to calculate image features, which reduces the computational amount of the model while improving the accuracy of locating strong light areas in the image.
[0047] 3. The present invention uses the PCA principal component analysis method to optimize the image features, simplifies the operation process of the model, and improves the calculation speed of the model.
[0048] 4. The present invention provides an important technical means for detecting strong light areas in an image. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following will briefly introduce the drawings required to be used in the embodiments of the present invention. Obviously, the following described drawings are only some embodiments of the present invention, and those of ordinary skill in the art can also obtain other drawings based on these drawings without creative efforts.
[0050] Figure 1 It is a flowchart of the method for detecting strong light areas in an image provided by an embodiment of the present invention.
[0051] Figure 2 It is a schematic diagram of the principle of the method for detecting strong light areas in an image provided by an embodiment of the present invention.
[0052] Figure 3It is a block diagram of a strong light area detection system in an image provided by an embodiment of the present invention;
[0053] In the figure: 1. Image data acquisition module; 2. Image preprocessing module; 3. Image block processing module; 4. Image type judgment module; 5. Image strong light area positioning module; 6. Connected domain detection module.
[0054] Figure 4 It is a schematic diagram of the training process of an image classifier model provided by an embodiment of the present invention.
[0055] Figure 5 It is a schematic diagram of image segmentation provided by an embodiment of the present invention.
[0056] Figure 6 It is a schematic diagram of the positioning result of strong light image blocks in an image provided by an embodiment of the present invention.
[0057] Figure 7 It is a schematic diagram of the marking result of strong light areas in an image provided by an embodiment of the present invention. Detailed implementation manners
[0058] In order to make the objectives, technical solutions and advantages of the present invention clearer and more understandable, the present invention will be further described in detail below in conjunction with embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0059] In view of the problems existing in the prior art, the present invention provides a method, system, medium, device and terminal for detecting strong light areas in images, and the present invention will be described in detail below with reference to the accompanying drawings.
[0060] As Figure 1 shown, the method for detecting strong light areas in an image provided by an embodiment of the present invention includes the following steps:
[0061] S101, a camera acquires image data of an area to be detected;
[0062] S102, preprocess the acquired image to complete the normalization of the pixel gray values of the image;
[0063] S103, perform block processing on the preprocessed image, calculate the gray value features of each image block, integrate them into the feature data of the entire image, and use the PCA method to perform dimensionality reduction processing on the image features;
[0064] S104, input the image feature values into a trained image classifier to complete the determination of the strong light and non-strong light types of the image;
[0065] S105, for the images classified as strong light types, use the image block gray value feature information calculated after image segmentation to locate the strong light areas of the image;
[0066] S106. Based on the detection result of the image type and the positioning result of the strong light area, perform the connected component detection of the strong light area in the image, determine the size of the strong light area, and display relevant information on the image.
[0067] The schematic diagram of the method for detecting the strong light area in the image provided by the embodiment of the present invention is as Figure 2 shown.
[0068] As Figure 3 shown, the system for detecting the strong light area in the image provided by the embodiment of the present invention includes:
[0069] An image data acquisition module 1, configured to acquire image data of a to-be-detected area by a camera;
[0070] An image preprocessing module 2, configured to preprocess the acquired image and complete the normalization of the gray value of the image pixels;
[0071] An image block processing module 3, configured to perform block processing on the preprocessed image, calculate the gray value feature of each image block, integrate it into the feature data of the entire image, and perform dimensionality reduction processing on the image features by using the PCA method;
[0072] An image type determination module 4, configured to input the image feature value into a trained image classifier to complete the determination of the strong light and non-strong light types of the image;
[0073] An image strong light area positioning module 5, configured to, for the image classified as the strong light type, use the gray value feature information of the image block calculated after image block division to perform the positioning of the strong light area in the image;
[0074] A connected component detection module 6, configured to perform connected component detection on the strong light area in the image according to the detection result of the image type and the positioning result of the strong light area, determine the size of the strong light area, and display relevant information on the image.
[0075] The technical solution of the present invention will be further described below in conjunction with specific embodiments.
[0076] Embodiment 1
[0077] The technical problem to be solved by the present invention is to provide a method for detecting the strong light area in an image, which uses a machine learning image classification method to determine the strong light and non-strong light types of the image collected by the camera, and locates the strong light area in the image by using the image gray feature for the image classified as the strong light type.
[0078] To solve the above technical problem, the technical solution provided by the present invention is:
[0079] A method for detecting the strong light area in an image, the specific steps are as follows:
[0080] (1) The camera acquires the image data of the area to be detected.
[0081] (2) Preprocess the acquired image to complete the normalization of the pixel gray values of the image.
[0082] (3) Perform block processing on the preprocessed image, calculate the gray value features of each image block, integrate them into the feature data of the entire image, and use the PCA method to perform dimensionality reduction processing on the image features.
[0083] (4) Input the image feature values into the trained image classifier to complete the determination of the strong light and non-strong light types of the image.
[0084] (5) For the images classified as strong light type, use the gray value feature information of the image blocks calculated after image block division to locate the strong light areas of the image.
[0085] (6) According to the detection results of the image type and the positioning results of the strong light areas, perform connected component detection on the strong light areas of the image, determine the size of the strong light areas, and display relevant information on the image.
[0086] The method of the present invention is applicable to images acquired by optoelectronic detection systems such as visible light, infrared, and ultraviolet.
[0087] The image block division and image feature calculation process in step (3) of the present invention includes:
[0088] Perform block processing on the preprocessed image, and evenly divide the image I with size [n, m] into M [k, k] image blocks. where is an integer, and the divided image blocks are marked as I j (x, y), j = 1, 2,..., M, and perform the following four calculations of image gray feature values for each image block, including:
[0089] The maximum value of the pixel gray values of the image block: f j1 = [I j (x, y)] max
[0090] The mean value of the pixel gray values of the image block:
[0091] The proportion of pixels with saturated gray values in the image block:
[0092]
[0093] The proportion of pixels with gray values greater than 70% of the saturation value in the image block:
[0094]
[0095] Combine to form the grayscale feature vector F of each image block j ={f j1 , f j2 , f j3 , f j4} where j = 1, 2, …, M.
[0096] After completing the feature calculation of the image blocks, integrate the grayscale feature vectors of each image block to form the feature vector of the entire image: F = {F1, F2, ..., F j}, where j = 1, 2, …, M, and then use the PCA principal component analysis method to perform dimensionality reduction processing on the feature vector and conduct principal component analysis.
[0097] The training process of the image classifier in step 4 of the present invention is as follows:
[0098] Perform pixel grayscale value normalization processing on the collected image samples, divide the image samples into training samples and test samples, perform feature extraction after dividing the training sample set images into blocks, use the optimized multiple groups of training sample features as the input of the image classifier to train the classifier, obtain the corresponding image classifier, and use the test samples to test the trained image classifier to obtain the recognition rate of the classifier for strong light images.
[0099] In addition to the SVM support vector machine classifier model, other supervised learning image classification algorithms can also be used to train the classification recognition model to achieve image classification in this step.
[0100] Compared with the existing technologies, the beneficial effects of the present invention are:
[0101] 1. The present invention proposes a method for detecting strong light regions in images, which combines machine learning image classification algorithms with traditional image processing methods, and while improving the detection efficiency and accuracy of strong light images, completes the positioning of strong light regions in images.
[0102] 2. The present invention uses the method of dividing images into blocks to calculate image features, which reduces the computational amount of the model while improving the accuracy of strong light region positioning in images.
[0103] 3. The present invention uses the PCA principal component analysis method to optimize image features, simplifies the operation process of the model, and improves the calculation speed of the model.
[0104] 4. The present invention provides an important technical means for detecting strong light regions in images.
[0105] Embodiment 2
[0106] The present invention provides a method for detecting strong light regions in images, and the overall algorithm principle process is asFigure 2 As shown, the method includes:
[0107] 1. Obtain the image captured by the camera, with the image size being 1024*1024 and the range of the pixel gray values of the image being [0, 4095];
[0108] 2. Preprocess the input image to complete the normalization of the gray values of the image. The main steps include:
[0109] ① Image preprocessing: Normalize the gray values of the obtained image to the range between [0, 1]. The main steps include the following:
[0110] Detect the number of bits n of the pixel gray value, and perform the normalization operation on the overall gray value of the image:
[0111]
[0112] where I r (x, y) is the original image pixel gray value, and I(x, y) is the normalized image gray value;
[0113] 3. Perform block processing on the preprocessed image, calculate the pixel gray value features of each image block, integrate them into the feature data of the entire image, and perform dimensionality reduction processing on the image features using the PCA method. The main steps include the following:
[0114] ① As Figure 5 shown, perform block processing on the image. Divide the image with a size of 1024*1024 into 64 image blocks of 128*128 evenly according to rows and columns, marked as I n (x, y), where n = 1, 2,..., 64. Calculate the following four image gray feature values for each image block, including:
[0115] The maximum value of the pixel gray value of the image block: f n1 =[I n (x, y)] max
[0116] The mean value of the pixel gray value of the image block:
[0117] The proportion of pixels with saturated gray values in the image block:
[0118]
[0119] The proportion of pixels with gray values greater than 70% of the saturation value in the image block:
[0120]
[0121] Combine to form the grayscale feature vector F of each image block n ={f n1 , f n2 , f n3 , f n4}, n = 1, 2, …, 64.
[0122] ② Integrate the grayscale feature vectors of each image block to form the feature vector of the entire image:
[0123] F = {F1, F2, ..., F n}, n = 1, 2, …, 64.
[0124] ③ Use the PCA method to perform dimensionality reduction on the feature vector, conduct principal component analysis, and finally determine that the number of principal components is 27.
[0125] 4. Input the image feature values into the trained image classifier to determine whether the image is of strong light or non-strong light type. The training process of the image classifier is as Figure 4 shown.
[0126] 5. For the images classified as strong light type, use the grayscale value feature information calculated after image segmentation to locate the strong light area of the image. The main steps include:
[0127] ① For the feature vector F n ={f n1 , f n2 , f n3 , f n4} of each image block, extract the proportion f n2 of the pixels with saturated grayscale values and the proportion J n4 of the pixels with grayscale values greater than 70% of the saturation value in each image block, and calculate the eigenvalue h n for strong light area determination according to the following formula:
[0128] h n = f n2 + f n4
[0129] Obtain the strong light area determination feature vector H = {h1, h2, ..., h n}, n = 64.
[0130] ② Sort the strong light area determination eigenvalues in descending order to obtain the sorted feature set (h i , x i ), where i = 1, 2, ..., 64, h i is the sorted eigenvalue, and x i is the original serial number corresponding to the eigenvalue.
[0131] ③For the sorted feature set (h i , x i ), count the number of elements in the feature set where h i is greater than the threshold A and mark it as m. Set the threshold A to 0.5. Output the first m elements of the feature set (h i , x i ), and output the sequence numbers x j of the image blocks corresponding to the strong light regions, where j = 1, 2,..., m, so as to determine the sequence numbers of the image blocks where the strong light regions are located in the image as shown in Figure 6 .
[0132] 6. According to the detection result of the image type and the positioning result of the strong light region, perform the connected component detection of the strong light region in the image to determine the size of the strong light region, and display relevant information on the image. The main steps are as follows:
[0133] ①For the images classified as the strong light type, perform the connected component detection of the strong light region to determine the area and size of the strong light region in the image, as shown in Figure 7 , and complete the marking of the strong light region in the image.
[0134] The image classifier training process in step 4 includes the following steps:
[0135] 1. Preprocess the sample image set and perform the normalization processing of the gray values of the sample images;
[0136] 2. Construct the training set and test set of the classifier algorithm. The main steps include:
[0137] ①Identify the sample image set, classify the strong light and non-strong light image sets (860 strong light image samples and 2063 non-strong light image samples). Randomly select 500 images from both the strong light and non-strong light samples to form the training set (1000 images), and the remaining part is used as the test set (1923 images).
[0138] 3. Process the training set images in blocks and extract image features. Use the PCA method to perform dimensionality reduction processing on the image features, analyze the principal components, and finally determine that the number of principal components is 27. The cumulative variance contribution rate is 95%. The main steps include:
[0139] For the sample image feature set D = {x1, x2,..., x m}, m = 256, perform principal component analysis on it. First, perform centering processing on it, and then assume that the coordinate system after projection transformation is {ω1, ω2,..., ω m}, where ω i , i = 1, 2,..., d is a set of standard orthogonal vector bases that satisfy
[0140] Then the sample x i has a projection coordinate z in the low-dimensional coordinate system i =(z i1 , z i2 ,..., z id ), where the reconstructed sample of x that can be obtained based on z i i
[0141]
[0142] The original sample x i and the reconstructed sample obtained based on the projection The distance between them can be expressed as:
[0143]
[0144]
[0145] In the formula, const is a constant, W = (ω1, ω2,..., ω d ), according to the principle of nearest reconstruction, minimizing the above formula. Since ω j is an orthonormal vector basis, is the covariance matrix, and the optimization objective of principal component analysis in the following formula can be obtained:
[0146]
[0147] s.t. W T W = I
[0148] where XX T is the covariance matrix of the sample x i , and I represents the identity matrix. After transforming the above formula using the Lagrange multiplier method, the following formula can be obtained:
[0149] XX T ω1 = λ i ω i
[0150] Finally, perform eigenvalue decomposition on the covariance matrix XX T , then sort the obtained eigenvalues in ascending order, and finally take the eigenvectors corresponding to the first n largest eigenvalues containing 95% of the information to form a new eigenvector matrix W opt= (ω1, ω2,..., ω n ) is the optimal solution of principal component analysis.
[0151] 4. Input the features of the training image set into the SVM classifier for training, and obtain the SVM classifier model after parameter tuning and optimization.
[0152] 5. Use the test samples to test the trained SVM image classifier, and obtain the recognition rate of the classifier for strong light images.
[0153] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in whole or in part in the form of a computer program product, the computer program product includes one or more computer instructions. When the computer program instructions are loaded or executed on a computer, the processes or functions described in the embodiments of the present invention are generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center in a wired manner (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wirelessly (such as infrared, wireless, microwave, etc.). The computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more integrated available media. The available medium may be a magnetic medium (such as a floppy disk, hard disk, magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid state disk (SSD)).
[0154] As described above, the above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any modification, equivalent replacement, and improvement made by those skilled in the art within the technical scope disclosed by the present invention, as long as they are made within the spirit and principle of the present invention, should be covered by the protection scope of the present invention.
Claims
1. A method for detecting strong light regions in an image, characterized in that, The method for detecting strong light regions in the image includes the following steps: Step 1: The camera acquires image data of the area to be detected; Step 2: Preprocess the acquired image to complete the normalization of the pixel gray values of the image; Step 3: Perform block processing on the preprocessed image, calculate the gray value features of each image block, integrate them into the feature data of the entire image, and use the PCA method to perform dimensionality reduction processing on the image features; Step 4: Input the image feature values into the trained image classifier to complete the determination of the types of strong light and non-strong light in the image; Step 5: For the images classified as strong light type, use the gray value feature information of the image blocks calculated after image block division to locate the strong light regions in the image; Step 6: According to the detection result of the image type and the location result of the strong light region, perform connected component detection on the strong light region in the image, determine the size of the strong light region, and display relevant information on the image; The image block division and image feature calculation process in Step 3 includes: The preprocessed image is segmented. The image I with size [n, m] is evenly divided into M image patches of [k, k]. where k is an integer, and the segmented image patches are labeled as I j (x, y), j = 1, 2, …, M. The following four grayscale feature values of each image patch are calculated, including: Maximum value of pixel gray value of image block: f j1 = [I j (x, y)] max ; Mean of pixel gray values of the image block: ; The proportion of pixels with saturated gray values in the image block: ; The proportion of pixels with gray values greater than 70% of the saturation value in the image block: ; Combine to form the grayscale feature vector F of each image block j ={f j1 , f j2 , f j3 , f j4}, j = 1, 2, …, M.
2. The method for detecting a strong light area in an image according to claim 1, wherein The image in Step 1 includes images obtained by optoelectronic detection systems including visible light, infrared, and ultraviolet; 3. The method for detecting a high-light area in an image according to claim 1, wherein After the feature calculation of the image patches is completed, the gray feature vectors of each image patch are integrated to form the feature vector of the entire image: F = {F1, F2,..., F j}, j = 1, 2,..., M; The principal component analysis (PCA) method is used to reduce the dimension of the feature vector and perform principal component analysis.
4. The method for detecting a strong light area in an image according to claim 1, wherein The training process of the image classifier in Step 4 includes: Perform pixel gray value normalization processing on the collected image samples, divide the image samples into training samples and test samples, perform feature extraction after block processing the training sample set images; Use the optimized multiple groups of training sample features as the input of the image classifier, train the classifier to obtain the corresponding image classifier, and use the test samples to test the trained image classifier to obtain the recognition rate of the classifier for strong light images; 5. An image highlight area detection system for implementing the image highlight area detection method according to any one of claims 1 to 4, characterized in that The system for detecting strong light regions in the image includes: An image data acquisition module for the camera to acquire image data of the area to be detected; An image preprocessing module for preprocessing the acquired image to complete the normalization of the pixel gray values of the image; An image block processing module for performing block processing on the preprocessed image, calculating the gray value features of each image block, integrating them into the feature data of the entire image, and using the PCA method to perform dimensionality reduction processing on the image features; An image type judgment module for inputting the image feature values into the trained image classifier to complete the determination of the types of strong light and non-strong light in the image; An image strong light region location module for, for the images classified as strong light type, using the gray value feature information of the image blocks calculated after image block division to locate the strong light regions in the image; A connected component detection module for performing connected component detection on the strong light region in the image according to the detection result of the image type and the location result of the strong light region, determining the size of the strong light region, and displaying relevant information on the image; 6. A computer device, characterized in that, The computer device includes a memory and a processor. When the computer program stored in the memory is executed by the processor, the processor executes the method for detecting strong light regions in the image according to any one of claims 1 to 4.
7. A computer-readable storage medium stores a computer program. When the computer program is executed by a processor, the processor is caused to execute the method for detecting a highlight area in the image according to any one of claims 1 to 4.
8. An information data processing terminal, characterized in that, The information data processing terminal is used to implement the system for detecting a highlight area in the image according to claim 5.
Citation Information
Patent Citations
Method for detecting existence of salient objects in optical images
CN104680545A
Target detection method and system
CN107545270A