Multi-image fast stitching method
By using QR code to calibrate the camera position and trajectory, multiple images are quickly spliced, solving the problem of time-consuming and unstable traditional splicing technology, and improving computing efficiency and splicing accuracy.
Patent Information
- Application Number
- CN202111597846.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-24
- Publication Date
- 2025-09-02
- Estimated Expiration
- 2041-12-24
AI Technical Summary
Traditional multi-image stitching technology takes a long time, relies on the quality of image feature points and is susceptible to external light interference, the stitching is unstable, and requires public areas of the image.
The camera shooting position and trajectory of the calibration sample with a QR code are used to obtain position information through QR code decoding, and the target image is quickly spliced in the calibration sample plane coordinate system.
The calculation efficiency and accuracy of image stitching are improved, the amount of data for image matching is reduced, the image calibration speed is fast, the stitching effect is stable, and it is not restricted by the public area of the image.
Smart Images

Figure CN114331839B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of image processing technology, and specifically relates to a method for rapid multi-image stitching. Background Art
[0002] Traditional multi-image visual computing primarily relies on image stitching technology, which stitches images together before performing the corresponding visual computations. Image stitching technology consists of three key components: feature point extraction and matching, image registration, and image fusion. Image registration, the core of the image stitching process, determines the overlapping areas and locations between the images to be stitched.
[0003] Traditional image stitching technology requires a common area between images, wasting the camera's field of view. Furthermore, each image capture requires extensive computational effort, including feature matching, image registration, and image fusion. This is time-consuming. The accuracy of image stitching is heavily dependent on the quality of the image's feature points, which is susceptible to interference from external light, resulting in unstable stitching. Summary of the Invention
[0004] In view of this, the technical solution disclosed in some embodiments is a method for rapid multi-image stitching, comprising the steps of:
[0005] S101, setting a calibration sample with a QR code, where the QR code contains its location information;
[0006] S102: photographing a calibration sample with a camera to obtain at least one calibration image, each calibration image containing at least two QR codes;
[0007] S103, calibrating the shooting position and shooting trajectory of the camera using the QR code in the calibration image;
[0008] S104, placing the target object at the location of the calibration sample, and photographing a selected area of the target object with a camera to obtain a target image of the selected area;
[0009] S105 , using the shooting position and shooting trajectory of the camera shooting the target image, determine the position information of the target image in the plane coordinate system where the calibration sample is located, and implement image stitching of the target image in the coordinate system based on the position information.
[0010] In the multi-image fast stitching method disclosed in some embodiments, the number of cameras is the same as the number of calibration images to be acquired.
[0011] In the multi-image fast stitching method disclosed in some embodiments, the number of cameras is less than the number of calibration images to be acquired.
[0012] In the multi-image rapid stitching method disclosed in some embodiments, the position information included in the QR code is the plane coordinate information of the position of the QR code on the plane where the calibration sample is located.
[0013] In the multi-image rapid stitching method disclosed in some embodiments, in step S101, a plurality of two-dimensional codes are provided in the calibration sample, and the plurality of two-dimensional codes are evenly distributed on the calibration sample.
[0014] Some embodiments disclose a method for rapid multi-image stitching. In step S102, a calibration image of the position is obtained according to a set number and position. In step S104, the target object is placed at the location of the calibration sample, and a camera is used to obtain the target image at the same position and the same number as in step S102.
[0015] The multi-image rapid stitching method disclosed in some embodiments further includes the steps of:
[0016] S106 : Based on the image stitching result, determine the distance between any two set positions in the plane coordinate system where the stitched image is located.
[0017] In some embodiments of the method for rapid multi-image splicing disclosed, the QR code is a matrix code.
[0018] In the multi-image fast stitching method disclosed in some embodiments, the calibration samples are checkerboard samples.
[0019] Some embodiments disclose a method for rapidly stitching multiple images, comprising the steps of:
[0020] S101, setting a calibration sample with a matrix code, dividing the calibration sample into M×N square areas, each of which is provided with at least two QR codes;
[0021] S102, using a camera to capture each square area to obtain M×N calibration images;
[0022] S103, using the QR code of each calibration image to calibrate and obtain the shooting position and shooting trajectory of the camera of the calibration image;
[0023] S104, placing the target object at any position within the area where the calibration sample is located, and using a camera to photograph the set position of the target object to obtain a target image at the set position;
[0024] S105 , using the shooting position and shooting trajectory of the camera shooting the target image, determine the position information of the target image in the plane coordinate system where the calibration sample is located, and perform image stitching on the target image in the coordinate system based on the position information.
[0025] The multi-image rapid stitching method disclosed in the embodiment of the present application first uses a calibration sample with a QR code to calibrate the camera shooting position and shooting trajectory of the calibration image, and then uses the calibrated camera shooting position and shooting trajectory information to determine the position information of multiple target images obtained by the camera. The multiple target images are quickly stitched together in the plane coordinate system where the calibration sample is located using the position information. The calibration image and the target image can be arbitrarily selected according to the image stitching requirements. The image stitching and image calculation data volume is small, the image matching is accurate, and the calculation efficiency is greatly improved. There is no need to be restricted by the common area of the image, the image calibration speed is fast, and the image stitching efficiency is high. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Figure 1 Flowchart of the multi-image rapid stitching method;
[0027] Figure 2 Schematic diagram of calibration image position information;
[0028] Figure 3 Schematic diagram of decoding the position information contained in the QR code in the calibration sample;
[0029] Figure 4 Schematic diagram of fast multi-image stitching. DETAILED DESCRIPTION
[0030] The term "embodiment" is used herein specifically to describe any embodiment as "exemplary," and should not be construed as superior or preferable to other embodiments. Performance indicators in the embodiments of this application were tested using conventional testing methods in the art, unless otherwise specified. It should be understood that the terms used in this application are intended solely to describe specific implementations and are not intended to limit the disclosure herein.
[0031] Unless otherwise specified, the technical and scientific terms used herein have the same meanings as commonly understood by ordinary technicians in the technical field to which this application belongs; other experimental methods and technical means not specifically specified in this application refer to experimental methods and technical means commonly used by ordinary technicians in this field.
[0032] As used herein, the terms "substantially" and "approximately" are used to describe small fluctuations. For example, they can refer to less than or equal to ±5%, such as less than or equal to ±2%, such as less than or equal to ±1%, such as less than or equal to ±0.5%, such as less than or equal to ±0.2%, such as less than or equal to ±0.1%, such as less than or equal to ±0.05%. Numerical data expressed or presented in range format herein are used for convenience and brevity only and should therefore be interpreted flexibly to include not only the values explicitly listed as the limits of the range, but also all independent values or subranges contained within the range. For example, a numerical range of "1-5%" should be interpreted to include not only the explicitly listed values of 1% to 5%, but also the independent values and subranges within the indicated range. Thus, included in this numerical range are independent values such as 2%, 3.5%, and 4%, and subranges such as 1% to 3%, 2% to 4%, and 3% to 5%, etc. This principle also applies to ranges that only list a single value. Furthermore, this interpretation applies regardless of the width of the range or the characteristics described.
[0033] Throughout this document, including in the claims, transitional terms such as "comprises," "includes," "with," "having," "contains," "involving," and "accommodating" are understood to be open-ended, meaning "including but not limited to." Only the transitional terms "consisting of" and "composed of" are closed transitional terms.
[0034] In order to better illustrate the content of this application, numerous specific details are provided in the specific examples below. It should be understood by those skilled in the art that this application can be implemented without certain specific details. In the examples, some methods, means, instruments, equipment, etc. well known to those skilled in the art are not described in detail in order to highlight the main purpose of this application.
[0035] Under the premise of no conflict, the technical features disclosed in the embodiments of this application can be combined arbitrarily, and the resulting technical solutions belong to the contents disclosed in the embodiments of this application.
[0036] The following is a combination of the embodiments and the appended Figure 1 、 2 , 3, and 4 provide further exemplary explanations of the technical details.
[0037] In some embodiments, as Figure 1 As shown, the multi-image fast stitching method includes the following steps:
[0038] S101. Set a calibration sample with a QR code, where the QR code contains its location information. Usually, the QR code is decoded to obtain the location information, and the location information contained in the QR code represents the location information of the calibration image containing the QR code. For example, the location information contained in the QR code is the plane coordinate information of the location of the QR code in the plane where the calibration sample is located. The information format after decoding the QR code is 110.100V1P1MM, where 110 represents the X-direction coordinate of the QR code in the rectangular coordinate system of the plane where the calibration sample is located, and 100 represents the Y-direction coordinate in the rectangular coordinate system of the plane.
[0039] S102: Use a camera to photograph calibration samples to obtain at least one calibration image, each calibration image containing at least two QR codes. Typically, two or more QR codes in an image can determine the camera position and angle used to obtain the calibration image. The position and orientation of the calibration image can also be determined based on the camera position and angle, and the position and orientation of the target image can be further determined during the target image stitching step.
[0040] S103, using the QR code in the calibration image to calibrate the camera's shooting position and shooting trajectory; the camera's shooting trajectory usually includes the camera's shooting angle information; using the QR code in the calibration image to calibrate the camera's shooting position and shooting trajectory, that is, using the QR code to determine the position information of the calibration image, and correlating the position information contained in the calibration image with the camera's shooting position and shooting trajectory, so that images obtained by the same camera at the same shooting position and shooting trajectory have the same position information; after the camera's shooting position and shooting trajectory are calibrated, all calibrated shooting positions and shooting trajectories are correlated with each calibration image; images at required positions in the calibration sample can be calibrated as needed, or images at all positions in the calibration sample can be calibrated;
[0041] S104, placing the target object at the location of the calibration sample, and using the camera to shoot a selected area of the target object to obtain a target image of the selected area; when stitching the target object image, according to the purpose and actual needs of the image stitching process, the target object is placed on the plane where the calibration sample is located, and the position on the target object where the image stitching process is required is selected for shooting, and the required position is covered by the calibrated camera shooting position and shooting trajectory, and each target image obtained including the selected position corresponds to a calibrated camera shooting position and shooting trajectory;
[0042] S105. Using the camera position and trajectory of the target image, the position information of the target image in the plane coordinate system of the calibration sample is determined, and image stitching of the target image in the coordinate system is performed. Typically, the coordinate information corresponding to the camera position and trajectory corresponding to the target image containing the selected position is used as the position coordinate information of the target image. The captured target image is arranged and combined according to its coordinate information in the plane coordinate system of the calibration sample, thereby achieving target image stitching in the plane coordinate system of the calibration sample. The stitched image has a fixed position in the plane coordinate system, and the coordinates of each point in the image can be calculated.
[0043] Usually, in the multi-image rapid stitching method, the calibration image only needs to be performed once, and the target object can be photographed multiple times and repeatedly, and subsequent image stitching and image calculation can be performed; the amount of data for image stitching and image calculation is small, the image matching is accurate, and the efficiency is greatly improved. There is no need to be restricted by the need for a common area for each image, and the stitching effect is stable.
[0044] As an optional embodiment, the number of cameras is equal to the number of calibration images to be acquired. The camera shooting position and shooting trajectory include each camera's number, location, and shooting angle. If the number of cameras is equal to the number of calibration images to be acquired, each camera corresponds to a calibration image, eliminating the need for further camera adjustment. When calibrating the cameras, only the correspondence between the calibration images and the shooting trajectory needs to be determined, improving the efficiency of multi-image calibration and multi-image stitching.
[0045] As an optional embodiment, the number of cameras is smaller than the number of calibration images to be acquired. If the number of cameras is smaller than the number of images to be calibrated, one camera can be used to calibrate more than two images. In this case, the calibration images need to be associated with the camera number, shooting position, and shooting angle. This requires high camera control accuracy, for example, precise control and adjustment of the camera's shooting angle.
[0046] As an optional embodiment, the calibration sample is provided with multiple QR codes, evenly distributed across the sample. The entire area containing the calibration sample can be divided into several regions, and each region can be calibrated individually. Alternatively, any desired calibration region can be selected to obtain a calibration image for that region. When selecting a calibration region, ensure that it contains at least two QR codes.
[0047] As an optional embodiment, a method for rapidly stitching multiple images includes the following steps:
[0048] S101, setting a calibration sample with a QR code, where the QR code contains its location information;
[0049] S102: photographing a calibration sample with a camera to obtain calibration images of multiple calibration positions set on the calibration sample, where each calibration image contains at least two QR codes;
[0050] S103, using the QR codes in the multiple calibration images to calibrate the shooting position and shooting trajectory of the camera corresponding to each calibration image;
[0051] S104, placing the target object at the location of the calibration sample, and using a camera to photograph multiple target areas of the target object to obtain target images of the multiple target areas; the positions and number of the target areas are the same as the calibration positions and number in step S102;
[0052] S105 , using the shooting position and shooting trajectory of the camera shooting the target image, determining the position information of the multiple target images in the plane coordinate system where the calibration sample is located, and realizing image stitching of the target images in the coordinate system.
[0053] Usually, in the multi-image rapid stitching method, image calibration can be performed on specific parts as needed, and then the target object can be photographed multiple times and repeatedly, and subsequent image stitching and image calculation can be performed; the amount of data for image stitching and image calculation is small, the image matching is accurate, and the efficiency is greatly improved. There is no need to be restricted by the need for a common area for each image, and the stitching effect is stable.
[0054] As an optional embodiment, the multi-image rapid stitching method further includes the steps of:
[0055] S106. Based on the image stitching results, determine the distance between any two set locations in the plane coordinate system of the stitched image. Each image in the stitched image obtained by the rapid image stitching method has exact and unique coordinate information in the plane coordinate system of the calibration sample. Each location or range in the image also has exact and unique coordinate information. This coordinate information reflects the relative position of each other in the plane coordinate system. This coordinate information can be used to directly perform calculations to obtain the required information. For example, the distance between any two locations can be directly calculated using their coordinates.
[0056] As an optional embodiment, the two-dimensional code is a matrix code.
[0057] As an optional embodiment, the calibration samples are checkerboard samples.
[0058] As an optional embodiment, the multi-image rapid stitching method includes the steps of:
[0059] S101. Set a calibration sample with a matrix code, divide the calibration sample into M×N square areas, and set at least two QR codes in each square area; M and N are natural numbers greater than 1;
[0060] S102, using a camera to capture each square area to obtain M×N calibration images;
[0061] S103, using the QR code of each calibration image to calibrate and obtain the shooting position and shooting trajectory of the camera of the calibration image;
[0062] S104, placing the target object at any position within the area where the calibration sample is located, and using a camera to photograph the set position of the target object to obtain a target image at the set position;
[0063] S105. Determine the position information of the target image in the plane coordinate system where the calibration sample is located using the shooting position and shooting trajectory of the camera that shoots the target image. Splice all target images in the coordinate system according to the position information of each target image to obtain the required stitched image.
[0064] Usually, after the calibration of the entire range of the calibration sample is completed, the image at any position within the calibration sample range corresponds to a camera shooting position and shooting angle. Any target object that can be included in the calibration sample range can be set within the calibration sample range, and a target photo can be taken at any position of the target object. The position of all positions in the target photo can be determined using the calibration results; then, the target photos can be arranged and combined in the same plane coordinate system as needed to obtain the actual position of the required target photo and perform image calculation.
[0065] As an optional embodiment, Figure 2 As shown in the figure above, the area A in the calibration sample is selected as the first calibration area. The first calibration area A contains three QR codes. The image of the first calibration area A is obtained and its position in the plane coordinate system where the calibration sample is located is determined as follows: Figure 2 As shown in the figure below.
[0066] As an optional embodiment, Figure 3 As shown, the calibration sample contains nine QR codes, which are evenly distributed on the calibration sample. The position information corresponding to each QR code is decoded to obtain the plane rectangular coordinate information, corresponding to Figure 3 The decoded character string shown includes the plane rectangular coordinate information corresponding to the nine QR codes in sequence.
[0067] As an optional embodiment, Figure 4 As shown in , the camera is used to obtain calibration images of the areas where the two positions D1 and D2 of the calibration sample are located, and the camera shooting position and shooting trajectory are calibrated and associated with the calibration image; then the target object B is placed on the plane where the calibration sample is located, as shown in Figure 4As shown in the left figure, take pictures of the target objects in the area of the two positions D1 and D2 again to obtain target images. Associate the position information of the target images containing positions D1 and D2 respectively to determine the actual positions of the two target images in the rectangular coordinate system of the plane where the calibration sample is located, as shown in the figure below. Figure 4 As shown in the figure on the right; Figure 4 It can be seen that the actual accurate distance between the center points of the two positions D1 and D2 can be determined by the coordinates of the two positions.
[0068] The multi-image rapid stitching method disclosed in the embodiment of the present application first uses a calibration sample with a QR code to calibrate the camera shooting position and shooting trajectory of the calibration image, and then uses the calibrated camera shooting position and shooting trajectory information to determine the position information of multiple target images obtained by the camera. The multiple target images are quickly stitched together in the plane coordinate system where the calibration sample is located using the position information. The calibration image and the target image can be arbitrarily selected according to the image stitching requirements. The image stitching and image calculation data volume is small, the image matching is accurate, and the calculation efficiency is greatly improved. There is no need to be restricted by the common area of the image, the image calibration speed is fast, and the image stitching efficiency is high.
[0069] The technical solutions disclosed in this application and the technical details disclosed in the embodiments are merely illustrative of the inventive concept of this application and do not constitute a limitation on the technical solutions of this application. Any conventional changes, replacements or combinations of the technical details disclosed in this application have the same inventive concept as this application and are within the scope of protection of the claims of this application.
Claims
1. A multi-image fast stitching method, characterized in that: Including steps: S101, setting a calibration sample with a QR code, wherein the QR code includes its location information; the location information included in the QR code is the plane coordinate information of the location of the QR code on the plane where the calibration sample is located; S102, photographing the calibration sample with a camera to obtain at least one calibration image, each calibration image containing at least two QR codes; S103, calibrating the shooting position and shooting trajectory of the camera using the QR code in the calibration image; specifically comprising: determining the position information of the calibration image using the QR code, and correlating the position information contained in the calibration image with the shooting position and shooting trajectory of the camera; S104, placing the target object at the location of the calibration sample, and using the camera to capture a selected area of the target object to obtain a target image of the selected area; each target image obtained including the selected location corresponds to a calibrated camera shooting position and shooting trajectory; S105 , using the shooting position and shooting trajectory of the camera shooting the target image, determine the position information of the target image in the plane coordinate system where the calibration sample is located, and implement image stitching of the target image in the coordinate system based on the position information.
2. The multi-image rapid stitching method according to claim 1, characterized in that: The number of the cameras is the same as the number of calibration images to be acquired.
3. The method for rapid multi-image stitching according to claim 1, wherein: The number of cameras is smaller than the number of calibration images to be acquired.
4. The method for rapid multi-image stitching according to claim 1, wherein: In step S101, a plurality of two-dimensional codes are provided in the calibration sample, and the plurality of two-dimensional codes are evenly distributed on the calibration sample.
5. The method for rapid multi-image stitching according to claim 1, wherein: In step S102, a calibration image of the position is obtained according to the set number and position; In step S104 , the target object is placed at the location of the calibration sample, and the camera is used to obtain the same location and the same number of target images as in step S102 .
6. The method for rapid multi-image stitching according to claim 1, wherein: Also includes the steps: S106 : Based on the image stitching result, determine the distance between any two set positions in the plane coordinate system where the stitched image is located.
7. The method for rapid multi-image stitching according to claim 1, wherein: The two-dimensional code is a matrix code.
8. The method for rapid multi-image stitching according to claim 1, wherein: The calibration samples are checkerboard samples.
9. A method for rapid multi-image stitching, characterized in that: Including steps: S101. Set a calibration sample with a matrix code, divide the calibration sample into M×N square areas, and set at least two QR codes in each square area; the QR codes contain their location information; the location information contained in the QR codes is the plane coordinate information of the location of the QR codes on the plane where the calibration sample is located; S102, using a camera to capture each square area to obtain M×N calibration images; S103, using the QR code of each calibration image to calibrate the camera's shooting position and shooting trajectory of the calibration image; specifically comprising: using the QR code to determine the position information of the calibration image, and correlating the position information contained in the calibration image with the camera's shooting position and shooting trajectory; S104, placing the target object at any position within the area where the calibration sample is located, and using the camera to capture the set position of the target object to obtain a target image at the set position; each target image obtained including the selected position corresponds to a calibrated camera shooting position and shooting trajectory; S105 , using the shooting position and shooting trajectory of the camera shooting the target image, determine the position information of the target image in the plane coordinate system where the calibration sample is located, and implement image stitching of the target image in the coordinate system based on the position information.
Citation Information
Patent Citations
Image acquisition processing device and image acquisition processing method
CN108769530A
Rapid joint calibration method for multiple 3D cameras
CN111426451A