Panorama stitching method and apparatus, electronic device, and storage medium
By selecting lenses and stitching methods on the panoramic stitching page, and using automatic or manual algorithms to generate stitching files, the problems of stitching gaps and inaccurate target display in the actual use of panoramic acquisition equipment are solved, achieving seamless stitching and high-quality panoramic display.
Patent Information
- Application Number
- CN202211647989.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-21
- Publication Date
- 2026-03-03
- Estimated Expiration
- 2042-12-21
AI Technical Summary
Panoramic acquisition equipment suffers from problems such as stitching gaps or inaccurate target display in actual use, which cannot be effectively solved by existing technologies.
By selecting the target lens and stitching method on the panoramic stitching page, the target image is acquired, and the stitching is processed using automatic or manual stitching algorithms to generate a stitched file. The pixel coordinate mapping of the panoramic acquisition device is then updated to optimize the stitching effect.
It enables seamless stitching of any shot within a 360° stitching range in real-world applications, meeting diverse user needs and improving stitching quality and image quality.
Smart Images

Figure CN115835022B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, and more specifically to panoramic stitching methods, apparatus, electronic devices, and storage media. Background Technology
[0002] Panoramic capture devices employ multiple fixed-focus lenses for image acquisition, calibrating the image based on the capture location to achieve a 360° panoramic image stitching output. Specifically, algorithms are used to crop, calibrate, and stretch overlapping images to achieve seamless panoramic video output. However, while the panoramic image is stitched and calibrated before leaving the factory, meaning it's pre-stitched, in actual use, the stitching effect is highly correlated with the actual scene. This can lead to gaps or misaligned targets in the stitched image output after installation. Summary of the Invention
[0003] In view of this, embodiments of the present invention provide a panoramic stitching method, apparatus, electronic device, and storage medium to solve the problem of poor panoramic stitching effect.
[0004] According to a first aspect, embodiments of the present invention provide a panoramic stitching method, including:
[0005] In response to a lens selection operation on the panoramic stitching page, at least two target lenses in the panoramic acquisition device are identified.
[0006] In response to the selection of a splicing method, a target splicing method is determined, which includes automatic splicing or manual splicing;
[0007] Acquire the target image corresponding to the target lens;
[0008] The target image is stitched together based on the target stitching method to determine the stitching file. The stitching file is used to represent the coordinate information of each pixel in the stitched image obtained after the images captured by the target lens are stitched together.
[0009] The stitched file is sent to the panoramic acquisition device so that the panoramic acquisition device can output the target stitched image based on the stitched file.
[0010] The panoramic stitching method provided in this invention selects target lenses according to the actual usage scenario, thereby enabling stitching settings for any lens within the stitching range of (0, 360°) in the actual usage scenario. At the same time, during the stitching process, corresponding stitching processing is performed for different target stitching methods, which can ensure that the stitched target image can meet the different needs of users and improve the stitching effect.
[0011] In some implementations, when the target stitching method is automatic stitching, the target image is a stitched image of the images captured by each of the target lenses. The step of stitching the target image based on the target stitching method to determine the stitched file includes:
[0012] Based on the target image, determine the target of interest in the target image to obtain the location information of the target of interest in the target image;
[0013] The location information is used to determine the target distance between the target of interest and the panoramic acquisition device;
[0014] Based on the target distance, the first stitching algorithm interface and the first calibration file in the panoramic acquisition device are invoked for stitching processing to obtain the stitched file.
[0015] The panoramic stitching method provided in this embodiment of the invention, for automatic stitching, mainly focuses on the target of interest in the target image. Based on this, the target distance between the target of interest and the panoramic acquisition device is determined, and the stitching file is determined using the target distance to ensure the stitching effect of the region of interest in the target image.
[0016] In some implementations, determining the target distance between the target of interest and the panoramic acquisition device using the location information includes:
[0017] The location information is used to determine the proportion of the target of interest in the target image.
[0018] Based on the correspondence between the percentage and the distance, the target distance corresponding to the target percentage is determined.
[0019] The panoramic stitching method provided in this invention uses the proportion of the target in the region of interest in the target image to calculate the target distance, ensuring that the target distance is related to the actual scene and improving the accuracy of the determined target distance.
[0020] In some implementations, when the target stitching method is manual stitching, the target image is the image captured by each of the target lenses. The step of stitching the target image based on the target stitching method to determine the stitched file includes:
[0021] Analyze any two adjacent target images to determine the similarities between them.
[0022] Based on the similarities, the second stitching algorithm interface and the second calibration file in the panoramic acquisition device are invoked for stitching processing to obtain the stitched file.
[0023] The panoramic stitching method provided in this embodiment of the invention focuses on all targets in the target image during manual stitching, aiming for a seamless scene where all target images are seamless. Based on this, the similarity analysis of any two adjacent target images can ensure that the obtained stitched file can achieve seamless stitching of all targets in the current application scenario.
[0024] In some implementations, analyzing any two adjacent target images to determine similarities between them includes:
[0025] Image enhancement processing is performed on each of the target images to obtain the target enhanced image;
[0026] In response to a selection operation of a contrast region in any two adjacent target enhancement images, a contrast region in any two adjacent target enhancement images is determined.
[0027] The two comparison regions are compared to determine the similarity points between any two adjacent target images.
[0028] The panoramic stitching method provided in this invention first performs image enhancement processing on the target image and then performs comparison processing on the images in the comparison area. On the one hand, it can improve the accuracy of similarity comparison, and on the other hand, it can reduce the amount of comparison data and improve stitching efficiency.
[0029] In some implementations, sending the stitched file to the panoramic acquisition device, so that the panoramic acquisition device outputs the target stitched image based on the stitched file, includes:
[0030] The stitched file is sent to the panoramic acquisition device, so that the panoramic acquisition device uses the stitched file to update the coordinate mapping of the pixels in the stitched image, and stitches the images captured by all lenses based on the updated pixel coordinate mapping to output the target stitched image.
[0031] The panoramic stitching method provided in this embodiment of the invention sends the stitched file to the panoramic acquisition device after obtaining the stitched file, so that the panoramic acquisition device can update the coordinate mapping of the pixels in the stitched image using the stitched file, thereby enabling image stitching using the updated coordinate mapping and achieving a better stitching effect.
[0032] In some implementations, sending the stitched file to the panoramic acquisition device, so that the panoramic acquisition device outputs the target stitched image based on the stitched file, includes:
[0033] The stitched file is sent to the panoramic acquisition device so that the panoramic acquisition device outputs the current stitched image based on the stitched file;
[0034] The current stitched image is displayed on the panoramic stitching page;
[0035] In response to the adjustment operation of the attitude angle of the panoramic acquisition device, the target attitude angle is determined;
[0036] The target attitude angle is sent to the panoramic acquisition device so that the panoramic acquisition device can output a target stitched image based on the target attitude angle.
[0037] The panoramic stitching method provided in this embodiment of the invention addresses situations where the image is not aligned or there are stitching gaps. By adjusting the posture using the posture angle adjustment function, the stitching gap phenomenon can be optimized.
[0038] According to a second aspect, embodiments of the present invention also provide a panoramic stitching device, comprising:
[0039] The first response module is used to respond to the selection operation of the lens in the panoramic stitching page to determine at least two target lenses in the panoramic acquisition device;
[0040] The second response module is used to respond to the selection operation of the splicing method and determine the target splicing method, which includes automatic splicing or manual splicing.
[0041] The acquisition module is used to acquire the target image corresponding to the target lens;
[0042] The stitching module is used to stitch the target image based on the target stitching method and determine the stitching file. The stitching file is used to represent the coordinate information of each pixel in the stitched image obtained after the images captured by the target lens are stitched together.
[0043] The sending module is used to send the stitched file to the panoramic acquisition device, so that the panoramic acquisition device can output the target stitched image based on the stitched file.
[0044] According to a third aspect, embodiments of the present invention provide an electronic device, including: a memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the computer instructions to perform the panoramic stitching method described in the first aspect or any embodiment of the first aspect.
[0045] According to a fourth aspect, embodiments of the present invention provide a computer-readable storage medium storing computer instructions for causing the computer to perform the panoramic stitching method described in the first aspect or any embodiment of the first aspect.
[0046] It should be noted that the corresponding beneficial effects of the panoramic stitching device, electronic device and computer-readable storage medium provided in the embodiments of the present invention can be found in the description of the corresponding beneficial effects of the panoramic stitching method above, and will not be repeated here. Attached Figure Description
[0047] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0048] Figure 1 This is a flowchart of a panoramic stitching method according to an embodiment of the present invention;
[0049] Figure 2 This is a flowchart of a panoramic stitching method according to an embodiment of the present invention;
[0050] Figure 3 This is a flowchart of a panoramic stitching method according to an embodiment of the present invention;
[0051] Figure 4 This is a structural block diagram of a panoramic stitching device according to an embodiment of the present invention;
[0052] Figure 5 This is a schematic diagram of the hardware structure of the electronic device provided in an embodiment of the present invention. Detailed Implementation
[0053] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0054] The panoramic stitching method provided in this invention is applied to electronic devices. Specifically, the electronic device is equipped with a web plugin. This web plugin acquires target images from the target lens of a panoramic acquisition device, performs stitching processing to obtain a stitched file, and then sends the stitched file to the panoramic acquisition device. The panoramic acquisition device then uses this stitched file to stitch together the images acquired by each lens, achieving a better stitching effect. In other words, the web plugin optimizes the stitching of images acquired by the panoramic acquisition device, making the stitched image adaptable to more scenes and improving the display effect of each scene.
[0055] It should be noted that the panoramic stitching method provided in this embodiment of the invention is not a panoramic stitching calibration before the panoramic acquisition device leaves the factory, but a panoramic stitching optimization performed in actual use scenarios after the panoramic acquisition device is installed.
[0056] Before leaving the factory, panoramic acquisition equipment undergoes panoramic stitching calibration, generating a calibration file, such as a .cal file. This file records lens geometric parameter calibration data. During panoramic imaging, the equipment uses this calibration file to call a built-in stitching algorithm to generate a stitched file, such as a .bin file. This stitched file contains the stitched data output by the algorithm. This stitched file resides in the target directory of the panoramic acquisition equipment and is used to achieve panoramic stitching imaging.
[0057] According to an embodiment of the present invention, a panoramic stitching method embodiment is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0058] This embodiment provides a panoramic stitching method that can be used in electronic devices, such as computers and mobile terminals. Figure 1 This is a flowchart of a panoramic stitching method according to an embodiment of the present invention, such as... Figure 1 As shown, the process includes the following steps:
[0059] S11, in response to a lens selection operation on the panoramic stitching page, identifies at least two target lenses in the panoramic acquisition device.
[0060] A panoramic stitching page is a collective term for a series of pages used by panoramic acquisition devices for stitching optimization, and is not limited to a single page. For panoramic acquisition devices, this involves multiple lenses. The device stitches together the images captured by all lenses to form a 360° panoramic view. The number of lenses in the panoramic acquisition device is set according to actual needs and is not limited here.
[0061] For a panoramic acquisition device, there is at least one image transmission channel, and each image transmission channel is used to transmit images captured by at least one lens. For example, a panoramic acquisition device includes 12 lenses, which are evenly distributed in 3 transmission channels, namely, transmission channel 1 corresponds to lenses 1-4; transmission channel 2 corresponds to lenses 5-8; and transmission channel 3 corresponds to lenses 9-12.
[0062] Before stitching and optimizing the panoramic acquisition equipment, the stitched image can be displayed on the panoramic stitching page. By analyzing the stitched image, the shots that need stitching optimization can be identified. The analysis of the stitched image can be done by the user observing it to determine the shots that need optimization, or by the user selecting shots according to their needs.
[0063] After the user interacts with the panoramic stitching page and makes selections, the target shots are determined. For example, the panoramic stitching page displays input controls for the starting and ending shots. The user enters numbers into these controls to determine the target shots. For instance, if the starting shot is 2 and the ending shot is 6, then the target shots are shots 2, 3, 4, 5, and 6. Alternatively, the panoramic stitching page displays a target shot input control. The user enters numbers into these controls to determine the target shots; for example, entering shots 2, 3, and 4 will result in target shots 2, 3, and 4. In other implementations, other target shot confirmation methods can be used, as long as the target shots can be confirmed.
[0064] It should be noted that since panoramic stitching is obtained by stitching together adjacent images, the selected target shots must be adjacent shots.
[0065] In some implementations, as described above, each image transmission channel is used to transmit images captured by at least one lens; therefore, each image transmission channel has a unique channel number. Selecting a channel number is equivalent to selecting all lenses corresponding to that channel number.
[0066] Therefore, determining the target lens can involve selecting the lens itself, choosing the channel number, and so on. The specific settings depend on the actual needs, and no limitations are imposed here.
[0067] S12, in response to the selection operation of the splicing method, determines the target splicing method.
[0068] The target splicing method includes automatic splicing or manual splicing.
[0069] This panoramic stitching method offers both automatic and manual stitching options. Automatic stitching optimizes the stitching of key targets within the image. For example, if the image contains buildings, elevated roads, and mountains, and the initial stitching shows seams in the elevated roads but not in the mountains and buildings, then only the traffic flow on the elevated roads might need to be considered, and other elements could be prioritized. Therefore, automatic stitching can be used. Because automatic stitching focuses on specific targets within the image, it requires obtaining the parameters of those specific targets during the stitching process to optimize the stitching accordingly.
[0070] Manual stitching optimizes the stitching of the entire target image, meaning it's used in scenes where the stitched image is completely seamless. For example, if an image contains buildings, highways, and mountains, and the initial stitching shows seams in the highways but not in the mountains and buildings, then manual stitching is used if you need to focus on all the targets in the stitched image. Because manual stitching focuses on the targets in the entire image, it optimizes the stitching for the entire scene.
[0071] S13, acquire the target image corresponding to the target lens.
[0072] After acquiring the target lens, the corresponding target image can be obtained from the panoramic acquisition device. The format of the target image is related to the target stitching method selected in S12 above. If the target stitching method is automatic stitching, the target image is the stitched image; if the target stitching method is manual stitching, the target image is the image captured by each target lens.
[0073] S14, perform stitching processing on the target image based on the target stitching method, and determine the stitching file.
[0074] The stitching file is used to represent the coordinate information of each pixel in the stitched image obtained after the images captured by the target lens are stitched together.
[0075] Because panoramic acquisition devices have stitching capabilities and provide corresponding stitching algorithms, after determining the target stitching method, the electronic device sends the necessary stitching parameters corresponding to the target stitching method to the panoramic acquisition device through a communication connection. The electronic device then uses its stitching algorithm to perform the stitching process, resulting in a stitched file.
[0076] The stitching process described above is equivalent to mapping the pixels in the original image to the stitched image during the stitching process. The purpose of the stitching process in this embodiment is to adjust the coordinate mapping of the pixels to avoid stitching seams in the final stitched file.
[0077] S15, send the stitching file to the panoramic acquisition device so that the panoramic acquisition device can output the target stitched image based on the stitching file.
[0078] After obtaining the stitched file, the stitched file is sent to the file directory of the panoramic acquisition device, which then triggers the panoramic acquisition device to stitch together the images captured by each lens based on the stitched file and output the target stitched image.
[0079] It should be noted that the panoramic acquisition device comes with an initial stitching file at the factory. Based on the initial stitching file, the coordinate mapping of the pixels is updated using the stitching file obtained in S14 above, in order to obtain a coordinate mapping that meets the requirements.
[0080] The panoramic stitching method provided in this embodiment selects target lenses according to the actual usage scenario, thereby enabling the stitching of any lens within the stitching range of (0, 360°) in the actual usage scenario. At the same time, during the stitching process, corresponding stitching processing is performed for different target stitching methods, which can ensure that the stitched target image can meet the different needs of users and improve the stitching effect.
[0081] This embodiment provides a panoramic stitching method that can be used in electronic devices, such as computers and mobile terminals. Figure 2 This is a flowchart of a panoramic stitching method according to an embodiment of the present invention, such as... Figure 2 As shown, the process includes the following steps:
[0082] S21, in response to a lens selection operation on the panoramic stitching page, to determine at least two target lenses in the panoramic acquisition device.
[0083] Please see details Figure 1 S11 of the illustrated embodiment will not be described again here.
[0084] S22, in response to the selection operation of the splicing method, determines the target splicing method.
[0085] The target splicing method includes automatic splicing or manual splicing.
[0086] Please see details Figure 1 S12 of the illustrated embodiment will not be described again here.
[0087] S23, acquire the target image corresponding to the target lens.
[0088] When the target stitching method is automatic stitching, the target image is the stitched image of the images captured by each target lens.
[0089] When the target stitching method is manual stitching, the target image is the image captured by each target lens.
[0090] S24, perform stitching processing on the target image based on the target stitching method, and determine the stitching file.
[0091] The stitching file is used to represent the coordinate information of each pixel in the stitched image obtained after the images captured by the target lens are stitched together.
[0092] In some implementations, when the target stitching method is automatic stitching, the above-mentioned S24 includes:
[0093] S241, Based on the target image, determine the target of interest in the target image to obtain the location information of the target of interest in the target image.
[0094] As mentioned above, automatic stitching is performed on a specific target within the target image. Therefore, in order to perform stitching on a specific target, it is necessary to first identify that target. In the following description, this specific target will be referred to as the target of interest.
[0095] The identification of targets of interest can be achieved by identifying seams in the target image and defining targets at these seams; or by allowing users to select targets within the target image through interactive selection. For example, users can select targets by using methods such as drawing a box. Of course, other methods can also be used to identify targets of interest, and no limitations are imposed here; the specific methods should be set according to actual needs.
[0096] Once the target of interest is identified, its positional information within the target's frame can be obtained. This positional information can be represented by the target's coordinates and size within the target's frame, or by the coordinates of the target's minimum bounding box, and so on.
[0097] S242, using location information to determine the target distance between the target of interest and the panoramic acquisition device.
[0098] After determining the location information of the target of interest, the target distance between the target of interest and the panoramic acquisition device can be determined by the user through visual inspection or other means; it can also be calculated proportionally based on the distance on the geographic map by associating the target image with the geographic map; or it can be determined by other means, etc.
[0099] In some embodiments, S242 includes:
[0100] (1) Use location information to determine the proportion of the target of interest in the target image.
[0101] (2) Based on the correspondence between the proportion and the distance, determine the target distance corresponding to the target proportion.
[0102] After determining the location information of the target of interest, the size of the area occupied by the target in the target image is obtained. By calculating the ratio of the area occupied by the target to the total area of the target image, the percentage of the target of interest in the target image can be obtained.
[0103] The electronic device stores the correspondence between the proportion and distance in the stitched image of the panoramic acquisition device. For example, after the panoramic acquisition device is installed, images of landmarks are captured at intervals, and the proportion of the landmark in the image and the distance between the landmark and the panoramic acquisition device are recorded. By repeatedly recording the proportion-distance data, curve fitting is performed to obtain the proportion-distance relationship expression. After obtaining the target proportion, the target distance corresponding to the target proportion can be calculated using this relationship expression.
[0104] By using the proportion of the target in the region of interest within the target image to calculate the target distance, the target distance is ensured to be relevant to the actual scene, thus improving the accuracy of the determined target distance.
[0105] S243, based on the target distance, calls the first stitching algorithm interface and the first calibration file in the panoramic acquisition device to perform stitching processing to obtain the stitched file.
[0106] After determining the target distance, clicking the stitching optimization control on the panoramic stitching page invokes the first stitching algorithm interface and the first calibration file from the panoramic acquisition device, generating a stitched file which is then fed back to the electronic device. This stitched file is the stitched data output by the stitching algorithm. Accordingly, the electronic device obtains the stitched file.
[0107] In some implementations, when the target stitching method is manual stitching, the above-mentioned S24 includes:
[0108] (1) Analyze any two adjacent target images to determine the similarities between them.
[0109] (2) Based on similarity points, the second stitching algorithm interface and the second calibration file in the panoramic acquisition device are called to perform stitching processing to obtain the stitched file.
[0110] When stitching manually, the acquired target images correspond one-to-one with the target shots. For example, if six target shots are selected, six target images will be acquired. As mentioned above, panoramic stitching is performed on adjacent shots, that is, on adjacent target images.
[0111] When manually stitching images together, it is necessary to identify similarities between adjacent target images for global calibration. Based on this, a similarity analysis is performed on any two adjacent target images to determine their similarities.
[0112] After identifying similar points, the electronic device calls the second stitching algorithm interface and the second calibration file in the panoramic acquisition device to perform stitching processing and generate a stitched file.
[0113] In some implementations, pto files are used to represent similar points. During stitching optimization, the pto files are imported into the second stitching algorithm of the panoramic acquisition device, the second stitching algorithm is called to generate a stitched file, and the stitched file is fed back to the electronic device.
[0114] When manually stitching, the main focus is on all targets in the target image, aiming for a seamless scene where all target images are seamless. Based on this, analyzing the similarities between any two adjacent target images ensures that the resulting stitched file can achieve seamless stitching of all targets in the current application scenario.
[0115] In some implementations, step (1) of S24 above includes:
[0116] 1.1) Perform image enhancement processing on each target image to obtain the target enhanced image.
[0117] 1.2) In response to the selection operation of the contrast region in any two adjacent target enhancement images, determine the contrast region in any two adjacent target enhancement images.
[0118] 1.3) Compare the two comparison areas to determine the similarities between any two adjacent target images.
[0119] Before determining similarity points, an image enhancement model is used to enhance the images of each target image. After obtaining the enhanced target images, similarity points are then determined. This image enhancement model improves the brightness and clarity of the target images, etc. No specific structural details regarding the image enhancement model are specified here; it can be configured according to actual needs.
[0120] First, image enhancement processing is performed on the target image, and then the images in the comparison area are compared. This can improve the accuracy of similarity comparison on the one hand, and reduce the amount of data to be compared on the other hand, thus improving the stitching efficiency.
[0121] S25, send the stitching file to the panoramic acquisition device so that the panoramic acquisition device can output the target stitched image based on the stitching file.
[0122] The stitched file is sent to the panoramic acquisition device, which then uses the stitched file to update the coordinate mapping of pixels in the stitched image. Based on the updated pixel coordinate mapping, the device stitches together the images captured by all lenses and outputs the target stitched image.
[0123] After the stitched file is sent to the panoramic acquisition device, the device calls its provided stitching algorithm interface, which in turn calls the media control interface. The media control then calls the memory mapping table interface to make the new stitched file effective and output the target stitched image in real time. The memory mapping table, based on the stitched file, represents the coordinate mapping of pixels in the stitched image.
[0124] It should be noted that both automatic and manual stitching methods can produce a stitched file. For panoramic acquisition devices, a marker file can be created to determine if a manually stitched file exists. When performing panoramic imaging, the device can first identify the presence of this marker file. If it exists, the manually stitched file is used for panoramic imaging; otherwise, the automatically stitched file is used. Of course, panoramic acquisition devices can also select the appropriate stitched file for panoramic imaging based on user needs.
[0125] The panoramic stitching method provided in this embodiment, for automatic stitching, mainly focuses on the target of interest (ROI) in the target image. Based on this, the target distance between the ROI and the panoramic acquisition device is determined, and the stitching file is determined using the target distance to ensure the stitching effect of the ROI in the target image. Furthermore, after obtaining the stitching file, it is sent to the panoramic acquisition device, allowing the device to update the coordinate mapping of pixels in the stitched image using the stitching file. This updated coordinate mapping enables image stitching, achieving a better stitching effect.
[0126] This embodiment provides a panoramic stitching method that can be used in electronic devices, such as computers and mobile terminals. Figure 3 This is a flowchart of a panoramic stitching method according to an embodiment of the present invention, such as... Figure 3 As shown, the process includes the following steps:
[0127] S31, in response to a lens selection operation on the panoramic stitching page, identifies at least two target lenses in the panoramic acquisition device.
[0128] Please see details Figure 1 S11 of the illustrated embodiment will not be described again here.
[0129] S32, in response to the selection operation of the splicing method, determines the target splicing method.
[0130] The target splicing method includes automatic splicing or manual splicing.
[0131] Please see details Figure 1 S12 of the illustrated embodiment will not be described again here.
[0132] S33, acquire the target image corresponding to the target lens.
[0133] Please see details Figure 2 S23 of the illustrated embodiment will not be described again here.
[0134] S34, perform stitching processing on the target image based on the target stitching method, and determine the stitching file.
[0135] The stitching file is used to represent the coordinate information of each pixel in the stitched image obtained after the images captured by the target lens are stitched together.
[0136] Please see details Figure 2 S24 of the illustrated embodiment will not be described again here.
[0137] S35 sends the stitching file to the panoramic acquisition device so that the panoramic acquisition device can output the target stitched image based on the stitching file.
[0138] Specifically, S35 includes:
[0139] S351 sends the stitched file to the panoramic acquisition device so that the panoramic acquisition device can output the current stitched image based on the stitched file.
[0140] Please see details Figure 2 S25 of the illustrated embodiment will not be described again here.
[0141] S352 displays the current stitched image on the panoramic stitching page.
[0142] S353, in response to the adjustment operation of the attitude angle of the panoramic acquisition device, determines the target attitude angle.
[0143] After the above stitching process, the optimized image can be displayed on the panoramic stitching page. If there are still issues such as misalignment or stitching gaps, the attitude angle of the panoramic acquisition device can be adjusted to optimize these problems.
[0144] After adjusting the attitude angle of the panoramic acquisition device and confirming that there are no stitching gaps based on the content displayed on the page, the attitude angle at this time is determined as the target attitude angle.
[0145] S354 sends the target attitude angle to the panoramic acquisition device so that the panoramic acquisition device can output the target stitched image based on the target attitude angle.
[0146] After determining the target attitude angle, the target attitude angle is sent to the panoramic acquisition device so that the panoramic acquisition device can perform panoramic stitching imaging based on the target attitude angle and output the target stitched image.
[0147] The panoramic stitching method provided in this embodiment addresses situations where the image is not aligned or there are gaps in the stitching. By adjusting the posture using the posture angle adjustment function, the stitching gaps can be optimized.
[0148] This embodiment also provides a panoramic stitching device for implementing the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that performs a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0149] This embodiment provides a panoramic stitching device, such as... Figure 4 As shown, it includes:
[0150] The first response module 41 is used to respond to the selection operation of the lens in the panoramic stitching page to determine at least two target lenses in the panoramic acquisition device.
[0151] The second response module 42 is used to determine the target splicing method in response to the selection operation of the splicing method, wherein the target splicing method includes automatic splicing or manual splicing;
[0152] Acquisition module 43 is used to acquire the target image corresponding to the target lens;
[0153] The stitching module 44 is used to stitch the target image based on the target stitching method and determine the stitching file. The stitching file is used to represent the coordinate information of each pixel in the stitched image obtained after the images captured by the target lens are stitched together.
[0154] The sending module 45 is used to send the stitched file to the panoramic acquisition device, so that the panoramic acquisition device outputs the target stitched image based on the stitched file.
[0155] In some embodiments, when the target stitching method is automatic stitching, the target image is the image stitched together from the images captured by each of the target lenses, and the stitching module 44 includes:
[0156] The first determining unit is configured to determine a target of interest in the target image based on the target image, so as to obtain the location information of the target of interest in the target image.
[0157] The second determining unit is used to determine the target distance between the target of interest and the panoramic acquisition device using the location information;
[0158] The first calling unit is used to call the first stitching algorithm interface and the first calibration file in the panoramic acquisition device to perform stitching processing based on the target distance, so as to obtain the stitched file.
[0159] In some implementations, the second determining unit includes:
[0160] The first determining subunit is used to determine the target proportion of the target of interest in the target image using the location information;
[0161] The second determining subunit is used to determine the target distance corresponding to the target percentage based on the correspondence between percentage and distance.
[0162] In some implementations, when the target stitching method is manual stitching, the target image is the image captured by each of the target lenses, and the stitching module 44 includes:
[0163] The analysis unit is used to analyze any two adjacent target images and determine the similarities between any two adjacent target images.
[0164] The second calling unit is used to call the second stitching algorithm interface and the second calibration file in the panoramic acquisition device based on the similarity points to perform stitching processing, so as to obtain the stitched file.
[0165] In some implementations, the analysis unit includes:
[0166] An image enhancement subunit is used to perform image enhancement processing on each of the target images to obtain an enhanced target image.
[0167] A response subunit is configured to determine the contrast region between any two adjacent target enhancement images in response to a selection operation of a contrast region between any two adjacent target enhancement images.
[0168] The third determining subunit is used to perform comparison processing on the two comparison regions to determine the similarity points in any two adjacent target images.
[0169] In some implementations, the sending module 45 includes:
[0170] The first sending unit is used to send the stitching file to the panoramic acquisition device, so that the panoramic acquisition device uses the stitching file to update the coordinate mapping of the pixels in the stitched image and stitches the images captured by all lenses based on the updated coordinate mapping of the pixels to output the target stitched image.
[0171] In some implementations, the sending module 45 includes:
[0172] The second sending unit is used to send the stitched file to the panoramic acquisition device, so that the panoramic acquisition device outputs the current stitched image based on the stitched file;
[0173] A display unit is used to display the current stitched image on the panoramic stitching page;
[0174] A response unit is used to determine the target attitude angle in response to an adjustment operation of the attitude angle of the panoramic acquisition device;
[0175] The third sending unit is used to send the target attitude angle to the panoramic acquisition device, so that the panoramic acquisition device outputs a target stitched image based on the target attitude angle.
[0176] In this embodiment, the panoramic stitching device is presented in the form of a functional unit. Here, a unit refers to an ASIC circuit, a processor and memory that execute one or more software or fixed programs, and / or other devices that can provide the above functions.
[0177] Further functional descriptions of the above modules are the same as those in the corresponding embodiments described above, and will not be repeated here.
[0178] This invention also provides an electronic device having the above-described features. Figure 4 The panoramic stitching device shown.
[0179] Please see Figure 5 , Figure 5 This is a schematic diagram of the structure of an electronic device provided in an optional embodiment of the present invention, such as... Figure 5 As shown, the electronic device may include: at least one processor 51, such as a CPU (Central Processing Unit), at least one communication interface 53, memory 54, and at least one communication bus 52. The communication bus 52 is used to enable communication between these components. The communication interface 53 may include a display screen or a keyboard; optionally, the communication interface 53 may also include a standard wired interface or a wireless interface. The memory 54 may be high-speed RAM (Random Access Memory) or non-volatile memory, such as at least one disk storage device. Optionally, the memory 54 may also be at least one storage device located remotely from the aforementioned processor 51. The processor 51 may be combined with... Figure 4The described apparatus has an application program stored in memory 54, and the processor 51 calls the program code stored in memory 54 to perform any of the above method steps.
[0180] The communication bus 52 can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The communication bus 52 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 5 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0181] The memory 54 may include volatile memory, such as random-access memory (RAM); the memory may also include non-volatile memory, such as flash memory, hard disk drive (HDD) or solid-state drive (SSD); the memory 54 may also include a combination of the above types of memory.
[0182] The processor 51 can be a central processing unit (CPU), a network processor (NP), or a combination of CPU and NP.
[0183] The processor 51 may further include a hardware chip. This hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.
[0184] Optionally, the memory 54 is also used to store program instructions. The processor 51 can invoke the program instructions to implement the panoramic stitching method as shown in any embodiment of this application.
[0185] This invention also provides a non-transitory computer storage medium storing computer-executable instructions that can execute the panoramic stitching method in any of the above method embodiments. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), random access memory (RAM), flash memory, hard disk drive (HDD), or solid-state drive (SSD), etc.; the storage medium may also include combinations of the above types of memory.
[0186] Although embodiments of the invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the invention, and such modifications and variations all fall within the scope defined by the appended claims.
Claims
1. A panorama stitching method characterized by, The method comprises the following steps: in response to a selection operation on a lens in a panoramic stitching page, at least two target lenses in a panoramic acquisition device are determined; in response to a selection operation on a stitching mode, a target stitching mode is determined, the target stitching mode comprising automatic stitching or manual stitching; target pictures corresponding to the target lenses are acquired from the panoramic acquisition device; when the target stitching mode is the automatic stitching, the target pictures are pictures after image stitching of images acquired by the target lenses, and the automatic stitching is stitching optimization for a key target in the target pictures; when the target stitching mode is the manual stitching, the target pictures are images acquired by the target lenses, and the manual stitching is stitching optimization for the entire target pictures; based on the target stitching mode, the target pictures are subjected to stitching processing, and a stitching file is determined, the stitching file being used to represent coordinate information of each pixel point in a stitching picture obtained after the images acquired by the target lenses are stitched; the stitching file is sent to the panoramic acquisition device, so that the panoramic acquisition device invokes a stitching algorithm, the new stitching file is validated, and a target stitching picture is output in real time.
2. The method of claim 1, wherein, The method of stitching processing the target pictures based on the target stitching mode to determine the stitching file comprises the following steps: based on the target pictures, a target of interest in the target pictures is determined to obtain position information of the target of interest in the target pictures; a target distance between the target of interest and the panoramic acquisition device is determined by using the position information; based on the target distance, a first stitching algorithm interface and a first calibration file in the panoramic acquisition device are invoked for stitching processing to obtain the stitching file.
3. The method of claim 2, wherein, The method of determining the target distance between the target of interest and the panoramic acquisition device by using the position information comprises the following steps: a target proportion of the target of interest in the target pictures is determined by using the position information; based on a corresponding relationship between a proportion and a distance, a target distance corresponding to the target proportion is determined.
4. The method of claim 1, wherein, The method of stitching processing the target pictures based on the target stitching mode to determine the stitching file comprises the following steps: any two adjacent target pictures are analyzed to determine a similar point in any two adjacent target pictures; based on the similar point, a second stitching algorithm interface and a second calibration file in the panoramic acquisition device are invoked for stitching processing to obtain the stitching file.
5. The method of claim 4, wherein, The method of analyzing any two adjacent target pictures to determine a similar point in any two adjacent target pictures comprises the following steps: each target picture is subjected to image enhancement processing to obtain a target enhanced picture; in response to a selection operation on a contrast region in any two adjacent target enhanced pictures, a contrast region in any two adjacent target enhanced pictures is determined; the two contrast regions are compared to determine a similar point in any two adjacent target pictures.
6. The method of claim 1, wherein, The method of sending the stitching file to the panoramic acquisition device to enable the panoramic acquisition device to output a target stitching picture based on the stitching file comprises the following steps: The stitching file is sent to the panoramic acquisition device, so that the panoramic acquisition device updates the coordinate mapping of the pixel points in the stitching picture by using the stitching file and outputs the target stitching picture after stitching the images acquired by all the lenses based on the updated coordinate mapping of the pixel points.
7. The method according to any one of claims 1 to 6, characterized in that, The sending of the stitching file to the panoramic acquisition device to make the panoramic acquisition device output a target stitching picture based on the stitching file comprises: The stitching file is sent to the panoramic acquisition device, so that the panoramic acquisition device outputs a current stitching picture based on the stitching file. The current stitching picture is displayed on the panoramic stitching page. In response to an adjustment operation on the attitude angle of the panoramic acquisition device, a target attitude angle is determined. The target attitude angle is sent to the panoramic acquisition device, so that the panoramic acquisition device outputs a target stitching picture based on the target attitude angle.
8. A panorama stitching apparatus characterized by comprising: Comprise: The first response module is configured to determine at least two target lenses in the panoramic acquisition device in response to a selection operation on a lens in the panoramic stitching page. The second response module is configured to determine a target stitching mode in response to a selection operation on a stitching mode, wherein the target stitching mode comprises automatic stitching or manual stitching. The acquisition module is configured to acquire a target picture corresponding to the target lenses from the panoramic acquisition device. The stitching module is configured to perform stitching processing on the target picture based on the target stitching mode to determine a stitching file, wherein the stitching file is used to represent coordinate information of each pixel point in a stitching picture obtained by stitching the images acquired by the target lenses. The sending module is configured to send the stitching file to the panoramic acquisition device, so that the panoramic acquisition device calls a stitching algorithm, validates a new stitching file, and outputs a target stitching picture in real time.
9. An electronic device, comprising: Comprise: A memory and a processor are communicatively connected, and the memory stores computer instructions. The processor executes the computer instructions to perform the panoramic stitching method in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer readable storage medium stores computer instructions for causing a computer to perform the panoramic stitching method in any one of claims 1-7.
Citation Information
Patent Citations
Method for correcting misplaced partial image splicing
CN107945113A
Image splicing method and device, electronic equipment and storage medium
CN113114975A