CN-115511823-B - Protective pressing plate image preprocessing method
Abstract
The invention provides a protective pressing plate image preprocessing method, which combines a multi-level fusion edge enhancement algorithm, a shadow removal algorithm based on double-color space and illumination compensation and an image correction algorithm based on a deformation degree curved surface to process, wherein the deformation degree curved surface of a pressing plate reflecting the distortion condition of a picture is provided by the deformation degree curved surface based on the image correction algorithm, the distortion condition caused by different shooting angles is caused, the correction of distortion is adaptively realized, and the operability and the accuracy of subsequent batch processing are improved by correcting all the ROI images of the pressing plate to the same plane and angle. The hierarchical fusion edge enhancement algorithm and the deformation degree curved surface-based image correction algorithm jointly realize the preprocessing operation on the image of the protective pressing plate, eliminate the influence of image distortion generated by shooting on individual differences of the pressing plate, and lay a foundation for subsequent batch processing operation.
Inventors
- ZHANG YING
- WANG LIHUA
- ZHANG YIHUI
- WU HAO
- Fu Boxiong
- DONG XUAN
- LI YANG
- SU KE
Assignees
- 国家电网有限公司
- 国网河北省电力有限公司石家庄供电分公司
Dates
- Publication Date
- 20260505
- Application Date
- 20220922
Claims (9)
- 1. A protecting press plate image preprocessing method is characterized by combining a protecting press plate image preprocessing algorithm consisting of a multi-level fusion edge enhancement algorithm, a shadow removal algorithm based on a double-color space and illumination compensation and an image correction algorithm based on a deformation degree curved surface, and executing image preprocessing operation before subsequent batch processing, wherein the multi-level fusion edge enhancement algorithm starts from different color level spaces of an image, adopts different edge enhancement methods to respectively carry out edge enhancement and then fusion on the images, improves the contrast ratio of a press plate ROI (region of interest) and a background part, is favorable for realizing subsequent detection and segmentation operation, adopts HSV (hue, saturation and saturation) and RGB (red, saturation) to realize automatic detection of shadows based on the shadow removal algorithm based on the double-color space and the illumination compensation, adopts the illumination compensation method to furthest restore the original characteristics of the image, completes shadow removal, and the image correction algorithm based on the deformation degree curved surface of the press plate proposes the deformation degree curved surface reflecting the distortion condition of the image, and self-adaptively realizes distortion correction on the image due to distortion condition caused by different shooting angles, and improves the operability and accuracy of subsequent batch processing by correcting each press plate image to the same plane and angle; The multi-level fusion edge enhancement algorithm comprises the steps of selecting a picture, respectively converting the picture into an HSV mode image and a gray level image, carrying out edge enhancement processing on two layers, carrying out histogram equalization on a brightness component in the HSV mode to enhance the contrast of the image, carrying out Gaussian-Laplace transformation sharpening processing on the equalized brightness image to enhance the edge, obtaining a first image enhanced in the HSV mode by overlapping the processed brightness component with original saturation and tone components, carrying out canny operator edge extraction on the gray level image layer, then overlapping the first image and the gray level image with the contrast stretching transformation aiming at gray switches in the gray level image, overlapping the first image and the gray level image to obtain a second image, respectively reducing the two images to an RGB mode, and finally obtaining an output image enhanced in the HSV mode.
- 2. The method for preprocessing an image of a protective platen according to claim 1, wherein the preprocessing by an image correction algorithm based on a deformation degree curved surface comprises the steps of: On the basis of edge enhancement and shadow removal, extracting all the press plate ROIs in the image by using a fast-RCNN target detection network, performing independent image processing operation on each ROI region image, extracting the connected domain with the largest area in each ROI image by combining a canny edge detection algorithm and a connected domain detection algorithm, and filling or partially removing the connected domain according to the edge with the nearest peripheral distance so as to realize the segmentation of the protection press plate.
- 3. The method for preprocessing an image of a protective platen according to claim 2, wherein the shadow removing method based on the two-color space and the illumination compensation is divided into two parts of shadow detection and shadow region restoration, and the specific steps are as follows: A. Shadow detection based on RGB (red, green, blue, and white) double-color space Firstly, converting a protective pressure plate image into an HSV color space to obtain hue, saturation and brightness values of each pixel point, and providing a shadow-like coefficient LS to comprehensively evaluate the saturation and brightness values corresponding to the pixel points, wherein the LS has the following calculation formula: The shadow-like coefficient LS is positively correlated with the brightness corresponding to the pixel, and negatively correlated with the saturation, namely, the shadow-like coefficient corresponding to the region with lower brightness and higher saturation is higher, and the probability of being regarded as a shadow region is maximum, which is consistent with the shadow characteristics observed by human eyes; Calculating LS values of all pixels in the image of the protective pressing plate, calculating a nuclear density curve by using a statistical method, taking the LS value corresponding to the first trough position after the maximum peak in the nuclear density curve as a threshold value, and using the threshold value to pre-select the area of the shadow part Separated from other parts; extracting the gray level image of R channel, dividing the image into two parts according to gray level by combining maximum inter-class variance method, wherein the part with smaller gray level is shadow preselected region extracted in RGB color space Taking out And Is the intersection of (1) As a finally detected shadow area; B. shadow removal algorithm based on illumination compensation In a real shooting scene, under the condition that the shadow generated by illumination has gradual change, the self-adaptive filling of the shadow part is realized by adopting an illumination compensation method so as to restore the characteristics of an original image to the greatest extent; The RGB values of the color image satisfy the formula: Wherein the method comprises the steps of Is a pixel point Is used for the RGB values of (a), Representing pixel points Is used for the illumination of the light source, Is a pixel point Except for the shadow part due to shielding, the pixel point in the image irradiates the direct light from the light source And reflected illumination of the environment Thus, the following formula can be obtained: Wherein the method comprises the steps of For the reduction coefficient of the direct light in the corresponding region of the image, the shaded portion corresponds to A value of 0, and the full image area corresponds to The value is 1, and the following formula can be rewritten: Wherein, the Pixels representing a shadow portion, which correspond to The value is set to 0 and the value is set to 0, For other parts than the shadow region, for a specific pixel point of the shadow region RGB values after shading filling With RGB values before filling The relationship between them satisfies: each pixel value of the shadow area S can be restored according to the corresponding illumination compensation relation according to the above formula, so that the shadow is removed; After the shadow part is removed by the illumination compensation method, the edge of the shadow area is usually affected by the detection accuracy to generate the condition of unnatural transition, in order to improve the accuracy of image shadow removal, the original information item of the restored image is subjected to smoothing operation on the edge area of the shadow area to the greatest extent after the shadow is removed, and the corresponding weight is self-adaptively given according to the distance between the original information item and the edge, and the weight formula is as follows: Wherein, the The distance of the current pixel from the actual edge, And The maximum and minimum distances from the actual edge in the edge region, respectively.
- 4. A method for preprocessing an image of a protective platen according to claim 3, wherein areas of the protective platen divided from the images of the ROIs are sequentially calculated, curves of the areas of the protective platen are drawn in units of rows and columns, the curves are arranged at the positions of the rows and columns to form a curved surface of the deformation degree of the platen, the shape of the curved surface of the deformation degree of the platen reflects the distortion condition of each part of the image, and the maximum point of the curved surface of the deformation degree of the platen reflects the distortion condition of each part of the image Representing the closest position to the photographed camera, from And calculating the difference between each pressure plate area point and the eight adjacent points, calculating to obtain a first difference minimum value point, stopping, and taking the calculated minimum value point corresponding to the pressure plate ROI with the least influence of distortion as a correction template.
- 5. The method for protecting a platen image preprocessing as claimed in claim 4, wherein the edge region is a region obtained by expanding the edge portion with 5*5 nuclei; Each part of the picture is the area where the pressing plate is positioned; And (3) independently correcting each ROI image by taking the length and the width of the pressing plate in the calculated correction template as a standard.
- 6. The method for protecting a platen according to claim 5, wherein the correction rule is to position four corner points of the protecting platen according to the previous segmentation result, keep the upper left corner point motionless, the inclination of the connecting line between the upper left corner point and the upper right and lower left corner points unchanged, and the distance between the corner points becomes the length and width of the corresponding platen.
- 7. The method for preprocessing the image of the protective pressing plate according to claim 6, wherein four groups of corner positions before and after correction can be obtained by correction rules, and then a perspective transformation matrix is calculated, and the specific calculation process is as follows: Where M is the perspective transformation matrix, Is a perspective transformation matrix coefficient; To correct any point in the previous image, [ X, Y, Z ] is the point where perspective transformation moves to three-dimensional space ] ) For perspective transformation to three-dimensional space and then to the two-dimensional image, namely the corresponding corrected image points, let m33=1, bring into four groups of angular point positions, can find the value of each coefficient in M, thus calculate and get corrected image according to the image before correction.
- 8. The method for preprocessing the image of the protective platen according to claim 7, wherein the probability hough straight line detection algorithm is used for detecting straight lines of the original image, the longest straight line is taken, the inclination of the longest straight line is calculated to represent the overall inclination degree of the image, and the inclination correction of the image is realized by rotating and changing each ROI image according to the inclination degree of the image.
- 9. The method of claim 8, wherein the longest straight line is a pinch line between the protective platen cabinets.
Description
Protective pressing plate image preprocessing method Technical Field The invention relates to an image preprocessing technology, in particular to a protecting pressing plate image preprocessing method. Background The traditional automatic detection technology of the protective pressing plate often omits the earlier image preprocessing operation, directly utilizes a target detection or segmentation network to realize the extraction of the ROI region of the protective pressing plate, the method has poor generalization capability for images shot by various shooting angles and illumination environments in practical application, cannot eliminate individual differences of the pressing plate in the same image due to image distortion, is not beneficial to batch processing operation, and has low accuracy. Disclosure of Invention The invention aims to provide a protective pressing plate image preprocessing algorithm combining a multi-level fusion edge enhancement algorithm and an image correction algorithm based on a deformation degree curved surface, so that preprocessing of a shot image of a protective pressing plate is realized, individual differences of the pressing plate caused by shooting environments and angles are eliminated, and the accuracy and the efficiency of batch processing operations such as automatic detection of the state of the subsequent protective pressing plate are improved. The technical scheme of the invention is as follows: The image preprocessing method of the protective pressing plate combines a protective pressing plate image preprocessing algorithm consisting of a multi-level fusion edge enhancement algorithm, a shadow removing algorithm based on a double-color space and illumination compensation and an image correction algorithm based on a deformation degree curved surface, and executes image preprocessing operation before subsequent batch processing; The multi-level fusion edge enhancement algorithm starts from different color level spaces of the image, adopts different edge enhancement methods to respectively carry out edge enhancement and then fusion, improves the contrast ratio of the ROI region and the background part of the pressing plate, and is beneficial to realizing subsequent detection and segmentation operation; The image correction algorithm based on the deformation degree curved surface provides a pressing plate deformation degree curved surface reflecting the picture distortion condition, and the distortion condition caused by different shooting angles is adaptively realized to correct the distortion, and the operability and accuracy of subsequent batch processing are improved by correcting the ROI images of each pressing plate to the same plane and angle. The multi-level fusion edge enhancement algorithm is characterized in that a picture is selected and is respectively converted into an HSV mode image and a gray level image, edge enhancement processing is carried out on two layers, in the HSV mode, histogram equalization is carried out on brightness components to enhance image contrast, gaussian-Laplace transformation sharpening processing is carried out on the equalized brightness images to enhance edges, the processed brightness components are overlapped with original saturation and tone components to obtain a first image enhanced in the HSV mode, canny operator edge extraction is carried out on the gray level image layers respectively, and then the gray level image is overlapped to the gray level image and contrast stretching conversion aiming at gray switches in the gray level image, the two images are overlapped together to obtain a second image, and the two images are respectively restored to the RGB mode and are fused to obtain an image with enhanced output edges. Preferably, the preprocessing of the image correction algorithm based on the deformation degree curved surface comprises the following steps: On the basis of edge enhancement and shadow removal, extracting all the press plate ROIs in the image by using a fast-RCNN target detection network, performing independent image processing operation on each ROI region image, extracting the connected domain with the largest area in each ROI image by combining a canny edge detection algorithm and a connected domain detection algorithm, and filling or partially removing the connected domain according to the edge with the nearest peripheral distance so as to realize the segmentation of the protection press plate. Preferably, aiming at the shadow problem generated by shooting the image of the protective pressing plate under the normal illumination condition, the step provides a shadow removing method based on double-color space and illumination compensation before being applied to an image correction algorithm so as to improve correction accuracy. The shadow removing method based on the double-color space and illumination compensation is divided into two parts of shadow detection and shadow region recovery, and the spec