Search

CN-116664608-B - Target detection and positioning method based on image enhancement

CN116664608BCN 116664608 BCN116664608 BCN 116664608BCN-116664608-B

Abstract

The invention relates to the field of target detection and positioning, in particular to an image enhancement-based target detection and positioning method for a mobile phone assembly scene. According to the method, an original image acquired by a visual sensor is enhanced, input images of target detection and input images calculated by target edges are enhanced respectively, overall brightness enhancement is adopted for target detection input, histogram equalization and Laplace sharpening are adopted for brightness and contrast enhancement, finally, the enhanced image is input into a deep learning network for target detection, an input RGB image of edge detection is subjected to linear enhancement by adopting a single R channel, a gray level image is subjected to Sigmod function enhancement, and Sobel edge detection is finally carried out, so that a target positioning process is realized.

Inventors

  • HUANG ZHENPING
  • CHEN JINLONG

Assignees

  • 桂林电子科技大学

Dates

Publication Date
20260505
Application Date
20230427

Claims (7)

  1. 1. The target detection and positioning method based on image enhancement is characterized in that the image obtained by a visual sensor is subjected to image enhancement before target detection and target positioning respectively, and the method comprises the following steps: The method comprises the steps of (1) improving the overall brightness of an image, and firstly improving the brightness of the image and reducing the influence of shadows on subsequent operation for the image information acquired under an illumination change scene; step (2) improving the overall contrast of the image through histogram equalization, and obtaining high-contrast image information according to the result of the step (1) to improve the brightness contrast of the image; step (3) adopting Laplace operator to sharpen the picture, enhancing the light-dark contrast at the edge of the picture or at the position with larger pixel value change, and highlighting the main body; detecting a target through a CNN convolutional neural network of YOLO v5, taking the result of the step (3) as the input of the network, and finally outputting the detected position and the boundary box of the target; The step (5) adopts an image linear enhancement method to carry out linear enhancement on the result of the step (3), and adopts a piecewise linear function to enhance the local information of the image; Step (6) calculating the result of the step (5) through a Sigmoid function; Step (7) carrying out edge detection on the image through a Sobel edge operator, intercepting part of the image of the detection result through the pixel coordinates of the detection frame in the result of the step (4) and the result of the step (6), and then obtaining an actual image boundary by adopting the step, and further positioning; Specifically, through the gray level image saved in the step (6) and the target frame position output in the step (4), firstly, the target frame image is cut out from the gray level image, then, the Sobel edge operator is adopted to detect the edge of the target, and firstly, convolution kernels are respectively selected for the X axis and the Y axis of the image And Then, the intercepted images are respectively subjected to convolution operation by two convolution checks to respectively obtain And Gray value for each pixel And outputting a final edge detection result after calculation, and thus, performing target positioning.
  2. 2. The image-enhancement-based target detection and localization method according to claim 1, wherein the step (1) specifically comprises: the RGB image is integrally lightened, the pixel values of three channels R, G and B of the picture are increased by 75, the 75 values are set manually, and then the three channels are combined, so that the brightness of the integral picture can be improved, and the formula is that Wherein , , Is the three channel pixel value after the brightness is increased.
  3. 3. The image-enhancement-based target detection and localization method according to claim 1, wherein the step (2) specifically comprises: processing the picture generated in the step (1) through histogram equalization, respectively performing equalization processing on three channels R, G and B in an RGB image, firstly slicing an original picture, and setting tileGridSize =64, wherein tileGridSize is the number of slices; Then each image is subjected to equalization processing, and all pixel values in the image are recorded firstly in the equalization processing Number of occurrences Where r is each specific pixel value in the picture, and then calculating the cumulative distribution function cdf of each pixel value r, i.e. the formula Sorting the cdf values from small to large, equally distributing the pixel values with cdf larger than a threshold value CLIPLIMIT =6 to the pixel values smaller than the threshold value, recalculating the cdf values until all the cdf' values are smaller than the threshold value, taking the minimum value cdf (min) and the maximum value cdf (max), and finally passing through the formula Calculating equalized pixel values And splicing the slice images into a large image after equalizing each image, so that the histogram equalization is completed.
  4. 4. The image-enhancement-based target detection and localization method according to claim 1, wherein the step (3) specifically comprises: Sharpening the equalized image by using Laplace operator by selecting convolution kernel And carrying out convolution operation on the image, and obtaining a sharpened image through convolution.
  5. 5. The image-enhancement-based target detection and localization method according to claim 1, wherein the step (4) specifically comprises: And (3) performing target detection operation on the image enhanced in the step (3) by adopting a YOLO v5 deep learning network, wherein YOLO v5 is an open source model, and targets in the image can be detected and marked by a boundary box through the model.
  6. 6. The image-enhancement-based object detection and localization method as claimed in claim 3, wherein the step (5) specifically comprises: Performing linear enhancement on the result of the step (3), firstly performing channel separation operation on the three channels, enhancing R channels, and performing linear enhancement on the R channels according to a formula Where R is the pixel value in the R channel, For the linearly enhanced pixel values, the R channels are individually enhanced and then the three channels of the image are combined.
  7. 7. The image-enhancement-based object detection and localization method according to claim 1, wherein the step (6) specifically comprises: the contrast of the sharpened picture is further improved through Sigmod functions, firstly, the three-channel picture is changed into a single-channel picture, namely a gray level picture, and then the three-channel picture is changed into a single-channel picture according to a formula Where r is each pixel value in the gray scale map, Is the pixel value enhanced by Sigmod functions.

Description

Target detection and positioning method based on image enhancement Technical Field The invention belongs to the field of target detection and positioning, and particularly relates to an image enhancement-based target detection and positioning method for a mobile phone assembly scene. Background At present, due to the rapid development of artificial intelligence and deep learning technology, a large number of robot operations are industrially performed by using vision sensors, people are working on the fact that robots have human vision detection and positioning capabilities, and the robots have target detection and positioning capabilities which are preconditions for completing intelligent operations, such as intelligent assembly, intelligent defect detection and the like. The target detection task mainly detects the position and the frame of a target object in an image or a video, and because the target detection task depends on a visual sensor, illumination change in the target detection task has a great influence on the detection success rate, the target detection task is usually required to be placed in a structural scene in practical application, and is unfavorable for the robot to complete an intelligent task, for example, intelligent assembly of mobile phone parts, the mobile phone assembly precision requirement is usually in a micron level, and illumination change in the operation can influence the precision of the target detection task. Disclosure of Invention The invention mainly aims to overcome the defect of low target detection and positioning precision under illumination change in the prior art, and provides an image enhancement-based target detection and positioning method which can well eliminate the influence of illumination on detection and positioning and improve the accuracy and robustness of target detection and positioning tasks by performing a series of image enhancement methods. The technical scheme for realizing the purpose of the invention is as follows: An image enhancement-based target detection and positioning method, which acquires image data through a visual sensor, enhances an image before target detection, and enhances the image to improve the precision of a task during target edge detection, comprises the following steps: The method comprises the steps of (1) improving the overall brightness of an image, and firstly improving the brightness of the image and reducing the influence of shadows on subsequent operation for the image information acquired under an illumination change scene; step (2) improving the overall contrast of the image through histogram equalization, and obtaining high-contrast image information according to the result of the step (1) to improve the brightness contrast of the image; step (3) adopting Laplace operator to sharpen the picture, enhancing the light-dark contrast at the edge of the picture or at the position with larger pixel value change, and highlighting the main body; detecting a target through a CNN convolutional neural network of YOLO v5, taking the result of the step (3) as the input of the network, and finally outputting the detected position and the boundary box of the target; The step (5) adopts an image linear enhancement method to carry out linear enhancement on the result of the step (3), and adopts a piecewise linear function to enhance the local information of the image; Step (6) calculating the result of the step (5) through a Sigmoid function, enhancing the assembly scene of the mobile phone, and further improving the difference between the mobile phone parts and the background; And (7) carrying out edge detection on the image through a Sobel edge operator, intercepting part of the image of the detection result through the pixel coordinates of the detection frame in the result of the step (4) and the result of the step (6), and then obtaining an actual image boundary by adopting the step, so as to position. Further, in step (1), the RGB image is integrally brightened, and the brightness of the whole picture can be improved by increasing the pixel values of the three channels R, G and B by 75, wherein the 75 values are set manually, and then combining the three channels. The formula isWherein,,Is the three channel pixel value after the brightness is increased. Further, step (2) processes the picture generated in step (1) through histogram equalization, and respectively equalizes R, G and B channels in RGB images, firstly, slices an original picture, and sets tileGridSize =64, tilegridsize as the number of slices, which is the optimal number of slices in the method, and then equalizes each image, and the equalization firstly records all pixel values in the pictureNumber of occurrencesWhere r is each specific pixel value in the picture, and then calculating the cumulative distribution function cdf of each pixel value r, i.e. the formulaSorting the cdf values from small to large, equally distributing the pixel values with cdf larger t