CN116433885A - Multi-opening pin positioning method based on sub-pixel edge - Google Patents
Multi-opening pin positioning method based on sub-pixel edge Download PDFInfo
- Publication number
- CN116433885A CN116433885A CN202310399508.2A CN202310399508A CN116433885A CN 116433885 A CN116433885 A CN 116433885A CN 202310399508 A CN202310399508 A CN 202310399508A CN 116433885 A CN116433885 A CN 116433885A
- Authority
- CN
- China
- Prior art keywords
- cotter
- cotter pin
- pin
- image
- outline
- 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.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 27
- 238000012216 screening Methods 0.000 claims abstract description 9
- 238000006243 chemical reaction Methods 0.000 claims description 6
- 239000000446 fuel Substances 0.000 claims description 4
- 238000012790 confirmation Methods 0.000 claims description 3
- 238000005520 cutting process Methods 0.000 claims description 3
- 230000010354 integration Effects 0.000 claims description 3
- 230000011218 segmentation Effects 0.000 claims description 3
- 238000010586 diagram Methods 0.000 description 6
- 238000001514 detection method Methods 0.000 description 3
- 238000004364 calculation method Methods 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 241001270131 Agaricus moelleri Species 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000008094 contradictory effect Effects 0.000 description 1
- 238000009826 distribution Methods 0.000 description 1
- 238000000605 extraction Methods 0.000 description 1
- 238000003384 imaging method Methods 0.000 description 1
- 238000003780 insertion Methods 0.000 description 1
- 230000037431 insertion Effects 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 238000011160 research Methods 0.000 description 1
- 239000000523 sample Substances 0.000 description 1
- 238000000638 solvent extraction Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/20—Image preprocessing
- G06V10/24—Aligning, centring, orientation detection or correction of the image
- G06V10/245—Aligning, centring, orientation detection or correction of the image by locating a pattern; Special marks for positioning
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/20—Image preprocessing
- G06V10/25—Determination of region of interest [ROI] or a volume of interest [VOI]
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/20—Image preprocessing
- G06V10/26—Segmentation of patterns in the image field; Cutting or merging of image elements to establish the pattern region, e.g. clustering-based techniques; Detection of occlusion
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/40—Extraction of image or video features
- G06V10/50—Extraction of image or video features by performing operations within image blocks; by using histograms, e.g. histogram of oriented gradients [HoG]; by summing image-intensity values; Projection analysis
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/70—Arrangements for image or video recognition or understanding using pattern recognition or machine learning
- G06V10/74—Image or video pattern matching; Proximity measures in feature spaces
- G06V10/75—Organisation of the matching processes, e.g. simultaneous or sequential comparisons of image or video features; Coarse-fine approaches, e.g. multi-scale approaches; using context analysis; Selection of dictionaries
- G06V10/751—Comparing pixel values or logical combinations thereof, or feature values having positional relevance, e.g. template matching
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/70—Arrangements for image or video recognition or understanding using pattern recognition or machine learning
- G06V10/74—Image or video pattern matching; Proximity measures in feature spaces
- G06V10/761—Proximity, similarity or dissimilarity measures
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Multimedia (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Health & Medical Sciences (AREA)
- Artificial Intelligence (AREA)
- Computing Systems (AREA)
- Databases & Information Systems (AREA)
- Evolutionary Computation (AREA)
- General Health & Medical Sciences (AREA)
- Medical Informatics (AREA)
- Software Systems (AREA)
- Image Analysis (AREA)
Abstract
The invention relates to the technical field of cotter positioning, in particular to a multi-cotter positioning method based on a sub-pixel edge, which comprises the following steps: 1. acquiring an image of the cotter pin to be detected by using an image acquisition device; 2. searching a plurality of possible cotter positions in the detected cotter image according to the specified track; 3. screening the possible positions of the cotter pins to obtain a plurality of regions of interest; 4. respectively constructing gray histograms of a plurality of regions of interest, and respectively analyzing and judging through the gray histograms of the plurality of regions of interest to obtain the outline of the real cotter pin; 5. calculating plane coordinates and depth of the outline of the real cotter pin; 6. and planning a path of the remaining cotter pin to be tested according to the current cotter pin. The method and the device can stably distinguish the cotter pin in the image and distinguish other objects, can acquire the positioning precision of the sub-pixel level, accurately calculate the position and the depth of the current cotter pin, and can carry out path planning according to the calculated cotter pin to be measured.
Description
Technical Field
The invention relates to the technical field of cotter positioning, in particular to a multi-cotter positioning method based on a sub-pixel edge.
Background
Cotter pin target identification and positioning algorithm designed in the research of the control system of the underwater mobile robot of the nuclear power station adopts a template matching mode to detect cotter pins, but because a large number of cotter pins and other similar hole sites exist in the same core plate, misjudgment is easy to generate, and the cotter pins are positioned to non-cotter pin objects. Further, since the detection of the cotter pin requires insertion of the probe rod into the cotter pin, depth information of the cotter pin is also required, but the algorithm can only acquire plane information, and cannot calculate the depth.
The detection of sub-pixel edges in Accurate subpixel edge location based on partial area effect (accurate sub-pixel edge positioning based on local area effect) uses a 5 x 3 window detection, and the computation error will increase when the gradient direction is encountered. Meanwhile, the mean value selection mode of the sub-pixel positions at the computing edge is not divided according to the gradient direction, so that the gray average value of the region division is wrong, and the computing result is error.
Disclosure of Invention
The invention provides a multi-opening pin positioning method based on a sub-pixel edge, which aims to solve the technical problems of large positioning and planning errors of the opening pin in the prior art.
In order to achieve the above purpose, the technical scheme of the invention is realized as follows:
the invention provides a multi-opening pin positioning method based on a sub-pixel edge, which comprises the following steps:
s1, acquiring an image of a cotter pin to be detected by using image acquisition equipment;
s2, searching a plurality of possible positions of cotter pins in the detected cotter pin image according to a specified track;
step S3, screening possible positions of a plurality of cotter pins to obtain a plurality of regions of interest;
s4, respectively constructing gray histograms of a plurality of regions of interest, and respectively analyzing and judging through the gray histograms of the plurality of regions of interest to obtain the outline of the real cotter pin;
s5, calculating plane coordinates and depth of the outline of the real cotter pin;
and S6, planning a path according to the plane coordinates of the outline of the real cotter pin.
Further, the step S2 specifically includes the following steps:
step S21, preparing a template image, wherein the template image comprises cotter pins, and extracting edges of the cotter pins of the template image to obtain boundary points of the cotter pins of the template image;
s22, solving the gradient direction and the gradient size of each boundary point in the template image by using a sobel operator;
s23, extracting edges of the detected cotter pin image, and calculating gradient directions and magnitudes of all boundary points in the detected cotter pin image in a mode of S22;
step S24, sliding the template image in the detected cotter pin image according to the specified track, calculating the similarity after each sliding according to the gradient direction and the gradient of each boundary point in the template image and the detected cotter pin image, and selecting interpolation square sums to calculate the similarity:
wherein T (x 'y') represents gradient information of the template image, I (x+x ', y+y') represents gradient information of each position of the measured cotter image, R (x, y) represents matching similarity, and whether cotter is provided or not is judged according to the following formula: (x, y), (x ', y') each represent a different pixel coordinate;
when f=1, it means that the current position may be provided with cotter pin, λ 3 Threshold coefficients set by the table; after the matched cotter pin is obtained, cutting the cotter pin from the cotter pin image to be detected, and taking the cotter pin as an interested area; when f=0, then the current position is indicated without cotter pins;
step S25, searching possible positions of cotter pins on the designated track in the mode of step S24 until the whole designated track is searched, and obtaining a plurality of regions of interest, namely possible positions of cotter pins.
Further, the step S3 specifically includes the following steps:
step S31, respectively extracting edges of a plurality of regions of interest to obtain the outlines of a plurality of suspected cotter pins;
step S32, screening the outline of the suspected cotter pins according to the following formula:
wherein g=1 means that the profile is a cotter pin; w, L each represents the width of the outline of the dummy cotter and the dummy cotterIs designed to take into account the possible occlusion in the actual situation, lambda g A threshold coefficient representing an adjustable screening range;
step S33, the outline of the suspected cotter with g=0 in step S32 is removed, the result is sent to step S4, if the outline of the suspected cotter with g=1 in step S32 does not exist, all the corresponding pixels of the region of interest are set to 0, and then the process returns to step S2.
Further, the step S4 specifically includes the following steps:
s41, constructing a gray level histogram of the region of interest;
step S42, dividing the gray level histogram of the region of interest into H A 、H B 、H C Three regions and determine whether it is a cotter pin by:
Q=H L ×H R
wherein Q represents whether or not it is a cotter pin, 0 represents a non-cotter pin, 1 represents a confirmation of cotter pin; s represents the total gray value number, H A And H is C Respectively represent the number of gray values in the corresponding region of interest, H L And H is R Respectively showing whether the left gray value and the right gray value meet the requirement, lambda 1 And lambda is 2 Respectively representing the set threshold coefficients;
step S43, when the region of interest is judged not to be a cotter pin, all pixels of the region in the cotter pin image to be detected are set to zero, and the step S2 is returned to for re-matching the position; if the pin is determined to be a cotter, the process advances to step S5.
Further, the step S5 specifically includes the following steps:
step S51, obtaining all edge points of the outline of the real cotter pin, and respectively calculating sub-pixel coordinates of each edge point;
step S52, performing circle fitting on the sub-pixel coordinates of each edge point by using a least square method to obtain the diameter of the outline of the real cotter pin in the image;
step S53, calculating the plane coordinates of the real cotter pin by using a conversion formula of the pixel coordinates and the physical coordinates and the diameter in the step S52;
and step S54, calculating the depth of the real cotter pin.
Further, the step S51 specifically includes the following steps:
step S511, acquiring one edge point of the outline of the real cotter pin;
step S512, defining a 3×3 window with the edge point (i, j) as the center, S L 、S M 、S R Respectively the sum of three columns of pixels in the window:
wherein E is L 、E M 、E R Representing the area of the lower region in the edge line of the corresponding region; a and B respectively represent gray values of the areas on two sides of the edge point segmentation; n represents the starting position, i.e. the starting coordinates of the summation within the window; h represents the height of the pixel;
step S513, solving the sum of the left, middle and right columns of pixels in the window by using integration, assuming that the curve passing through the edge is y=ax≡2+bx+c, where a, b, c are the curve coefficients, which are respectively as follows:
respectively solving gray values of the A region and the B region by using the average value of three nearest points of the A region and the B region to obtain:
obtaining a curve of the edge point;
step S514, repeating steps S511 to S513, and obtaining the sub-pixel coordinates of each edge point of the outline of the real cotter pin.
Further, the conversion formula in the step S53 specifically includes:
wherein r represents the actual radius of the true cotter pin, P a Representing the diameter, P, of the true cotter outline detected in the image size The actual physical size corresponding to each pixel.
Further, the step S6 specifically includes the following steps:
step S61, calculating the plane coordinates in the step S53 to the perpendicular line of the square hole profile of the nearest fuel rod;
step S62, calculating the deflection angle of the vertical line, namely the movement direction of the real cotter pin;
step S63, two different path planning modes are constructed, namely a path planning mode I and a path planning mode II;
step S64, selecting a path planning mode from the path planning modes I and II according to the movement direction of the real cotter pin, and calculating the distance required to move for searching the adjacent real cotter pin each time according to the selected path planning mode; and saves the relevant data.
Further, the calculating the distance to be moved for each search for the adjacent real cotter pin in the step S64 is specifically:
when in the same row, the distance that the horizontal axis and the vertical axis need to move is respectively:
when the change is needed, the distance between the horizontal axis and the vertical axis is as follows:
where P represents the pitch of cotter pins in the same row, Q represents the pitch of cotter pins in different rows, α represents the angle of the direction of movement of the cotter pins, β represents the angle of line feed, and α+β=90°.
The invention has the beneficial effects that:
1. the cotter pin in the image can be stably distinguished and other objects can be distinguished.
2. The positioning accuracy of the sub-pixel level can be obtained, and the position and depth of the opening pin can be accurately calculated.
3. The positioning device can automatically position the first cotter pin of the current coverage range (100X 100 cm) and automatically position the cotter pin.
4. The cotter pin in the coverage range (100 multiplied by 100 cm) can be subjected to track planning and traversing positioning.
Drawings
FIG. 1 is a schematic diagram of an initial point location lookup path;
FIG. 2 is a schematic diagram of a sobel operator;
FIG. 3 is a schematic diagram of gray histogram partitioning;
FIG. 4 is a schematic diagram of sub-pixel coordinate calculation;
FIG. 5 is a schematic view of the relative positions of cotter pins and square holes;
fig. 6 is a schematic diagram of two path planning modes.
Detailed Description
The invention will be described in further detail with reference to the accompanying drawings and specific examples. In the description of the present invention, the relative orientation or positional relationship is based on the orientation or positional relationship shown in fig. 1, where "up" and "down" refer to the up-down direction of fig. 1, and take fig. 1 as an example, the vertical paper surface is up, the vertical paper surface is down, the vertical paper surface is left, the vertical paper surface is right, the vertical paper surface is inward and front, the vertical paper surface is outward and rear, the left-right direction is transverse, and the up-down direction is vertical. It is to be understood that such directional terms are merely used to facilitate the description of the invention and to simplify the description, and are not intended to indicate or imply that the devices or elements so referred to must have a particular orientation, be constructed and operate in a particular orientation, and thus are not to be construed as limiting the invention.
Referring to fig. 1, an embodiment of the present application provides a multi-opening pin positioning method based on a subpixel edge, including the following steps:
s1, acquiring an image of a cotter pin to be detected by using image acquisition equipment;
s2, searching a plurality of possible positions of cotter pins in the detected cotter pin image according to a specified track;
step S3, screening possible positions of a plurality of cotter pins to obtain a plurality of regions of interest;
s4, respectively constructing gray histograms of a plurality of regions of interest, and respectively analyzing and judging through the gray histograms of the plurality of regions of interest to obtain the outline of the real cotter pin;
s5, calculating plane coordinates and depth of the outline of the real cotter pin;
and S6, planning a path according to the plane coordinates of the outline of the real cotter pin.
In this embodiment, the step S2 specifically includes the following steps:
step S21, preparing a template image, wherein the template image comprises cotter pins, and extracting edges of the cotter pins of the template image to obtain boundary points of the cotter pins of the template image;
s22, solving the gradient direction and the gradient size of each boundary point in the template image by using a sobel operator;
s23, extracting edges of the detected cotter pin image, and calculating gradient directions and magnitudes of all boundary points in the detected cotter pin image in a mode of S22;
step S24, sliding the template image in the detected cotter pin image according to the specified track, calculating the similarity after each sliding according to the gradient direction and the gradient of each boundary point in the template image and the detected cotter pin image, and selecting interpolation square sums to calculate the similarity:
wherein T (x ', y') represents gradient information of the template image, I (x+x ', y+y') represents gradient information of each position of the measured cotter pin image, and R (x, y) represents matching similarity; (x, y), (x ', y') each represent a different pixel coordinate;
whether or not the cotter pin is provided is judged according to the following steps:
when f=1, it indicates that the current position may have a cotter pin, and λ3 indicates a set threshold coefficient; after the matched cotter pin is obtained, cutting the cotter pin from the cotter pin image to be detected as a region of interest (ROI: region of interesting); when f=0, then the current position is indicated without cotter pins;
step S25, searching possible positions of cotter pins on the designated track in the mode of step S24 until the whole designated track is searched, and obtaining a plurality of regions of interest, namely possible positions of cotter pins.
In this embodiment, the step S3 specifically includes the following steps:
step S31, respectively extracting edges of a plurality of regions of interest to obtain the outlines of a plurality of suspected cotter pins;
in step S32, since the cotter is imaged in a circular shape, the aspect ratio of the contour of the cotter must be about 1. Edge extraction is carried out on the ROI, a plurality of outlines are formed in the extracted drawing, and the outlines of a plurality of suspected cotter pins are screened according to the following formula:
wherein g=1 indicates that the contour is an openingA pin; w, L the width of the outline of the dummy cotter, the length of the outline of the dummy cotter, lambda, respectively, considering that there may be a shadow in the actual situation g Threshold coefficient, lambda, representing adjustable screening range g When the shading condition is serious, lambda is shown as 0.7-0.8 g Lowering to locate the cotter pin; g=0 means that the profile is not a cotter pin;
step S33, the outline of the suspected cotter with g=0 in step S32 is removed, the result is sent to step S4, if the outline of the suspected cotter with g=1 in step S32 does not exist, all the corresponding pixels of the region of interest are set to 0, and then the process returns to step S2.
In this embodiment, the step S4 specifically includes the following steps:
step S41, because the cotter pin structure is different from other parts on the core plate, the reflection of each area in the imaging is also different, and the areas can be distinguished through the distribution of the gray level histogram, so the step firstly constructs the gray level histogram of the interested area;
step S42, dividing the gray level histogram of the region of interest into H A 、H B 、H C Three regions and determine whether it is a cotter pin by:
Q=H L ×H R
wherein Q represents whether or not it is a cotter pin, 0 represents a non-cotter pin, 1 represents a confirmation of cotter pin; s represents the total gray value number, H A And H is C Respectively represent the number of gray values in the corresponding region of interest, H L And H is R Respectively showing whether the left gray value and the right gray value meet the requirement, lambda 1 And lambda is 2 Respectively representing the set threshold coefficients; wherein lambda is 1 =0.15~0.35;λ 2 =0.25~0.4;
Step S43, when the region of interest is judged not to be a cotter pin, all pixels of the region in the cotter pin image to be detected are set to zero, and the step S2 is returned to for re-matching the position; if it is determined as a cotter, only one profile remains, and the process proceeds to step S5.
In this embodiment, the step S5 specifically includes the following steps:
step S51, obtaining all edge points of the outline of the real cotter pin, and respectively calculating sub-pixel coordinates of each edge point;
step S52, performing circle fitting on the sub-pixel coordinates of each edge point by using a least square method to obtain the diameter of the outline of the real cotter pin in the image;
step S53, calculating the plane coordinates of the real cotter pin by using a conversion formula of the pixel coordinates and the physical coordinates and the diameter in the step S52;
and step S54, calculating the depth of the real cotter pin.
In this embodiment, the step S51 specifically includes the following steps:
step S511, acquiring one edge point of the outline of the real cotter pin;
in step S512, the subpixel coordinates are calculated as shown in fig. 4, since the edge of the cotter pin is circular, if each edge point is crossed by an edge, the curve passing through the edge point can be y=ax 2 +bx+c. As shown in fig. 4, the gray scale at the edge is discontinuous, but the gray scales at both sides of the edge are consistent, and the gray scale values of the areas at both sides of the edge division are represented by a and B, and then the gray scale values at the edge points are necessarily between a and B, which is represented as:
wherein E is (i,j) Representing the area of the lower region in the edge line; (i, j) represents window coordinates; h represents a pixel height, which defaults to 1;
defining a 3 x 3 window centered on the edge point (i, j), S L 、S M 、S R Respectively the sum of three columns of pixels in the window:
wherein E is L 、E M 、E R Representing the area of the lower region in the edge line of the corresponding region; a and B respectively represent gray values of the areas on two sides of the edge point segmentation; n represents the starting position, i.e. the starting coordinates of the summation within the window; h represents the height of the pixel;
step S513, solving the sum of the left, middle and right columns of pixels in the window by using integration, assuming that the curve passing through the edge is y=ax≡2+bx+c, where a, b, c are the curve coefficients, which are respectively as follows:
respectively solving gray values of the A region and the B region by using the average value of three nearest points of the A region and the B region to obtain:
obtaining a curve of the edge point;
step S514, repeating steps S511 to S513, and obtaining the sub-pixel coordinates of each edge point of the outline of the real cotter pin.
In this embodiment, the conversion formula in step S53 is specifically:
wherein r represents the actual radius of the true cotter pin, P a Representing the diameter, P, of the true cotter outline detected in the image size For the actual physical scale corresponding to each pixelCun.
In this embodiment, the step S54 specifically includes the following steps:
step S541, fitting by using a polynomial to obtain the depth of the real cotter pin, where the polynomial is specifically as follows:
y=ax 3 +bx 2 +cx+d。
the coefficients are obtained by fitting polynomials in advance according to different scenes, and the cotter pin size, namely x, is substituted into an expression to solve the cotter pin.
The fitting method is as follows:
1. acquiring cotter pin images of different known heights;
2. extracting the size of the cotter pin in the images;
3. using the cotter height and cotter image size, a polynomial is fitted by least squares.
In this embodiment, the step S6 specifically includes the following steps:
if the current cotter pin is detected to be the first cotter pin, path planning is carried out, otherwise, the next planned point is entered. Because of the manufacturing process, the relative positions among the cotter pins are fixed, and other cotter pin coordinates can be obtained only by calculating the current cotter pin direction. A square hole for placing the fuel rod is necessarily formed on one side of the cotter pin, a straight line of the square hole closest to the center of the cotter pin is calculated to be the moving direction, and a hole position schematic diagram is shown in fig. 5;
step S61, calculating the plane coordinates in the step S53 to the perpendicular line of the square hole profile of the nearest fuel rod;
step S62, calculating the deflection angle of the vertical line, namely the movement direction of the real cotter pin;
step S63, two different path planning modes are constructed, namely a path planning mode I and a path planning mode II; setting the angle as theta, adopting a first planning mode when theta is less than 45 degrees and adopting a second planning mode when theta is less than-15 degrees, wherein the second planning mode is shown in figure 6;
step S64, selecting a path planning mode from the path planning modes I and II according to the movement direction of the real cotter pin, and calculating the distance required to move for searching the adjacent real cotter pin each time according to the selected path planning mode; and saves the relevant data.
In this embodiment, the calculation in step S64 is specifically performed as follows:
when in the same row, the distance that the horizontal axis and the vertical axis need to move is respectively:
when the change is needed, the distance between the horizontal axis and the vertical axis is as follows:
where P represents the pitch of cotter pins in the same row, Q represents the pitch of cotter pins in different rows, α represents the angle of the direction of movement of the cotter pins, β represents the angle of line feed, and α+β=90°.
The foregoing is merely illustrative of the present invention, and the present invention is not limited thereto, and any person skilled in the art will readily recognize that variations or substitutions are within the scope of the present invention. Moreover, the technical solutions of the embodiments of the present invention may be combined with each other, but it is necessary to be based on the fact that those skilled in the art can implement the embodiments, and when the technical solutions are contradictory or cannot be implemented, it should be considered that the combination of the technical solutions does not exist, and is not within the scope of protection claimed by the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims (9)
1. The multi-opening pin positioning method based on the edges of the sub-pixels is characterized by comprising the following steps of:
s1, acquiring an image of a cotter pin to be detected by using image acquisition equipment;
s2, searching a plurality of possible positions of cotter pins in the detected cotter pin image according to a specified track;
step S3, screening possible positions of a plurality of cotter pins to obtain a plurality of regions of interest;
s4, respectively constructing gray histograms of a plurality of regions of interest, and respectively analyzing and judging through the gray histograms of the plurality of regions of interest to obtain the outline of the real cotter pin;
s5, calculating plane coordinates and depth of the outline of the real cotter pin;
and S6, planning a path according to the plane coordinates of the outline of the real cotter pin.
2. The method of positioning multiple cotter pins according to claim 1, wherein said step S2 comprises the steps of:
step S21, preparing a template image, wherein the template image comprises cotter pins, and extracting edges of the cotter pins of the template image to obtain boundary points of the cotter pins of the template image;
s22, solving the gradient direction and the gradient size of each boundary point in the template image by using a sobel operator;
s23, extracting edges of the detected cotter pin image, and calculating gradient directions and magnitudes of all boundary points in the detected cotter pin image in a mode of S22;
step S24, sliding the template image in the detected cotter pin image according to the specified track, calculating the similarity after each sliding according to the gradient direction and the gradient of each boundary point in the template image and the detected cotter pin image, and selecting interpolation square sums to calculate the similarity:
wherein, T (x ', y') represents gradient information of the template image, I (x+x ', y+y') is gradient information of each position of the measured cotter pin image, R (x, y) represents matching similarity, and whether the current position has cotter pins is judged according to the following formula: (x, y), (x ', y') each represent a different pixel coordinate;
when f=1, it means that the current position may be provided with a cotter pin, λ 3 Representing the set threshold coefficient; after the matched cotter pin is obtained, cutting the cotter pin from the cotter pin image to be detected, and taking the cotter pin as an interested area; when f=0, then the current position is indicated without cotter pins;
step S25, searching possible positions of cotter pins on the designated track in the mode of step S24 until the whole designated track is searched, and obtaining a plurality of regions of interest, namely possible positions of cotter pins.
3. The method of positioning multiple cotter pins according to claim 2, wherein said step S3 comprises the steps of:
step S31, respectively extracting edges of a plurality of regions of interest to obtain the outlines of a plurality of suspected cotter pins;
step S32, screening the outline of the suspected cotter pins according to the following formula:
wherein g=1 means that the profile is a cotter pin; w, L the width of the outline of the dummy cotter, the length of the outline of the dummy cotter, lambda, respectively, considering that there may be a shadow in the actual situation g A threshold coefficient representing an adjustable screening range;
step S33, the outline of the suspected cotter with g=0 in step S32 is removed, the result is sent to step S4, if the outline of the suspected cotter with g=1 in step S32 does not exist, all the corresponding pixels of the region of interest are set to 0, and then the process returns to step S2.
4. A multi-cotter positioning method according to claim 3, characterized in that said step S4 comprises the steps of:
s41, constructing a gray level histogram of the region of interest;
step S42, dividing the gray level histogram of the region of interest into H A 、H B 、H C Three regions and determine whether it is a cotter pin by:
Q=H L ×H R
wherein Q represents whether or not it is a cotter pin, 0 represents a non-cotter pin, 1 represents a confirmation of cotter pin; s represents the total gray value number, H A And H is C Respectively represent the number of gray values in the corresponding region of interest, H L And H is R Respectively showing whether the left gray value and the right gray value meet the requirement, lambda 1 And lambda is 2 Respectively representing the set threshold coefficients;
step S43, when the region of interest is judged not to be a cotter pin, all pixels of the region in the cotter pin image to be detected are set to zero, and the step S2 is returned to for re-matching the position; if the pin is determined to be a cotter, the process advances to step S5.
5. The method of positioning multiple cotter pins according to claim 4, wherein said step S5 comprises the steps of:
step S51, obtaining all edge points of the outline of the real cotter pin, and respectively calculating sub-pixel coordinates of each edge point;
step S52, performing circle fitting on the sub-pixel coordinates of each edge point by using a least square method to obtain the diameter of the outline of the real cotter pin in the image;
step S53, calculating the plane coordinates of the real cotter pin by using a conversion formula of the pixel coordinates and the physical coordinates and the diameter in the step S52;
and step S54, calculating the depth of the real cotter pin.
6. The method of positioning multiple cotter pins according to claim 5, wherein said step S51 includes the steps of:
step S511, acquiring one edge point of the outline of the real cotter pin;
step S512, defining a 3×3 window with the edge point (i, j) as the center, S L 、S M 、S R Respectively the sum of three columns of pixels in the window:
wherein E is L 、E M 、E R Representing the area of the lower region in the edge line of the corresponding region; a and B respectively represent gray values of the areas on two sides of the edge point segmentation; n represents the starting position, i.e. the starting coordinates of the summation within the window; h represents the height of the pixel;
step S513, solving the sum of the left, middle and right columns of pixels in the window by using integration, assuming that the curve passing through the edge is y=ax 2 +bx+c, where a, b, c are the curve coefficients, which are respectively as follows:
respectively solving gray values of the A region and the B region by using the average value of three nearest points of the A region and the B region to obtain:
obtaining a curve of the edge point;
step S514, repeating steps S511 to S513, and obtaining the sub-pixel coordinates of each edge point of the outline of the real cotter pin.
7. The method for positioning multiple cotter pins according to claim 5, wherein the conversion formula in step S53 is specifically:
wherein r represents the actual radius of the true cotter pin, P a Representing the diameter, P, of the true cotter outline detected in the image size The actual physical size corresponding to each pixel.
8. The method of positioning multiple cotter pins according to claim 7, wherein said step S6 comprises the steps of:
step S61, calculating the plane coordinates in the step S53 to the perpendicular line of the square hole profile of the nearest fuel rod;
step S62, calculating the deflection angle of the vertical line, namely the movement direction of the real cotter pin;
step S63, two different path planning modes are constructed, namely a path planning mode I and a path planning mode II;
step S64, selecting a path planning mode from the path planning modes I and II according to the movement direction of the real cotter pin, and calculating the distance required to move for searching the adjacent real cotter pin each time according to the selected path planning mode; and saves the relevant data.
9. The method for planning paths of multiple cotters according to claim 8, wherein the calculating the distance to be moved for each search for the adjacent real cotters in step S64 is specifically:
when in the same row, the distance that the horizontal axis and the vertical axis need to move is respectively:
when the change is needed, the distance between the horizontal axis and the vertical axis is as follows:
where P represents the pitch of cotter pins in the same row, Q represents the pitch of cotter pins in different rows, a represents the angle of the direction of movement of the cotter pins, β represents the angle of line feed, and α+β=90°.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310399508.2A CN116433885A (en) | 2023-04-13 | 2023-04-13 | Multi-opening pin positioning method based on sub-pixel edge |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310399508.2A CN116433885A (en) | 2023-04-13 | 2023-04-13 | Multi-opening pin positioning method based on sub-pixel edge |
Publications (1)
Publication Number | Publication Date |
---|---|
CN116433885A true CN116433885A (en) | 2023-07-14 |
Family
ID=87081111
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310399508.2A Pending CN116433885A (en) | 2023-04-13 | 2023-04-13 | Multi-opening pin positioning method based on sub-pixel edge |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116433885A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116664613A (en) * | 2023-07-24 | 2023-08-29 | 合肥埃科光电科技股份有限公司 | Pixel edge position detection method, system and storage medium based on FPGA |
CN116993966A (en) * | 2023-09-27 | 2023-11-03 | 诺伯特智能装备(山东)有限公司 | Casting polishing vision intelligent positioning method and system |
-
2023
- 2023-04-13 CN CN202310399508.2A patent/CN116433885A/en active Pending
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116664613A (en) * | 2023-07-24 | 2023-08-29 | 合肥埃科光电科技股份有限公司 | Pixel edge position detection method, system and storage medium based on FPGA |
CN116664613B (en) * | 2023-07-24 | 2023-10-31 | 合肥埃科光电科技股份有限公司 | Pixel edge position detection method, system and storage medium based on FPGA |
CN116993966A (en) * | 2023-09-27 | 2023-11-03 | 诺伯特智能装备(山东)有限公司 | Casting polishing vision intelligent positioning method and system |
CN116993966B (en) * | 2023-09-27 | 2023-12-12 | 诺伯特智能装备(山东)有限公司 | Casting polishing vision intelligent positioning method and system |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN116433885A (en) | Multi-opening pin positioning method based on sub-pixel edge | |
CN106651942B (en) | Three-dimensional rotating detection and rotary shaft localization method based on characteristic point | |
CN105469388B (en) | Building point cloud registration method based on dimensionality reduction | |
CN104121902B (en) | Implementation method of indoor robot visual odometer based on Xtion camera | |
CN110443836A (en) | A kind of point cloud data autoegistration method and device based on plane characteristic | |
CN101894375B (en) | Person tracking method and person tracking apparatus | |
CN109211198B (en) | Intelligent target detection and measurement system and method based on trinocular vision | |
US20040170315A1 (en) | Calibration apparatus, calibration method, program for calibration, and calibration jig | |
US9214024B2 (en) | Three-dimensional distance measurement apparatus and method therefor | |
CN113052881A (en) | Automatic registration method for extracting pole point in indoor three-dimensional point cloud | |
CN114037706A (en) | Precast beam segment surface flatness detection method based on three-dimensional point cloud model | |
Wu et al. | A novel high precise laser 3D profile scanning method with flexible calibration | |
CN112669379B (en) | Image feature rapid extraction method based on auxiliary mark points | |
CN116342718B (en) | Calibration method, device, storage medium and equipment of line laser 3D camera | |
CN115774265B (en) | Two-dimensional code and laser radar fusion positioning method and device for industrial robot | |
CN112762910B (en) | Short-measuring-range correction calibration method suitable for laser scanner | |
CN109631912A (en) | A kind of deep space spherical object passive ranging method | |
CN112857315B (en) | Steel pipe column verticality measuring method based on three-dimensional laser scanning | |
IL184993A (en) | Method for extracting edge in photogrammetry with subpixel accuracy | |
Shi et al. | An adaptive grid search algorithm for fitting spherical target of terrestrial LiDAR | |
CN113340304B (en) | Gradient extraction method and device | |
CN103679713A (en) | Two-dimensional image registration method for partially matched images | |
CN117710458A (en) | Binocular vision-based carrier aircraft landing process relative position measurement method and system | |
CN112233186A (en) | Equipment air tightness detection camera self-calibration method based on image perception | |
CN105205817A (en) | Underwater terrain matching method based on sonar image edge angular point histogram |
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 |