CN110008955B - Method for testing character imprinting quality of surface of automobile brake pad - Google Patents

Method for testing character imprinting quality of surface of automobile brake pad Download PDF

Info

Publication number
CN110008955B
CN110008955B CN201910255460.1A CN201910255460A CN110008955B CN 110008955 B CN110008955 B CN 110008955B CN 201910255460 A CN201910255460 A CN 201910255460A CN 110008955 B CN110008955 B CN 110008955B
Authority
CN
China
Prior art keywords
image
character
area
brake pad
areas
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
CN201910255460.1A
Other languages
Chinese (zh)
Other versions
CN110008955A (en
Inventor
项荣
徐晗升
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Jiliang University
Original Assignee
China Jiliang University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Jiliang University filed Critical China Jiliang University
Priority to CN201910255460.1A priority Critical patent/CN110008955B/en
Publication of CN110008955A publication Critical patent/CN110008955A/en
Application granted granted Critical
Publication of CN110008955B publication Critical patent/CN110008955B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/24Aligning, centring, orientation detection or correction of the image
    • G06V10/245Aligning, centring, orientation detection or correction of the image by locating a pattern; Special marks for positioning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition
    • G06V30/14Image acquisition
    • G06V30/148Segmentation of character regions
    • G06V30/153Segmentation of character regions using recognition of characters or words
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Image Analysis (AREA)
  • Image Processing (AREA)

Abstract

The invention discloses a method for testing the character imprinting quality of the surface of an automobile brake pad. The method carries out image segmentation based on an OTSU algorithm; calculating the coordinates of the circle center image of the two extracted positioning circle hole areas; positioning and extracting the character areas on the two sides according to the relative position relation between the circle centers of the two positioning holes and the character areas on the two sides; adopting self-adaptive threshold value segmentation to carry out binarization in the extracted character areas on the two sides; acquiring a matching template for the brake pad image used as the matching template based on a projection method; the method comprises the steps that a to-be-inspected brake pad image is subjected to template matching in extracted character areas on two sides one by one according to a character imprinting sequence from top to bottom, and the optimal matching area is filled until all templates are matched; and realizing the inspection of the character imprinting quality of the surface of the brake pad according to the number of black pixels in the result image. The method can realize the inspection of the character imprinting quality of the surface of the automobile brake pad, and provides a new idea for the area positioning of the visual detection object.

Description

Method for testing character imprinting quality of surface of automobile brake pad
Technical Field
The invention relates to a quality inspection method, in particular to a quality inspection method for embossed characters on the surface of an automobile brake pad.
Background
With the continuous improvement of the living standard of people, the preservation amount of automobiles as daily used transportation means tends to increase continuously, and the driving safety of automobiles also becomes the focus of attention of people. As an important part influencing the driving safety of an automobile, the quality of an automobile brake pad directly influences the personal safety of drivers and passengers of the automobile, and therefore, the quality of the automobile brake pad is particularly important to be managed and managed in a unified mode. Embossed characters representing the type or batch of the brake pad are usually printed on the brake pad, and quality inspection of the embossed characters is an important step for realizing quality management of the brake pad. The character imprinting quality inspection of the surface of the automobile brake pad mainly comprises two parts of character area positioning and character imprinting quality inspection.
At present, means for realizing character region positioning in machine vision mainly adopts methods such as gradient, character texture characteristics or special mathematical morphology characteristics (such as automobile license plates) of a character region. The methods need to correspondingly process the whole image and judge according to corresponding characteristics so as to extract the character area, and although a good positioning effect can be obtained, the positioning time is long, so that the methods are suitable for processing images with relatively regular positioning areas and unfixed positioning areas. However, for the visual detection object with irregular edges of the character area, such as an automobile brake pad, and the position of the character area is relatively fixed to the part, a more efficient and accurate character area positioning method is needed.
After the character area is located, character imprinting quality inspection needs to be performed. The current inspection method generally carries out character recognition one by one, and then judges whether character imprinting is correct or not according to a character recognition result, so as to realize character imprinting quality inspection. The method is based on a single character recognition algorithm, and the accuracy rate of single character recognition can directly influence the accuracy and reliability of surface character imprinting quality inspection. However, characters with very similar shapes, such as the letter "I" and the number "1", the letter "o" and the number "0", are more likely to be recognized incorrectly, and the method for recognizing characters one by one needs to compare all characters in the character library, and the number of characters in the character library is large, which results in a long time for checking the stamping quality of the characters, so that a simpler, more efficient and more accurate method for checking the overall characters is needed to ensure the accuracy and efficiency of checking the stamping quality of the characters.
The invention can realize the automatic inspection of the character imprinting quality on the surface of the automobile brake pad, can provide an effective method for area positioning of a visual detection object, and provides a new idea for inspecting the character printing quality.
Disclosure of Invention
The invention aims to provide a method for testing the character imprinting quality of the surface of an automobile brake pad so as to realize automatic positioning of a character area on the surface of the automobile brake pad and automatic testing of the character imprinting quality.
The technical scheme adopted by the invention is as follows:
the invention comprises the following steps:
1.1) character area positioning: the method comprises the following steps of automatically positioning and extracting character areas on the left side and the right side of a brake pad by adopting an automatic positioning method for character areas of the automobile brake pad; firstly, extracting a binary image B of the automobile brake pad through an OTSU automatic threshold segmentation algorithm, and denoising the binary image B of the automobile brake pad based on Gaussian filtering and corrosion expansion algorithm; secondly, two positioning round holes of the brake pad are extracted through BLOB analysis, and least square method fitting circle formulas are applied to all pixel points in the round hole area to extract the circle center image coordinates of the two positioning round holes of the brake pad; performing image rotation correction of a corresponding angle based on an included angle formed by a circle center connecting line of the two positioning circular holes and an image abscissa, so that the circle center connecting line of the two positioning circular holes of the brake pad is parallel to the image abscissa; finally, image coordinates of external rectangle characteristic points (points for determining the positions of the external rectangles of the character areas at the two sides in an image coordinate system) of the character areas at the two sides of the brake pad are calculated and determined through the fixed relative position relationship between the character areas at the two sides of the brake pad and the two positioning round holes, so that the automatic positioning of the character areas at the two sides of the brake pad is realized;
1.2) character region extraction: extracting left and right character area images Z from the original image O according to the positions of the circumscribed rectangles of the character areas on the two sides determined in the step 1.1) and m rows multiplied by n columns of the preset circumscribed rectangles;
1.3) character area image noise reduction: performing noise reduction on the left and right character area images Z obtained in the step 1.2) by adopting a corrosion and expansion algorithm of a gray scale image to obtain noise reduction images L of the left and right character areasZ
1.4) character area image binarization: applying an adaptive threshold segmentation algorithm to the noise-reduced image L obtained in step 1.3)ZCarrying out binarization processing to obtain a binarization image D; the self-adaptive threshold segmentation algorithm realizes image segmentation by respectively calculating a segmentation threshold of each pixel, and the realization method comprises the following steps: solving the weighted average value of the pixel gray values in the N neighborhood of each pixel; subtracting a constant C from the weighted average value of the pixel to obtain a binarization segmentation threshold value T of the pixel; if the current processed image is a template image used for the subsequent character imprinting quality inspection, the step 1.5) is carried out after the step is finished; if the current processed image is the image to be detected, entering the step 1.8) after the step is finished;
1.5) vertical projection: are respectively opposite to each otherCarrying out vertical projection on the two-side character area binary image D obtained in the step 1.4) to obtain a vertical projection histogram TXVertical projection histogram TXThe height of (a) represents the number of pixels of which the gray scale value is 0 in each column corresponding to the binarized image D; in the vertical projection of histogram TXCorresponding to the boundary point with the height of 0 and non-0, cutting the image at the corresponding column in the binary image D, and reserving the vertical projection histogram TXObtaining a vertical projection segmentation image S in a region with a height not corresponding to 0X
1.6) horizontal projection: segmenting the image S for vertical projectionXPerforming horizontal projection to obtain horizontal projection histogram TYHorizontal projection histogram TYIs indicative of the vertical projection segmented image SXCorresponding to the number of pixels with the gray scale value of 0 in each row; projecting histogram T in the horizontal directionYCorresponds to a boundary point with a width of 0 and a non-0 and divides the image S in the vertical projectionXCutting the image at the middle corresponding line and reserving the horizontal projection histogram TYObtaining a character template image in an area with a width different from 0;
1.7) storage of matching templates: storing the character template image obtained in the step 1.6) as a matching template for subsequent character imprinting quality inspection;
1.8) character imprinting quality inspection: the character impression quality inspection of the surface of the automobile brake pad is realized through a character impression correctness judgment method; according to the method, corresponding matching templates are used for matching and obtaining the best matching regions (namely the sub-regions with the highest coincidence rate with the matching templates in the character regions) one by one according to the character imprinting sequence from top to bottom in the character regions on the left side and the right side in a binary image D through a template matching algorithm, the best matching regions corresponding to each matching template are filled into white through region filling, finally, the character imprinting quality inspection on the surface of the automobile brake pad is realized according to whether the number of remaining black pixels in the filled image exceeds a threshold value, if the number of remaining black pixels in the image is smaller than the threshold value, the character imprinting quality is qualified, and if not, the character imprinting quality is unqualified.
The method for automatically positioning the character area of the automobile brake pad in the step 1.1) comprises the following steps:
2.1) image segmentation: carrying out image segmentation on the automobile brake pad by adopting an OTSU automatic threshold image segmentation algorithm based on a gray image to obtain a binary image B; the non-brake pad area and the two positioning round hole areas of the brake pad in the binary image B are taken as backgrounds, and the brake pad area is taken as a foreground;
2.2) image noise reduction: performing Gaussian blur on the binary image B; performing erosion-dilation operation on the basis of Gaussian blur to eliminate noise points in the image to obtain a filtered image LB
2.3) extracting two positioning round hole areas: by BLOB analysis, a filtered image L is extractedBThe maximum background area in the brake pad is inverted, the maximum background area is converted into a foreground area, and the rest background area is the two positioning round hole areas of the brake pad, so that the two positioning round hole areas of the brake pad are extracted; reading the horizontal and vertical coordinates of the image of the pixel with the gray value of 0 in the two positioning round hole areas, wherein the horizontal coordinate ranges of the two positioning round hole areas are different in the image coordinate system because the two positioning round hole areas are arranged on the left side and the right side of the brake pad respectively, and therefore when the horizontal coordinate of the pixel in the positioning round hole area is less than half of the total array number of the image, the pixel is considered to belong to the left positioning round hole area; when the horizontal coordinate of the pixel of the positioning round hole area is more than half of the total number of the columns of the image, the pixel is considered to belong to the right positioning round hole area;
2.4) calculating the circle center coordinates and the distance between the two positioning holes: the circle center coordinate values (X) of the left positioning round hole and the right positioning round hole are obtained by applying a least square method fitting circle formula to all pixel points in the round hole areaL,YL)、(XR,YR) And calculating the distance L between the two circle centers, as shown in formula (1):
Figure GDA0002744630240000031
2.5) calculating the inclination angle of the brake pad: the included angle value alpha formed by the connecting line of the circle centers of the two positioning round holes of the brake pad and the horizontal coordinate axis of the image is used as the inclination angle of the brake pad, and the calculation is shown as the formula (2):
Figure GDA0002744630240000032
2.6) image rotation: rotating the image by an angle of-alpha around a midpoint A of a connecting line of the centers of the two positioning circular holes to enable the connecting line of the centers of the two positioning circular holes to be parallel to a horizontal coordinate axis of the image; the coordinates of the centers of the positioning round holes at the left side and the right side after rotation are respectively (X)l,Yl)、(Xr,Yr) It is calculated as shown in equation (3):
Figure GDA0002744630240000041
2.7) calculating the coordinates of the character area circumscribed rectangle characteristic points: defining the upper right vertex of the circumscribed rectangle of the left character area as a characteristic point of the character area, and defining the upper left vertex of the circumscribed rectangle of the right character area as the characteristic point of the character area; because the relative position relation of the centers of the left and right character areas and the left and right positioning round holes on the surface of the brake pad is fixed, the image coordinates (x) of the characteristic points of the left and right character areas can be calculated according to the coordinates of the centers of the left and right positioning round holesl,yl)、(xr,yr) As shown in formula (4):
Figure GDA0002744630240000042
in the formula: a and b are preset proportionality coefficients which are constants;
2.8) calculation of the length and width of the circumscribed rectangle of the character region (length in the vertical direction and width in the horizontal direction): because the size of the area where the characters are stamped on the surface of the brake pad is fixed, the length m and the width n of the circumscribed rectangle of the character area can be proportionally determined according to the circle center distance L of the two fixed positioning round holes obtained in the step 2.4), as shown in the formula (5):
m=cL,n=dL (5)
in the formula: c. d is a preset proportionality coefficient and is a constant;
2.9) character area positioning: according to character region characteristics of left and right sidesCharacteristic point coordinate (x)l,yl)、(xr,yr) And the length m and the width n of the circumscribed rectangle of the character area, calculating the coordinates of the rest 3 vertexes of the circumscribed rectangle of the character areas on the left side and the right side, and completing the positioning of the character areas on the left side and the right side, as shown in formula (6):
Figure GDA0002744630240000043
in the formula: (x)llu,yllu)、(xlld,ylld)、(xlrd,ylrd)、(xrru,yrru)、(xrrd,yrrd)、(xrld,yrld) The coordinates in the image plane of the upper left corner point, the lower right corner point of the left character area, the upper right corner point, the lower right corner point and the lower left corner point of the right character area are respectively.
The method for judging the character imprinting correctness in the step 1.8) is realized by the following steps:
3.1) template matching: respectively matching the left and right character areas in the binarized image D by using corresponding matching templates one by one according to a character imprinting sequence from top to bottom (which can also be adjusted according to actual conditions) through a template matching algorithm, and acquiring an optimal matching area (namely a sub-area with the highest coincidence rate with the matching templates in the character area);
3.2) best matching area filling: filling the image into the optimal matching area, namely filling all pixels in the optimal matching area into white, namely adjusting all gray values to 255; the filling area is 3 pixels widened in the upper, lower, left and right directions on the basis of the size of the matched template, so that the checked character is completely covered, and the character is prevented from being checked repeatedly;
3.3) returning to the step 3.1) until the matching of all characters in the left and right character areas is completed, and turning to the step 3.4):
3.4) counting the total number S of pixels with the gray value of 0 in the character areas at the left and right sidesN
3.5) total number S of pixels with gray value of 0 according to the left and right character areasNJudging whether the character imprinting quality is qualified or not: if SN<TN(TNA preset threshold value), the character imprinting is correct, and the character imprinting quality is qualified; otherwise, the character imprinting is wrong, and the character imprinting quality is unqualified.
The invention has the beneficial effects that: the invention realizes the inspection of the character imprinting quality of the surface of the automobile brake pad, can provide a new method for realizing the automatic positioning of the area where the visual detection object is positioned, and can provide a new idea for the inspection of the character imprinting quality.
Drawings
FIG. 1 is a schematic diagram of the components of a character imprinting quality inspection system for an automobile brake pad.
FIG. 2 is a flow chart of a character imprinting quality inspection method for an automobile brake pad.
FIG. 3 is a brake pad sample view.
FIG. 4 is a brake pad pattern image segmentation result.
FIG. 5 is a brake pad pattern noise reduction result.
FIG. 6 is a diagram of a brake pad positioning hole extracted after an inversion operation.
Fig. 7 is a schematic view of image rotation correction.
FIG. 8 is a schematic diagram of the calculation of coordinates of feature points of a rectangle circumscribing a character region.
Fig. 9 is a character area diagram extracted after the brake pad character area is located.
FIG. 10 is a binary image of a character region.
Fig. 11 is a two-sided character region vertical projection histogram.
Fig. 12 is a horizontal projection histogram of both side character regions.
FIG. 13 is a drawing of the extracted character matching template.
In fig. 1: the system comprises a camera 1, a computer 2, automobile brake pad surface character imprinting quality inspection software 3, 4 strip light sources 4, 5, 7 and 8, an automobile brake pad 6 and an optical lens 9.
Detailed Description
The invention is further illustrated by the following figures and examples.
FIG. 1 illustrates one embodiment of a system for locating characters on the surface of an automotive brake pad. Comprises a character area positioning system of an automobile brake pad and an image receiving device. The lighting system uses a square lighting system consisting of 4 30w red stripe lights 4, 5, 7, 8. The image receiving device adopts a black-and-white camera 1, the model of the black-and-white camera is JHSM500Bf-E, the maximum resolution is 2592 multiplied by 1944, the band buffer is provided, and the CMOS is 1/2.5'. The lens 9 is a megapixel lens with the model number of JHL 1108-5M. The computer 2 is a WIN 7 operating system and the image processing algorithm programming environment is Microsoft Visual Studio 2010. The automobile brake pad 5 is a excel (JuRID) brake pad with the model number of 200 FF.
The specific implementation of character area positioning of the automobile brake pad is as follows:
adjusting an illumination system to enable the illumination intensity of an image acquisition area to be moderate and uniform, and the gears of the red strip lights 4, 5, 7 and 8 are respectively 6.2, 6.8 and 6.6; converting the received optical image into an electronic image through a lens 9 and a black-and-white camera 1 and inputting the electronic image into a computer 2; and the automobile brake pad character area positioning software 3 in the computer 2 realizes the automatic positioning of the brake pad character area.
As shown in fig. 2, the automatic positioning method for the character area of the automobile brake pad in the automobile brake pad character area positioning software 5 is specifically implemented as follows:
1.1) character area positioning: the method comprises the following steps of automatically positioning and extracting character areas on the left side and the right side of a brake pad by adopting an automatic positioning method for character areas of the automobile brake pad; firstly, extracting a binary image B of the automobile brake pad through an OTSU automatic threshold segmentation algorithm, and denoising the binary image B of the automobile brake pad based on Gaussian filtering and corrosion expansion algorithm; secondly, two positioning round holes of the brake pad are extracted through BLOB analysis, and least square method fitting circle formulas are applied to all pixel points in the round hole area to extract the circle center image coordinates of the two positioning round holes of the brake pad; performing image rotation correction of a corresponding angle based on an included angle formed by a circle center connecting line of the two positioning circular holes and an image abscissa, so that the circle center connecting line of the two positioning circular holes of the brake pad is parallel to the image abscissa; finally, image coordinates of external rectangle characteristic points (points for determining the positions of the external rectangles of the character areas at the two sides in an image coordinate system) of the character areas at the two sides of the brake pad are calculated and determined through the fixed relative position relationship between the character areas at the two sides of the brake pad and the two positioning round holes, so that the automatic positioning of the character areas at the two sides of the brake pad is realized;
1.2) character region extraction: according to the positions of the circumscribed rectangles of the two side character areas determined in the step 1.1) and the size of the preset circumscribed rectangles m rows × n columns, left and right side character area images Z, namely, two side rectangle dotted line areas in fig. 8, are extracted from the original image O, as shown in fig. 9.
1.3) character area image noise reduction: performing noise reduction on the left and right character area images Z obtained in the step 1.2) by adopting a corrosion and expansion algorithm of a gray scale image to obtain noise reduction images L of the left and right character areasZ
The left character area image adopts a rectangular convolution kernel with the size of 10 multiplied by 10, and the right character area image adopts a rectangular convolution kernel with the size of 6 multiplied by 6;
1.4) character area image binarization: applying an adaptive threshold segmentation algorithm to the noise-reduced image L obtained in step 1.3)ZCarrying out binarization processing to obtain a binarization image D; the self-adaptive threshold segmentation algorithm realizes image segmentation by respectively calculating a segmentation threshold of each pixel, and the realization method comprises the following steps: solving the weighted average value of the pixel gray values in the N neighborhood of each pixel; subtracting a constant C from the weighted average value of the pixel to obtain a binarization segmentation threshold value T of the pixel; the present invention uses the mean of the neighborhood as the result of the weighted average. The mathematical expression of adaptive threshold segmentation is shown in equation (8):
Figure GDA0002744630240000071
in the formula, F (i, j) is the gray value of the pixel point in the ith row and the jth column in the N × N neighborhood of the pixel. The neighborhood of size 31 x 31 is used in the present invention, reduced by a constant of 20. The characters of a part of brake pads are slightly embossed, so that the difference between the gray level of the characters in the image and the gray level of the brake pads near the characters is small, the part of the image can be over-segmented when being subjected to adaptive threshold segmentation, and namely, the part of the characters can be segmented as a background. Therefore, a corresponding adjustment method is designed for the partial image, the number of pixels with the gray value of 0 is counted for the segmented image, if the number of the pixels with the gray value of 0 is less than 1300, the segmentation is considered to be over-segmented, at this time, the subtracted constant in the adaptive threshold segmentation is adjusted to 15, and then the image before the adaptive segmentation is subjected to the new adaptive threshold segmentation. The segmentation results are shown in fig. 10. If the current processed image is a template image used for the subsequent character imprinting quality inspection, the step 1.5) is carried out after the step is finished; if the current processed image is the image to be detected, entering the step 1.8) after the step is finished;
1.5) vertical projection: respectively carrying out vertical projection on the two-side character area binary images D obtained in the step 1.4) to obtain a vertical projection histogram TXAs shown in fig. 11, the histogram T is vertically projectedXThe height of (a) represents the number of pixels of which the gray scale value is 0 in each column corresponding to the binarized image D; in the vertical projection of histogram TXThe boundary point (the boundary point of the white area and the black area on the abscissa axis in fig. 11) with the height of 0 and non-0 is correspondingly cut at the corresponding column in the binary image D, and the vertical projection histogram T is keptXThe region (black region in fig. 11) having a height other than 0 corresponds to the vertical projection divided image SX
1.6) horizontal projection: segmenting the image S for vertical projectionXPerforming horizontal projection to obtain horizontal projection histogram TYAs shown in fig. 12, the histogram T is projected horizontallyYIs indicative of the vertical projection segmented image SXCorresponding to the number of pixels with the gray scale value of 0 in each row; projecting histogram T in the horizontal directionYThe boundary point between 0 and non-0 (the boundary point on the ordinate of the white area and the black area in fig. 12) corresponds to the vertical projection divided image SXCutting the image at the middle corresponding line and reserving the horizontal projection histogram TYA region (black region in fig. 12) having a width other than 0, to obtain a character template image;
1.7) storage of matching templates: storing the character template image obtained in the step 1.6) as a matching template for subsequent character imprinting quality inspection, as shown in fig. 13;
1.8) character imprinting quality inspection: the character impression quality inspection of the surface of the automobile brake pad is realized through a character impression correctness judgment method; according to the method, corresponding matching templates are used for matching and obtaining the best matching regions (namely the sub-regions with the highest coincidence rate with the matching templates in the character regions) one by one according to the character imprinting sequence from top to bottom in the character regions on the left side and the right side in a binary image D through a template matching algorithm, the best matching regions corresponding to each matching template are filled into white through region filling, finally, the character imprinting quality inspection on the surface of the automobile brake pad is realized according to whether the number of remaining black pixels in the filled image exceeds a threshold value, if the number of remaining black pixels in the image is smaller than the threshold value, the character imprinting quality is qualified, and if not, the character imprinting quality is unqualified.
The method for automatically positioning the character area of the automobile brake pad in the step 1.1) comprises the following steps:
2.1) image segmentation: carrying out image segmentation on the automobile brake pad by adopting an OTSU automatic threshold image segmentation algorithm based on a gray image to obtain a binary image B; in the binary image B, the non-brake pad area and the two positioning round hole areas of the brake pad are backgrounds, the brake pad area is a foreground, as shown in fig. 4, the background area and the two positioning round hole areas of the brake pad are black, and the brake pad area is white;
2.2) image noise reduction: and performing Gaussian blur on the binary image B by adopting a 9 multiplied by 9 rectangular Gaussian filter, wherein the transverse filter coefficient and the longitudinal filter coefficient are both 2. On the basis of Gaussian blur, rectangular kernels with different sizes are adopted to carry out 3-round erosion expansion operation (erosion first and then expansion, expansion first and then erosion, erosion first and then expansion), the sizes of the adopted rectangular kernels are respectively 15 × 15, 20 × 20 and 10 × 10, noise points in the image are further eliminated, and a filtering image L is obtainedBAs shown in fig. 5;
2.3) extracting two positioning round hole areas: extracting the filtered image L by a BLOB analysis model of 3 x 3 sizeBAnd negating the largest background area in (1) to (2)The maximum background area is converted into a foreground area, and the rest background area is the two positioning round hole areas of the brake pad, so that the two positioning round hole areas of the brake pad are extracted, as shown in fig. 6 (the distribution of black and white areas in the drawing is opposite to the actual situation, and the observation is convenient); reading the horizontal and vertical coordinates of the image of the pixel with the gray value of 0 in the two positioning round hole areas, wherein the horizontal coordinate ranges of the two positioning round hole areas are different in the image coordinate system because the two positioning round hole areas are arranged on the left side and the right side of the brake pad respectively, and therefore when the horizontal coordinate of the pixel in the positioning round hole area is less than half of the total array number of the image, the pixel is considered to belong to the left positioning round hole area; when the horizontal coordinate of the pixel of the positioning round hole area is more than half of the total number of the columns of the image, the pixel is considered to belong to the right positioning round hole area;
2.4) calculating the circle center coordinates and the distance between the two positioning holes: the circle center coordinate values (X) of the left positioning round hole and the right positioning round hole are obtained by applying a least square method fitting circle formula to all pixel points in the round hole areaL,YL)、(XR,YR) And calculating the distance L between the two circle centers, as shown in formula (1):
Figure GDA0002744630240000091
2.5) calculating the inclination angle of the brake pad: the included angle value alpha formed by the connecting line of the circle centers of the two positioning round holes of the brake pad and the horizontal coordinate axis of the image is used as the inclination angle of the brake pad, and the calculation is shown as the formula (2):
Figure GDA0002744630240000092
2.6) image rotation: rotating the image by an angle of-alpha around a midpoint A of a connecting line of the centers of the two positioning circular holes to enable the connecting line of the centers of the two positioning circular holes to be parallel to a horizontal coordinate axis of the image; the coordinates of the centers of the positioning round holes at the left side and the right side after rotation are respectively (X)l,Yl)、(Xr,Yr) It is calculated as shown in equation (3):
Figure GDA0002744630240000093
2.7) calculating the coordinates of the character area circumscribed rectangle characteristic points: defining the upper right vertex of the circumscribed rectangle of the left character area as a characteristic point of the character area, and defining the upper left vertex of the circumscribed rectangle of the right character area as the characteristic point of the character area; because the relative position relation of the centers of the left and right character areas and the left and right positioning round holes on the surface of the brake pad is fixed, the image coordinates (x) of the characteristic points of the left and right character areas can be calculated according to the coordinates of the centers of the left and right positioning round holesl,yl)、(xr,yr) As shown in formula (4):
Figure GDA0002744630240000094
in the formula: a and b are preset proportionality coefficients and are constants, and a is 0.495 and b is 0.29 through test determination; (ii) a
2.8) calculation of the length and width of the circumscribed rectangle of the character region (length in the vertical direction and width in the horizontal direction): because the size of the area where the characters are stamped on the surface of the brake pad is fixed, the length m and the width n of the circumscribed rectangle of the character area can be proportionally determined according to the circle center distance L of the two fixed positioning round holes obtained in the step 2.4), as shown in the formula (5):
m=cL,n=dL (5)
in the formula: c. d is a preset proportionality coefficient and is a constant, and the experiment determines that c is 0.19 and d is 0.079;
2.9) character area positioning: according to the coordinates (x) of the characteristic points of the left and right character areasl,yl)、(xr,yr) And the length m and the width n of the circumscribed rectangle of the character area, calculating the coordinates of the rest 3 vertexes of the circumscribed rectangle of the character areas on the left side and the right side, and completing the positioning of the character areas on the left side and the right side, as shown in formula (6):
Figure GDA0002744630240000101
in the formula: (x)llu,yllu)、(xlld,ylld)、(xlrd,ylrd)、(xrru,yrru)、(xrrd,yrrd)、(xrld,yrld) The coordinates in the image plane of the upper left corner point, the lower right corner point of the left character area, the upper right corner point, the lower right corner point and the lower left corner point of the right character area are respectively.
The method for judging the character imprinting correctness in the step 1.8) is realized by the following steps:
3.1) template matching: respectively matching the left and right character areas in the binary image D by calling template matching functions (matchtemplates) in an OpenCV library according to a certain sequence by using corresponding matching templates one by one, and acquiring an optimal matching area (namely a sub-area with the highest coincidence rate with the matching template in the character area); the characteristic parameter for matching is CV _ TM _ SQDIFF, namely the square difference, and the mathematical expression of the characteristic parameter is shown as a formula (7);
Figure GDA0002744630240000102
in the formula, T (x ', y') represents the gray value of the pixel points in the y 'th row and the y' th column in the template image, I (x + x ', y + y') represents the gray value of the pixel points in the y + y 'th row and the x + x' th column in the image to be identified, and the upper left corner point of the template image is located in the y +1 th row and the y +1 th column in the image to be identified.
Since the left characters "I" and "J" may be mismatched with other characters in the matching process, template matching is performed in the order of "D", "R", "U", "J", and "I" in the template matching process of the left character. The template matching process of the right character carries out template matching according to the sequence from top to bottom (namely 'F', '0' and '2');
3.2) best matching area filling: filling the image into the optimal matching area, namely filling all pixels in the optimal matching area into white, namely adjusting all gray values to 255; the filling area is 3 pixels widened in the upper, lower, left and right directions on the basis of the size of the matched template, so that the checked character is completely covered, and the character is prevented from being checked repeatedly;
3.3) returning to the step 3.1) until the matching of all characters in the left and right character areas is completed, and turning to the step 3.4):
3.4) counting the total number S of pixels with the gray value of 0 in the character areas at the left and right sidesN
3.5) total number S of pixels with gray value of 0 according to the left and right character areasNJudging whether the character imprinting quality is qualified or not: if SN<TN(TNA preset threshold value), the character imprinting is correct, and the character imprinting quality is qualified; otherwise, the character imprinting is wrong, and the character imprinting quality is unqualified. Determined by experiments, the preset threshold value TN=60。
And carrying out surface character imprinting quality inspection on 216 brake pad images to be inspected according to the steps and the method, wherein the accuracy of character area positioning is 100%, the accuracy of character inspection is 100%, and the inspection speed is 1.692 s/pad, so that the surface character imprinting quality inspection of the automobile brake pad can be efficiently and accurately realized.

Claims (1)

1. A method for testing the stamping quality of characters on the surface of an automobile brake pad is characterized by comprising the following steps:
1.1) character area positioning, comprising the following steps:
image segmentation: carrying out image segmentation on the automobile brake pad by adopting an OTSU automatic threshold image segmentation algorithm based on a gray image to obtain a binary image B; the non-brake pad area and the two positioning round hole areas of the brake pad in the binary image B are taken as backgrounds, and the brake pad area is taken as a foreground;
image denoising: performing Gaussian blur on the binary image B; performing erosion-dilation operation on the basis of Gaussian blur to eliminate noise points in the image to obtain a filtered image LB
Extracting two positioning round hole areas: by BLOB analysis, a filtered image L is extractedBAnd negating the maximum background area in the background image to obtain the maximum backgroundThe area is converted into a foreground area, and the rest background area is the two positioning round hole areas of the brake pad, so that the two positioning round hole areas of the brake pad are extracted; reading the horizontal and vertical coordinates of the image of the pixel with the gray value of 0 in the two positioning round hole areas, wherein the horizontal coordinate ranges of the two positioning round hole areas are different in the image coordinate system because the two positioning round hole areas are arranged on the left side and the right side of the brake pad respectively, and therefore when the horizontal coordinate of the pixel in the positioning round hole area is less than half of the total array number of the image, the pixel is considered to belong to the left positioning round hole area; when the horizontal coordinate of the pixel of the positioning round hole area is more than half of the total number of the columns of the image, the pixel is considered to belong to the right positioning round hole area;
fourthly, calculating the circle center coordinates and the space between the two positioning holes: the circle center coordinate values (X) of the left positioning round hole and the right positioning round hole are obtained by applying a least square method fitting circle formula to all pixel points in the round hole areaL,YL)、(XR,YR) And calculating the distance L between the two circle centers, as shown in formula (1):
Figure FDA0002758011710000011
calculating the inclination angle of the brake pad: the included angle value alpha formed by the connecting line of the circle centers of the two positioning round holes of the brake pad and the horizontal coordinate axis of the image is used as the inclination angle of the brake pad, and the calculation is shown as the formula (2):
Figure FDA0002758011710000012
image rotation: rotating the image by an angle of-alpha around a midpoint A of a connecting line of the centers of the two positioning circular holes to enable the connecting line of the centers of the two positioning circular holes to be parallel to a horizontal coordinate axis of the image; the coordinates of the centers of the positioning round holes at the left side and the right side after rotation are respectively (X)l,Yl)、(Xr,Yr) It is calculated as shown in equation (3):
Figure FDA0002758011710000013
and (c) calculating coordinates of the character region circumscribed rectangle characteristic points: defining the upper right vertex of the circumscribed rectangle of the left character area as a characteristic point of the character area, and defining the upper left vertex of the circumscribed rectangle of the right character area as the characteristic point of the character area; because the relative position relation of the centers of the left and right character areas and the left and right positioning round holes on the surface of the brake pad is fixed, the image coordinates (x) of the characteristic points of the left and right character areas can be calculated according to the coordinates of the centers of the left and right positioning round holesl,yl)、(xr,yr) As shown in formula (4):
Figure FDA0002758011710000021
in the formula: a and b are preset proportionality coefficients which are constants;
calculating the length and width of a rectangle externally connected with the character area, wherein the length is in the vertical direction, and the width is in the horizontal direction: because the size of the area where the characters are stamped on the surface of the brake pad is fixed, the length m and the width n of the circumscribed rectangle of the character area can be proportionally determined according to the circle center distance L of the two fixed positioning round holes obtained in the step (1.1), as shown in the formula (5):
m=cL,n=dL (5)
in the formula: c. d is a preset proportionality coefficient and is a constant;
ninthly, character area positioning: according to the coordinates (x) of the characteristic points of the left and right character areasl,yl)、(xr,yr) And the length m and the width n of the circumscribed rectangle of the character area, calculating the coordinates of the rest 3 vertexes of the circumscribed rectangle of the character areas on the left side and the right side, and completing the positioning of the character areas on the left side and the right side, as shown in formula (6):
Figure FDA0002758011710000022
in the formula: (x)llu,yllu)、(xlld,ylld)、(xlrd,ylrd)、(xrru,yrru)、(xrrd,yrrd)、(xrld,yrld) Coordinates in an image plane of an upper left corner point, a lower left corner point and a lower right corner point of the left character region and an upper right corner point, a lower right corner point and a lower left corner point of the right character region respectively;
1.2) character region extraction: extracting left and right character area images Z from the original image O according to the positions of the circumscribed rectangles of the character areas on the two sides determined in the step 1.1) and m rows multiplied by n columns of the preset circumscribed rectangles;
1.3) character area image noise reduction: performing noise reduction on the left and right character area images Z obtained in the step 1.2) by adopting a corrosion and expansion algorithm of a gray scale image to obtain noise reduction images L of the left and right character areasZ
1.4) character area image binarization: applying an adaptive threshold segmentation algorithm to the noise-reduced image L obtained in step 1.3)ZCarrying out binarization processing to obtain a binarization image D; the self-adaptive threshold segmentation algorithm realizes image segmentation by respectively calculating a segmentation threshold of each pixel, and the realization method comprises the following steps: solving the weighted average value of the pixel gray values in the N neighborhood of each pixel; subtracting a constant C from the weighted average value of the pixel to obtain a binarization segmentation threshold value T of the pixel; if the current processed image is a template image used for the subsequent character imprinting quality inspection, the step 1.5) is carried out after the step is finished; if the current processed image is the image to be detected, entering the step 1.8) after the step is finished;
1.5) vertical projection: respectively carrying out vertical projection on the two-side character area binary images D obtained in the step 1.4) to obtain a vertical projection histogram TXVertical projection histogram TXThe height of (a) represents the number of pixels of which the gray scale value is 0 in each column corresponding to the binarized image D; in the vertical projection of histogram TXCorresponding to the boundary point with the height of 0 and non-0, cutting the image at the corresponding column in the binary image D, and reserving the vertical projection histogram TXObtaining a vertical projection segmentation image S in a region with a height not corresponding to 0X
1.6) horizontal projection: segmenting the image S for vertical projectionXTo perform horizontal castingShadow, obtaining a horizontal projection histogram TYHorizontal projection histogram TYIs indicative of the vertical projection segmented image SXCorresponding to the number of pixels with the gray scale value of 0 in each row; projecting histogram T in the horizontal directionYCorresponds to a boundary point with a width of 0 and a non-0 and divides the image S in the vertical projectionXCutting the image at the middle corresponding line and reserving the horizontal projection histogram TYObtaining a character template image in an area with a width different from 0;
1.7) storage of matching templates: storing the character template image obtained in the step 1.6) as a matching template for subsequent character imprinting quality inspection;
1.8) character impression quality check, comprising the following steps:
matching templates: respectively matching the left and right character areas in the binary image D by using corresponding matching templates one by one according to a character imprinting sequence from top to bottom through a template matching algorithm, and acquiring an optimal matching area, namely a sub-area with the highest coincidence rate with the matching templates in the character areas;
filling the optimal matching area: filling the image into the optimal matching area, namely filling all pixels in the optimal matching area into white, namely adjusting all gray values to 255; the filling area is 3 pixels widened in the upper, lower, left and right directions on the basis of the size of the matched template, so that the checked character is completely covered, and the character is prevented from being checked repeatedly;
thirdly, returning to the step 1.8), and turning to the step 1.8) until the matching of all characters in the left and right character areas is completed;
fourthly, counting the total number S of pixels with 0 gray value in the character areas at the left side and the right sideN
The total number S of pixels with gray value of 0 in the left and right character regionsNJudging whether the character imprinting quality is qualified or not: if SN<TN,TNIf the preset threshold value is reached, the character imprinting is correct, and the character imprinting quality is qualified; otherwise, the character imprinting is wrong, and the character imprinting quality is unqualified.
CN201910255460.1A 2019-04-01 2019-04-01 Method for testing character imprinting quality of surface of automobile brake pad Expired - Fee Related CN110008955B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910255460.1A CN110008955B (en) 2019-04-01 2019-04-01 Method for testing character imprinting quality of surface of automobile brake pad

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910255460.1A CN110008955B (en) 2019-04-01 2019-04-01 Method for testing character imprinting quality of surface of automobile brake pad

Publications (2)

Publication Number Publication Date
CN110008955A CN110008955A (en) 2019-07-12
CN110008955B true CN110008955B (en) 2020-12-15

Family

ID=67169167

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910255460.1A Expired - Fee Related CN110008955B (en) 2019-04-01 2019-04-01 Method for testing character imprinting quality of surface of automobile brake pad

Country Status (1)

Country Link
CN (1) CN110008955B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110412052B (en) * 2019-08-12 2022-02-15 艾尔玛科技股份有限公司 Curved surface hot stamping quality detection method and system
CN111192273A (en) * 2019-12-27 2020-05-22 西北工业大学 Digital shot blasting coverage rate measuring method based on computer vision technology

Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5321995A (en) * 1993-01-11 1994-06-21 Chrysler Corporation Parking brake pedal pad
CN101334837A (en) * 2008-07-31 2008-12-31 重庆大学 Multi-method integrated license plate image positioning method
CN101706873A (en) * 2009-11-27 2010-05-12 东软集团股份有限公司 Identification method and device of digital-class limitation marking
CN101739566A (en) * 2009-12-04 2010-06-16 重庆大学 Self-adapting projection template method-based automobile plate positioning method
CN103324930A (en) * 2013-06-28 2013-09-25 浙江大学苏州工业技术研究院 License plate character segmentation method based on grey level histogram binaryzation
US8851246B2 (en) * 2009-07-27 2014-10-07 Knorr-Bremse Systeme Fuer Nutzfahrzeuge Gmbh Brake pad for a disc brake
CN105258727A (en) * 2015-10-28 2016-01-20 中国计量学院 Brake backplane automatic detection device based on machine vision
CN105528789A (en) * 2015-12-08 2016-04-27 深圳市恒科通多维视觉有限公司 Robot vision positioning method and device, and visual calibration method and device
CN105701492A (en) * 2014-11-25 2016-06-22 宁波舜宇光电信息有限公司 Machine vision identification system and implementation method thereof
CN106558089A (en) * 2015-09-21 2017-04-05 展讯通信(上海)有限公司 Image depth method for drafting and device
CN107084666A (en) * 2017-05-10 2017-08-22 中国计量大学 Brake block dimension synthesis detection method based on machine vision
CN206435500U (en) * 2017-01-16 2017-08-25 中国计量大学 Brake block product quality automatic detection device
CN109035225A (en) * 2018-07-12 2018-12-18 中国计量大学 A kind of automotive brake pads presentation quality inspection illumination system layout quality evaluating method

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2578898A1 (en) * 2010-06-04 2013-04-10 Toyota Jidosha Kabushiki Kaisha Break device, friction couple and break pad for brake system
CN102651069B (en) * 2012-03-31 2013-09-25 重庆大学 Contour-based local invariant region detection method
CN106384113A (en) * 2016-11-07 2017-02-08 湖南源信光电科技有限公司 Odd-and-even-line license plate character dividing method based on projection and template matching

Patent Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5321995A (en) * 1993-01-11 1994-06-21 Chrysler Corporation Parking brake pedal pad
CN101334837A (en) * 2008-07-31 2008-12-31 重庆大学 Multi-method integrated license plate image positioning method
US8851246B2 (en) * 2009-07-27 2014-10-07 Knorr-Bremse Systeme Fuer Nutzfahrzeuge Gmbh Brake pad for a disc brake
CN101706873A (en) * 2009-11-27 2010-05-12 东软集团股份有限公司 Identification method and device of digital-class limitation marking
CN101739566A (en) * 2009-12-04 2010-06-16 重庆大学 Self-adapting projection template method-based automobile plate positioning method
CN103324930A (en) * 2013-06-28 2013-09-25 浙江大学苏州工业技术研究院 License plate character segmentation method based on grey level histogram binaryzation
CN105701492A (en) * 2014-11-25 2016-06-22 宁波舜宇光电信息有限公司 Machine vision identification system and implementation method thereof
CN106558089A (en) * 2015-09-21 2017-04-05 展讯通信(上海)有限公司 Image depth method for drafting and device
CN105258727A (en) * 2015-10-28 2016-01-20 中国计量学院 Brake backplane automatic detection device based on machine vision
CN105528789A (en) * 2015-12-08 2016-04-27 深圳市恒科通多维视觉有限公司 Robot vision positioning method and device, and visual calibration method and device
CN206435500U (en) * 2017-01-16 2017-08-25 中国计量大学 Brake block product quality automatic detection device
CN107084666A (en) * 2017-05-10 2017-08-22 中国计量大学 Brake block dimension synthesis detection method based on machine vision
CN109035225A (en) * 2018-07-12 2018-12-18 中国计量大学 A kind of automotive brake pads presentation quality inspection illumination system layout quality evaluating method

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
基于Halcon的刹车片字符检测算法研究;马艳宁等;《电子科技》;20161015;第29卷(第10期);摘要、第1-5部分 *
用于刹车片外观质量检验的照明系统质量检验;项荣;《仪器仪表学报》;20181130;第39卷(第11期);全文 *

Also Published As

Publication number Publication date
CN110008955A (en) 2019-07-12

Similar Documents

Publication Publication Date Title
CN115375676B (en) Stainless steel product quality detection method based on image recognition
CN107545239B (en) Fake plate detection method based on license plate recognition and vehicle characteristic matching
CN109034145B (en) Bank card number identification method based on OpenCV
CN110930390B (en) Chip pin missing detection method based on semi-supervised deep learning
US11490854B2 (en) Method and device for analyzing water content of skin by means of skin image
CN115908269B (en) Visual defect detection method, visual defect detection device, storage medium and computer equipment
CN110210448B (en) Intelligent face skin aging degree identification and evaluation method
CN107490582B (en) Assembly line workpiece detection system
CN112686858A (en) Visual defect detection method, device, medium and equipment for mobile phone charger
CN111583216A (en) Defect detection method for PCBA
CN105447512A (en) Coarse-fine optical surface defect detection method and coarse-fine optical surface defect detection device
Shaikh et al. A novel approach for automatic number plate recognition
CN114881915A (en) Symmetry-based mobile phone glass cover plate window area defect detection method
CN110008955B (en) Method for testing character imprinting quality of surface of automobile brake pad
CN110674812A (en) Civil license plate positioning and character segmentation method facing complex background
CN117094975A (en) Method and device for detecting surface defects of steel and electronic equipment
CN109800641B (en) Lane line detection method based on threshold value self-adaptive binarization and connected domain analysis
CN115661110B (en) Transparent workpiece identification and positioning method
CN108205641B (en) Gesture image processing method and device
CN109690555B (en) Curvature-based face detector
CN112183229B (en) Word lattice extraction method and device of operation paper image based on calculation dynamic parameters
JP4115378B2 (en) Defect detection method
CN110321828B (en) Front vehicle detection method based on binocular camera and vehicle bottom shadow
CN114359597A (en) Oil tank inner cover identification and pose parameter sensing method based on vision
CN113505811A (en) Machine vision imaging method for hub production

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20201215

CF01 Termination of patent right due to non-payment of annual fee