Image production method, device, electronic equipment and computer readable storage medium

By cropping and merging the left and right images captured by the binocular module, the problem of discontinuous stitching in existing technologies is solved, resulting in a wider field of view and more continuous effect for panoramic images, thus improving the user experience.

CN117197017BActive Publication Date: 2026-07-31HANGZHOU JIEFENG TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HANGZHOU JIEFENG TECH CO LTD
Filing Date
2023-09-26
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

In existing technologies, when performing binocular stitching based on two images to be stitched vertically, a complete picture cannot be presented and the stitching effect is discontinuous, which affects the user experience.

Method used

By acquiring the left and right images captured by the binocular module, the parts outside the overlapping area in the horizontal direction are cropped and merged in the horizontal direction. The vertical gradient filling color value method is used to make the fusion area of ​​the panoramic image gradually blend from left to right, improving the user experience.

Benefits of technology

This achieves a wider field of view in panoramic images and a more continuous fusion effect, enhancing the user's viewing experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117197017B_ABST
    Figure CN117197017B_ABST
Patent Text Reader

Abstract

This application provides an image creation method, apparatus, electronic device, and computer-readable storage medium. The method includes: acquiring a left image and a right image captured by a binocular module; if there is a horizontally overlapping region between the left image and the right image, cropping the overlapping region of the left image (excluding a first fusion region) and cropping the overlapping region of the right image (excluding a second fusion region), obtaining cropped left and right images; and using a vertical gradient fill color value method to fuse the first fusion region in the cropped left image and the second fusion region in the cropped right image to obtain a panoramic image. This method, by using a vertical gradient fill color value method to fuse the first fusion region of the left image and the second fusion region of the right image, results in a panoramic image that presents a wider field of view while also making the fused portion of the panoramic image appear more continuous.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of image processing, and specifically relates to an image production method, apparatus, electronic device, and computer-readable storage medium. Background Technology

[0002] Currently, binocular stitching fusion technology allows two cameras or sensors to simultaneously capture images from different perspectives and fuse them into a single image with a wider and more comprehensive view, thus providing a broader field of view. This plays an important role in applications such as panoramic scene observation, navigation, and detection.

[0003] However, in existing technologies, binocular stitching is usually based on two images to be stitched vertically, but the stitched image cannot present a complete picture, and the effect presented by stitching two images is not continuous, resulting in a poor user experience. Summary of the Invention

[0004] Therefore, the purpose of this application is to provide an image production method, apparatus, electronic device, and computer-readable storage medium to improve the problem in the prior art that binocular stitching and fusion based on two images to be stitched in the vertical direction cannot present a complete picture.

[0005] The embodiments of this application are implemented as follows:

[0006] In a first aspect, embodiments of this application provide an image creation method, including: acquiring a left image and a right image captured by a binocular module;

[0007] If there is a horizontally overlapping area between the left image and the right image, the overlapping area of ​​the left image, excluding the first fusion area, and the overlapping area of ​​the right image, excluding the second fusion area, are cropped to obtain cropped left and right images; wherein the first fusion area and the second fusion area have the same area; the first fusion area in the cropped left image and the second fusion area in the cropped right image are merged to obtain a panoramic image, wherein the image of the fusion area of ​​the panoramic image gradually blends from left to right.

[0008] In this embodiment, the left and right images captured by the binocular module placed in the horizontal direction are stitched together to ensure that the resulting panoramic image presents a wider field of view. Furthermore, by merging the first fusion region of the left image and the second fusion region of the right image, the fusion region of the resulting panoramic image presents a gradual and compatible effect from left to right. The connection between the fusion region and the left and right images is more continuous, and the resulting panoramic image provides a better viewing experience for the user, thereby enhancing the user experience.

[0009] In one possible implementation of the first aspect embodiment, before cropping the overlapping region of the left image excluding the first fusion region and the overlapping region of the right image excluding the second fusion region to obtain the cropped left and right images, the method further includes: determining that the overlapping region satisfies a preset cropping condition; the overlapping region satisfying the preset cropping condition indicates that the field of view width of the panoramic image formed by merging the cropped left and right images is at a suitable width.

[0010] In this embodiment, if there is an overlapping area between the left and right images, and the overlapping area is too large, the panoramic image obtained by merging and stitching the left and right images after cropping will have a narrow field of view, affecting the user's viewing experience. Therefore, by determining that the overlapping area between the left and right images meets the preset cropping conditions, indicating that the overlapping area between the left and right images is within a suitable range, and then cropping the overlapping area of ​​the left image excluding the first fusion area and the overlapping area of ​​the right image excluding the second fusion area, the field of view of the merged panoramic image can be made to be within a suitable width.

[0011] In one possible implementation of the first aspect embodiment, determining whether the overlapping region satisfies a preset cropping condition includes: determining whether the overlapping region satisfies the preset cropping condition based on a first width and a second width; wherein the first width is the width of the region in the overlapping region of the left image excluding the first fusion region, and the second width is the width of the region in the overlapping region of the right image excluding the second fusion region; the overlapping region satisfies the preset cropping condition if the absolute difference between the first width and the second width is not greater than a first preset width, and the sum of the first width and the second width is not greater than a second preset width.

[0012] In this embodiment of the application, during the process of determining that the overlapping area meets the preset cropping conditions, if the absolute difference between the first width and the second width is not greater than the first set width, and the sum of the first width and the second width is not greater than the second set width, then the overlapping area is determined to meet the preset cropping conditions. When the overlapping area meets the preset cropping conditions, the left and right images are then cropped, which can avoid sacrificing too much field of view during the cropping process.

[0013] In one possible implementation of the first aspect embodiment, after determining the width of the region other than the first fusion region in the overlapping region of the left image as the first width and the width of the region other than the second fusion region in the overlapping region of the right image as the second width, the method further includes: adjusting the positions of the two different cameras on the binocular module when the absolute difference between the first width and the second width is greater than the first preset width, or when the sum of the first width and the second width is greater than the second preset width, so that the overlapping regions in the left and right images captured by the two cameras respectively meet the preset cropping conditions.

[0014] In this embodiment of the application, during the process of determining that the overlapping area meets the preset cropping conditions, if the absolute difference between the first width and the second width is greater than the first set width, or the sum of the first width and the second width is greater than the second set width, indicating that the width of the overlapping area between the left image and the right image is too large, then the positions of the two different cameras on the binocular module are adjusted so that the overlapping areas in the left image and the right image captured by the two cameras respectively meet the preset cropping conditions, thereby avoiding sacrificing too much field of view during the cropping process.

[0015] In one possible implementation of the first aspect embodiment, before fusing the first fusion region in the cropped left image and the second fusion region in the cropped right image using the vertical gradient fill color value method to obtain a panoramic image, the method further includes: determining that the field of view in the cropped left image and the cropped right image are aligned in the vertical direction.

[0016] In this embodiment of the application, if it is determined that the field of view in the cropped left image and the cropped right image are aligned in the vertical direction before fusing the left image and the right image, the discontinuity of the field of view in the panoramic image generated after fusing the left image and the right image can be avoided.

[0017] In one possible implementation of the first aspect embodiment, determining that the cropped left image and the cropped right image are aligned in the vertical direction includes: if the cropped left image and the cropped right image are not aligned in the vertical direction, cropping the portion of the cropped left image and the cropped right image that is not aligned in the vertical direction.

[0018] In this embodiment of the application, if it is determined that the cropped left image and the cropped right image are not aligned in the vertical field of view before fusing the left and right images, the misaligned parts of the cropped left and right images are cropped so that the cropped left image and the cropped right image can be aligned in the vertical field of view. This can avoid the situation of discontinuous field of view in the panoramic image generated after fusing the left and right images.

[0019] In one possible implementation of the first aspect embodiment, the first fusion region includes a predetermined number of first pixels, and the second fusion region includes a predetermined number of second pixels. Fusing the first fusion region in the cropped left image with the second fusion region in the cropped right image to obtain a panoramic image includes: fusing the first pixels in the first fusion region of the cropped left image with the corresponding second pixels in the second fusion region of the cropped right image to obtain a panoramic image. The third color value of each pixel in the fusion region of the panoramic image is calculated from the first color value of the corresponding first pixel, the first weight corresponding to the first color value, the second color value of the corresponding second pixel, and the second weight corresponding to the second color value.

[0020] In this embodiment, in order to make the panoramic image appear more continuous, the first pixel in the first fusion region of the left image is mapped one-to-one with the second pixel in the second fusion region of the right image. Using the first color value of the first pixel, the first weight corresponding to the first color value, the second color value of the corresponding second pixel, and the second weight corresponding to the second color value, the third color value of each pixel in the panoramic image is calculated and encoded into the corresponding pixel in the panoramic image. This enables the image in the fusion region of the panoramic image to present a gradual and compatible effect from left to right, resulting in a better viewing experience for the fused panoramic image and thus enhancing the user experience.

[0021] In one possible implementation of the first aspect embodiment, the first fusion region comprises n columns of first pixels, where n is a multiple of 8, and the first weight corresponding to the first color value of each column of first pixels is... The second fusion region contains n columns of second pixels, where n is a multiple of 8, and the second weight corresponding to the second color value of each column of second pixels is... Where alpha represents the transparency of a pixel. The first pixel and the second pixel in the same column have the same alpha value. The first pixel and the second pixel in each column have the same alpha value. 'a' represents the column number.

[0022] In this embodiment, the first pixel in the first fusion region is matched one-to-one with the second pixel in the second fusion region, and the first pixel and the second pixel are fused to obtain the fusion region of the panoramic image. In the fusion region of the panoramic image, from left to right, the closer a pixel is to the left, the greater its first weight and the smaller its second weight. Conversely, the closer a pixel is to the right, the smaller its first weight and the greater its second weight. The closer a pixel in the fusion region of the panoramic image is to the left image, the greater the influence of its color value on the first color value corresponding to the first pixel in the left image, resulting in a more continuous fusion between the left side and the left image. Similarly, the closer a pixel is to the right image, the greater the influence of its color value on the second color value corresponding to the second pixel in the right image, resulting in a more continuous fusion between the right side and the right image. This allows the fusion region of the panoramic image to present a gradual and compatible effect from left to right, resulting in a better-looking panoramic image and improved user experience.

[0023] Secondly, embodiments of this application provide an image processing apparatus, the apparatus comprising: an acquisition module for acquiring a left image and a right image captured by a binocular module; and a processing module for cropping, if there is a horizontally overlapping region in the left image and the right image, cropping the region in the overlapping region of the left image excluding a first fusion region, and cropping the region in the overlapping region of the right image excluding a second fusion region, to obtain cropped left and right images; wherein the first fusion region and the second fusion region have the same area; and merging the first fusion region in the cropped left image with the second fusion region in the cropped right image to obtain a panoramic image, wherein the image of the fusion region of the panoramic image gradually blends from left to right.

[0024] Thirdly, embodiments of this application provide an electronic device, comprising: a binocular camera for acquiring a left image and a right image; a processor, configured to crop the region of the overlapping region of the left image (excluding a first fusion region) and the region of the overlapping region of the right image (excluding a second fusion region) if there is a horizontally overlapping region in the left image and the right image, to obtain cropped left and right images; wherein the first fusion region and the second fusion region have the same area; the first fusion region in the cropped left image and the second fusion region in the cropped right image are fused to obtain a panoramic image, wherein the image of the fusion region of the panoramic image shows a gradual merging from left to right.

[0025] Fourthly, embodiments of this application provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method provided in the first aspect embodiment or any possible implementation in conjunction with the first aspect embodiment.

[0026] It should be understood that the second to fourth aspects of the embodiments of the present invention are consistent with the technical solutions of the first aspect of the embodiments of the present invention, and the beneficial effects achieved by each aspect and the corresponding feasible implementation are similar, and will not be described again.

[0027] Other features and advantages of this application will be set forth in the following description. The objectives and other advantages of this application can be realized and obtained through the structures specifically pointed out in the written description and the accompanying drawings. Attached Figure Description

[0028] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the accompanying drawings used in the embodiments will be briefly described below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. The above and other objects, features, and advantages of this application will become clearer through the accompanying drawings.

[0029] Figure 1 A schematic flowchart of an image creation method provided in an embodiment of this application is shown.

[0030] Figure 2 This paper illustrates a schematic diagram of the image acquisition principle of a binocular module provided in an embodiment of this application.

[0031] Figure 3 This illustration shows a schematic diagram of the overlapping area between a left image and a right image provided in an embodiment of this application.

[0032] Figure 4 This diagram illustrates a principle for determining a first width and a second width according to an embodiment of this application.

[0033] Figure 5 This illustration shows a schematic diagram of a left and right image that are misaligned in the vertical direction, as provided in an embodiment of this application.

[0034] Figure 6 This illustration shows a schematic diagram of a method for obtaining a panoramic image according to an embodiment of this application.

[0035] Figure 7 This diagram illustrates a principle of fusing a first fusion region and a second fusion region according to an embodiment of this application.

[0036] Figure 8A schematic diagram of the structure of an image production apparatus provided in an embodiment of this application is shown.

[0037] Figure 9 A schematic diagram of the structure of an electronic device provided in an embodiment of this application is shown. Detailed Implementation

[0038] The technical solutions of the embodiments of this application will now be described with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. The following embodiments are provided as examples to more clearly illustrate the technical solutions of this application, and should not be used to limit the scope of protection of this application. Those skilled in the art will understand that, without conflict, the following embodiments and features can be combined with each other.

[0039] It should be noted that similar reference numerals and letters in the following figures denote similar items; therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. Furthermore, relational terms such as "first," "second," etc., in the description of this application are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one…" does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0040] The inventors of this application have discovered that existing binocular stitching and fusion technologies typically use two images, one above the other, in a vertical direction to stitch and fuse them. However, the resulting panoramic image cannot present a complete picture, and the effect of stitching two images is not continuous, affecting the user's viewing experience and resulting in a poor user experience.

[0041] In view of this, this application provides an image production method, which uses a vertical gradient filling color value method to merge a first fusion region of the left image and a second fusion region of the right image. The resulting panoramic image can present a wider field of view, and the effect presented by the fused part in the panoramic image is more continuous. The fused panoramic image can provide a better viewing experience for users, thereby improving the user experience.

[0042] The technical solutions provided in the embodiments of this application are described below with reference to the accompanying drawings. Please refer to [the accompanying drawings]. Figure 1 This application provides an image creation method, the process of which is described as follows:

[0043] Step S101: Acquire the left and right images captured by the binocular module.

[0044] In this embodiment, the binocular module includes two cameras located on the same horizontal plane, capable of capturing images from different angles and perspectives. The left and right images have the same resolution, and the two cameras on the binocular module are located in the same horizontal field of view.

[0045] like Figure 2 As shown, Figure 2 This demonstrates the image acquisition principle of a binocular module, in which... Figure 2 The image captured by camera 1 is the left image. Figure 2 The image captured by camera 2 is a right image. The brand and model of the binocular module used in this application are not limited.

[0046] Step S102: If there is a horizontally overlapping area between the left and right images, crop the area in the overlapping area of ​​the left image except for the first fusion area, and crop the area in the overlapping area of ​​the right image except for the second fusion area, to obtain the cropped left and right images.

[0047] The first and second fusion areas have the same area.

[0048] In this embodiment of the application, during the process of stitching and fusing the left and right images acquired by the binocular module into a panoramic image, the left and right images can only be stitched and fused into a panoramic image if there is a horizontally overlapping area between them. If there is no horizontally overlapping area between the left and right images, the panoramic image will inevitably be discontinuous during the fusion process because there will be no repeated field of view in the middle. Figure 1 The diagram shows the image acquisition principle of the binocular module. The horizontal field of view ∠1 and the horizontal field of view ∠2 projected by camera 1 and camera 2 are equal. The images projected by camera 1 and camera 2 have a partial overlapping angle. At this time, the left image captured by camera 1 and the right image captured by camera 2 can be considered to have an overlapping area.

[0049] If it is determined that there is a horizontally overlapping area between the left and right images, cropping the area of ​​the overlapping area of ​​the left image except for the first fusion area, and cropping the area of ​​the overlapping area of ​​the right image except for the second fusion area, leaving only the first and second fusion areas for fusion processing, can greatly reduce the amount of computation in the fusion process.

[0050] In one implementation, before performing step S102, the following method can be used: determining that the overlapping region meets a preset cropping condition; the overlapping region meeting the preset cropping condition indicates that the field of view width of the panoramic image formed by fusing the cropped left and right images is at a suitable width.

[0051] In this implementation method, such as Figure 3 As shown, Figure 3 The diagram illustrates the overlapping area between the left and right images. Before cropping the left and right images, the overlapping area is determined to meet preset cropping conditions, indicating that the overlapping area of ​​the left and right images is within a suitable range. Then, cropping is performed on the overlapping area of ​​the left image excluding the first fusion region and the overlapping area of ​​the right image excluding the second fusion region, ensuring that the field of view width of the merged panoramic image is appropriate. The preset cropping conditions can be: the width of the overlapping area is not greater than a specified width, which can be set according to the actual width of the left and right images; alternatively, the preset cropping condition can be that the overlap of the field of view between the left and right images is higher than a set threshold, indicating a high degree of overlap in the overlapping area. Cropping the overlapping area of ​​the left image excluding the first fusion region and the overlapping area of ​​the right image excluding the second fusion region further enhances the continuity of the merged panoramic image.

[0052] As one possible implementation, determining whether the overlapping region meets the preset cropping conditions can be achieved by: determining whether the overlapping region meets the preset cropping conditions based on a first width and a second width; wherein, the first width is the width of the region in the overlapping region of the left image excluding the first fusion region, and the second width is the width of the region in the overlapping region of the right image excluding the second fusion region; the overlapping region meets the preset cropping conditions when the absolute difference between the first width and the second width is not greater than the first preset width, and the sum of the first width and the second width is not greater than the second preset width.

[0053] In this implementation, such as Figure 4 As shown, Figure 4The diagram illustrates the principle of determining the first width and the second width. The first and second set widths can be widths of a set number of pixels, specified widths, etc. For example, the first set width can be 8 pixels, and the second set width can be 80 pixels.

[0054] As another possible implementation, the method for determining that the overlapping region meets the preset cropping conditions may be as follows: when the width of the region other than the first fusion region in the overlapping region of the left image is determined to be the first width, and the width of the region other than the second fusion region in the overlapping region of the right image is determined to be the second width, if the absolute difference between the first width and the second width is greater than the first preset width, or if the sum of the first width and the second width is greater than the second preset width, the positions of the two different cameras on the binocular module are adjusted so that the overlapping regions in the left and right images captured by the two cameras respectively meet the preset cropping conditions.

[0055] In this embodiment, if the absolute difference between the first width and the second width is greater than the first set width, or the sum of the first width and the second width is greater than the second set width, indicating that the width of the overlapping area between the left image and the right image is too large, then the positions of the two different cameras on the binocular module are adjusted so that the overlapping areas in the left image and the right image captured by the two cameras respectively meet the preset cropping conditions, thereby avoiding sacrificing too much field of view during the cropping process.

[0056] In another implementation, given the cropped left and right images, the following method can be used: aligning the vertical field of view in the cropped left and right images.

[0057] In this implementation, if it is determined that the field of view in the cropped left image and the cropped right image are aligned in the vertical direction before fusing the left image and the right image, the discontinuity of the field of view in the panoramic image generated after fusing the left image and the right image can be avoided.

[0058] As one possible implementation, if the vertical viewpoints of the cropped left and right images are not aligned before merging the left and right images, the misaligned portions of the cropped left and right images are cropped.

[0059] In this implementation, if it is determined that the cropped left image and the cropped right image are not aligned in the vertical field of view, the misaligned parts of the cropped left image and the cropped right image are cropped so that the cropped left image and the cropped right image can be aligned in the vertical field of view. This can avoid the situation that the panoramic image generated after the left image and the right image are fused in the subsequent process, resulting in a discontinuous field of view.

[0060] As one possible implementation, if the vertical field of view in the cropped left and right images is not aligned before merging the left and right images, such as... Figure 5 As shown, Figure 5 The diagram shows that the left and right images after cropping are not aligned in the vertical direction. It is determined whether the height h of the misaligned part in the cropped left and right images is within a preset height threshold range. If h is not within the preset height threshold range, the positions of the two different cameras on the binocular module are adjusted so that the vertical view of the left and right images after cropping is aligned.

[0061] In this implementation, when h is not within the preset height threshold range, it indicates that the overlap of the vertical field of view between the cropped left and right images is too low. Even if the misaligned parts of the cropped left and right images in the vertical direction are cropped out, a large amount of the image will be lost. Therefore, only when h is within the preset height threshold range can it be ensured that after the misaligned parts of the cropped left and right images in the vertical direction are cropped out, most of the image can still be retained.

[0062] Step S103: Merge the first fusion region in the cropped left image with the second fusion region in the cropped right image to obtain a panoramic image.

[0063] In this implementation, by fusing the first fusion region of the left image and the second fusion region of the right image, the fused portion of the resulting panoramic image exhibits a more continuous effect, resulting in a better viewing experience for the user and enhancing the overall user experience. Please see [link to relevant documentation]. Figure 6 , Figure 6 The diagram illustrates the principle of obtaining a panoramic image in the above embodiments. The method of filling color values ​​with a vertical gradient is used to fill the pixels in the fusion region of the panoramic image, thus obtaining the panoramic image. The fusion region of the panoramic image exhibits a gradual blending from left to right. The method of merging the first fusion region and the second fusion region to obtain the fusion region of the panoramic image can be the vertical gradient filling color value method.

[0064] In one implementation, step S103 can be achieved by fusing the first pixel in the first fusion region of the cropped left image with the second pixel in the second fusion region of the corresponding cropped right image to obtain a panoramic image. The third color value of each pixel in the fusion region of the panoramic image is calculated by the first color value of the corresponding first pixel, the first weight corresponding to the first color value, the second color value of the corresponding second pixel, and the second weight corresponding to the second color value. Each calculated third color value is encoded into the corresponding pixel in the fusion region of the panoramic image, so that the image in the fusion region of the panoramic image presents a gradual blending effect from left to right.

[0065] The process of merging the first and second merging regions is explained in detail below. Please refer to [link / reference]. Figure 7 , Figure 7 This demonstrates the process of overlapping a first and a second blended region. The first and second blended regions have the same area and resolution, therefore containing the same number of pixels. The first pixel in the first blended region corresponds one-to-one with the second pixel in the second blended region, resulting in the blended region of the panoramic image. The color values ​​of the pixels in the blended region of the panoramic image are filled using a vertical gradient filling method.

[0066] In the process of filling color values ​​into pixels in the fusion region of a panoramic image, the first weight of the color value of the first pixel and the second weight of the color value of the corresponding second pixel are different for different pixels in the fusion region. A third color value is calculated based on the first color value of the first pixel, the first weight corresponding to the first color value, the second color value of the corresponding second pixel, and the second weight corresponding to the second color value, and this third color value is encoded into the pixel to obtain the panoramic image.

[0067] As one possible implementation, in determining the first weight and the second weight, the first fusion region contains n columns of first pixels, where n is a multiple of 8, and the first weight corresponding to the first color value of each column of first pixels is... The second fusion region contains n columns of second pixels, where n is a multiple of 8, and the second weight corresponding to the second color value of each column of second pixels is... alpha represents the transparency of a pixel. Pixels in the same column have the same alpha value. Each column of pixels... 'a' represents the column number.

[0068] For example, such as Figure 7 As shown, Figure 7The fusion region of the panoramic image contains 8 columns of pixels. The first and second pixels point to the same pixel in the panoramic image, indicating that the first and second pixels coincide with that pixel in the panoramic image. The first weight of the first color value corresponding to the first column of pixels in the fusion region is 0.875, and the second weight of the second color value corresponding to the first column of pixels in the fusion region is 0.125; the first weight of the first color value corresponding to the second column of pixels in the fusion region is 0.75, and the second weight of the second color value corresponding to the second column of pixels in the fusion region is 0.25; the first weight of the first color value corresponding to the third column of pixels in the fusion region is 0.625, and the second weight of the second color value corresponding to the third column of pixels in the fusion region is 0.375; the first weight of the first color value corresponding to the fourth column of pixels in the fusion region is 0.5, and the second weight of the second color value corresponding to the fourth column of pixels in the fusion region is 0. 0.5; The first weight of the first color value corresponding to the 5th column pixel in the blending region is 0.375, and the second weight of the second color value corresponding to the 5th column pixel is 0.625; The first weight of the first color value corresponding to the 6th column pixel in the blending region is 0.75, and the second weight of the second color value corresponding to the 6th column pixel is 0.25; The first weight of the first color value corresponding to the 7th column pixel in the blending region is 0.875, and the second weight of the second color value corresponding to the 7th column pixel is 0.25; The first weight of the first color value corresponding to the 8th column pixel in the blending region is 0, and the second weight of the second color value corresponding to the 8th column pixel is 1.

[0069] In the panoramic image, the first color value of the first pixel corresponding to a certain pixel in the third row is (55, 48, 96), the second color value of the corresponding second pixel is (63, 50, 114), and the third color value of the corresponding third pixel is (58, 48.75, 102.75), which is rounded to obtain the third color value as (58, 49, 103). The calculation formula is: Third color value = First color value * First weight + Second color value * Second weight. The first, second, and third color values ​​can be RGB values ​​or YUV values.

[0070] Please see Figure 8 Based on the same inventive concept, this application also provides an image processing device 100, which includes an acquisition module 101 and a processing module 102.

[0071] The acquisition module 101 is used to acquire the left and right images captured by the binocular module.

[0072] The processing module 102, if there is a horizontally overlapping area between the left and right images, is used to crop the area in the overlapping area of ​​the left image excluding the first fusion area, and to crop the area in the overlapping area of ​​the right image excluding the second fusion area, to obtain cropped left and right images; wherein the first fusion area and the second fusion area have the same area; the first fusion area in the cropped left image and the second fusion area in the cropped right image are merged to obtain a panoramic image; wherein the image of the fusion area of ​​the panoramic image gradually blends from left to right.

[0073] Optionally, the processing module 102 is further configured to: determine that the overlapping area meets the preset cropping conditions; the overlapping area meeting the preset cropping conditions indicates that the field of view width of the panoramic image formed by fusing the cropped left and right images is at a suitable width.

[0074] Optionally, the processing module 102 is specifically used to: determine whether the overlapping region meets the preset cropping conditions based on the first width and the second width; wherein, the first width is the width of the region in the overlapping region of the left image excluding the first fusion region, and the second width is the width of the region in the overlapping region of the right image excluding the second fusion region; if the absolute difference between the first width and the second width is not greater than the first preset width, and the sum of the first width and the second width is not greater than the second preset width, the overlapping region meets the preset cropping conditions.

[0075] Optionally, the processing module 102 is further configured to: adjust the positions of two different cameras on the binocular module when the absolute difference between the first width and the second width is greater than the first set width, or when the sum of the first width and the second width is greater than the second set width, so that the overlapping areas in the left and right images captured by the two cameras respectively meet the preset cropping conditions.

[0076] Optionally, the processing module 102 is also used to: determine the vertical alignment of the viewpoints in the cropped left image and the cropped right image.

[0077] Optionally, the processing module 102 is specifically used to: if the vertical view of the cropped left image and the cropped right image is not aligned, crop the part of the cropped left image and the cropped right image that is not aligned in the vertical direction.

[0078] Optionally, the processing module 102 is specifically used to: fuse the first pixel in the first fusion region of the cropped left image with the second pixel in the second fusion region of the corresponding cropped right image to obtain a panoramic image; wherein, the third color value of each pixel in the fusion region of the panoramic image is calculated by the first color value of the corresponding first pixel, the first weight corresponding to the first color value, the second color value of the corresponding second pixel, and the second weight corresponding to the second color value.

[0079] Optionally, the first fusion region contains n columns of first pixels, where n is a multiple of 8, and the first weight corresponding to the first color value of each column of first pixels is... The second fusion region contains n columns of second pixels, where n is a multiple of 8. The second weight corresponding to the second color value of each column of second pixels is... Here, alpha represents the transparency of a pixel. The first and second pixels in the same column have the same alpha value. The first and second pixels in each column have the same alpha value. 'a' represents the column number.

[0080] The image processing apparatus 100 provided in this application embodiment has the same implementation principle and technical effect as the aforementioned method embodiment. For the sake of brevity, any parts not mentioned in the apparatus embodiment can be referred to the corresponding content in the aforementioned method embodiment.

[0081] like Figure 9 As shown, Figure 9 This diagram illustrates a structural block diagram of an electronic device 200 provided in an embodiment of this application. The electronic device 200 includes: a binocular module 210, a memory 220, a communication bus 230, and a processor 240.

[0082] The binocular module 210, the memory 220, and the processor 240 are electrically connected directly or indirectly to achieve data transmission or interaction. For example, these components can be electrically connected to each other through one or more communication buses 230 or signal lines. The binocular module 210 is used to acquire left and right images. The memory 220 is used to store computer programs, such as... Figure 8The software functional module shown is the image processing apparatus 100. The image processing apparatus 100 includes at least one software functional module that can be stored as software or firmware in the memory 220 or embedded in the operating system (OS) of the electronic device 200. The processor 240 is used to execute executable modules stored in the memory 220, such as the software functional module or computer program included in the image processing apparatus 100. For example, the processor 240 is used to execute the image processing method described above.

[0083] The memory 220 may be, but is not limited to, random access memory (RAM), read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), etc.

[0084] Processor 240 may be an integrated circuit chip with signal processing capabilities. The aforementioned processor can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), a microprocessor, etc.; it can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. Alternatively, processor 240 can also be any conventional processor.

[0085] Among them, the aforementioned electronic devices 200 include, but are not limited to, mobile phones, tablets, and other electronic devices that can be equipped with binocular modules.

[0086] This application embodiment also provides a non-volatile computer-readable storage medium (hereinafter referred to as the storage medium) storing a computer program, which is executed by a computer such as the electronic device 200 described above to perform the image creation method described above.

[0087] It should be noted that the various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.

[0088] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can also be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram and / or flowchart, and combinations of blocks in block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.

[0089] In addition, the functional modules in the various embodiments of this application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.

[0090] If the aforementioned functions are implemented as software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a computer-readable storage medium and includes several instructions to cause a computer device (which may be a personal computer, laptop, server, or electronic device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned computer-readable storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0091] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. An image production method characterized by comprising: include: Acquire the left and right images captured by the binocular module; If there is a horizontally overlapping area between the left image and the right image, the overlapping area of ​​the left image, excluding the first fusion area, and the overlapping area of ​​the right image, excluding the second fusion area, are cropped to obtain the cropped left and right images; wherein the first fusion area and the second fusion area have the same area. The first fusion region in the cropped left image and the second fusion region in the cropped right image are merged to obtain a panoramic image, wherein the image of the fusion region of the panoramic image shows a gradual blending from left to right; The first fusion region contains a predetermined number of first pixels, and the second fusion region contains a predetermined number of second pixels. The first fusion region in the cropped left image and the second fusion region in the cropped right image are fused to obtain a panoramic image, including: The first pixel in the first fusion region of the cropped left image is fused with the second pixel in the second fusion region of the corresponding cropped right image to obtain a panoramic image; wherein, the third color value of each pixel in the fusion region of the panoramic image is calculated by the first color value of the corresponding first pixel, the first weight corresponding to the first color value, the second color value of the corresponding second pixel, and the second weight corresponding to the second color value; The first fusion region contains n columns of first pixels, where n is a multiple of 8, and the first weight corresponding to the first color value of each column of first pixels is... The second fusion region contains n columns of second pixels, where n is a multiple of 8, and the second weight corresponding to the second color value of each column of second pixels is... ;in, The transparency of a pixel is the transparency of the first pixel and the second pixel located in the same column. The values ​​are the same, and the first pixel and the second pixel in each column are the same. , For column numbers.

2. The method of claim 1, wherein, Before cropping the overlapping region of the left image (excluding the first fusion region) and the overlapping region of the right image (excluding the second fusion region) to obtain the cropped left and right images, the method further includes: The overlapping region is determined to meet the preset cropping conditions; the fact that the overlapping region meets the preset cropping conditions indicates that the field of view width of the panoramic image formed by merging the cropped left and right images is at a suitable width.

3. The method of claim 2, wherein, Determining that the overlapping area meets the preset cutting conditions includes: The overlapping region is determined to meet the preset cropping conditions based on a first width and a second width; wherein, the first width is the width of the overlapping region of the left image excluding the first fusion region, and the second width is the width of the overlapping region of the right image excluding the second fusion region; the overlapping region meets the preset cropping conditions if the absolute difference between the first width and the second width is not greater than a first preset width, and the sum of the first width and the second width is not greater than a second preset width.

4. The method of claim 3, wherein, The method further includes: If the absolute difference between the first width and the second width is greater than the first set width, or if the sum of the first width and the second width is greater than the second set width, the positions of the two different cameras on the binocular module are adjusted so that the overlapping areas in the left and right images captured by the two cameras respectively meet the preset cropping conditions.

5. The method of claim 1, wherein, Before fusing the first fusion region in the cropped left image with the second fusion region in the cropped right image to obtain a panoramic image, the method further includes: The cropped left image and the cropped right image are aligned in the vertical field of view.

6. The method of claim 1, wherein, Determining the vertical alignment of the field of view in the cropped left image and the cropped right image includes: If the vertical viewpoints of the cropped left image and the cropped right image are not aligned, the portion of the cropped left image that is not aligned vertically is cropped.

7. An image producing apparatus characterized by comprising: The device includes: The acquisition module is used to acquire the left and right images captured by the binocular module; The processing module, if there is a horizontally overlapping area between the left image and the right image, is used to crop the area of ​​the overlapping area of ​​the left image excluding the first fusion area, and to crop the area of ​​the overlapping area of ​​the right image excluding the second fusion area, to obtain cropped left and right images; wherein the first fusion area and the second fusion area have the same area; the first fusion area in the cropped left image and the second fusion area in the cropped right image are merged to obtain a panoramic image, wherein the image of the fusion area of ​​the panoramic image shows a gradual blending from left to right; The first fusion region contains a predetermined number of first pixels, and the second fusion region contains a predetermined number of second pixels. The processing module is specifically used to fuse the first pixels in the first fusion region of the cropped left image with the second pixels in the corresponding second fusion region of the cropped right image to obtain a panoramic image. The third color value of each pixel in the fusion region of the panoramic image is calculated from the first color value of the corresponding first pixel, the first weight corresponding to the first color value, the second color value of the corresponding second pixel, and the second weight corresponding to the second color value. The first fusion region contains n columns of first pixels, where n is a multiple of 8, and the first weight corresponding to the first color value of each column of first pixels is... The second fusion region contains n columns of second pixels, where n is a multiple of 8, and the second weight corresponding to the second color value of each column of second pixels is... ;in, The transparency of a pixel is the transparency of the first pixel and the second pixel located in the same column. The values ​​are the same, and the first pixel and the second pixel in each column are the same. , For column numbers.

8. An electronic device, characterized in that, The electronic device includes: A binocular camera is used to acquire left and right images; The processor, if there is a horizontally overlapping area between the left image and the right image, is used to crop the area of ​​the overlapping area of ​​the left image excluding the first fusion area, and to crop the area of ​​the overlapping area of ​​the right image excluding the second fusion area, to obtain cropped left and right images; wherein the first fusion area and the second fusion area have the same area; the first fusion area in the cropped left image and the second fusion area in the cropped right image are merged to obtain a panoramic image, wherein the image of the fusion area of ​​the panoramic image shows a gradual blending from left to right; The first fusion region contains a predetermined number of first pixels, and the second fusion region contains a predetermined number of second pixels. The processor is specifically configured to fuse the first pixels in the first fusion region of the cropped left image with the second pixels in the corresponding second fusion region of the cropped right image to obtain a panoramic image. The third color value of each pixel in the fusion region of the panoramic image is calculated from the first color value of the corresponding first pixel, the first weight corresponding to the first color value, the second color value of the corresponding second pixel, and the second weight corresponding to the second color value. The first fusion region contains n columns of first pixels, where n is a multiple of 8, and the first weight corresponding to the first color value of each column of first pixels is... The second fusion region contains n columns of second pixels, where n is a multiple of 8, and the second weight corresponding to the second color value of each column of second pixels is... ;in, The transparency of a pixel is the transparency of the first pixel and the second pixel located in the same column. The values ​​are the same, and the first pixel and the second pixel in each column are the same. , For column numbers.

9. A computer readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by a processor to perform the steps of the method as described in any one of claims 1-6.