Movatterモバイル変換


[0]ホーム

URL:


CN119379539B - Image stitching method, system and readable storage medium - Google Patents

Image stitching method, system and readable storage medium
Download PDF

Info

Publication number
CN119379539B
CN119379539BCN202411974715.7ACN202411974715ACN119379539BCN 119379539 BCN119379539 BCN 119379539BCN 202411974715 ACN202411974715 ACN 202411974715ACN 119379539 BCN119379539 BCN 119379539B
Authority
CN
China
Prior art keywords
image
stitched
view
stitching
calibration plate
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
CN202411974715.7A
Other languages
Chinese (zh)
Other versions
CN119379539A (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.)
Hangzhou Huicui Intelligent Technology Co ltd
Original Assignee
Hangzhou Huicui Intelligent Technology 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 Hangzhou Huicui Intelligent Technology Co ltdfiledCriticalHangzhou Huicui Intelligent Technology Co ltd
Priority to CN202411974715.7ApriorityCriticalpatent/CN119379539B/en
Publication of CN119379539ApublicationCriticalpatent/CN119379539A/en
Application grantedgrantedCritical
Publication of CN119379539BpublicationCriticalpatent/CN119379539B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Classifications

Landscapes

Abstract

Translated fromChinese

本申请公开了一种图像拼接方法、系统及可读存储介质。所述方法包括:获取第一视野和第二视野的标定板图像;获得第一视野和第二视野图像之间的单应性矩阵,作为两幅拼接图像之间的转换矩阵;获取与标定板图像相同的视角获取第一视野和第二视野的拼接图像,利用转换矩阵对拼接图像进行转换,并根据转换结果进行拼接得到初步拼接图像;根据初步拼接图像,分别计算两幅拼接图像到初步拼接图像之间的单应性矩阵;通过单应性矩阵将两幅拼接变换到初步拼接图像中,并对变换后的重叠区域进行像素融合,获得拼接后的图像。本发明所述方法具备精度高、鲁棒性强、速度快且使用方便的特点。

The present application discloses an image stitching method, system and readable storage medium. The method comprises: obtaining a calibration plate image of a first field of view and a second field of view; obtaining a homography matrix between the first field of view and the second field of view images as a conversion matrix between two stitched images; obtaining a stitched image of the first field of view and the second field of view at the same viewing angle as the calibration plate image, transforming the stitched image using the conversion matrix, and stitching to obtain a preliminary stitched image according to the transformation result; according to the preliminary stitched image, respectively calculating the homography matrix between the two stitched images and the preliminary stitched image; transforming the two stitched images into the preliminary stitched image through the homography matrix, and performing pixel fusion on the transformed overlapping area to obtain the stitched image. The method of the present invention has the characteristics of high precision, strong robustness, fast speed and easy use.

Description

Image stitching method, system and readable storage medium
Technical Field
The application relates to the technical field of image stitching, in particular to an image stitching method, an image stitching system and a readable storage medium.
Background
The image stitching technique is a technique for stitching a plurality of images having overlapping portions into one image, and is very often used in the field of machine vision. The conventional image stitching method mainly comprises a method based on feature matching and a method based on conversion of a calibration plate, but the conventional method has a plurality of problems and disadvantages.
The principle of the feature matching-based method is that feature points are matched in pairs for images to be spliced, a conversion matrix is calculated according to the matched feature points, one of the images is transformed into a coordinate system of the other image through the conversion matrix to be spliced, but the method has high requirements on the feature points, and if a large number of similar feature points exist in the two images, the feature points can be paired incorrectly to cause unstable splicing.
The principle of the calibration plate conversion-based method is that the image coordinate system of one image is converted into the calibration plate coordinate system and then is converted into the image coordinate system of the other image for splicing, so that unstable splicing caused by feature point matching errors can be effectively avoided. But it requires multiple coordinate conversions and errors are easily generated during the conversion. And the requirement on the calibration plate is high, the calibration plate needs to be capable of directly reading the coordinate system of the calibration plate in the image, otherwise, the conversion relation from the image coordinate system to the coordinate system of the calibration plate to the image coordinate system cannot be calculated, and the conversion relation calculation process is relatively troublesome. Meanwhile, multiple times of conversion can bring more time consumption in the actual splicing process, and the service efficiency is affected under the condition of larger images.
Disclosure of Invention
The application aims to provide an image stitching method, an image stitching system and a readable storage medium. By designing a calibration plate consisting of a black marker and a plurality of small holes and a conversion relation calculation method, the extraction and one-to-one pairing of the small Kong Zhixin coordinates are respectively completed between two images, and the conversion matrix is directly calculated through multiple points, so that the accuracy and the speed of image splicing are improved. The first aspect of the application provides an image stitching method, which comprises the following steps:
Obtaining calibration plate images of a first view and a second view, wherein the inside of the calibration plate images is distributed with black rectangular marker shapes of a plurality of ordered round holes;
performing relation conversion on the calibration plate images of the first view and the second view to obtain a homography matrix between the images of the first view and the second view, and using the homography matrix as a conversion matrix between the two spliced images;
Acquiring spliced images of a first visual field and a second visual field, which are respectively the first spliced image and the second spliced image, from the same visual angle as the calibration plate image;
Converting the first spliced image and the second spliced image by using a conversion matrix, and splicing according to a conversion result to obtain a preliminary spliced image;
According to the preliminary stitched image, respectively calculating a homography matrix H1 from the first stitched image to the preliminary stitched image and a homography matrix H2 from the second stitched image to the preliminary stitched image;
And transforming the first spliced image and the second spliced image into the preliminary spliced image through a homography matrix H1 and a homography matrix H2 respectively, and carrying out pixel fusion on the transformed overlapping area to obtain a spliced image.
Optionally, the performing relationship conversion on the calibration plate images of the first field of view and the second field of view to obtain a homography matrix between the images of the first field of view and the second field of view specifically includes:
threshold segmentation is carried out on the calibration plate image to obtain a first brightness area and a second brightness area of the calibration plate image, wherein the brightness value of the second brightness area is higher than that of the first brightness area
Taking the connected domain of the first brightness area as a darkening connected domain, and filling holes in the darkening connected domain of the calibration plate image;
filtering the darkening connected domain according to the area, and reserving the darkening connected domain with the area larger than a set threshold value;
Screening out a connected domain with the highest rectangle degree from the darkened connected domain with the area larger than a set threshold value, namely the marker;
extracting the minimum bounding box of the marker, and obtaining two corner points of the upper edge of the minimum bounding box of the marker;
calculating a linear function of the upper edge according to the two corner points of the upper edge of the minimum bounding box;
Interference shielding is carried out on the second brightness area, and a luminous communication area inside the calibration plate image is obtained;
Screening the connected domains of the round holes according to the area, calculating the mass center of each connected domain of the round holes, and obtaining a round hole mass center Set1;
Calculating the vertical distance from the center of mass of each circular hole to the upper edge of the marker according to the linear function of the upper edge, and sequencing the center of mass Set1 of the circular holes from small to large according to the vertical distance to obtain a center of mass Set2 of the circular holes;
The round hole centroid Set2 is locally ordered from small to large according to the abscissa, and a final round hole centroid Set is obtained;
performing circular hole coordinate extraction on the calibration plate images of the first view and the second view, and respectively obtaining two circular hole centroid sets corresponding to each other in sequence;
And calculating and storing a homography matrix H between the calibration plate image of the first field of view and the calibration plate image of the second field of view through two circular hole centroid sets in one-to-one correspondence.
Optionally, the connected area of the first brightness area of the calibration plate image is a white area connected in the binary image of the calibration plate image.
Optionally, the calculation formula of the rectangle degree is:
,
wherein y is the rectangle degree,To be the minimum bounding box area,The area of the pixel is communicated with the area of the domain for the marker.
Optionally, the interference shielding is specifically that a marker binary image and a second brightness region binary image are extracted, the marker binary image is mapped into the second brightness region binary image, and the gray value of the region, corresponding to the black pixel in the marker binary image, in the second brightness region binary image is set to 255.
Optionally, the local sorting is performed on the round hole centroid Set2 from small to large according to the abscissa, and the local sorting rule is as follows:
judging whether the upper edge of the minimum bounding box is a long side or a short side, and determining the number of round holes in each row of the upper edge of the minimum bounding box;
and (3) setting the number of round holes in each row of the upper edge of the minimum bounding box as X, traversing the round hole centroid Set2 according to the number of the round holes, and sequencing every X holes in sequence according to the sequence from small to large.
Optionally, the step of respectively calculating a homography matrix H1 from the first stitched image to the preliminary stitched image and a homography matrix H2 from the second stitched image to the preliminary stitched image according to the preliminary stitched image specifically includes:
calculating corner points of the first spliced image and the second spliced image:
Let the height of the first stitched image beWidth ofThe height of the second spliced image isWidth of;
The four corner points of the first spliced image are respectively;
The four corner points of the second spliced image are respectively;
Transforming the angular point coordinates of the second spliced image into the coordinate system of the first spliced image through a homography matrix H, wherein the transformation formula is P ' =P ' ×H, and normalizing P ', so as to obtain new four angular point coordinates,,,;
Calculating the size of the preliminary stitched image after stitching through the four corner coordinates of the first stitched image and the four corner coordinates converted by the second stitched image;
The width of the preliminary mosaic image is:
;
the height of the preliminary stitched image is:
;
Calculating coordinates corresponding to the corner of the first stitched image and the corner of the second stitched image in the preliminary stitched image:
The corner of the first stitched image and the corner of the second stitched image are subtractedNamely, corresponding coordinates in the preliminary mosaic image;
Wherein,,
,
And respectively calculating a homography matrix H1 between the first spliced image and the preliminary spliced image and a homography matrix H2 between the second spliced image and the preliminary spliced image through converting corresponding image corner coordinates before and after conversion.
Optionally, the pixel fusion is performed on the transformed overlapping area, and the fusion mode includes:
average value fusion, namely obtaining an average value of corresponding pixels in the first spliced image and the second spliced image;
Maximum value fusion, namely taking the maximum value of the corresponding pixels in the first spliced image and the second spliced image;
The minimum value fusion, namely, the corresponding pixels in the first spliced image and the second spliced image take the minimum value;
tail-end fusion, namely directly covering the second spliced image by the overlapped area.
The second aspect of the present invention provides an image stitching system, comprising a memory and a processor, wherein the memory comprises an image stitching method program, and the image stitching method program, when executed by the processor, implements the steps of the image stitching method.
A third aspect of the present invention provides a computer-readable storage medium having an image stitching method program embodied therein, which when executed by a processor, implements the steps of the image stitching method.
As can be seen from the above, the present application provides an image stitching method, system and readable storage medium. The method has the characteristics of high precision, strong robustness, high speed and convenient use.
Aiming at the problems of precision and speed, the application designs a calibration plate consisting of a black marker and a plurality of small holes and a conversion relation calculating method. The small Kong Zhixin coordinates are extracted and matched one by one between the two visual field calibration plate images, the conversion matrix is directly calculated through multiple points, the more the number of the points is, the higher the accuracy is, and compared with the conventional calibration plate conversion method, the splicing can be completed through one-time conversion, and the accuracy and the speed are not lost in the middle.
Aiming at the convenience problem, the application provides the coordinate pairing method, which can automatically sort and pair the extracted circular hole centroids without manual matching of operators, and is simpler and more convenient than the conventional calibration plate conversion method.
Aiming at the robustness problem, the application adopts multiple modes to select and process the splicing overlapping area, can overcome the influence of illumination to a certain extent, and the splicing boundary is more natural.
Additional features and advantages of the application will be set forth in the description which follows, and in part will be apparent from the description, or may be learned by practice of the embodiments of the application. The objectives and other advantages of the application will be realized and attained by the structure particularly pointed out in the written description and claims thereof as well as the appended drawings.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the embodiments of the present application will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and should not be considered as limiting the scope, and other related drawings can be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is an overall flowchart of an image stitching method according to an embodiment of the present application.
FIG. 2 is an image of a calibration plate according to an embodiment of the present application.
FIG. 3 is a first calibration plate image provided in an embodiment of the present application.
FIG. 4 is a second calibration plate image provided in an embodiment of the present application.
Fig. 5 is a binary diagram of a first luminance area according to an embodiment of the present application.
Fig. 6 is an image of a calibration plate image with a darkened connected area filled with holes according to an embodiment of the present application.
FIG. 7 is an image of a calibration plate image according to an embodiment of the present application after area filtering.
FIG. 8 is a binary image of a marker according to an embodiment of the present application.
Fig. 9 is a second luminance area binary image provided in an embodiment of the present application.
FIG. 10 is a graph showing the internal brightness of a marker according to an embodiment of the present application.
Fig. 11 is a schematic diagram of a center of mass of a circular hole according to an embodiment of the present application.
FIG. 12 is a schematic view of the vertical distance from the center of mass of a circular hole to the upper edge of a marker according to an embodiment of the present application.
Fig. 13 is a block diagram of an image stitching system according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present application, but not all embodiments. The components of the embodiments of the present application generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the application, as presented in the figures, is not intended to limit the scope of the application, as claimed, but is merely representative of selected embodiments of the application. All other embodiments, which can be made by a person skilled in the art without making any inventive effort, are intended to be within the scope of the present application.
It should be noted that like reference numerals and letters refer to like items in the following figures, and thus once an item is defined in one figure, no further definition or explanation thereof is necessary in the following figures. Meanwhile, in the description of the present application, the terms "first", "second", and the like are used only to distinguish the description, and are not to be construed as indicating or implying relative importance.
Referring to fig. 1, an image stitching method according to some embodiments of the present application includes:
S102, obtaining calibration plate images of a first view and a second view, wherein the inside of the calibration plate images is distributed with black rectangular marker shapes of a plurality of ordered round holes;
It should be noted that, the calibration plate is formed by a black rectangular marker shape with a plurality of orderly round holes distributed inside, the number of the round holes is customized by a user, the row-column distribution (the number of the holes in each row is equal, the number of the holes in each column is equal), and the more the number of the round holes, the higher the precision. The calibration plate is shown in fig. 2, where the black marker is located intermediate the first field of view and the second field of view, both of which require the black marker to be photographed.
It should be noted that both the first field of view and the second field of view need to contain the complete rectangular marker.
If the splice is lateral, the tag needs to be in the vertical direction (short side up and down, long side left and right). In the case of a vertical splice, the tag needs to be in the transverse direction (short side on the left and right, long side up and down).
S104, performing relation conversion on the calibration plate images of the first view and the second view to obtain a homography matrix between the images of the first view and the second view, and using the homography matrix as a conversion matrix between the two spliced images;
S106, acquiring spliced images of a first visual field and a second visual field, which are respectively the first spliced image and the second spliced image, from the same visual angle as the calibration plate image;
S108, converting the first spliced image and the second spliced image by using a conversion matrix, and splicing according to a conversion result to obtain a preliminary spliced image;
s110, respectively calculating a homography matrix H1 from the first jigsaw image to the preliminary mosaic image and a homography matrix H2 from the second jigsaw image to the preliminary mosaic image according to the preliminary mosaic image;
s112, converting the first spliced image and the second spliced image into the preliminary spliced image through a homography matrix H1 and a homography matrix H2 respectively, and carrying out pixel fusion on the overlapped area after conversion to obtain a spliced image.
According to an embodiment of the present invention, the performing relationship conversion on the calibration plate images of the first field of view and the second field of view to obtain a homography matrix between the images of the first field of view and the second field of view specifically includes:
It should be noted that, in the present application, the calibration plate image includes a first field of view and a second field of view, where the first calibration plate image is shown in fig. 3, and the second calibration plate image is shown in fig. 4.
Threshold segmentation is carried out on the calibration plate image to obtain a first brightness area and a second brightness area of the calibration plate image, wherein the brightness value of the second brightness area is higher than that of the first brightness area
And the connected area of the first brightness area of the calibration plate image is a white area connected in the binary image of the calibration plate image.
In the application, the binary processing is carried out on the calibration plate image to obtain a calibration plate binary image, and the white areas connected in the binary image are connected areas. As shown in fig. 5.
Taking the connected domain of the first brightness area as a darkening connected domain, and filling holes in the darkening connected domain of the calibration plate image;
In the present application, the hole filling is performed on the darkened communication area of the calibration plate image, as shown in fig. 6.
The darkened connected domain is filtered according to the area, and the darkened connected domain with the area larger than the set threshold value is reserved, as shown in fig. 7.
Screening out a connected domain with highest rectangle degree from dark connected domains with areas larger than a set threshold value, namely a marker (black rectangle connected domain);
extracting the minimum bounding box of the marker, and obtaining two corner points of the upper edge of the minimum bounding box of the marker;
It should be noted that, the application extracts the minimum bounding box of the rectangular marker, can obtain four corner points of the marker, obtain two corner points of the upper edge of the rectangular marker, and judge whether the upper edge is a short side or a long side according to the distance between the corner points. The number of round holes on one long side is different from that on one short side, so that a basis is provided for subsequent operation.
Calculating a linear function of the upper edge according to the two corner points of the upper edge of the minimum bounding box;
Interference shielding is carried out on the second brightness area, and a luminous communication area inside the calibration plate image is obtained;
It should be noted that, in the present application, the threshold of the calibration plate image is divided, that is, the marker is subjected to binarization processing, so as to obtain a marker binary image, so as to obtain a first brightness region and a second brightness region of the calibration plate image, the marker binary image is shown in fig. 8, and then the marker binary image is subjected to interference shielding, so as to obtain a lighting connected region inside the marker, that is, a second brightness region binary image, and the second brightness region binary image is shown in fig. 9.
The shielding mode is to map the marker binary image into a second brightness region binary image, and the gray value of the region, corresponding to the black pixel in the marker binary image, in the second brightness region binary image is set to 255. And obtaining a marker internal brightening binary image, and obtaining a marker internal brightening connected domain, wherein the marker internal brightening binary image is shown in fig. 10.
And screening the connected domains of the round holes according to the area, calculating the mass center of each connected domain of the round holes, and obtaining a round hole mass center Set1, wherein the schematic diagram of the mass center of the round holes is shown in figure 11.
Calculating the vertical distance from the center of mass of each circular hole to the upper edge of the marker according to the linear function of the upper edge, and sequencing the center of mass Set1 of the circular holes from small to large according to the vertical distance to obtain a center of mass Set2 of the circular holes;
the method calculates the vertical distance from the center of mass of each round hole to the upper edge of the marker, sorts the round hole center of mass Set1 according to the vertical distance from small to large, and obtains the round hole center of mass Set2. A schematic of the vertical distance of the centroid of the circular hole from the top edge of the tag is shown in fig. 12.
The round hole centroid Set2 is locally ordered from small to large according to the abscissa, and a final round hole centroid Set is obtained;
performing circular hole coordinate extraction on the calibration plate images of the first view and the second view, and respectively obtaining two circular hole centroid sets corresponding to each other in sequence;
It should be noted that, the first view field and the second view field are both extracted by the circular hole coordinates in the above steps, and two circular hole centroid sets corresponding to each other in sequence are respectively obtained, and are assumed to be Set' (reference image) and Set "(image to be spliced) respectively.
And calculating and storing a homography matrix H between the calibration plate image of the first field of view and the calibration plate image of the second field of view through two circular hole centroid sets in one-to-one correspondence.
According to the embodiment of the invention, the calculation formula of the rectangle degree is as follows:
,
wherein y is the rectangle degree,To be the minimum bounding box area,The area of the pixel is communicated with the area of the domain for the marker.
According to the embodiment of the invention, the interference shielding is specifically implemented by extracting a marker binary image and a second brightness region binary image, mapping the marker binary image into the second brightness region binary image, and fully blackening the region of the second brightness region binary image, which corresponds to the region of the marker binary image with black pixels.
According to the embodiment of the invention, the round hole centroid Set2 is locally ordered from small to large according to the abscissa, and the local ordering rule is as follows:
judging whether the upper edge of the minimum bounding box is a long side or a short side, and determining the number of round holes in each row of the upper edge of the minimum bounding box;
And (3) setting the number of round holes in each row of the upper edge of the minimum bounding box as X, traversing the round hole centroid Set2 according to the number of the round holes, and sequencing every X holes in sequence according to the sequence from small to large. For example, 4 holes per row, the round hole centroid Set2 is traversed, and every four holes are ordered from small to large.
According to the embodiment of the invention, according to the preliminary stitched image, a homography matrix H1 from the first stitched image to the preliminary stitched image and a homography matrix H2 from the second stitched image to the preliminary stitched image are respectively calculated, specifically:
calculating corner points of the first spliced image and the second spliced image:
it should be noted that, as a specific embodiment, the present application performs stitching using the first stitched image and the second stitched image.
Let the height of the first stitched image beWidth ofThe height of the second spliced image isWidth of;
The four corner points of the first spliced image are respectively;
The four corner points of the second spliced image are respectively;
Transforming the angular point coordinates of the second spliced image into the coordinate system of the first spliced image through a homography matrix H, wherein the transformation formula is P ' =P ' ×H, and normalizing P ', so as to obtain new four angular point coordinates,,,;
Calculating the size of the preliminary stitched image after stitching through the four corner coordinates of the first stitched image and the four corner coordinates converted by the second stitched image;
The width of the preliminary mosaic image is:
;
the height of the preliminary stitched image is:
;
Calculating coordinates corresponding to the corner of the first stitched image and the corner of the second stitched image in the preliminary stitched image:
The corner of the first stitched image and the corner of the second stitched image are subtractedNamely, corresponding coordinates in the preliminary mosaic image;
Wherein,,
,
And respectively calculating a homography matrix H1 between the first spliced image and the preliminary spliced image and a homography matrix H2 between the second spliced image and the preliminary spliced image through converting corresponding image corner coordinates before and after conversion.
According to an embodiment of the present invention, the pixel fusion is performed on the transformed overlapping area, and the fusion mode includes:
average value fusion, namely obtaining an average value of corresponding pixels in the first spliced image and the second spliced image;
Maximum value fusion, namely taking the maximum value of the corresponding pixels in the first spliced image and the second spliced image;
The minimum value fusion, namely, the corresponding pixels in the first spliced image and the second spliced image take the minimum value;
tail-end fusion, namely directly covering the second spliced image by the overlapped area.
The first stitched image and the second stitched image are respectively transformed into the preliminary stitched image through H1 and H2, and the transformed overlapping region needs to be specially processed. The special processing of the application is to perform pixel fusion on overlapping areas, and the fusion modes which can be selected by a user comprise mean value fusion, maximum value fusion, minimum value fusion, tail connection fusion and the like. And carrying out pixel fusion on the transformed overlapping area to obtain a spliced image.
As shown in fig. 13, the second aspect of the present invention provides an image stitching system, where the image stitching system 13 includes a memory 131 and a processor 132, and the memory 131 includes an image stitching method program, and the image stitching method program, when executed by the processor 132, implements the steps of the image stitching method.
A third aspect of the present invention provides a computer-readable storage medium having an image stitching method program embodied therein, which when executed by a processor, implements the steps of the image stitching method.
As can be seen from the above, the present application provides an image stitching method, system and readable storage medium. The method has the characteristics of high precision, strong robustness, high speed and convenient use.
Aiming at the problems of precision and speed, the application designs a calibration plate consisting of a black marker and a plurality of small holes and a conversion relation calculating method. The small Kong Zhixin coordinates are extracted and matched one by one between the calibration plate images of the first view and the second view respectively, the conversion matrix is directly calculated through multiple points, the more the number of the points, the higher the accuracy is, and compared with the conventional calibration plate conversion method, the splicing can be completed through one-time conversion, and the accuracy and the speed are not lost in the middle.
Aiming at the convenience problem, the application provides the coordinate pairing method, which can automatically sort and pair the extracted circular hole centroids without manual matching of operators, and is simpler and more convenient than the conventional calibration plate conversion method.
Aiming at the robustness problem, the application adopts multiple modes to select and process the splicing overlapping area, can overcome the influence of illumination to a certain extent, and the splicing boundary is more natural.
In the several embodiments provided by the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is merely a logical function division, and there may be additional divisions of actual implementation, such as multiple units or components may be combined or integrated into another system, or some features may be omitted or not performed. In addition, the various components shown or discussed may be coupled or directly coupled or communicatively coupled to each other via some interface, whether indirectly coupled or communicatively coupled to devices or units, whether electrically, mechanically, or otherwise.
The units described as separate components may or may not be physically separate, and components displayed as units may or may not be physical units, may be located in one place or distributed on a plurality of network units, and may select some or all of the units according to actual needs to achieve the purpose of the embodiment.
In addition, each functional unit in each embodiment of the present invention may be integrated in one processing unit, or each unit may be separately used as a unit, or two or more units may be integrated in one unit, where the integrated units may be implemented in a form of hardware or a form of hardware plus a form of software functional unit.
It will be appreciated by those of ordinary skill in the art that implementing all or part of the steps of the above method embodiments may be implemented by hardware associated with program instructions, where the above program may be stored in a readable storage medium, where the program when executed performs the steps comprising the above method embodiments, where the above storage medium includes various media that may store program code, such as a removable storage device, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk.
Or the above-described integrated units of the invention may be stored in a readable storage medium if implemented in the form of software functional modules and sold or used as separate products. Based on such understanding, the technical solution of the embodiments of the present invention may be embodied in essence or a part contributing to the prior art in the form of a software product stored in a storage medium, including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in the embodiments of the present invention. The storage medium includes various media capable of storing program codes such as a removable storage device, a ROM, a RAM, a magnetic disk or an optical disk.

Claims (10)

Translated fromChinese
1.一种图像拼接方法,其特征在于,所述方法包括:1. An image stitching method, characterized in that the method comprises:获取第一视野和第二视野的标定板图像,所述标定板图像内部分布若干个有序圆孔的黑色长方标记物形构成;Acquire calibration plate images of the first field of view and the second field of view, wherein the calibration plate images are composed of a plurality of black rectangular markers with ordered circular holes distributed inside;对第一视野和第二视野的标定板图像进行关系转换,获得第一视野和第二视野图像之间的单应性矩阵,作为两幅拼接图像之间的转换矩阵;Performing relational transformation on the calibration plate images of the first field of view and the second field of view to obtain a homography matrix between the first field of view and the second field of view images as a transformation matrix between the two stitched images;获取与标定板图像相同的视角得到第一视野和第二视野的拼接图像,分别为第一拼接图像和第二拼接图像;Acquire the same viewing angle as the calibration plate image to obtain a stitched image of the first field of view and a second field of view, which are respectively a first stitched image and a second stitched image;利用转换矩阵对第一拼接图像和第二拼接图像进行转换,并根据转换结果进行拼接得到初步拼接图像;The first stitched image and the second stitched image are transformed by using a transformation matrix, and stitched together according to the transformation result to obtain a preliminary stitched image;根据初步拼接图像,分别计算第一拼图像接到初步拼接图像的单应性矩阵H1和第二拼接图像到初步拼接图像之间的单应性矩阵H2;According to the preliminary stitching image, respectively calculating a homography matrix H1 between the first stitching image and the preliminary stitching image and a homography matrix H2 between the second stitching image and the preliminary stitching image;将第一拼接图像和第二拼接图像分别通过单应性矩阵H1和单应性矩阵H2变换到初步拼接图像中,并对变换后的重叠区域进行像素融合,获得拼接后的图像。The first stitched image and the second stitched image are transformed into a preliminary stitched image through the homography matrix H1 and the homography matrix H2 respectively, and the transformed overlapping area is pixel-fused to obtain a stitched image.2.根据权利要求1所述的一种图像拼接方法,其特征在于,所述对第一视野和第二视野的标定板图像进行关系转换,获得第一视野和第二视野图像之间的单应性矩阵,具体包括:2. The image stitching method according to claim 1, characterized in that the step of performing relational transformation on the calibration plate images of the first field of view and the second field of view to obtain a homography matrix between the images of the first field of view and the second field of view specifically comprises:对标定板图像阈值分割,获取标定板图像的第一亮度区域和第二亮度区域,所述第二亮度区域的亮度值高于第一亮度区域的亮度值;Performing threshold segmentation on the calibration plate image to obtain a first brightness area and a second brightness area of the calibration plate image, wherein a brightness value of the second brightness area is higher than a brightness value of the first brightness area;以第一亮度区域的连通域为发暗连通域,对标定板图像的发暗连通域进行孔填充;Taking the connected domain of the first brightness area as the dark connected domain, performing hole filling on the dark connected domain of the calibration plate image;按面积过滤发暗连通域,保留面积大于设定阈值的发暗连通域;Filter the dark connected domains by area, and retain the dark connected domains whose area is larger than the set threshold;在面积大于设定阈值的发暗连通域中筛选出矩形度最高的连通域,即为标记物;The connected domain with the highest rectangularity is selected from the dark connected domains whose area is larger than the set threshold, which is the marker;提取标记物的最小包围框,获取标记物的最小包围框上边缘的两个角点;Extract the minimum bounding box of the marker and obtain the two corner points on the upper edge of the minimum bounding box of the marker;根据最小包围框上边缘的两个角点计算出上边缘的直线函数;Calculate the straight line function of the upper edge based on the two corner points of the upper edge of the minimum bounding box;对第二亮度区域进行干扰屏蔽,获取到标定板图像内部的发亮连通域;Interference shielding is performed on the second brightness area to obtain the bright connected domain inside the calibration plate image;按照面积筛选圆孔的连通域,并计算出每个圆孔连通域的质心,获取到圆孔质心集合Set1;Filter the connected domains of the circular holes according to their areas, and calculate the centroid of each connected domain of the circular holes to obtain the circular hole centroid set Set1;根据上边缘的直线函数计算每一个圆孔质心到标记物上边缘的垂直距离,将圆孔质心集合Set1按照垂直距离从小到大进行排序,获取到圆孔质心集合Set2;The vertical distance from the center of mass of each circular hole to the upper edge of the marker is calculated according to the straight line function of the upper edge, and the center of mass set of circular holes Set1 is sorted in ascending order according to the vertical distance to obtain the center of mass set of circular holes Set2;对圆孔质心集合Set2按照横坐标从小到大进行局部排序,获取到最终的圆孔质心集合Set;The circular hole mass center set Set2 is locally sorted according to the horizontal coordinate from small to large, and the final circular hole mass center set Set is obtained;对第一视野和第二视野的标定板图像进行圆孔坐标提取,分别获取到两个顺序一一对应的圆孔质心集合;Extract the circular hole coordinates from the calibration plate images of the first field of view and the second field of view, and obtain two sets of circular hole centroids that correspond to each other in sequence;通过两个一一对应的圆孔质心集合,计算第一视野的标定板图像和第二视野的标定板图像之间的单应性矩阵H,并保存。The homography matrix H between the calibration plate image of the first field of view and the calibration plate image of the second field of view is calculated and saved through two one-to-one corresponding circular hole centroid sets.3.根据权利要求2所述的一种图像拼接方法,其特征在于,所述标定板图像的第一亮度区域的连通域为标定板图像的二值图中相连的白色区域。3. An image stitching method according to claim 2, characterized in that the connected domain of the first brightness area of the calibration plate image is a connected white area in the binary image of the calibration plate image.4.根据权利要求3所述的一种图像拼接方法,其特征在于,所述矩形度的计算公式为:4. The image stitching method according to claim 3, wherein the rectangularity is calculated as follows: ,其中, y为矩形度,为最小包围框面积,为标记物连通域像素面积。Among them, y is the rectangularity, is the minimum bounding box area, is the pixel area of the connected domain of the marker.5.根据权利要求4所述的一种图像拼接方法,其特征在于,所述干扰屏蔽具体为:提取标记物二值图和第二亮度区域二值图,并将标记物二值图映射到第二亮度区域二值图中,将第二亮度区域二值图中对应标记物二值图中像素为黑的区域灰度值设置为255。5. An image stitching method according to claim 4, characterized in that the interference shielding specifically comprises: extracting the marker binary image and the second brightness area binary image, and mapping the marker binary image to the second brightness area binary image, and setting the grayscale value of the area in the second brightness area binary image corresponding to the pixel in the marker binary image that is black to 255.6.根据权利要求5所述的一种图像拼接方法,其特征在于,所述对圆孔质心集合Set2按照横坐标从小到大进行局部排序,其局部排序规则为:6. The image stitching method according to claim 5, characterized in that the circular hole mass center set Set2 is locally sorted from small to large according to the horizontal coordinate, and the local sorting rule is:判断最小包围框上边缘是长边还是短边的信息,确定最小包围框上边缘每行有圆孔的数量;Determine whether the upper edge of the minimum bounding box is a long edge or a short edge, and determine the number of circular holes in each row of the upper edge of the minimum bounding box;设最小包围框上边缘每行的圆孔数量为X,根据圆孔的数量对圆孔质心集合Set2进行遍历,每X个孔按照从小到大排序依次排序。Assume that the number of circular holes in each row on the upper edge of the minimum bounding box is X, and traverse the circular hole centroid set Set2 according to the number of circular holes, and sort every X holes in order from small to large.7.根据权利要求3所述的一种图像拼接方法,其特征在于,所述根据初步拼接图像,分别计算第一拼接图像到初步拼接图像的单应性矩阵H1和第二拼接图像到初步拼接图像之间的单应性矩阵H2,具体为:7. The image stitching method according to claim 3, characterized in that, according to the preliminary stitching image, the homography matrix H1 from the first stitching image to the preliminary stitching image and the homography matrix H2 from the second stitching image to the preliminary stitching image are respectively calculated, specifically:计算第一拼接图像和第二拼接图像的角点:Calculate the corner points of the first and second stitched images:设第一拼接图像的高度为,宽度为;第二拼接图像的高度为,宽度为Assume the height of the first stitched image is , the width is ; The height of the second stitched image is , the width is ;则第一拼接图像的四个角点分别为Then the four corner points of the first stitched image are , , , ;第二拼接图像的四个角点分别为The four corner points of the second stitched image are , , , ;将第二拼接图像的角点坐标通过单应性矩阵H变换到第一拼接图像的坐标系中,变换公式为:P"=P'*H,再对P"进行归一化,获取到新的四个角点坐标The corner point coordinates of the second stitched image are transformed into the coordinate system of the first stitched image through the homography matrix H. The transformation formula is: P"=P'*H. Then P" is normalized to obtain the new four corner point coordinates. , , , ;通过第一拼接图像的四个角点坐标和第二拼接图像转换后的四个角点坐标,计算出拼接后的初步拼接图像尺寸;Calculating the size of the initial stitched image after stitching by using the coordinates of the four corner points of the first stitched image and the coordinates of the four corner points of the second stitched image after conversion;初步拼接图像的宽度为:The width of the initial stitched image is: ,初步拼接图像的高度为:The height of the initial stitched image is: ,计算出第一拼接图像的角点和第二拼接图像的角点在初步拼接图像中对应的坐标:Calculate the corresponding coordinates of the corner points of the first stitched image and the corner points of the second stitched image in the preliminary stitched image:第一拼接图像的角点和第二拼接图像的角点都减去,即为在初步拼接图像中对应的坐标;The corner points of the first stitched image and the corner points of the second stitched image are subtracted , which are the corresponding coordinates in the preliminary stitching image;其中,in, , ,通过转换前后的对应的图像角点坐标,分别计算第一拼接图像到初步拼接图像之间的单应性矩阵H1和第二拼接图像到初步拼接图像之间的单应性矩阵H2。The homography matrix H1 between the first stitched image and the preliminary stitched image and the homography matrix H2 between the second stitched image and the preliminary stitched image are calculated respectively by using the corresponding image corner point coordinates before and after the conversion.8.根据权利要求3所述的一种图像拼接方法,其特征在于,所述对变换后的重叠区域进行像素融合,融合模式包括:8. The image stitching method according to claim 3, characterized in that the pixel fusion is performed on the transformed overlapping area, and the fusion mode includes:均值融合:第一拼接图像和第二拼接图像中对应像素取均值;Mean fusion: take the mean of corresponding pixels in the first stitched image and the second stitched image;最大值融合:第一拼接图像和第二拼接图像中对应的像素取最大值;Maximum fusion: the corresponding pixels in the first stitched image and the second stitched image take the maximum value;最小值融合:第一拼接图像和第二拼接图像中对应的像素取最小值;Minimum value fusion: the corresponding pixels in the first stitched image and the second stitched image take the minimum value;接尾融合:重叠区域直接覆盖第二拼接图像。End-to-end fusion: The overlapping area directly covers the second stitched image.9.一种图像拼接系统,其特征在于,包括存储器和处理器,所述存储器中包括图像拼接方法程序,所述图像拼接方法程序被所述处理器执行时,实现如权利要求1至8中任一项所述的一种图像拼接方法的步骤。9. An image stitching system, characterized in that it comprises a memory and a processor, wherein the memory comprises an image stitching method program, and when the image stitching method program is executed by the processor, the steps of an image stitching method as claimed in any one of claims 1 to 8 are implemented.10.一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中包括图像拼接方法程序,所述图像拼接方法程序被处理器执行时,实现如权利要求1至8中任一项所述的一种图像拼接方法的步骤。10. A computer-readable storage medium, characterized in that the computer-readable storage medium comprises an image stitching method program, and when the image stitching method program is executed by a processor, the steps of an image stitching method as claimed in any one of claims 1 to 8 are implemented.
CN202411974715.7A2024-12-312024-12-31Image stitching method, system and readable storage mediumActiveCN119379539B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN202411974715.7ACN119379539B (en)2024-12-312024-12-31Image stitching method, system and readable storage medium

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202411974715.7ACN119379539B (en)2024-12-312024-12-31Image stitching method, system and readable storage medium

Publications (2)

Publication NumberPublication Date
CN119379539A CN119379539A (en)2025-01-28
CN119379539Btrue CN119379539B (en)2025-06-03

Family

ID=94339814

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202411974715.7AActiveCN119379539B (en)2024-12-312024-12-31Image stitching method, system and readable storage medium

Country Status (1)

CountryLink
CN (1)CN119379539B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN120182111B (en)*2025-05-202025-07-25深圳明锐理想科技股份有限公司 Multi-camera field of view fusion method, electronic device and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN112037130A (en)*2020-08-272020-12-04江苏提米智能科技有限公司Adaptive image splicing and fusing method and device, electronic equipment and storage medium
CN112734779A (en)*2020-11-252021-04-30深圳了然视觉科技有限公司Dot calibration plate edge sub-pixel detection method

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN101710932B (en)*2009-12-212011-06-22华为终端有限公司Image stitching method and device
CN113344795B (en)*2021-08-052021-10-29常州铭赛机器人科技股份有限公司Rapid image splicing method based on prior information
CN114549666B (en)*2022-04-262022-09-06杭州蓝芯科技有限公司AGV-based panoramic image splicing calibration method
CN115861063A (en)*2022-11-292023-03-28重庆长安汽车股份有限公司Depth estimation-based panoramic stitching method
CN116310132A (en)*2023-03-292023-06-23内蒙动力机械研究所Three-dimensional point cloud splicing system and method based on turntable and improved iterative algorithm
CN116612006A (en)*2023-05-252023-08-18中国传媒大学 An image stitching method and device based on deep learning
CN118037779A (en)*2024-03-202024-05-14征图新视(江苏)科技股份有限公司Track guiding deviation correcting method based on 2D vision
CN118505791A (en)*2024-04-232024-08-16武汉大学Image stitching method and device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN112037130A (en)*2020-08-272020-12-04江苏提米智能科技有限公司Adaptive image splicing and fusing method and device, electronic equipment and storage medium
CN112734779A (en)*2020-11-252021-04-30深圳了然视觉科技有限公司Dot calibration plate edge sub-pixel detection method

Also Published As

Publication numberPublication date
CN119379539A (en)2025-01-28

Similar Documents

PublicationPublication DateTitle
CN112686812B (en) Bank card tilt correction detection method, device, readable storage medium and terminal
CN119379539B (en)Image stitching method, system and readable storage medium
CN109753953B (en)Method and device for positioning text in image, electronic equipment and storage medium
CN110472623A (en)Image detecting method, equipment and system
WO2017157034A1 (en)Method, device, and storage medium for identifying two-dimensional code
CN107247950A (en)A kind of ID Card Image text recognition method based on machine learning
CN108596166A (en)A kind of container number identification method based on convolutional neural networks classification
CN110569774B (en) An Automatic Digitization Method of Line Chart Image Based on Image Processing and Pattern Recognition
CN105893925A (en)Human hand detection method based on complexion and device
CN104866849A (en)Food nutrition label identification method based on mobile terminal
CN113392819B (en)Batch academic image automatic segmentation and labeling device and method
CN106169080A (en)A kind of combustion gas index automatic identifying method based on image
CN102136058A (en)Bar code image identification method
CN105740860A (en)Automatic detection method for Chinese character area of shop sign in natural scene
JP6890427B2 (en) Car number recognition device
CN104700062A (en)Method and equipment for identifying two-dimension code
CN106156684A (en) A two-dimensional code recognition method and device
CN109101855B (en)Lost positioning frame two-dimensional code identification method based on opencv
CN109766750A (en)A kind of table line position finding and detection method of financial statement
CN111461131A (en)Identification method, device, equipment and storage medium for ID card number information
CN111259891B (en)Method, device, equipment and medium for identifying identity card in natural scene
CN111737478A (en)Text detection method, electronic device and computer readable medium
CN115082776A (en)Electric energy meter automatic detection system and method based on image recognition
CN110619331A (en)Color distance-based color image field positioning method
CN112581452A (en)Industrial accessory surface defect detection method and system, intelligent device and storage medium

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
GR01Patent grant
GR01Patent grant

[8]ページ先頭

©2009-2025 Movatter.jp