CN113393538B - Gate crack detection method based on double-checkerboard calibration - Google Patents

Gate crack detection method based on double-checkerboard calibration Download PDF

Info

Publication number
CN113393538B
CN113393538B CN202110796408.4A CN202110796408A CN113393538B CN 113393538 B CN113393538 B CN 113393538B CN 202110796408 A CN202110796408 A CN 202110796408A CN 113393538 B CN113393538 B CN 113393538B
Authority
CN
China
Prior art keywords
checkerboard
area
calibration plate
point set
checkerboard calibration
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.)
Active
Application number
CN202110796408.4A
Other languages
Chinese (zh)
Other versions
CN113393538A (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.)
Nanjing Xinbida Intelligent Technology Co ltd
Nanjing Sure Tech & Dev Co ltd
Original Assignee
Nanjing Xinbida Intelligent Technology Co ltd
Nanjing Sure Tech & Dev Co ltd
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 Nanjing Xinbida Intelligent Technology Co ltd, Nanjing Sure Tech & Dev Co ltd filed Critical Nanjing Xinbida Intelligent Technology Co ltd
Priority to CN202110796408.4A priority Critical patent/CN113393538B/en
Publication of CN113393538A publication Critical patent/CN113393538A/en
Application granted granted Critical
Publication of CN113393538B publication Critical patent/CN113393538B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/80Analysis of captured images to determine intrinsic or extrinsic camera parameters, i.e. camera calibration
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/136Segmentation; Edge detection involving thresholding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/60Analysis of geometric attributes
    • G06T7/62Analysis of geometric attributes of area, perimeter, diameter or volume
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30204Marker

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Geometry (AREA)
  • Image Processing (AREA)
  • Length Measuring Devices By Optical Means (AREA)

Abstract

The invention discloses a gate crack detection method based on double checkerboard calibration, which has the technical scheme that the method comprises a preparation step and a detection step, wherein the preparation step comprises the steps of acquiring internal parameters and distortion parameters of a camera module, erecting the camera module for image acquisition, the detection step comprises the steps of carrying out gray scale treatment on an image, carrying out regional treatment and scaling treatment, thereby improving the speed of image treatment, acquiring a corner point set on a checkerboard, carrying out sub-pixel comparison, acquiring a sub-pixel corner point set which is extracted finely, converting the sub-pixel corner point set into a camera corner point set, calculating the corner point set under a camera coordinate system through a conversion formula, and further obtaining the actual distance and the actual gate crack distance of a gate. The gate gap detection method based on double checkerboard calibration has the effects of accurately detecting the distance between two gates and improving the detection accuracy.

Description

Gate crack detection method based on double-checkerboard calibration
Technical Field
The invention relates to the technical field of image analysis, in particular to a gate crack detection method based on double-checkerboard calibration.
Background
The gate has wide application in hydraulic engineering, is mainly used for controlling to close and open a water discharge channel, can also intercept water flow, control water level, regulate flow and the like, and in the use process of the gate, if the gate can not be stably closed, larger potential safety hazards and economic losses are often brought, so that the gate is required to be detected in the closing process of the gate, the accurate detection of the distance between two gates is very important in the closing detection of the gate, however, the direct observation of a gate monitoring image by naked eyes can not achieve higher precision and long-time accuracy.
Although the prior art also has the function of monitoring and detecting the gate through image analysis processing, the algorithm of the prior art often carries out direct distance judgment according to the position of the gate on the image, which has strong dependence on the installation mode of a single gate and a camera. If the pose of the camera is slightly changed, the prior experience is not suitable for judging the distance between the gates, which brings higher economic cost and erection difficulty in maintenance, and meanwhile, the distance between the two gates cannot be judged in a time-efficient manner, and the accuracy cannot be ensured. Therefore, it is important to provide a means for accurately detecting the closing distance of the two gates.
Disclosure of Invention
Aiming at the defects of the prior art, the invention aims to provide a gate crack detection method based on double-checkerboard calibration, which has the effects of accurately detecting the distance between two gates and improving the detection accuracy.
In order to achieve the above purpose, the present invention provides the following technical solutions:
The method comprises a preparation step and a detection step, and specifically comprises the following steps:
The preparation steps are as follows:
s1, acquiring internal parameters and distortion parameters of a camera module;
s2, respectively installing a first checkerboard calibration plate and a second checkerboard calibration plate with the same model at the corners of one side of the two gates in the opposite direction;
s3, erecting a camera module, continuously collecting images of the checkerboard calibration plates, and establishing a camera coordinate system according to the position of the camera module;
The detection step comprises:
Step 1: gray processing is carried out on the color image acquired by the camera module to obtain a source image;
Step 2: carrying out regional treatment on a source image, obtaining a regional image through the regional treatment, and carrying out scaling treatment on the regional image to obtain a primary image;
Step 3: establishing a checkerboard pixel coordinate system by using a checkerboard, and acquiring a corner point set on the checkerboard calibration plate in the primary image in the checkerboard pixel coordinate system, wherein the corner point set is characterized by a point set of intersection points of black and white corners on the checkerboard calibration plate, the corner point set on the first checkerboard calibration plate is P A, and the corner point set on the second checkerboard calibration plate is P B;
Step 4: performing fine extraction according to the angular point set P A、PB sub-pixel comparison method obtained in the step 3 to obtain a sub-pixel angular point set U A、UB, wherein U A represents the sub-pixel angular point set on the first checkerboard calibration plate, and U B represents the sub-pixel angular point set on the second checkerboard calibration plate;
Step 5: respectively establishing a first 3D checkerboard coordinate system and a second 3D checkerboard coordinate system by taking the upper left corner of the first checkerboard calibration plate and the upper left corner of the second checkerboard calibration plate as an origin and the side length as coordinate axes, acquiring a camera angular point set V A under the first 3D checkerboard coordinate system, and acquiring a camera angular point set V B under the second 3D checkerboard coordinate system;
Step 6: carrying out pnp camera pose measurement matching on V A、VB and U A、UB respectively, and carrying in camera internal parameters and distortion parameters acquired in the step S1 when carrying out camera pose measurement matching to obtain an RT matrix under the camera coordinate system, wherein the RT matrix comprises R A、TA and R B、TB, R represents a rotation matrix of a point set, and T represents a translation vector of the point set;
Step 7: according to the transformation formula of the coordinate system, Calculating to obtain a corner point set C A、CB under a camera coordinate system, wherein C A represents the corner point set on a first checkerboard calibration plate in the camera coordinate system, and C B represents the corner point set on a second checkerboard calibration plate in the camera coordinate system;
Step 8: taking the midpoint coordinate C A、cB of the C A、CB as a representative of the actual distance D between the first checkerboard calibration plate and the second checkerboard calibration plate;
Step 9: and calculating the gate gap distance of the gate according to the actual distance between the middle points of the first checkerboard calibration plate and the second checkerboard calibration plate.
As a further improvement of the invention, an image optimization module is also arranged in the camera module, and an edge area is arranged in the image optimization module; the specific steps of the regionalization treatment in the step 2 are as follows:
Step 2.1: disposing the source image in an edge region;
step 2.2: collecting the image edges and the edges of the first checkerboard calibration plate and the second checkerboard calibration plate in the source image;
Step 2.3: calibrating the upper edge, the lower edge and the edge of one side deviating from the second checkerboard calibration plate, forming a first calibration line, calibrating the upper edge, the lower edge and the edge of one side deviating from the first checkerboard calibration plate, forming a second calibration line, and connecting the first calibration line and the second calibration line to form a closed calibration area;
Step 2.4: and cutting along the calibration area formed by the first surface calibration line and the second calibration line to form an area image.
As a further improvement of the invention, a scaling module is preset in the camera module, a comparison algorithm and an area threshold value are preset in the scaling module, the comparison algorithm is used for calculating the ratio of the area of the first checkerboard calibration plate to the area of the second checkerboard calibration plate to the area of the area image, and the scaling processing in the step 2 specifically comprises the following steps:
Step 2.5: calculating the area ratio of the first checkerboard calibration plate to the second checkerboard calibration plate and the area ratio of the area image according to a comparison algorithm, generating an area finger, wherein the area finger represents the ratio of the area ratio of the first checkerboard calibration plate to the area ratio of the area image to the area image of the second checkerboard calibration plate, and comparing the area value with an area threshold;
Step 2.6: if the area value is larger than the area threshold value, performing shrinkage processing; and if the area value is smaller than the area threshold value, performing amplification processing so that the area value is the same as the area threshold value, and representing the area image as the optimal size.
As a further improvement of the present invention, the specific steps of the reduction process and the enlargement process are as follows:
Step 2.61: acquiring a central point of the region image, and establishing a scaling coordinate system along the central point, wherein coordinate axes of the scaling coordinate system are respectively parallel to side lines of the region image;
Step 2.62: aligning one side line of the area image with one side line of the calibration area;
Step 2.63: and respectively performing difference calculation along the coordinate axis direction of the scaled coordinate system to respectively obtain length values Lx and Ly along the coordinate axis direction, and performing reduction or a method according to the length values obtained by the difference calculation so as to make the area value equal to the area threshold value.
As a further improvement of the present invention, the step 4 further includes a sub-pixel corner point set iteration step, and the camera module is further preset with a euclidean distance threshold, an iteration frequency threshold, and a window size threshold, which specifically includes the steps of:
Step 4.1: carrying out multiple sub-pixel comparison on the corner point set P A、PB to obtain a plurality of groups of sub-pixel corner point sets UA and UB;
Step 4.2: sequentially carrying out iterative processing on a plurality of groups of sub-pixel corner point sets, and calculating Euclidean distance between the position of the sub-pixel corner point set and the iterative sub-pixel corner point set at the end of each iteration;
stopping iteration when the calculated Euclidean distance is smaller than a preset Euclidean distance threshold value or the iteration number reaches a preset iteration number threshold value;
Step 4.3: after stopping iteration, judging the difference between the final U A、UB and the final P A、PB, and judging whether the difference is greater than half of a window size threshold;
If the difference is greater than half of the window size threshold, replacing the window size threshold with P A、PB to obtain a final sub-pixel corner point set U A、UB;
If the difference is less than half of the window size threshold, the final U A、UB is used as the sub-pixel corner point set.
As a further improvement of the present invention, the step 9 includes a distance algorithm, where the distance algorithm is used to calculate the door gap distance, and the specific calculation steps are as follows:
Step 9.1: calculating the side length L 1 of the first checkerboard calibration plate along the length direction of the gate and the side length L 2 of the second checkerboard calibration plate along the length direction of the gate;
step 9.2: the door gap distance H is calculated through a distance algorithm, and the specific distance algorithm is as follows:
Wherein: h represents a door gap distance value; d represents an actual distance value; l 1 represents the side length of the first checkerboard calibration plate along the length direction of the gate, and L 2 represents the side length of the second checkerboard calibration plate along the length direction of the gate.
As a further improvement of the present invention, the step 9 includes a truth strategy, where the truth strategy specifically is:
Step 9.1: component acquisition is carried out on c A、cB along the X, Y, Z axis of the camera coordinate system, and the acquired component values along X, Y, Z are subjected to difference processing to obtain error values D X、DY and D Z along X, Y, Z;
Step 9.2: acquiring a component c A、cB along X, Y, Z of the camera coordinate system for a plurality of times when the camera is closed in the camera coordinate system, and averaging the coordinate values acquired for a plurality of times to obtain component true values d X、dY and d Z;
Step 9.3: and taking the difference value between the obtained error value and the component true value as an actual distance.
As a further improvement of the present invention, the graying processing includes any one of a component method, an average method, and a weighted average method.
The invention has the beneficial effects that: the camera module is used for collecting the first checkerboard calibration plate and the second checkerboard calibration plate, gray processing is carried out on the obtained color images to obtain source images, so that the processing speed of the camera module on the images is improved, regional processing and scaling processing are carried out on the source images to enable the images to reach the optimal size, the processing speed of the corner point sets obtained after the images are obtained is further improved, sub-pixel corner point sets after fine extraction are obtained through sub-pixel comparison of the corner point sets, the sub-pixel corner point sets are converted into camera corner point sets under a camera coordinate system, the actual distance between the first checkerboard calibration plate and the second checkerboard calibration plate is obtained through a conversion formula, the accurate gate gap distance is further obtained, the accurate detection of the distance between two gates is realized, and the effect of detection accuracy is improved.
Drawings
FIG. 1 is a system flow diagram of the present invention;
Fig. 2 is a diagram showing the effect of the actual detection of the present invention.
Detailed Description
The invention will now be described in further detail with reference to the drawings and examples. Wherein like parts are designated by like reference numerals. It should be noted that the words "front", "back", "left", "right", "upper" and "lower" used in the following description refer to directions in the drawings, and the words "bottom" and "top", "inner" and "outer" refer to directions toward or away from, respectively, the geometric center of a particular component.
Referring to fig. 1 and 2, a specific embodiment of a gate crack detection method based on double-checkerboard calibration according to the present invention includes a preparation step and a detection step;
the preparation steps comprise:
s1, acquiring internal parameters and distortion parameters of a camera module, wherein the mode of acquiring the internal parameters and the distortion parameters is a commonly used acquisition means in the prior art, and is not described in detail herein;
s2, respectively installing a first checkerboard calibration plate and a second checkerboard calibration plate with the same model at the corners of one side of the two gates in the opposite direction;
s3, erecting a camera module, continuously collecting images of the checkerboard calibration plates, and building a camera coordinate system according to the position of the camera module.
The detection step comprises the following steps:
Step 1: carrying out graying treatment on the color image acquired by the camera module to obtain a source image, wherein the graying treatment mode comprises any one of a component method, an average value method and a weighted average method;
Step 2: carrying out regional treatment on a source image, obtaining a regional image through the regional treatment, and carrying out scaling treatment on the regional image to obtain a primary image;
the camera module is internally provided with an image optimization module, an edge area is arranged in the image optimization module, a scaling module is preset in the camera module, a comparison algorithm and an area threshold value are preset in the scaling module, and the comparison algorithm is used for calculating the ratio of the area of the first checkerboard calibration plate to the area of the second checkerboard calibration plate to the area of the area image;
the regionalization processing in the step2 specifically comprises the following steps:
Step 2.1: disposing the source image in an edge region;
step 2.2: collecting the image edges and the edges of the first checkerboard calibration plate and the second checkerboard calibration plate in the source image;
Step 2.3: calibrating the upper edge, the lower edge and the edge of one side deviating from the second checkerboard calibration plate, forming a first calibration line, calibrating the upper edge, the lower edge and the edge of one side deviating from the first checkerboard calibration plate, forming a second calibration line, and connecting the first calibration line and the second calibration line to form a closed calibration area;
step 2.4: cutting a calibration area formed along the first calibration line and the second calibration line to form an area image, wherein the first checkerboard calibration plate and the second checkerboard calibration plate have the same size specification, so that the ends of the first calibration line and the second calibration line can intersect when extending, and a rectangular calibration area is formed;
the scaling process in step 2 comprises the following specific steps:
step 2.5: calculating the area ratio of the first checkerboard calibration plate to the second checkerboard calibration plate and the area ratio of the area image according to a comparison algorithm, generating an area finger, wherein the area finger represents the ratio of the area ratio of the first checkerboard calibration plate to the area ratio of the area image to the area image of the second checkerboard calibration plate, and comparing the area value with an area threshold;
Step 2.6: if the area value is larger than the area threshold value, performing shrinkage processing; if the area value is smaller than the area threshold value, performing amplification processing to enable the area value to be the same as the area threshold value, and representing the area image to be the optimal size;
Step 2.61: acquiring a central point of the region image, and establishing a scaling coordinate system along the central point, wherein coordinate axes of the scaling coordinate system are respectively parallel to side lines of the region image;
Step 2.62: aligning one side line of the area image with one side line of the calibration area;
step 2.63: performing difference calculation along the coordinate axis direction of the scaled coordinate system to obtain length values Lx and Ly along the coordinate axis direction respectively, and performing reduction or a method according to the length values obtained by the difference calculation to make the area value equal to the area threshold value;
Due to the limitation of the type selection and the scene of the camera module, in the gate closing process, the first checkerboard calibration plate and the second checkerboard calibration plate can acquire the image processing irrelevant area, so that the processing speed of an image can be influenced, the influence of the irrelevant area on the image processing is eliminated through regional processing, the image size is in the optimal size under the action of scaling processing, and the subsequent processing speed of the image is improved.
Step 3: and establishing a checkerboard pixel coordinate system by using a checkerboard, and acquiring a corner point set on the checkerboard calibration plate in the primary image in the checkerboard pixel coordinate system, wherein the corner point set is characterized by a point set of intersection points of black and white corners on the checkerboard calibration plate, the corner point set on the first checkerboard calibration plate is P A, and the corner point set on the second checkerboard calibration plate is P B.
Step 4: performing fine extraction according to the angular point set P A、PB sub-pixel comparison method obtained in the step 3 to obtain a sub-pixel angular point set U A、UB,UA which represents the sub-pixel angular point set positioned on the first checkerboard calibration plate, and U B which represents the sub-pixel angular point set positioned on the second checkerboard calibration plate;
the method also comprises an iteration step of the sub-pixel angular point set, wherein a Euclidean distance threshold value, an iteration frequency threshold value and a window size threshold value are also preset in the camera module, and the specific steps are as follows:
Step 4.1: carrying out multiple sub-pixel comparison on the corner point set P A、PB to obtain a plurality of groups of sub-pixel corner point sets U A、UB;
Step 4.2: sequentially carrying out iterative processing on a plurality of groups of sub-pixel corner point sets, and calculating Euclidean distance between the position of the sub-pixel corner point set and the iterative sub-pixel corner point set at the end of each iteration;
stopping iteration when the calculated Euclidean distance is smaller than a preset Euclidean distance threshold value or the iteration number reaches a preset iteration number threshold value;
Step 4.3: after stopping iteration, judging the difference between the final U A、UB and the final P A、PB, and judging whether the difference is greater than half of a window size threshold;
If the difference is greater than half of the window size threshold, replacing the window size threshold with P A、PB to obtain a final sub-pixel corner point set U A、UB;
If the difference is less than half of the window size threshold, the final U A、UB is used as the sub-pixel corner point set.
Step 5: and respectively establishing a first 3D checkerboard coordinate system and a second 3D checkerboard coordinate system by taking the upper left corners of the first checkerboard calibration plate and the second checkerboard calibration plate as the origin and the side length as coordinate axes, acquiring a camera angular point set V A under the first 3D checkerboard coordinate system, and acquiring a camera angular point set V B under the second 3D checkerboard coordinate system.
Step 6: and carrying out pnp camera pose measurement matching on V A、VB and U A、UB respectively, and carrying in camera internal parameters and distortion parameters acquired in the step S1 when carrying out camera pose measurement matching to obtain an RT matrix under the camera coordinate system, wherein the RT matrix comprises R A、TA and R B、TB, R represents a rotation matrix of the point set, and T represents a translation vector of the point set.
Step 7: according to a coordinate system transformation formula, a corner point set C A、 CB,CA under a camera coordinate system is calculated to represent the corner point set on a first checkerboard calibration plate in the camera coordinate system, and C B represents the corner point set on a second checkerboard calibration plate in the camera coordinate system.
Step 8: the actual distance D between the first checkerboard calibration plate and the second checkerboard calibration plate is represented by the midpoint coordinate C A、cB of C A、CB.
Step 9: calculating the gate gap distance H of the gate according to the actual distance between the middle points of the first checkerboard calibration plate and the second checkerboard calibration plate;
the step 9 comprises a distance algorithm, wherein the distance algorithm is used for calculating the door gap distance, and the specific calculation steps are as follows:
Step 9.1: calculating the side length L 1 of the first checkerboard calibration plate along the length direction of the gate and the side length L 2 of the second checkerboard calibration plate along the length direction of the gate;
step 9.2: the door gap distance H is calculated through a distance algorithm, and the specific distance algorithm is as follows:
Wherein: h represents a door gap distance value; d represents an actual distance value; l1 represents the side length of the first checkerboard calibration plate along the length direction of the gate, and L2 represents the side length of the second checkerboard calibration plate along the length direction of the gate.
Working principle and effect:
The camera module is used for collecting the first checkerboard calibration plate and the second checkerboard calibration plate, gray processing is carried out on the obtained color images to obtain source images, so that the processing speed of the camera module on the images is improved, regional processing and scaling processing are carried out on the source images to enable the images to reach the optimal size, the processing speed of the corner point sets obtained after the images are obtained is further improved, sub-pixel corner point sets after fine extraction are obtained through sub-pixel comparison of the corner point sets, the sub-pixel corner point sets are converted into camera corner point sets under a camera coordinate system, the actual distance between the first checkerboard calibration plate and the second checkerboard calibration plate is obtained through a conversion formula, the accurate gate gap distance is further obtained, the accurate detection of the distance between two gates is realized, and the effect of detection accuracy is improved.
Example 2:
The specific implementation mode of the gate crack detection method based on double checkerboard calibration is different from the embodiment 1 in that:
step 9 includes a truth strategy, where the truth strategy specifically includes:
Step 9.1: component acquisition is carried out on c A、cB along the X, Y, Z axis of the camera coordinate system, and the acquired component values along X, Y, Z are subjected to difference processing to obtain error values D X、DY and D Z along X, Y, Z;
Step 9.2: acquiring a component c A、cB along X, Y, Z of the camera coordinate system for a plurality of times when the camera is closed in the camera coordinate system, and averaging the coordinate values acquired for a plurality of times to obtain component true values d X、dY and d Z;
Step 9.3: and taking the difference value between the obtained error value and the component true value as an actual distance.
The above description is only a preferred embodiment of the present invention, and the protection scope of the present invention is not limited to the above examples, and all technical solutions belonging to the concept of the present invention belong to the protection scope of the present invention. It should be noted that modifications and adaptations to the present invention may occur to one skilled in the art without departing from the principles of the present invention and are intended to be within the scope of the present invention.

Claims (8)

1. A gate crack detection method based on double checkerboard calibration is characterized by comprising the following steps: the method comprises a preparation step and a detection step, and specifically comprises the following steps:
The preparation steps are as follows:
s1, acquiring internal parameters and distortion parameters of a camera module;
s2, respectively installing a first checkerboard calibration plate and a second checkerboard calibration plate with the same model at the corners of one side of the two gates in the opposite direction;
s3, erecting a camera module, continuously collecting images of the checkerboard calibration plates, and establishing a camera coordinate system according to the position of the camera module;
The detection step comprises:
Step 1: gray processing is carried out on the color image acquired by the camera module to obtain a source image;
Step 2: carrying out regional treatment on a source image, obtaining a regional image through the regional treatment, and carrying out scaling treatment on the regional image to obtain a primary image;
Step 3: establishing a checkerboard pixel coordinate system by using a checkerboard, and acquiring a corner point set on the checkerboard calibration plate in the primary image in the checkerboard pixel coordinate system, wherein the corner point set is characterized by a point set of intersection points of black and white corners on the checkerboard calibration plate, the corner point set on the first checkerboard calibration plate is P A, and the corner point set on the second checkerboard calibration plate is P B;
Step 4: performing fine extraction according to the angular point set P A、PB sub-pixel comparison method obtained in the step 3 to obtain a sub-pixel angular point set U A、UB, wherein U A represents the sub-pixel angular point set on the first checkerboard calibration plate, and U B represents the sub-pixel angular point set on the second checkerboard calibration plate;
Step 5: respectively establishing a first 3D checkerboard coordinate system and a second 3D checkerboard coordinate system by taking the upper left corner of the first checkerboard calibration plate and the upper left corner of the second checkerboard calibration plate as an origin and the side length as coordinate axes, acquiring a camera angular point set V A under the first 3D checkerboard coordinate system, and acquiring a camera angular point set V B under the second 3D checkerboard coordinate system;
Step 6: carrying out pnp camera pose measurement matching on V A、VB and U A、UB respectively, and carrying in camera internal parameters and distortion parameters acquired in the step S1 when carrying out camera pose measurement matching to obtain an RT matrix under the camera coordinate system, wherein the RT matrix comprises R A、TA and R B、TB, R represents a rotation matrix of a point set, and T represents a translation vector of the point set;
Step 7: according to the transformation formula of the coordinate system, Calculating to obtain a corner point set C A、CB under a camera coordinate system, wherein C A represents the corner point set on a first checkerboard calibration plate in the camera coordinate system, and C B represents the corner point set on a second checkerboard calibration plate in the camera coordinate system;
Step 8: taking the midpoint coordinate C A、cB of the C A、CB as a representative of the actual distance D between the first checkerboard calibration plate and the second checkerboard calibration plate;
Step 9: and calculating the gate gap distance of the gate according to the actual distance between the middle points of the first checkerboard calibration plate and the second checkerboard calibration plate.
2. The gate crack detection method based on double-checkerboard calibration of claim 1, wherein the gate crack detection method is characterized by comprising the following steps: the camera module is internally provided with an image optimization module, the image optimization module is internally provided with an edge area, and the regional processing in the step 2 specifically comprises the following steps:
Step 2.1: disposing the source image in an edge region;
step 2.2: collecting the image edges and the edges of the first checkerboard calibration plate and the second checkerboard calibration plate in the source image;
Step 2.3: calibrating the upper edge, the lower edge and the edge of one side deviating from the second checkerboard calibration plate, forming a first calibration line, calibrating the upper edge, the lower edge and the edge of one side deviating from the first checkerboard calibration plate, forming a second calibration line, and connecting the first calibration line and the second calibration line to form a closed calibration area;
Step 2.4: and cutting along the calibration area formed by the first surface calibration line and the second calibration line to form an area image.
3. The gate crack detection method based on double-checkerboard calibration according to claim 2, wherein the gate crack detection method is characterized by comprising the following steps: the camera module is internally provided with a scaling module in a preset mode, the scaling module is internally provided with a comparison algorithm and an area threshold value in a preset mode, the comparison algorithm is used for calculating the ratio of the area of the first checkerboard calibration plate to the area of the second checkerboard calibration plate to the area of the area image, and the scaling processing in the step 2 specifically comprises the following steps:
Step 2.5: calculating the area ratio of the first checkerboard calibration plate to the second checkerboard calibration plate and the area ratio of the area image according to a comparison algorithm, generating an area finger, wherein the area finger represents the ratio of the area ratio of the first checkerboard calibration plate to the area ratio of the area image to the area image of the second checkerboard calibration plate, and comparing the area value with an area threshold;
Step 2.6: if the area value is larger than the area threshold value, performing shrinkage processing; and if the area value is smaller than the area threshold value, performing amplification processing so that the area value is the same as the area threshold value, and representing the area image as the optimal size.
4. The gate crack detection method based on double-checkerboard calibration as claimed in claim 3, wherein the gate crack detection method is characterized by comprising the following steps: the specific steps of the shrinking treatment and the enlarging treatment are as follows:
Step 2.61: acquiring a central point of the region image, and establishing a scaling coordinate system along the central point, wherein coordinate axes of the scaling coordinate system are respectively parallel to side lines of the region image;
Step 2.62: aligning one side line of the area image with one side line of the calibration area;
step 2.63: and respectively performing difference calculation along the coordinate axis direction of the scaled coordinate system to respectively obtain length values L x and L y along the coordinate axis direction, and performing reduction or method according to the length values obtained by the difference calculation so as to make the area value equal to the area threshold value.
5. The gate crack detection method based on double-checkerboard calibration of claim 1, wherein the gate crack detection method is characterized by comprising the following steps: the step 4 further includes an iteration step of the sub-pixel corner point set, and the camera module is further preset with a euclidean distance threshold, an iteration frequency threshold and a window size threshold, which specifically includes the steps of:
Step 4.1: carrying out multiple sub-pixel comparison on the corner point set P A、PB to obtain a plurality of groups of sub-pixel corner point sets U A、UB;
Step 4.2: sequentially carrying out iterative processing on a plurality of groups of sub-pixel corner point sets, and calculating Euclidean distance between the position of the sub-pixel corner point set and the iterative sub-pixel corner point set at the end of each iteration;
stopping iteration when the calculated Euclidean distance is smaller than a preset Euclidean distance threshold value or the iteration number reaches a preset iteration number threshold value;
Step 4.3: after stopping iteration, judging the difference between the final U A、UB and the final P A、PB, and judging whether the difference is greater than half of a window size threshold;
If the difference is greater than half of the window size threshold, replacing the window size threshold with P A、PB to obtain a final sub-pixel corner point set U A、UB;
And if the difference value is smaller than half of the window size threshold value, using U A、UB obtained by final iteration as a sub-pixel corner point set.
6. The gate crack detection method based on double-checkerboard calibration of claim 1, wherein the gate crack detection method is characterized by comprising the following steps: the step 9 includes a distance algorithm, wherein the distance algorithm is used for calculating the door gap distance, and the specific calculation steps are as follows:
Step 9.1: calculating the side length L1 of the first checkerboard calibration plate along the length direction of the gate and the side length L2 of the second checkerboard calibration plate along the length direction of the gate;
step 9.2: the door gap distance H is calculated through a distance algorithm, and the specific distance algorithm is as follows:
Wherein: h represents a door gap distance value; d represents an actual distance value; l 1 represents the side length of the first checkerboard calibration plate along the length direction of the gate, and L 2 represents the side length of the second checkerboard calibration plate along the length direction of the gate.
7. The gate crack detection method based on double-checkerboard calibration of claim 1, wherein the gate crack detection method is characterized by comprising the following steps: the step 9 includes a truth strategy, where the truth strategy specifically includes:
Step 9.1: component acquisition is carried out on c A、cB along the X, Y, Z axis of the camera coordinate system, and the acquired component values along X, Y, Z are subjected to difference processing to obtain error values D X、DY and D Z along X, Y, Z;
Step 9.2: acquiring a component c A、cB along X, Y, Z of the camera coordinate system for a plurality of times when the camera is closed in the camera coordinate system, and averaging the coordinate values acquired for a plurality of times to obtain component true values d X、dY and d Z;
Step 9.3: and taking the difference value between the obtained error value and the component true value as an actual distance.
8. The gate crack detection method based on double-checkerboard calibration according to any one of claims 1 to 7, wherein: the graying processing includes any one of a component method, an average method, and a weighted average method.
CN202110796408.4A 2021-07-14 2021-07-14 Gate crack detection method based on double-checkerboard calibration Active CN113393538B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110796408.4A CN113393538B (en) 2021-07-14 2021-07-14 Gate crack detection method based on double-checkerboard calibration

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110796408.4A CN113393538B (en) 2021-07-14 2021-07-14 Gate crack detection method based on double-checkerboard calibration

Publications (2)

Publication Number Publication Date
CN113393538A CN113393538A (en) 2021-09-14
CN113393538B true CN113393538B (en) 2024-05-28

Family

ID=77626097

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110796408.4A Active CN113393538B (en) 2021-07-14 2021-07-14 Gate crack detection method based on double-checkerboard calibration

Country Status (1)

Country Link
CN (1) CN113393538B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114782419B (en) * 2022-06-17 2022-08-23 山东水利建设集团有限公司 Water conservancy construction gradient detection method

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018018987A1 (en) * 2016-07-29 2018-02-01 深圳市未来媒体技术研究院 Calibration pre-processing method for light field camera
JP2018179981A (en) * 2017-04-18 2018-11-15 パナソニックIpマネジメント株式会社 Camera calibration method, camera calibration program and camera calibration device
CN109003312A (en) * 2018-08-24 2018-12-14 重庆邮电大学 A kind of camera calibration method based on nonlinear optimization
CN110689579A (en) * 2019-10-18 2020-01-14 华中科技大学 Rapid monocular vision pose measurement method and measurement system based on cooperative target
CN111243032A (en) * 2020-01-10 2020-06-05 大连理工大学 Full-automatic checkerboard angular point detection method
CN111260731A (en) * 2020-01-10 2020-06-09 大连理工大学 Checkerboard sub-pixel level corner point self-adaptive detection method
CN111536902A (en) * 2020-04-22 2020-08-14 西安交通大学 Galvanometer scanning system calibration method based on double checkerboards

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106651961B (en) * 2016-12-09 2019-10-11 中山大学 A kind of unmanned plane scaling method and system based on color solid calibration object

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018018987A1 (en) * 2016-07-29 2018-02-01 深圳市未来媒体技术研究院 Calibration pre-processing method for light field camera
JP2018179981A (en) * 2017-04-18 2018-11-15 パナソニックIpマネジメント株式会社 Camera calibration method, camera calibration program and camera calibration device
CN109003312A (en) * 2018-08-24 2018-12-14 重庆邮电大学 A kind of camera calibration method based on nonlinear optimization
CN110689579A (en) * 2019-10-18 2020-01-14 华中科技大学 Rapid monocular vision pose measurement method and measurement system based on cooperative target
CN111243032A (en) * 2020-01-10 2020-06-05 大连理工大学 Full-automatic checkerboard angular point detection method
CN111260731A (en) * 2020-01-10 2020-06-09 大连理工大学 Checkerboard sub-pixel level corner point self-adaptive detection method
CN111536902A (en) * 2020-04-22 2020-08-14 西安交通大学 Galvanometer scanning system calibration method based on double checkerboards

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
一种基于棋盘格模板单目摄像机高精度标定方法;赖文敬;周延周;朱文卓;鲍鸿;;广东工业大学学报;20150815(03);全文 *
一种改进的快速SUSAN棋盘格角点检测算法;夏海英;刘伟涛;朱勇建;;广西师范大学学报(自然科学版);20180115(01);全文 *
双目标定中棋盘格图像角点样本筛选及标定;李晋惠;岳鑫;高飞;;西安工业大学学报;20160629(05);全文 *

Also Published As

Publication number Publication date
CN113393538A (en) 2021-09-14

Similar Documents

Publication Publication Date Title
CN112419297B (en) Bolt loosening detection method, device, equipment and storage medium
CN110807355B (en) Pointer instrument detection and reading identification method based on mobile robot
CN116664557B (en) Visual detection method for surface defects of fan blade
CN105354815B (en) It is a kind of that localization method is accurately identified based on flat-type micro part
CN105488501B (en) The method of license plate sloped correction based on rotation projection
CN107063458B (en) Ceramic tile coloration piecemeal detection method based on machine vision
CN113313677B (en) Quality detection method for X-ray image of wound lithium battery
WO2016055031A1 (en) Straight line detection and image processing method and relevant device
CN114998355B (en) Production defect identification method and device for sealing rubber ring
CN103345755A (en) Chessboard angular point sub-pixel extraction method based on Harris operator
CN113393538B (en) Gate crack detection method based on double-checkerboard calibration
CN104657727A (en) Lane line detection method
CN111126253A (en) Knife switch state detection method based on image recognition
CN112529875A (en) Photovoltaic module glass burst early warning method and system based on artificial intelligence
CN116258722B (en) Intelligent bridge building detection method based on image processing
CN109242917A (en) One kind being based on tessellated camera resolution scaling method
CN111311695A (en) Clear water concrete surface color difference analysis method based on convolutional neural network
CN115018872A (en) Intelligent control method of dust collection equipment for municipal construction
CN104408721A (en) Stamper image extracting method based on background density estimation
CN103632373B (en) A kind of flco detection method of three-frame difference high-order statistic combination OTSU algorithms
CN112734779A (en) Dot calibration plate edge sub-pixel detection method
CN110033469B (en) Sub-pixel edge detection method and system
CN111985436A (en) Workshop ground mark line identification fitting method based on LSD
CN108205814B (en) Method for generating black and white contour of color image
CN114283157A (en) Ellipse fitting-based ellipse object segmentation method

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