Centroid-based structured light angle point detection method

文档序号:9336 发布日期:2021-09-17 浏览:121次 中文

1. A centroid-based structured light angle point detection method is characterized by comprising the following steps:

step 1), after converting a shot image into a binary image, carrying out contour search based on an edge detection algorithm, traversing the search to obtain a maximum connected domain, and converting the region into a rectangular picture frame, wherein the maximum contour region is a target image;

step 2), carrying out region segmentation on the target image according to the connected domains, carrying out threshold segmentation to obtain a plurality of connected domains of the image, and marking each connected domain;

step 3), on the basis of region segmentation, acquiring a pixel set G of the connected domain contour through an edge detection algorithm, and calculating a central point of each contour by using a space moment function, wherein the central point is the centroid of the connected domain;

step 4), traversing pixel points of each connected domain, and dividing the connected domain into n subregions according to the position of the centroid coordinate and the light shape characteristic of the standard structure, wherein n is the number of sides of the polygon;

and 5) according to a distance measurement formula, calculating n pixel points with the mass center farthest from each subregion through a distance maximum formula, namely corner points of each connected domain, and marking the corner points.

2. The centroid-based structured light angular point detection method according to claim 1, wherein in step 3), the spatial moment function is:

wherein m ispqThe method comprises the following steps of taking a p + q order space moment function, wherein p and q are orders, M multiplied by N is the pixel size of an image where a connected domain is located, G (i, j) is a pixel set of a connected domain outline, and i and j represent the ith row and the jth column of pixel points of the image;

the centroid coordinates can be found from equation (1):

whereinIs a coordinate of the line of the center of mass,is a centroid row coordinate, m00The zero-order moment of the space moment function represents the number of elements of the pixel set G; m is10The first moment of the space moment function represents the accumulated sum of the pixel row coordinates in the pixel set G; m is01Is the first moment of the spatial moment function and represents the cumulative sum of the pixel column coordinates in the pixel set G.

3. The centroid-based structured light angular point detection method according to claim 1, wherein in step 5), Euclidean distance is used as a distance metric, wherein the distance maximum formula is:

where d is the distance between the centroid and each corner point, xaIs the line coordinate, y, of a pixel pointaColumn coordinates of the pixel points; x is the number ofcIs the line coordinate of the centroid, ycIs the column coordinate of the centroid.

Background

Corner detection is a method for obtaining image characteristics in a computer vision system, and is widely applied to the fields of motion detection, image matching, video tracking, three-dimensional modeling, target identification and the like. A corner point is usually defined as the intersection of two edges, more strictly speaking, a local neighborhood of a corner point should have boundaries of two different regions in different directions. The current classical corner detection technology comprises a Harris corner detection algorithm, a Fast corner detection algorithm, a Surf corner detection algorithm and the like.

For cross-medium underwater imaging, a captured structured light image can be seriously distorted and blurred due to random fluctuation of the water surface. Such distortion and blurring of the image seriously affect the subjective feeling of human visual observation and are very likely to cause erroneous judgment of the image contents. For the images, the current corner detection method has the problems of missing detection, repeated detection, multiple detection, inaccurate detection and the like, and causes interference on the restoration of subsequent images and the identification of targets.

Disclosure of Invention

The invention provides a centroid-based structured light corner point detection method, which guarantees detection precision and prevents generation of false corner points, aiming at the defects of the existing corner point detection algorithm.

The technical scheme adopted by the invention for solving the technical problems is as follows:

a centroid-based structured light angle point detection method comprises the following steps:

step 1), after converting a shot image into a binary image, carrying out contour search based on an edge detection algorithm, traversing the search to obtain a maximum connected domain, and converting the region into a rectangular picture frame, wherein the maximum contour region is a target image;

step 2), carrying out region segmentation on the structured light image according to the connected domains, namely starting from any pixel in the target image, searching a pixel set formed by adjacent pixels with the same pixel value as one connected domain, carrying out threshold segmentation to obtain a plurality of connected domains of the structured light image, and marking each connected domain;

step 3), on the basis of region segmentation, acquiring a pixel set G of the connected domain contour through an edge detection algorithm, and calculating a central point of each contour by using a spatial moment function, namely a centroid of the connected domain, wherein the spatial moment function is as follows:

wherein m ispqThe method comprises the following steps of taking a p + q order space moment function, wherein p and q are orders, M multiplied by N is the pixel size of an image where a connected domain is located, G (i, j) is a pixel set of a connected domain outline, and i and j represent the ith row and the jth column of pixel points of the image;

the centroid coordinates can be found from equation (1):

whereinIs a coordinate of the line of the center of mass,is a centroid row coordinate, m00Representing elements of the set G of pixels as a zeroth order moment of a function of the spatial momentThe number of the cells; m is10The first moment of the space moment function represents the accumulated sum of the pixel row coordinates in the pixel set G; m is01The first moment of the space moment function represents the accumulated sum of pixel column coordinates in the pixel set G;

step 4), traversing pixel points of each connected domain, and dividing the connected domain into n subregions according to the position of the centroid coordinate and the light shape characteristic of the standard structure, wherein n is the number of sides of the polygon;

step 5), according to a distance measurement formula, calculating n pixel points with the mass center farthest from each subregion through a distance maximum formula, namely corner points of each connected domain, and marking the corner points; for example, euclidean distance is used as a measure of distance, where the distance maximum formula is:

where d is the distance between the centroid and each corner point, xaIs the line coordinate, y, of a pixel pointaColumn coordinates of the pixel points; x is the number ofcIs the line coordinate of the centroid, ycIs the column coordinate of the centroid.

The invention has the advantages that:

(1) aiming at the defects of the existing angle point detection algorithm, the problems of multi-detection, false detection, missing detection when the motion blur occurs in the image and the like in the method are solved;

(2) the invention provides a centroid-based structured light angle point detection method by utilizing an edge detection correlation principle. The photographed structured light may have severe distortion and motion blur due to random fluctuation of the water surface. Such distortion and blurring of the image seriously affect the subjective feeling of human visual observation and are very likely to cause erroneous judgment of the image contents. The method is also suitable for extracting the angular points of the distorted image caused by cross-medium underwater imaging, ensures the reliability of the detection result, improves the data processing speed and shortens the time for extracting the angular points.

Drawings

FIG. 1 is a schematic diagram of a centroid-based structured light corner detection method in an embodiment;

FIG. 2 is a flow chart of centroid-based structured light corner point detection in an embodiment;

fig. 3a to fig. 3e are diagrams illustrating an actual shooting and processing effect of the centroid-based structured light corner detection method in the embodiment, where fig. 3a is an actual image, fig. 3b is a target area for acquiring an image, fig. 3c is a preprocessed image of the target area, fig. 3d is a square centroid, and fig. 3e is a result of corner detection;

fig. 4 a-4 b are graphs of analysis of squares of distortion and distortion generated by interlaced stripe structured light caused by randomly fluctuating water surface in an embodiment, in which fig. 4a is a diagram of capturing a distorted structured light image, and fig. 4b is a diagram of detecting a corner point of the structured light image.

Detailed Description

The invention will be described in detail below with reference to the drawings and embodiments, examples of which are illustrated in the drawings. The embodiments described below with reference to the drawings are illustrative and intended to be illustrative of the invention and are not to be construed as limiting the invention.

Example (b):

as shown in fig. 2, an underwater standard structured light image is shot in the air, and the detection of the corner of the distorted structured light in the image is realized by image preprocessing and a centroid-based structured light corner detection method, which specifically includes the following technologies:

structured light: because structured light has non-contact measurement, the scheme is mature, can also use at night, and the precision is higher advantage, often is used for carrying out three-dimensional scanning or three-dimensional space and restores.

Edge detection: and irrelevant information in the image is eliminated, and contour information with severe brightness change in the image is obtained, so that the reliability of feature extraction, image segmentation, target identification and positioning is improved.

Angular point detection: the current corner detection technology comprises a Harris algorithm, a Fast algorithm, a Susan algorithm and the like. For the structured light image of the type shown in FIG. 3b, the problems of missing detection, multiple detection, inaccurate detection and the like exist in the conventional algorithm, and the invention provides a structured light angle point detection method based on the centroid by utilizing the edge detection correlation principle.

As shown in fig. 2, an underwater standard structured light image is shot by a camera in the air, the shot image is subjected to contour screening based on an edge detection method to obtain a target area where structured light is located, binarization processing is performed on the target area, and each corner of the obtained target image is detected by a centroid structured light corner detection method.

A centroid-based structured light angle point detection method comprises the following steps:

step (1), shooting an underwater standard structured light image through a camera in the air as shown in fig. 3a, converting the shot image into a binary image, then performing contour search based on an edge detection algorithm, traversing the search to obtain a maximum connected domain, converting the region into a rectangular picture frame, and extracting the maximum contour region in fig. 3a as a target image where structured light is located as shown in fig. 3 b;

step (2), performing binarization processing on the extracted target image as shown in fig. 3c, performing region segmentation on the structured light image according to connected domains, namely starting from any pixel in the target image, searching adjacent pixels with the same pixel value to form a pixel set as one connected domain, performing threshold segmentation to obtain a plurality of connected domains, and marking each connected domain;

step (3), on the basis of region segmentation, acquiring a pixel set G of the connected domain contour through an edge detection algorithm, and calculating a central point of each contour by using a spatial moment function, namely, a centroid of the connected domain is shown in fig. 3d, wherein the spatial moment function is:

wherein m ispqThe method comprises the following steps of taking a p + q order space moment function, wherein p and q are orders, M multiplied by N is the pixel size of an image where a connected domain is located, G (i, j) is a pixel set of a connected domain outline, and i and j represent the ith row and the jth column of pixel points of the image;

the centroid coordinates can be found from equation (1):

is a coordinate of the line of the center of mass,is the coordinates of the mass center column; m is00The zero-order moment of the space moment function represents the number of elements of the pixel set G; m is10The first moment of the space moment function represents the accumulated sum of the pixel row coordinates in the pixel set G; m is01The first moment of the space moment function represents the accumulated sum of pixel column coordinates in the pixel set G;

step (4), traversing pixel points of each connected domain, dividing the connected domain into n subregions according to the coordinate position of the centroid and the light shape characteristic of the standard structure, wherein n is the number of sides of the polygon, dividing the connected domain into 4 subregions according to the coordinate position of the centroid, and setting the row coordinate of the input vector index value as xaColumn coordinate of yaLine coordinate of center point is xcColumn coordinate of ycThe judgment relationship is shown in table 1, and the judgment range is each connected domain;

TABLE 1 area determination Table

Determining the relation Region(s)
xa<xc&ya<yc Upper left of
xa>xc&ya<yc Left lower part
xa<xc&ya>yc Upper right part
xa>xc&ya>yc Lower right

Step (5), using the euclidean distance as a distance measurement standard, as shown in fig. 1, calculating 4 pixels with the largest centroid distance 4 sub-regions by using a distance maximum formula, that is, the corner points, as shown in points P1-P4 in fig. 1, where max is the maximum value, and marking the corner points, so as to obtain all the corner points of the structured light as shown in fig. 3e, where the distance maximum formula is:

where d is the distance between the centroid and each corner point, xaIs the line coordinate, y, of a pixel pointaColumn coordinates of the pixel points; x is the number ofcIs the line coordinate of the centroid, ycIs the column coordinate of the centroid.

Compared with other corner detection methods, the method is used for distorted squares generated by staggered stripe images caused by random fluctuation of the water surface, and as shown in fig. 4a and 4b, the problems of missing detection, repeated detection, multiple detection, inaccurate detection caused by motion blur and the like can be avoided in the corner detection.

The above-mentioned embodiments are merely preferred embodiments of the present invention, and the scope of the present invention is not limited thereto, so that variations made according to the principle of the present invention should be covered within the scope of the present invention.

完整详细技术资料下载
上一篇:石墨接头机器人自动装卡簧、装栓机
下一篇:基于强弱联合半监督直觉模糊聚类的图像分割方法

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!