A computer vision-based target detection method and system

By employing preprocessing, detail enhancement, clustering and segmentation, and background noise reduction, the accuracy of computer vision target detection is improved, the problems of ambient lighting and noise are solved, and more efficient target detection is achieved.

CN120894542BActive Publication Date: 2026-01-16南昌理工学院
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511416754.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-09-30
Publication Date
2026-01-16
Estimated Expiration
2045-09-30

AI Technical Summary

Technical Problem

Existing computer vision target detection technologies are susceptible to interference from ambient lighting and noise in complex scenes, leading to decreased detection accuracy and a higher risk of misidentification.

Method used

By performing preprocessing, detail enhancement and environmental compensation, clustering and segmentation, correction processing and background denoising and suppression, the image quality is improved and the target features are highlighted. The template is used to train the model for target detection.

Benefits of technology

It effectively solves the problems of ambient light interference and noise, improves the accuracy of target detection, and avoids misidentification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120894542B_ABST
    Figure CN120894542B_ABST
Patent Text Reader

Abstract

The application provides a target detection method and system based on computer vision, which comprises the following steps: preprocessing a target image to be detected to obtain a pretreated image; performing detail enhancement and environment compensation on the pretreated image to obtain an enhanced image; performing clustering segmentation on the enhanced image to obtain an environment image and a foreground image; performing first correction processing on the environment image and second correction processing on the foreground image to obtain a first corrected image and a second corrected image; combining the first corrected image and the second corrected image to obtain a final corrected image; performing denoising and background suppression on the final corrected image to obtain a denoised image; obtaining a template training image; training a preset detection model through the template training image; inputting the denoised image into the trained preset detection model to perform target detection and output a target detection result. The application can improve the accuracy of target detection and avoid misrecognition.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the technical field of target detection, and particularly relates to a target detection method and system based on computer vision. BACKGROUND

[0002] Computer vision is a science of how to make a machine see, and more further, refers to using a camera and a computer to replace human eyes to identify, track and measure a target and the like machine vision, and further performs image processing, so that the computer processing becomes an image more suitable for human eye observation or transmission to an instrument detection.

[0003] For the field of target detection, computer vision can be used for detection, and generally, a target image is acquired, a series of processing and target positioning are performed on the image, and then a position of the target is output, but in an actual situation, due to influences of a shooting scene, weather factors and a shooting device, various noises exist in the image and the target is not obvious, which further affects accuracy of target detection and easily causes erroneous recognition. SUMMARY

[0004] In order to solve the above technical problems, the application provides a target detection method and system based on computer vision, which are used to solve technical problems in the prior art.

[0005] In one aspect, the application provides the following technical scheme, a target detection method based on computer vision, comprising:

[0006] acquiring a target image to be detected, pre-processing the target image to be detected to obtain a pre-processed image;

[0007] performing detail enhancement and environment compensation on the pre-processed image to obtain an enhanced image;

[0008] performing clustering segmentation on the enhanced image to obtain an environment image and a foreground image, performing first correction processing on the environment image and second correction processing on the foreground image to obtain a first corrected image and a second corrected image, and combining the first corrected image and the second corrected image to obtain a final corrected image;

[0009] performing denoising and background suppression on the final corrected image to obtain a denoised image;

[0010] acquiring a template training image, training a preset detection model through the template training image, inputting the denoised image into the trained preset detection model to perform target detection, and outputting a target detection result.

[0011] Compared with the prior art, the present application has the beneficial effects that: the present application first acquires a to-be-detected target image, pre-processes the to-be-detected target image to obtain a pre-processed image, then performs detail enhancement and environment compensation on the pre-processed image to obtain an enhanced image, then performs clustering segmentation on the enhanced image to obtain an environment image and a foreground image, performs first correction processing on the environment image and second correction processing on the foreground image to obtain a first corrected image and a second corrected image, combines the first corrected image and the second corrected image to obtain a final corrected image, then performs denoising and background suppression on the final corrected image to obtain a denoised image, then acquires a template training image, trains a preset detection model through the template training image, inputs the denoised image into the trained preset detection model for target detection to output a target detection result, the present application first performs detail enhancement and environment compensation, which can effectively solve the problem of over-bright or over-dark image caused by environmental light interference, then performs correction on the image, which can highlight the foreground information and the detail information in the image, then performs denoising and background suppression on the image, which can effectively improve the noise points in the image and suppress the background information, highlight the features and the detail information of the target, and thus improve the accuracy of subsequent target detection and avoid misrecognition.

[0012] Preferably, the step of performing detail enhancement and environment compensation on the pre-processed image to obtain an enhanced image comprises:

[0013] extracting a V-channel image of the pre-processed image , calculating a first enhancement factor based on the V-channel image :

[0014] ;

[0015] calculating a second enhancement factor based on the first enhancement factor :

[0016] ;

[0017] wherein, is the prior of the V-channel image, represents the pixel mean value of the V-channel image;

[0018] calculating a to-be-determined enhanced image based on the first enhancement factor , the second enhancement factor :

[0019] ;

[0020] based on the to-be-determined enhanced image​​​ determining a final enhanced image :

[0021] ;

[0022] wherein, represents a noise estimate of the V channel image;

[0023] replacing the V channel image of the pre-processed image with the final enhanced image to obtain an enhanced image.

[0024] Preferably, the step of clustering segmenting the enhanced image to obtain an ambient image and a foreground image, first correcting the ambient image, second correcting the foreground image to obtain a first corrected image and a second corrected image, and combining the first corrected image and the second corrected image to obtain a final corrected image comprises:

[0025] converting the enhanced image from RGB space to LAB space to obtain a converted image;

[0026] converting pixels in the converted image into a two-dimensional data and iteratively clustering the two-dimensional data using a mean clustering algorithm to obtain an ambient image and a foreground image;

[0027] calculating an ambient value based on the ambient image :

[0028] ;

[0029] wherein, represents a pixel point in the enhanced image , and is a mask of the ambient image, represents a number of pixels in the ambient image;

[0030] determining a first corrected image and a second corrected image based on the ambient value , and combining the first corrected image and the second corrected image to obtain a final corrected image.

[0031] Preferably, the step of determining a first corrected image and a second corrected image based on the ambient value , and combining the first corrected image and the second corrected image to obtain a final corrected image comprises:

[0032] calculating a first transmittance based on the ambient value :

[0033] ;​

[0034] wherein, represents a pixel point in the R or G or B channel image of the enhanced image, represents a pixel point in the R or G or B channel image of the ideal image, represents a region corresponding to the environment image;

[0035] based on the environment value calculating a second transmittance :

[0036] ;

[0037] wherein, represents an adjustment factor, represents a region corresponding to the foreground image;

[0038] based on the first transmittance , the second transmittance determining a first corrected image , a second corrected image :

[0039] ; ;

[0040] wherein, represents a transmittance threshold value;

[0041] combining the first corrected image and the second corrected image to obtain a final corrected image.

[0042] Preferably, the step of denoising and background suppressing the final corrected image to obtain a denoised image comprises:

[0043] defining two structuring elements of the same shape but different sizes , based on the structuring element performing morphological filtering on the final corrected image to obtain a filtered image :

[0044] ;

[0045] wherein, is a closing operation, represents a structuring element related to the structuring element , represents a structuring element whose size is between the structuring element and the structuring element , and whose shape is the same as the structuring element ;

[0046] performing wavelet transform on the filtered image to obtain a low-frequency component image and a high-frequency component image, the high-frequency component image including a horizontal component image, a vertical component image and a diagonal component image;

[0047] setting a sliding window with a size of in the low-frequency component image, calculating a window intensity based on the sliding window:

[0048]

[0049] wherein, represents a gray value of a center pixel point of the sliding window, represents a gray value at in the sliding window;

[0050] dividing the sliding window into four sub-regions with the same size, determining a gradient of a pixel point in each sub-region relative to the center pixel point of the sliding window and storing the gradient in a gradient set corresponding to each sub-region, and eliminating a gradient in the gradient set that does not satisfy a preset condition to obtain an eliminated gradient set;

[0051] determining an updated low-frequency image based on the eliminated gradient set, and determining an intermediate denoising image based on the updated low-frequency image, the horizontal component image, the vertical component image and the diagonal component image;

[0052] performing two-dimensional discrete Fourier transform on the intermediate denoising image to obtain an amplitude spectrum and a phase spectrum;

[0053] determining a denoising image based on the amplitude spectrum and the phase spectrum.

[0054] Preferably, the step of determining the updated low-frequency image based on the eliminated gradient set, and determining the intermediate denoising image based on the updated low-frequency image, the horizontal component image, the vertical component image and the diagonal component image includes:

[0055] calculating a gradient amplitude mean value based on the eliminated gradient set:

[0056]

[0057] wherein, represents a number of gradients in the eliminated gradient set corresponding to the th sub-region, represents a gradient in the eliminated gradient set corresponding to the th sub-region;

[0058] calculating a gradient image based on the gradient amplitude mean value :​​

[0059] ;

[0060] wherein, is a judgment threshold value;

[0061] based on the gradient map , the window intensity determining an updated low-frequency image :

[0062] ;

[0063] determining a pixel threshold value , the horizontal component image, the vertical component image, the diagonal component image greater than the pixel threshold value of the pixel point is eliminated, to obtain the update horizontal image, update vertical image, update diagonal image:

[0064] ;

[0065] wherein, represents the mean value of the pixel of the horizontal component image, the vertical component image or the diagonal component image, represents the pixel variance of the horizontal component image, the vertical component image or the diagonal component image, is a control coefficient;

[0066] The updated horizontal image, the updated vertical image, the updated diagonal image are superimposed to obtain an updated high-frequency image, and the updated high-frequency image and the updated low-frequency image are fused to obtain an intermediate denoising image.

[0067] Preferably, the step of determining the denoising image based on the amplitude spectrum and the phase spectrum comprises:

[0068] based on the amplitude spectrum determining the frequency spectrum residual :

[0069] ;

[0070] wherein, represents the mean filter kernel;

[0071] based on the frequency spectrum residual and the phase spectrum reconstructs the frequency domain signal and inversely two-dimensional discrete Fourier transform to the space domain to obtain a transform image;

[0072] Gaussian filtering the transform image on multiple scales to obtain a plurality of scale Gaussian blurred images ;

[0073] At scale a target sliding window of size is set in the blurred image , based on the target sliding window, a number of intermediate scale images are calculated:

[0074]

[0075] wherein denotes the median of the pixels of the target sliding window, is a guard zero constant, denotes the pixel values within the central region of the target sliding window;

[0076] the individual intermediate scale images are fused by taking the maximum value pixel-wise to obtain a multi-scale image ;

[0077] a local window is set in the multi-scale image, based on the local window a target saliency map is calculated:

[0078]

[0079] wherein denotes the variance of the pixel values within the local window, denotes the global variance of the multi-scale image;

[0080] based on the target saliency map , the multi-scale image a denoised image is determined:

[0081]

[0082] wherein denotes a hyperparameter.

[0083] In a second aspect, the present application provides the following technical solution, a target detection system based on computer vision, the system comprises:

[0084] a preprocessing module, configured to acquire a target image to be detected, and perform preprocessing on the target image to be detected to obtain a preprocessed image;

[0085] an enhancement module, configured to perform detail enhancement and environment compensation on the preprocessed image to obtain an enhanced image;

[0086] ​​​The correction module is configured to perform cluster segmentation on the enhanced image to obtain an environment image and a foreground image, perform first correction processing on the environment image, perform second correction processing on the foreground image to obtain a first corrected image and a second corrected image, and combine the first corrected image and the second corrected image to obtain a final corrected image.

[0087] The denoising module is configured to perform denoising and background suppression on the final corrected image to obtain a denoised image.

[0088] The detection module is configured to obtain a template training image, train a preset detection model by using the template training image, input the denoised image into the trained preset detection model to perform target detection, and output a target detection result.

[0089] In a third aspect, the present application provides a computer, which comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the computer vision-based target detection method as described above when executing the computer program.

[0090] In a fourth aspect, the present application provides a storage medium, which stores a computer program, and the computer program is executable on a processor to implement the computer vision-based target detection method as described above. BRIEF DESCRIPTION OF DRAWINGS

[0091] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without any creative effort on the basis of these drawings.

[0092] Figure 1 A flowchart of the computer vision-based target detection method provided for the first embodiment of the present application;

[0093] Figure 2 A structural block diagram of the computer vision-based target detection system provided for the second embodiment of the present application;

[0094] Figure 3 A hardware structural schematic diagram of the computer provided for another embodiment of the present application.

[0095] The embodiments of the present application will be further described below with reference to the drawings. DETAILED DESCRIPTION

[0096] Embodiments of the present application are described below in detail with reference to the accompanying drawings, wherein like or similar elements are denoted by like or similar reference symbols throughout the drawings. The embodiments described below are exemplary and are intended to explain the embodiments of the present application, and are not to be understood as limiting the present application.

[0097] Embodiment One

[0098] In the embodiment one of the present application, as shown in the figure, a target detection method based on computer vision comprises: Figure 1

[0099] S1, obtaining a target image to be detected, and pre-processing the target image to be detected to obtain a pre-processed image;

[0100] Wherein, the target image to be detected can be obtained by a monocular or binocular camera, and the target to be detected can be a person, a drone or other objects, etc., and the pre-processing process includes image cropping, rotation, translation transformation, etc. The above pre-processing process is a common means of image processing, and therefore will not be described here.

[0101] S2, performing detail enhancement and environment compensation on the pre-processed image to obtain an enhanced image;

[0102] Wherein, the step S2 comprises:

[0103] S21, extracting a V channel image of the pre-processed image , calculating a first enhancement factor based on the V channel image :

[0104] ;

[0105] Specifically, the purpose of the first enhancement factor here is to deal with the case of image overexposure.

[0106] S22, calculating a second enhancement factor based on the first enhancement factor :

[0107] ;

[0108] Wherein, is the prior of the V channel image, and the pixel mean of the V channel image is represented by

[0109] ​Wherein, for the prior of V channel image, the value of V channel of normal brightness image is generally between 200 and 255, so the V channel image is proportionally distributed to the range of 200 to 255 for normalization, and the prior of V channel image is obtained, and the second enhancement factor is used to balance the brightness of the whole image, avoid local over-brightness or over-darkness, enhance the intensity of dark area and reduce the intensity of bright area.

[0110] S23, calculating a pending enhancement image based on the first enhancement factor , the second enhancement factor ;

[0111] ;

[0112] Specifically, the purpose of calculating the pending enhancement image is to avoid underexposure.

[0113] S24, determining a final enhancement image based on the pending enhancement image ;

[0114] ;

[0115] In the formula, represents the noise estimation of the V channel image.

[0116] S25, replacing the V channel image of the preprocessed image with the final enhancement image to obtain an enhanced image.

[0117] S3, clustering and segmenting the enhanced image to obtain an environment image and a foreground image, performing first correction processing on the environment image and second correction processing on the foreground image to obtain a first corrected image and a second corrected image, and combining the first corrected image and the second corrected image to obtain a final corrected image.

[0118] Wherein, the step S3 comprises:

[0119] S31, converting the enhanced image from RGB space to LAB space to obtain a converted image.

[0120] S32, converting the pixels in the converted image into two-dimensional data and performing iterative clustering processing on the two-dimensional array using a mean clustering algorithm to obtain an environment image and a foreground image.

[0121] ​​Specifically, the mean clustering algorithm here is K-means clustering algorithm, for the converted image, when it is converted into a two-dimensional array, each row represents a pixel position, and there are three columns representing the channel values of L, A and B respectively.

[0122] S33, calculating an environment value based on the environment image :

[0123] ;

[0124] wherein, represents a pixel point in the enhanced image , and is a mask of the environment image, represents the number of pixels in the environment image.

[0125] S34, determining a first correction image and a second correction image based on the environment value , and combining the first correction image and the second correction image to obtain a final correction image;

[0126] wherein, the step S34 comprises:

[0127] S341, calculating a first transmittance based on the environment value :

[0128] ;

[0129] wherein, represents a pixel point in the R or G or B channel image of the enhanced image, represents a pixel point in the R or G or B channel image of the ideal image, represents a region corresponding to the environment image.

[0130] S342, calculating a second transmittance based on the environment value :

[0131] ;

[0132] wherein, represents an adjustment factor, represents a region corresponding to the foreground image.

[0133] S343, determining a first correction image and a second correction image based on the first transmittance and the second transmittance respectively: :

[0134] ;​​​ ;

[0135] In the formula, represents a transmittance threshold value;

[0136] Specifically, the transmittance threshold value is 0.1.

[0137] S347, combining the first corrected image and the second corrected image to obtain a final corrected image.

[0138] S4, denoising and background suppression are performed on the final corrected image to obtain a denoised image;

[0139] The step S4 includes:

[0140] S41, defining two structural elements of the same shape and different sizes Based on the structural elements , morphological filtering is performed on the final corrected image to obtain a filtered image :

[0141] ;

[0142] In the formula, is a closing operation, represents a structural element related to the structural element , represents a structural element with a size between the structural elements and the structural element , and the shape of the structural element is the same as that of the structural element ;

[0143] Specifically, the above structural elements are all flat structural elements.

[0144] S42, wavelet transform is performed on the filtered image to obtain a low-frequency component image and a high-frequency component image, and the high-frequency component image includes a horizontal component image, a vertical component image and a diagonal component image.

[0145] S43, a sliding window with a size of is set in the low-frequency component image, and a window intensity is calculated based on the sliding window:

[0146] ;

[0147] In the formula, represents the gray value of the center pixel point of the sliding window, represents the gray value at in the sliding window.

[0148] S44, divide the sliding window into four sub-regions of equal size, determine the gradient of each pixel in each sub-region relative to the center pixel of the sliding window and store it in the gradient set corresponding to each sub-region, and eliminate the gradients in the gradient set that do not meet the preset condition to obtain an eliminated gradient set;

[0149] Specifically, since the sliding window is a square window, the sliding window can be evenly divided into four sub-regions of equal size by diagonal lines, and when , it is considered that the preset condition is met, otherwise the preset condition is not met, where represents the gradient of the pixel in the i-th sub-region relative to the center pixel of the sliding window, . .

[0150] S45, determine an updated low-frequency image based on the eliminated gradient set, and determine an intermediate denoising image based on the updated low-frequency image, the horizontal component image, the vertical component image and the diagonal component image;

[0151] The step S45 includes:

[0152] S451, calculate the gradient amplitude mean value based on the eliminated gradient set:

[0153] ;

[0154] In the formula, represents the number of gradients in the eliminated gradient set corresponding to the i-th sub-region, represents the gradient in the eliminated gradient set corresponding to the i-th sub-region. S452, calculate a gradient map based on the gradient amplitude mean value

[0155] :

[0156] ;

[0157] In the formula, is a judgment threshold.

[0158] S453, determine an updated low-frequency image based on the gradient map and the window intensity :

[0159] ;

[0160] Specifically, the gradient map and the window intensity are multiplied element by element, and the updated low-frequency image is obtained.​​

[0161] S454, determining a pixel point threshold , removing pixel points greater than the pixel point threshold in the horizontal component image, the vertical component image, and the diagonal component image to obtain an updated horizontal image, an updated vertical image, and an updated diagonal image:

[0162] ;

[0163] In the formula, , the pixel mean of the horizontal component image, the vertical component image, or the diagonal component image, , the pixel variance of the horizontal component image, the vertical component image, or the diagonal component image, is a control coefficient;

[0164] Specifically, the control coefficient here is specifically 45.

[0165] S455, superimposing the updated horizontal image, the updated vertical image, and the updated diagonal image to obtain an updated high-frequency image, and fusing the updated high-frequency image with the updated low-frequency image to obtain an intermediate denoising image.

[0166] S46, performing two-dimensional discrete Fourier transform on the intermediate denoising image to obtain an amplitude spectrum and a phase spectrum;

[0167] S47, determining a denoising image based on the amplitude spectrum and the phase spectrum;

[0168] The step S47 includes:

[0169] S371, determining a spectral residual based on the amplitude spectrum ;

[0170] ;

[0171] In the formula, , the mean filter kernel.

[0172] S372, reconstructing a frequency domain signal based on the spectral residual and the phase spectrum and inversely performing two-dimensional discrete Fourier transform to the spatial domain to obtain a transformed image.

[0173] S373, performing Gaussian filtering on the transformed image in multiple scales to obtain a plurality of scale Gaussian blurred images .

[0174] S374, setting a target sliding window with a size of in the scale Gaussian blurred image with a scale of .​ , calculating a plurality of intermediate scale images based on the target sliding window :

[0175] ;

[0176] wherein, represents a pixel median value of the target sliding window, is a zero-preventing constant, represents a pixel value in a central region of the target sliding window .

[0177] Specifically, the zero-preventing constant is generally taken as 10 for the purpose of preventing the denominator from being 0 -6 .

[0178] S375, fusing the plurality of intermediate scale images by taking a maximum value pixel by pixel to obtain a multi-scale image . .

[0179] S376, setting a local window in the multi-scale image, and calculating a target saliency map based on the local window :

[0180] ;

[0181] wherein, represents a variance of pixel values in the local window, represents a global variance of the multi-scale image;

[0182] Specifically, the size of the local window here is 7x7.

[0183] S377, determining a denoised image based on the target saliency map , the multi-scale image :

[0184] ;

[0185] wherein, represents a hyperparameter;

[0186] Specifically, the hyperparameter here is used to control the background suppression intensity and the saliency degree of the target, and in the present application, it is 0.5.

[0187] S5, obtaining a template training image, training a preset detection model through the template training image, inputting the denoised image into the trained preset detection model for target detection, and outputting a target detection result;

[0188] ​Specifically, the preset detection model here is a YOLOv7 model, the corresponding template training image is obtained, the model is trained through the template training image, and then the denoising image is input into the trained model, so that the corresponding target detection result is obtained.

[0189] The computer vision-based target detection method provided by the embodiment one of the application first acquires a target image to be detected, pre-processes the target image to be detected to obtain a pre-processed image, then performs detail enhancement and environment compensation on the pre-processed image to obtain an enhanced image, then performs clustering segmentation on the enhanced image to obtain an environment image and a foreground image, performs first correction processing on the environment image and second correction processing on the foreground image to obtain a first corrected image and a second corrected image, combines the first corrected image and the second corrected image to obtain a final corrected image, then performs denoising and background suppression on the final corrected image to obtain a denoising image, then acquires a template training image, trains a preset detection model through the template training image, inputs the denoising image into the trained preset detection model for target detection, and outputs a target detection result. The application first performs detail enhancement and environment compensation, which can effectively solve the problem of over-bright or over-dark images caused by environmental light interference, then performs correction on the image, which can highlight the foreground information and the detail information in the image, and then performs denoising and background suppression on the image, which can effectively improve the noise points in the image and suppress the background information, highlight the features and the detail information of the target, and thus improve the accuracy of subsequent target detection and avoid misrecognition.

[0190] Embodiment two

[0191] As shown in Figure 2 , the embodiment two of the application provides a computer vision-based target detection system, which comprises:

[0192] A pre-processing module 1 is configured to acquire a target image to be detected, and pre-process the target image to be detected to obtain a pre-processed image.

[0193] An enhancement module 2 is configured to perform detail enhancement and environment compensation on the pre-processed image to obtain an enhanced image.

[0194] A correction module 3 is configured to perform clustering segmentation on the enhanced image to obtain an environment image and a foreground image, perform first correction processing on the environment image and second correction processing on the foreground image to obtain a first corrected image and a second corrected image, and combine the first corrected image and the second corrected image to obtain a final corrected image.

[0195] A denoising module 4 is configured to perform denoising and background suppression on the final corrected image to obtain a denoising image.

[0196] The detection module 5 is configured to acquire a template training image, train a preset detection model through the template training image, input the denoised image into the trained preset detection model for target detection, and output a target detection result.

[0197] The enhancement module 2 comprises:

[0198] A first enhancement sub-module is configured to extract a V-channel image of the preprocessed image , calculate a first enhancement factor based on the V-channel image :

[0199] ;

[0200] A second enhancement sub-module is configured to calculate a second enhancement factor based on the first enhancement factor :

[0201] ;

[0202] In the formula, is a prior of the V-channel image, denotes a pixel mean value of the V-channel image;

[0203] A pending enhancement sub-module is configured to calculate a pending enhancement image based on the first enhancement factor and the second enhancement factor :

[0204] ;

[0205] A final enhancement sub-module is configured to determine a final enhancement image based on the pending enhancement image :

[0206] ;

[0207] In the formula, denotes a noise estimation of the V-channel image;

[0208] A replacement sub-module is configured to replace the V-channel image of the preprocessed image with the final enhancement image to obtain an enhanced image.

[0209] The correction module 3 comprises:

[0210] A conversion sub-module is configured to convert the enhanced image from an RGB space to an LAB space to obtain a converted image.

[0211] ​​​​The clustering submodule is used to convert the pixels in the transformed image into two-dimensional data and perform iterative clustering processing on the two-dimensional array using the mean clustering algorithm to obtain the environment image and the foreground image;

[0212] The environment value submodule is used to calculate environment values ​​based on the environment image. :

[0213] ;

[0214] In the formula, Indicates enhanced image The pixels in As a mask for the environmental image, Indicates the number of pixels in the environment image;

[0215] Combination submodule, used based on the environmental values A first corrected image and a second corrected image are determined, and the first corrected image and the second corrected image are combined to obtain a final corrected image.

[0216] The combined submodule includes:

[0217] A first transmittance unit is used to base the environmental value. Calculate the first transmittance :

[0218] ;

[0219] In the formula, This represents the pixels in the R, G, or B channel of the enhanced image. Pixels in the R, G, or B channel of an ideal image. Indicates the region corresponding to the environmental image;

[0220] The second transmittance unit is used based on the environmental value. Calculate the second transmittance :

[0221] ;

[0222] In the formula, Indicates the adjustment factor. This represents the region corresponding to the foreground image;

[0223] Correction unit, used for adjusting based on the first transmittance The second transmittance Determine the first corrected image respectively Second Corrected Image :

[0224] ; ;

[0225] In the formula, represents a transmittance threshold value;

[0226] a combination unit, configured to combine the first corrected image and the second corrected image to obtain a final corrected image.

[0227] The denoising module 4 comprises:

[0228] a structural element sub-module, configured to define two structural elements of the same shape but different sizes based on the structural elements perform morphological filtering processing on the final corrected image to obtain a filtered image .

[0229] ;

[0230] In the formula, is a closing operation, represents a structural element related to the structural element , represents a structural element of the same shape as the structural element but with a size between the structural elements ;

[0231] a wavelet sub-module, configured to perform wavelet transform on the filtered image to obtain a low-frequency component image and a high-frequency component image, the high-frequency component image comprising a horizontal component image, a vertical component image and a diagonal component image;

[0232] an intensity sub-module, configured to set a sliding window with a size of in the low-frequency component image, and calculate a window intensity based on the sliding window:

[0233] ;

[0234] In the formula, represents a gray value of a center pixel point of the sliding window, represents a gray value at in the sliding window;

[0235] a rejection sub-module, configured to divide the sliding window into four sub-regions of the same size, determine a gradient of a pixel point in each sub-region relative to the center pixel point of the sliding window and store the gradient in a gradient set corresponding to each sub-region, and reject a gradient in the gradient set that does not satisfy a preset condition to obtain a rejected gradient set;

[0236] an intermediate denoising module configured to determine an updated low-frequency image based on the removed gradient set, and determine an intermediate denoising image based on the updated low-frequency image, the horizontal component image, the vertical component image and the diagonal component image;

[0237] a Fourier module configured to perform two-dimensional discrete Fourier transform on the intermediate denoising image to obtain an amplitude spectrum and a phase spectrum;

[0238] a denoising module configured to determine a denoising image based on the amplitude spectrum and the phase spectrum.

[0239] The intermediate denoising module comprises:

[0240] a mean unit configured to calculate a gradient amplitude mean based on the removed gradient set :

[0241] ;

[0242] wherein, n represents a gradient number in the removed gradient set corresponding to the i-th sub-region, represents a gradient in the removed gradient set corresponding to the i-th sub-region;

[0243] a gradient unit configured to calculate a gradient image based on the gradient amplitude mean :

[0244] ;

[0245] wherein, n represents a gradient number in the removed gradient set corresponding to the i-th sub-region, is a judgment threshold;

[0246] a low-frequency updating unit configured to determine an updated low-frequency image based on the gradient image , and the window intensity :

[0247] ;

[0248] a high-frequency updating unit configured to determine a pixel point threshold , and remove pixel points greater than the pixel point threshold from the horizontal component image, the vertical component image and the diagonal component image to obtain an updated horizontal image, an updated vertical image and an updated diagonal image:

[0249] ;

[0250] wherein, n represents a gradient number in the removed gradient set corresponding to the i-th sub-region, represents a pixel mean of the horizontal component image, the vertical component image or the diagonal component image,​​​​​ Represents the pixel variance of the horizontal component image, vertical component image, or diagonal component image. For control coefficients;

[0251] The overlay unit is used to overlay the updated horizontal image, the updated vertical image, and the updated diagonal image to obtain an updated high-frequency image, and to fuse the updated high-frequency image with the updated low-frequency image to obtain an intermediate denoised image.

[0252] The noise reduction submodule includes:

[0253] Residual unit, used based on the amplitude spectrum Determine the spectral residual :

[0254] ;

[0255] In the formula, Represents the mean filter kernel;

[0256] Inverse transform unit, used for based on the spectral residual The frequency domain signal is reconstructed from the phase spectrum and then subjected to an inverse two-dimensional discrete Fourier transform to the spatial domain to obtain the transformed image.

[0257] The Gaussian filtering unit is used to perform multi-scale Gaussian filtering on the transformed image to obtain a multi-scale Gaussian blurred image. ;

[0258] Scale unit, used for scales of In a scale-gaussian blurred image, the size is set to target sliding window Several intermediate-scale images are calculated based on the target sliding window. :

[0259] ;

[0260] In the formula, This represents the median pixel value of the target sliding window. To prevent zero constant, Represents the center area of ​​the target sliding window Pixel values ​​within;

[0261] Multi-scale units are used to fuse images at various intermediate scales by taking the maximum value pixel by pixel. To obtain multi-scale images ;

[0262] A saliency unit is used to define a local window in the multi-scale image and calculate a target saliency map based on the local window. :

[0263] ;

[0264] wherein, denotes the variance of the pixel values within the local window, denotes the global variance of the multi-scale image;

[0265] a denoising unit configured to determine a denoised image based on the target saliency map , the multi-scale image ;

[0266] ;

[0267] wherein, denotes a hyperparameter.

[0268] In some embodiments of the present application, the present application provides a computer, comprising a memory 102, a processor 101, and a computer program stored in the memory 102 and capable of running on the processor 101, wherein the processor 101 implements the computer vision based target detection method as described above when executing the computer program.

[0269] Specifically, the processor 101 can include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement embodiments of the present application.

[0270] ​The memory 102 can include mass storage for data or instructions. By way of example, and not limitation, the memory 102 can include a Hard Disk Drive (HDD), a floppy disk drive, a solid-state drive (SSD), a flash drive, a Compact Disk Drive (CD Drive), a DVD Drive, a tape drive, a USB drive, or any combination of two or more of these. The memory 102 can be removable and / or non-removable (or fixed) as appropriate. The memory 102 can be internal or external as appropriate. In certain embodiments, the memory 102 is a non-volatile memory. In certain embodiments, the memory 102 includes a Read-Only Memory (ROM) and a Random Access Memory (RAM). The ROM can be a mask-programmed ROM, a Programmable ROM (PROM), an Erasable PROM (EPROM), an Electrically Erasable PROM (EEPROM), an Electrically Alterable ROM (EAROM), or a FLASH memory, or any combination of two or more of these, as appropriate. The RAM can be a Static Random-Access Memory (SRAM) or a Dynamic Random-Access Memory (DRAM), which can be a Fast Page Mode Dynamic Random-Access Memory (FPMDRAM), an Extended Data Output Dynamic Random-Access Memory (EDODRAM), a Synchronous Dynamic Random-Access Memory (SDRAM), or the like, as appropriate.

[0271] The memory 102 can be used to store or buffer various data files needed for processing and / or communication, and possible computer program instructions executed by the processor 101.

[0272] The processor 101 reads and executes the computer program instructions stored in the memory 102 to implement the above-mentioned computer vision-based target detection method.

[0273] In some embodiments, the computer can further include a communication interface 103 and a bus 100. As shown, the processor 101, the memory 102, and the communication interface 103 are connected through the bus 100 and complete communication with each other. Figure 3

[0274] The communication interface 103 is used to realize the communication between the modules, devices, units and / or equipment in the embodiments of the present application. The communication interface 103 can also realize data communication with other components, such as external devices, image / data acquisition devices, databases, external storage, and image / data processing workstations, etc.

[0275] ​Bus 100 includes hardware, software, or both, to couple components of computer device to each other and to couple components of computer device to other devices. Bus 100 includes, but is not limited to, at least one of the following: a data bus, an address bus, a control bus, an expansion bus, a local bus, and the like. By way of example and not limitation, bus 100 can include an Accelerated Graphics Port (AGP) or other graphics bus, an Extended Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a Hyper Transport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an InfiniBand (IB) interconnect, a Low Pin Count (LPC) bus, a memory bus, a Micro Channel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local (VLB) bus, or another suitable bus or a combination of two or more of these. Where appropriate, bus 100 can include one or more buses. Although the present embodiments describe and show a particular bus, the present embodiments contemplate any suitable bus or interconnect.

[0276] The computer can acquire a computer vision-based target detection system, and execute the computer vision-based target detection method of the present application, so as to realize the computer vision-based target detection.

[0277] In some embodiments of the present application, in combination with the above-mentioned computer vision-based target detection method, the present embodiments provide the following technical solutions: a storage medium, which has a computer program stored thereon, and the computer program is executed by a processor to implement the above-mentioned computer vision-based target detection method.

[0278] Those skilled in the art will appreciate that the logic and / or steps represented in the flow diagrams, or otherwise described herein, can be embodied in executable instructions, for example, that can be executed by a general-purpose computer, special-purpose computer, or other computing device to perform the steps illustrated in the flow diagrams, or otherwise described herein. As will be understood, such steps can be performed by a combination of hardware and / or software methods. In some embodiments, the steps can be performed by hardware alone using, for example, custom circuitry and / or dedicated hardware. In other embodiments, the steps can be performed by software alone using, for example, a general-purpose computer or other computing device. In yet other embodiments, the steps can be performed by a combination of hardware and software, for example, using a suitably programmed general-purpose computer or other computing device.

[0279] More specific examples (a non-exhaustive list) of the computer readable medium include the following: an electrical connection (electronic) having one or more wires, a portable computer diskette (magnetic), a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, and a portable compact disc read-only memory (CDROM). Additionally, the computer readable medium can also be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, for example, via optical scanning of the paper or other medium, then compiled, interpreted, or otherwise processed in a suitable manner, if necessary, and then stored in a computer memory.

[0280] It should be understood that aspects of the application can be implemented in hardware, software, firmware or combinations thereof. In the above embodiments, various steps or methods can be implemented in software or firmware that is stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any of the following technologies, known in the art, or combinations thereof, can be used: a discrete logic circuit having logic gates for implementing logic functions upon data signals, an application specific integrated circuit having appropriate combinational logic gates, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0281] The technical features of the above-described embodiments can be combined in any manner, and for brevity, not all possible combinations are described, however, any combination of the technical features is considered to be within the scope of the present specification.

[0282] The above embodiments only express several implementation manners of the present application, and the description is more specific and detailed, but it should not be understood as a limitation on the scope of the patent. It should be noted that for ordinary skilled persons in the art, without departing from the concept of the present application, several modifications and improvements can be made, which are within the protection scope of the present application. Therefore, the protection scope of the present application patent should be subject to the appended claims.

Claims

1. A computer vision-based object detection method, characterized in that, The method comprises the following steps: obtaining a target image to be detected, and preprocessing the target image to be detected to obtain a preprocessed image; performing detail enhancement and environment compensation on the preprocessed image to obtain an enhanced image; performing clustering segmentation on the enhanced image to obtain an environment image and a foreground image, performing first correction processing on the environment image, performing second correction processing on the foreground image, to obtain a first corrected image and a second corrected image, and combining the first corrected image and the second corrected image to obtain a final corrected image, which comprises: converting the enhanced image from an RGB space to an LAB space to obtain a converted image; converting pixels in the converted image into two-dimensional data and performing iterative clustering processing on the two-dimensional array using a mean clustering algorithm to obtain an environment image and a foreground image; computing an environment value based on the environment image : ; wherein represents an enhanced image pixel in the enhanced image, is a mask of the environment image, represents a number of pixels in the environment image; based on the environmental value determining a first corrected image, a second corrected image, combining the first corrected image and the second corrected image to obtain a final corrected image; performing denoising and background suppression on the final corrected image to obtain a denoised image; obtaining a template training image, training a preset detection model through the template training image, inputting the denoised image into the trained preset detection model for target detection, and outputting a target detection result; the step of performing denoising and background suppression on the final corrected image to obtain a denoised image comprises: Defining two structuring elements of the same shape but different sizes , based on the structuring elements performing morphological filtering on the final corrected image to obtain a filtered image : ; wherein is a closing operation, denotes a structuring element related to the structuring element denotes a structuring element whose shape is identical to the structuring element whose shape is identical to the structuring element performing wavelet transform on the filtered image to obtain a low-frequency component image and a high-frequency component image, and the high-frequency component image comprises a horizontal component image, a vertical component image and a diagonal component image; A sliding window of size is set in the low frequency component image, and a window intensity is calculated based on the sliding window. ; In the formula, represents the gray value of the center pixel point of the sliding window, represents the gray value at the position of the sliding window; represents the gray value at the position of the sliding window; dividing the sliding window into four sub-regions of the same size, determining the gradient of each sub-region with respect to the center pixel of the sliding window and storing it in the gradient set corresponding to each sub-region, and removing the gradients in the gradient set that do not meet the preset condition to obtain a removed gradient set; determining an updated low-frequency image based on the removed gradient set, and determining an intermediate denoised image based on the updated low-frequency image, the horizontal component image, the vertical component image and the diagonal component image; performing two-dimensional discrete Fourier transform on the intermediate denoised image to obtain an amplitude spectrum and a phase spectrum; determining a denoised image based on the amplitude spectrum and the phase spectrum.

2. The computer vision-based object detection method of claim 1, wherein, The step of performing detail enhancement and environment compensation on the preprocessed image to obtain an enhanced image comprises: extracting a V-channel image of the pre-processed image , based on the V-channel image computing a first enhancement factor : ; based on the first enhancement factor computing a second enhancement factor : ; wherein is a prior for the V-channel image, denotes the pixel mean of the V-channel image; based on the first enhancement factor , the second enhancement factor computing a pending enhancement image : ; based on the pending enhancement image determining a final enhancement image : ; wherein denotes the noise estimate of the V-channel image; The final enhanced image Replace the V channel image of the preprocessed image to obtain the enhanced image.

3. The computer vision-based object detection method of claim 1, wherein, said determining the first correction image, the second correction image, and the combining the first correction image and the second correction image to obtain the final correction image comprises: determining a first correction image, a second correction image, and combining the first correction image and the second correction image to obtain a final correction image comprises: based on the environmental value calculating a first transmittance : ; wherein, represents a pixel point in the R or G or B channel image of the enhanced image, represents a pixel point in the R or G or B channel image of the ideal image, represents a region corresponding to the environment image; based on the environmental value calculating a second transmittance : ; In the formula, represents an adjustment factor, represents a region corresponding to the foreground image; based on the first transmittance , the second transmittance determining a first corrected image , a second corrected image respectively ; ; In the formula, represents the transmittance threshold value; combining the first corrected image and the second corrected image to obtain a final corrected image.

4. The computer vision-based object detection method of claim 1, wherein, The step of determining an updated low-frequency image based on the removed gradient set, and determining an intermediate denoised image based on the updated low-frequency image, the horizontal component image, the vertical component image and the diagonal component image comprises: calculating a gradient magnitude mean based on the set of culling gradients : ; In the formula, represents the number of gradients in the gradient set corresponding to the i-th sub-region, represents the number of gradients in the gradient set corresponding to the i-th sub-region, represents the number of gradients in the gradient set corresponding to the i-th sub-region, represents the number of gradients in the gradient set corresponding to the i-th sub-region, based on the gradient magnitude mean computing a gradient map : ; In the formula, is a judgment threshold value; based on the gradient map , the window intensity determining an updated low frequency image : ; Determining a pixel point threshold The pixel points greater than the pixel point threshold in the horizontal component image, the vertical component image and the diagonal component image are removed to obtain an updated horizontal image, an updated vertical image and an updated diagonal image. ; wherein represents the pixel mean of the horizontal component image, the vertical component image or the diagonal component image, represents the pixel variance of the horizontal component image, the vertical component image or the diagonal component image, is a control coefficient; superimposing the updated horizontal image, the updated vertical image and the updated diagonal image to obtain an updated high-frequency image, and fusing the updated high-frequency image and the updated low-frequency image to obtain an intermediate denoised image.

5. The computer vision-based object detection method of claim 1, wherein, The step of determining a denoised image based on the amplitude spectrum and the phase spectrum comprises: based on the magnitude spectrum determining spectral residual : ; In the formula, denotes the mean filter kernel; based on the spectral residual reconstructing a frequency domain signal from the phase spectrum and inverse two-dimensional discrete Fourier transforming to a spatial domain to obtain a transformed image; performing a Gaussian filtering on the transformed image in multiple scales to obtain a plurality of scale Gaussian blurred images ; A target sliding window of size is set in a scale Gaussian blurred image of size A number of intermediate scale images are computed based on the target sliding window : ; wherein represents the median value of the pixels in the target sliding window, is a non-zero constant to prevent division by zero, represents the pixel value within the central region of the target sliding window . fusing the individual intermediate scale images by taking the maximum value pixel by pixel to obtain a multi-scale image ; setting a local window in the multi-scale image, computing a target saliency map based on the local window : ; wherein denotes the variance of the pixel values within the local window, denotes the global variance of the multi-scale image; based on the target saliency map , multi-scale image determining a denoised image : ; In the formula, denotes a hyperparameter.

6. A computer vision based object detection system employing the computer vision based object detection method as claimed in claim 1, characterized in that, The system comprises: a preprocessing module configured to obtain a target image to be detected, and to preprocess the target image to be detected to obtain a preprocessed image; an enhancement module configured to perform detail enhancement and environment compensation on the preprocessed image to obtain an enhanced image; The correction module is configured to perform cluster segmentation on the enhanced image to obtain an environment image and a foreground image, perform first correction processing on the environment image, perform second correction processing on the foreground image, obtain a first corrected image and a second corrected image, and combine the first corrected image and the second corrected image to obtain a final corrected image. The denoising module is configured to perform denoising and background suppression on the final corrected image to obtain a denoised image. The detection module is configured to obtain a template training image, train a preset detection model by using the template training image, input the denoised image into the trained preset detection model for target detection, and output a target detection result.

7. A computer comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor executes the computer program to implement the computer vision-based target detection method in any one of claims 1 to 5.

8. A storage medium, characterized by The storage medium stores the computer program, and the computer program is executed by the processor to implement the computer vision-based target detection method in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Weak and small airspace target detection method based on super-resolution feature enhancement

    CN113223059A

  • Underground coal mine target detection method based on visual large model and video analysis equipment

    CN118411512A