Image stitching method, device, camera equipment, storage medium and electronic device
By using multiple sub-photographing devices in the imaging device and adjusting the stitching mode according to the target scene, the problem that image stitching in the prior art cannot adapt to the needs of multiple scenes is solved, and a more flexible monitoring field of view and frame ratio is achieved.
Patent Information
- Application Number
- CN202411307881.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-19
- Publication Date
- 2025-02-18
- Estimated Expiration
- 2044-09-19
AI Technical Summary
In the prior art, image stitching cannot adapt to the needs of multiple scenarios, resulting in a small monitoring field of view and cannot meet the needs of actual scenarios.
By including multiple sub-photographing devices in the imaging device, the stitching mode is determined based on the target scene, and when the stitching mode does not match the target scene, the sub-photographing device is controlled to rotate to match the target scene, collect images and stitch them.
It realizes the adjustment of the splicing mode according to the target scenario, adapts to the needs of multiple scenarios, and expands the flexibility of monitoring field of vision and format ratio.
Smart Images

Figure CN118828237B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of communications, and in particular, to an image stitching method, an image stitching device, an image pickup device, a storage medium and an electronic device. Background Art
[0002] In the related art, when performing image stitching, it can only be done in a fixed manner, for example, the images captured by the camera device are stitched along the short sides. As a result, the monitoring field of view of the stitched image is small and cannot meet the actual scene requirements.
[0003] It can be seen from this that the related technology has the problem that image stitching cannot adapt to the needs of various scenarios.
[0004] Currently, no effective solution has been proposed for the above-mentioned problems existing in the related technologies. Summary of the invention
[0005] The embodiments of the present invention provide an image stitching method, device, camera equipment, storage medium and electronic device to at least solve the problem in the related art that image stitching cannot adapt to the requirements of various scenes.
[0006] According to one embodiment of the present invention, there is provided an image stitching method, comprising: determining a stitching mode for stitching images captured by the camera device when determining that a scene in a target area photographed by a camera device is a target scene, wherein the camera device comprises a plurality of sub-camera devices, the plurality of sub-camera devices at least comprising a first sub-camera device and a second sub-camera device, the first sub-camera device comprising: a first lens barrel, a first sensor, a first bracket and a first driving device, the first lens barrel being connected to the first sensor, the first driving device being connected to the first lens barrel, the first driving device being used to drive the first lens barrel and the first sensor The sensor rotates a target angle along a first direction, the second sub-camera device comprises: a second lens barrel, a second sensor, a second bracket and a second driving device, the second lens barrel is connected to the second sensor, the second driving device is connected to the second lens barrel, and the second driving device is used to drive the second lens barrel and the second sensor to rotate a target angle along the first direction; when the stitching mode does not match the target scene, the sub-camera device included in the camera device is controlled to rotate the target angle according to the first direction, wherein the shooting area of the sub-camera device is the area included in the target area, and the shooting area of each sub-camera device is different; each sub-camera device is controlled to capture images to obtain multiple first images; the multiple first images are stitched according to a model matching the target scene to obtain a first stitched image.
[0007] According to another embodiment of the present invention, there is provided an image stitching device, comprising: a determination module, for determining a stitching mode for stitching images captured by the camera device when it is determined that a scene in a target area photographed by the camera device is a target scene, wherein the camera device comprises a plurality of sub-camera devices, the plurality of sub-camera devices at least comprising a first sub-camera device and a second sub-camera device, the first sub-camera device comprising: a first lens barrel, a first sensor, a first bracket and a first driving device, the first lens barrel is connected to the first sensor, the first driving device is connected to the first lens barrel, the first driving device is used to drive the first lens barrel and the first sensor to rotate along a first direction by a target angle, the second sub-camera device comprising: a second lens barrel, a second sensor, a second bracket and a first driving device. a frame and a second driving device, the second lens barrel is connected to the second sensor, the second driving device is connected to the second lens barrel, and the second driving device is used to drive the second lens barrel and the second sensor to rotate along a first direction to a target angle; a first control module is used to control the sub-camera device included in the camera device to rotate the target angle along the first direction when the stitching mode does not match the target scene, wherein the shooting area of the sub-camera device is the area included in the target area, and the shooting area of each sub-camera device is different; a second control module is used to control each of the sub-camera devices to capture images to obtain multiple first images; a stitching module is used to stitch the multiple first images according to a model matching the target scene to obtain a first stitched image.
[0008] According to another embodiment of the present invention, there is also provided a camera device, comprising: a first sub-camera device, the first sub-camera device comprising: a first lens barrel, a first sensor, a first bracket and a first driving device, the first lens barrel is connected to the first sensor, the first driving device is connected to the first lens barrel, and the first driving device is used to drive the first lens barrel and the first sensor to rotate along a first direction to a target angle; a second sub-camera device, the second sub-camera device comprising: a second lens barrel, a second sensor, a second bracket and a second driving device, the second lens barrel is connected to the second sensor, the second driving device is connected to the second lens barrel, and the second driving device is used to drive the second lens barrel and the second sensor to rotate along the first direction to a target angle.
[0009] According to yet another embodiment of the present invention, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the steps of any one of the above method embodiments when run.
[0010] According to yet another embodiment of the present invention, there is provided an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0011] According to yet another embodiment of the present invention, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps of the method described in each embodiment of the present application are implemented.
[0012] Through the present invention, when it is determined that the scene of the target area photographed by the camera device is the target scene, a splicing mode for splicing the images collected by the camera device is determined, and when the splicing mode does not match the target scene, the sub-camera devices included in the camera device are controlled to rotate the target angle in a first direction, and after rotating the target angle, each sub-camera device is controlled to collect images to obtain multiple first images, and the multiple first images are spliced according to the model matching the target scene to obtain a first spliced image. That is, the first mode of adjusting and splicing multiple first spliced images according to the target scene is realized, and therefore, the problem that image splicing in the related art cannot adapt to the needs of multiple scenes can be solved, and the effect of image splicing adapting to the needs of multiple scenes can be achieved. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] Figure 1 It is a hardware structure block diagram of a mobile terminal of an image stitching method according to an embodiment of the present invention;
[0014] Figure 2 is a flow chart of an image stitching method according to an embodiment of the present invention;
[0015] Figure 3 is a schematic diagram of short-side splicing according to an embodiment of the present invention;
[0016] Figure 4 It is a schematic diagram of the structure of a camera device in the related art;
[0017] Figure 5 This is a schematic diagram of the horizontal short side splicing of the roundabout;
[0018] Figure 6 This is a schematic diagram of the longitudinal short side splicing of the roundabout;
[0019] Figure 7 is a schematic diagram of a camera device according to an embodiment of the present invention;
[0020] Figure 8 is a schematic structural diagram of a camera device according to an embodiment of the present invention;
[0021] Fig. 9 is a schematic diagram of a first bracket according to an embodiment of the present invention;
[0022] Fig.10 is a schematic diagram of a second bracket according to an embodiment of the present invention;
[0023] Fig.11 is a schematic diagram of a first driving device according to an embodiment of the present invention;
[0024] Fig.12 is a schematic diagram of a first image according to an embodiment of the present invention;
[0025] Fig.13 is a schematic diagram of a splicing process according to an embodiment of the present invention;
[0026] Fig.14 is a schematic diagram of a target area according to an embodiment of the present invention;
[0027] Fig.15 is a schematic diagram of an image output by a sensor of a first sub-camera device according to an embodiment of the present invention;
[0028] Fig.16 is a schematic diagram of an image output by a sensor of a second sub-camera device according to an embodiment of the present invention;
[0029] Fig.17 is a schematic diagram of an image captured by a first sub-camera device according to an embodiment of the present invention;
[0030] Fig.18 is a schematic diagram of an image captured by a second sub-camera device according to an embodiment of the present invention;
[0031] Fig.19 is a schematic diagram of an image captured by the first sub-camera device after movement according to an embodiment of the present invention;
[0032] Fig. 20 is a schematic diagram of an image captured by the second sub-camera device after movement according to an embodiment of the present invention;
[0033] Fig.21 is a schematic diagram of a first stitched image according to an embodiment of the present invention;
[0034] Fig. 22 is a schematic diagram of an image captured by a first sub-camera device and an image captured by a second sub-camera device according to an embodiment of the present invention;
[0035] Fig.23 is a schematic diagram of a second stitched image according to an embodiment of the present invention;
[0036] Fig.24 is a schematic diagram comparing short-side splicing and long-side splicing according to an embodiment of the present invention;
[0037] Fig.25is a schematic diagram of a second mode splicing according to an embodiment of the present invention;
[0038] Fig.26 is a flow chart of an image stitching method according to a specific embodiment of the present invention;
[0039] Fig. 27 4 is a structural block diagram of an image stitching device according to an embodiment of the present invention.
[0040] Explanation of the reference numerals: 10: first sub-camera device; 110: first lens barrel; 120: first sensor; 130: first bracket; 131: first through hole; 140: first driving device; 141: first motor; 142: first worm gear; 143: first turbine; 144: first slide groove; 145: first positioning column; 20: second sub-camera device; 210: second lens barrel; 220: second sensor; 230: second bracket; 231: second through hole; 240: second driving device; 241: second motor; 242: second worm gear; 243: second turbine; 244: second slide groove; 245: second positioning column. DETAILED DESCRIPTION
[0041] Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings and in combination with the embodiments.
[0042] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0043] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a mobile terminal as an example, Figure 1 FIG. 1 is a hardware structure block diagram of a mobile terminal of an image stitching method according to an embodiment of the present invention. Figure 1 As shown, the mobile terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, wherein the mobile terminal may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the mobile terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.
[0044] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the image stitching method in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the mobile terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0045] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0046] In this embodiment, a method for stitching images is provided. Figure 2 is a flow chart of an image stitching method according to an embodiment of the present invention. Figure 2 As shown, the process includes the following steps:
[0047] Step S202, in the case of determining that the scene of the target area photographed by the camera device is the target scene, determining a stitching mode for stitching the images collected by the camera device, wherein the camera device includes a plurality of sub-camera devices, the plurality of sub-camera devices include at least a first sub-camera device and a second sub-camera device, the first sub-camera device includes: a first lens barrel, a first sensor, a first bracket and a first driving device, the first lens barrel is connected to the first sensor, the first driving device is connected to the first lens barrel, the first driving device is used to drive the first lens barrel and the first sensor to rotate along a first direction by a target angle, the second sub-camera device includes: a second lens barrel, a second sensor, a second bracket and a second driving device, the second lens barrel is connected to the second sensor, the second driving device is connected to the second lens barrel, and the second driving device is used to drive the second lens barrel and the second sensor to rotate along the first direction by a target angle;
[0048] Step S204, when the stitching mode does not match the target scene, controlling the sub-camera device included in the camera device to rotate a target angle in a first direction, wherein the shooting area of the sub-camera device is the area included in the target area, and the shooting area of each sub-camera device is different;
[0049] Step S206, controlling each of the sub-camera devices to capture images to obtain a plurality of first images;
[0050] Step S208: stitching the plurality of first images according to a model matching the target scene to obtain a first stitched image.
[0051] For a panoramic stitching camera, after the installation parameters are fixed, its maximum monitoring field of view is fixed, and the aspect ratio of the panoramic image after fusion and stitching is also fixed. For example, for a camera that uses the short side for fusion and stitching, its aspect ratio is width: height ≈ long side length * 2 - overlapping area length: short side length. For the short side stitching diagram, please refer to the attached Figure 3 In actual use, surveillance cameras have different monitoring ranges in different scenes at different times, and users have actual needs to adjust the monitoring field of view. Figure 4 It is a schematic diagram of the structure of a camera device in the related art, such as Figure 4 As shown, the stitching lens is in a fixed mode. If the user wants to adjust the field of view, the lens needs to be rotated or the installation angle needs to be adjusted, which is inconvenient to use. Even if the installation angle is adjusted, since the edges of the stitching of each eye image remain unchanged, the maximum aspect ratio of the image output by each eye image sensor is also fixed, so the aspect ratio of the panoramic image of the maximum monitoring range is also fixed, which is not flexible enough. Therefore, it is possible to determine the target scene of the target area photographed by the camera device and the current stitching mode. When the two do not match, adjust the shooting angle of the camera device. Among them, adjusting the shooting angle of the camera device does not require adjusting the installation angle of the camera device. It only needs to control the sensor and lens of the sub-camera device in the camera device. The adjustment method is simple and convenient.
[0052] In the above embodiment, different target scenes can match different stitching modes. When the target scene is a narrow and long area that needs to be monitored, such as an area with an aspect ratio greater than 1, the stitching mode can be short-side stitching. When the target scene is a square area that needs to be monitored, such as an area with an aspect ratio close to 1, the stitching mode can be long-side stitching. That is to say, in different time periods or different scenes, the field of view that the user wants to monitor is different, and the user has scenes and needs to adjust the field of view and aspect ratio in real time. For example, at an intersection with a roundabout, it is necessary to monitor a narrow and long lane when driving, and use binocular short-side stitching, and the aspect ratio is relatively large. When walking, it is necessary to monitor four crosswalks, and the aspect ratio of the aspect ratio is close to a square. At this time, the long-side stitching of the binocular is better. In the waiting hall of the station, it is generally necessary to monitor the narrow aisle in the middle or the waiting areas on both sides. If a multi-eye stitching camera can provide two different monitoring aspect ratios, it can be flexibly adjusted by the user to meet the monitoring needs of different scenes. Figure 5 This is a schematic diagram of the horizontal short side splicing of the roundabout, such as Figure 5 As shown, when the road is open to traffic, the user only needs to monitor the lateral lanes and does not pay attention to the zebra crossings. The monitoring field of view includes the lateral lanes, and the pedestrian crossings on the left and right sides are also within the field of view. Figure 6 This is a schematic diagram of the longitudinal short side splicing of the roundabout, such as Figure 6 As shown, the upper and lower pedestrian crossings are within the field of vision.
[0053] In the above embodiment, the camera device can be a multi-eye camera, that is, the camera device can include multiple sub-camera devices, and each sub-camera device is used to shoot different areas in the target area. When the camera device is a binocular camera, the camera device includes two sub-camera devices, and when the camera device is a trinocular camera, the camera device includes three sub-camera devices. When the camera device includes two sub-camera devices, namely a first sub-camera device and a second sub-camera device, each sub-camera device can include a motor, a worm, a positioning column, a lens, a turbine bracket, a sensor board, and a lens bracket. The worm is driven by the rotation of the motor, and the rotation of the worm drives the elliptical turbine. The cooperation of the elliptical turbine and the positioning column can realize horizontal movement in the X-axis direction while rotating the lens module. The separate drive control of the two single machines makes the use scope and use scenarios of the product more diversified.
[0054] The present application provides a camera device. The schematic diagram of the camera device can be found in the attached Figure 7 ,like Figure 7As shown, the camera device can be a multi-eye fusion stitching camera, and the camera device includes a first sub-camera device 10 and a second sub-camera device 20. The first sub-camera device 10 and the second sub-camera device 20 are both used to obtain images of corresponding shooting areas, and the shooting areas of the first sub-camera device 10 and the second sub-camera device 20 are not completely the same; after shooting, the images obtained by the first sub-camera device 10 and the second sub-camera device 20 are fused to form an image of the target area. Through the above settings, the shooting areas of the first sub-camera device 10 and the second sub-camera device 20 are not completely the same, which can increase the field of view of the camera device.
[0055] In this embodiment, the schematic diagram of the camera structure can be found in the attached Figure 8 ,like Figure 8 As shown, the first sub-camera device 10 includes a first lens barrel 110, a first sensor 120, a first bracket 130 and a first driving device 140. The first lens barrel 110 is connected to the first sensor 120, and the first driving device 140 is connected to the first lens barrel 110. The first driving device 140 is used to drive the first lens barrel 110 and the first sensor 120 to rotate a target angle along a first direction.
[0056] In some implementations, the first sensor 120 is located at the light-emitting side of the first lens barrel 110, and the first sensor 120 is used to acquire an image. Exemplarily, the first sensor 120 may include an image sensor (Charge Coupled Device, referred to as a CCD sensor) or a complementary metal oxide semiconductor sensor (Complementary Metal-Oxide-Semiconductor, referred to as a CMOS sensor), etc. A first lens assembly is disposed in the first lens barrel 110, and the first lens assembly may include a convex lens and / or a concave lens disposed along the optical axis, and the first lens assembly may improve the quality of the image acquired by the first sensor 120.
[0057] In the above implementation, the image captured by the first sensor 120 is rectangular, and the image includes a long side and a short side. The first driving device 140 drives the first lens barrel 110 and the first sensor 120 to rotate along the first direction by a target angle, and accordingly, after the rotation, the image captured by the first sensor 120 rotates accordingly.
[0058] In some examples, the target angle may be 90°, and after the rotation, the image acquired by the first sensor 120 rotates 90° accordingly. When the long side of the image before the rotation is in a horizontal position, the long side of the image after the rotation is rotated to a vertical position; conversely, when the long side of the image before the rotation is in a vertical position, the long side of the image after the rotation is rotated to a horizontal position.
[0059] In the present application, see the attached Figure 8 The second sub-camera device 20 includes: a second lens barrel 210, a second sensor 220, a second bracket 230 and a second driving device 240, the second lens barrel 210 is connected to the second sensor 220, the second driving device 240 is connected to the second lens barrel 210, and the second driving device 240 is used to drive the second lens barrel 210 and the second sensor 220 to rotate along the first direction to a target angle.
[0060] The second sensor 220 is located at the light-emitting side of the second lens barrel 210, and the second sensor 220 is used to acquire an image. Exemplarily, the second sensor 220 may include an image sensor (Charge Coupled Device, referred to as CCD sensor) or a complementary metal oxide semiconductor sensor (Complementary Metal-Oxide-Semiconductor, referred to as CMOS sensor), etc. A second lens assembly is disposed in the second lens barrel 210, and the second lens assembly may include a convex lens and / or a concave lens disposed along the optical axis, and the second lens assembly may improve the image quality acquired by the second sensor 220.
[0061] In the above implementation, the image captured by the second sensor 220 is rectangular, and the image includes a long side and a short side. The second driving device 240 drives the second lens barrel 210 and the second sensor 220 to rotate along the first direction by a target angle, and accordingly, after the rotation, the image captured by the second sensor 220 rotates accordingly.
[0062] In some examples, the target angle may be 90°, and after the rotation, the image acquired by the second sensor 220 rotates 90° accordingly. When the long side of the image before the rotation is in a horizontal position, the long side of the image after the rotation is rotated to a vertical position; conversely, when the long side of the image before the rotation is in a vertical position, the long side of the image after the rotation is rotated to a horizontal position.
[0063] It can be understood that before the rotation, the long side of the image acquired by the first sensor 120 is parallel to the long side of the image acquired by the second sensor 220, and the two long sides are close to each other, so that after the rotation, the image acquired by the first sensor 120 and the image acquired by the second sensor 220 can be spliced along the long side; or, before the rotation, the long side of the image acquired by the first sensor 120 is parallel to the long side of the image acquired by the second sensor 220, and the two short sides are close to each other, so that after the rotation, the image acquired by the first sensor 120 and the image acquired by the second sensor 220 can be spliced along the short side.
[0064] In the above embodiment, the second bracket and the first bracket can be an integrated structure to facilitate the production of the camera device. Of course, the second bracket and the first bracket can also be set separately, and the corresponding second bracket can be set at a distance from the first bracket, or the second bracket can be connected to the first bracket by bolt connection or clamping, etc., and the embodiment of the present application does not limit this.
[0065] In the imaging device provided in the embodiment of the present application, the first driving device 140 can drive the first lens barrel 110 and the first sensor 120 to rotate along the first direction to a target angle, and at the same time, the second driving device 240 drives the second lens barrel 210 and the second sensor 220 to rotate along the first direction to a target angle, so that the images can be spliced along the long side or along the short side, thereby improving the imaging quality.
[0066] In the embodiment of the present application, the schematic diagram of the first bracket can be found in the attached Fig. 9 ,like Fig. 9 As shown, the first bracket 130 is provided with a first through hole 131, the width of the first through hole 131 is equal to the outer diameter of the first lens barrel 110, the length of the first through hole 131 is greater than the outer diameter of the first lens barrel 110, and the length direction of the first through hole 131 is parallel to the line connecting the axes of the first lens barrel 110 and the second lens barrel 210. The first lens barrel 110 is inserted into the first through hole 131, that is, the first through hole 131 allows the first lens barrel 110 to rotate inside it, and also allows the first lens barrel 110 to move in the first through hole 131 in the extension direction.
[0067] In the above implementation, the first driving device 140 is used to drive the first lens barrel 110 and the first sensor 120 to rotate along the first direction while driving the first lens barrel 110 and the first sensor 120 to move along the length direction of the first through hole 131 .
[0068] With such a configuration, the distance between the first lens barrel 110 and the second lens barrel 210 can be adjusted while the first lens barrel 110 and the first sensor 120 are rotated, thereby ensuring that the images acquired by the first sensor 120 and the second sensor 220 partially overlap or are adjacent to each other after the rotation, so as to avoid the stitched image not displaying a complete image of the target area.
[0069] In the above embodiment, the schematic diagram of the second bracket can be found in the attached Fig.10 ,like Fig.10As shown, the second bracket 230 is provided with a second through hole 231, the width of the second through hole 231 is equal to the outer diameter of the second lens barrel 210, the length of the second through hole 231 is greater than the outer diameter of the second lens barrel 210, and the length direction of the second through hole 231 is parallel to the line connecting the axes of the first lens barrel 110 and the second lens barrel 210; the second lens barrel 210 is penetrated by the second through hole 231, that is, the second through hole 231 allows the second lens barrel 210 to rotate therein, and also allows the second lens barrel 210 to move in the extension direction of the second through hole 231.
[0070] In the above implementation, the second driving device 240 is used to drive the second lens barrel 210 and the second sensor 220 to rotate along the first direction while driving the second lens barrel 210 and the second sensor 220 to move along the length direction of the second through hole 231 .
[0071] With such a configuration, the distance between the first lens barrel 110 and the second lens barrel 210 can be adjusted while the second lens barrel 210 and the second sensor 220 are rotated, further ensuring that the images acquired by the first sensor 120 and the second sensor 220 partially overlap or are adjacent to each other after the rotation, so as to avoid the stitched image not displaying a complete image of the target area.
[0072] In the embodiment of the present application, the schematic diagram of the first driving device can be found in the attached Fig.11 ,like Fig.11 As shown, the first driving device 140 includes: a first motor 141, a first worm 142 and a first turbine 143, the first motor 141 is drivingly connected to the first worm 142, the first worm 142 is meshed with the first turbine 143, and the first turbine 143 is connected to the first lens barrel 110; the first turbine 143 is elliptical, the center of the first turbine 143 is located on the axis of the first lens barrel 110, and the spokes of the first turbine 143 are provided with a first slide groove 144, the first slide groove 144 is elliptical, the major axis of the first slide groove 144 coincides with the major axis of the first turbine 143, and the minor axis of the first slide groove 144 coincides with the minor axis of the first turbine 143; the first bracket 130 is provided with a first positioning column 145, and the first positioning column 145 is slidably disposed in the first slide groove 144.
[0073] Through the above arrangement, the first motor 141 drives the first turbine 143 to rotate, and at the same time, the first positioning column 145 slides in the first slide groove 144. The first turbine 143 drives the first lens barrel 110 and the first sensor 120 to rotate, and moves along the length direction of the first through hole 131 to adjust the distance between the first sensor 120 and the second sensor 220. The driving structure is simple and easy to manufacture.
[0074] The second driving device 240 includes: a second motor 241, a second worm 242 and a second turbine 243, the second motor 241 is drivingly connected to the second worm 242, the second worm 242 is meshed with the second turbine 243, and the second turbine 243 is connected to the second lens barrel 210; the second turbine 243 is elliptical, the center of the second turbine 243 is located on the axis of the second lens barrel 210, and a second slide groove 244 is arranged on the spokes of the second turbine 243, the second slide groove 244 is elliptical, the major axis of the second slide groove 244 coincides with the major axis of the second turbine 243, and the minor axis of the second slide groove 244 coincides with the minor axis of the second turbine 243; a second positioning column 245 is arranged on the second bracket 230, and the second positioning column 245 is slidably arranged in the second slide groove 244.
[0075] Through the above arrangement, the second motor 241 drives the second turbine 243 to rotate, and at the same time, the second positioning column 245 slides in the second slide groove 244. The second turbine 243 drives the second lens barrel 210 and the second sensor 220 to rotate, and moves along the length direction of the second through hole 231 to adjust the distance between the first sensor 120 and the second sensor 220. The driving structure is simple and easy to manufacture.
[0076] It can be understood that the long axis length of the first slide groove 144 is smaller than the long axis length of the first turbine 143, and the short axis length of the first slide groove 144 is smaller than the short axis length of the first turbine 143; similarly, the long axis length of the second slide groove 244 is smaller than the long axis length of the second turbine 243, and the short axis length of the second slide groove 244 is smaller than the short axis length of the second turbine 243.
[0077] In the above implementation, the first chute 144 extends from the corresponding elliptical major axis to the adjacent minor axis. In this way, the first chute 144 can limit the rotation angle of the first turbine 143, that is, the target angle is limited to 90°.
[0078] Similarly, the second chute 244 extends from the corresponding elliptical major axis to the adjacent minor axis. In this way, the second chute 244 can limit the rotation angle of the second turbine 243, that is, the target angle is limited to 90°.
[0079] In some embodiments, the first sensor 120 is rectangular, so that the image acquired by the first sensor 120 is rectangular. Accordingly, the long side of the first sensor 120 may be parallel to the length direction of the first through hole 131. Similarly, the second sensor 220 is rectangular, so that the image acquired by the second sensor 220 is rectangular. Accordingly, the long side of the second sensor 220 is parallel to the length direction of the second through hole 231.
[0080] In other embodiments, the first sensor 120 is rectangular, so that the image acquired by the first sensor 120 is rectangular. Accordingly, the long side of the first sensor 120 may be parallel to the width direction of the first through hole 131. Similarly, the second sensor 220 is rectangular, so that the image acquired by the second sensor 220 is rectangular. Accordingly, the long side of the second sensor 220 is parallel to the width direction of the second through hole 231.
[0081] In the above embodiment, after the sub-camera device rotates the target angle according to the first direction, each sub-camera device can be controlled to capture images to obtain multiple first images, and the multiple first images are spliced. The first direction can be clockwise or counterclockwise, and the target angle can be any angle, such as 30°, 45°, 90°, 135°, etc., and the present invention is not limited to this.
[0082] Through the present invention, when it is determined that the scene of the target area photographed by the camera device is the target scene, a splicing mode for splicing the images collected by the camera device is determined, and when the splicing mode does not match the target scene, the sub-camera devices included in the camera device are controlled to rotate the target angle in a first direction, and after rotating the target angle, each sub-camera device is controlled to collect images to obtain multiple first images, and the multiple first images are spliced according to the model matching the target scene to obtain a first spliced image. That is, the first mode of adjusting and splicing multiple first spliced images according to the target scene is realized, so that the problem that the existing image splicing cannot adapt to the needs of multiple scenes can be solved, and the effect of image splicing adapting to the needs of multiple scenes can be achieved.
[0083] Optionally, the executor of the above steps may be a background processor, or other devices with similar processing capabilities, or a machine that integrates at least an image acquisition device and a data processing device, wherein the image acquisition device may include a graphics acquisition module such as a camera, and the data processing device may include a computer, a mobile phone or other terminal, but is not limited thereto.
[0084] In an exemplary embodiment, stitching a plurality of first images according to a model matching the target scene to obtain a first stitched image comprises: repeatedly performing a stitching operation until the images included in the plurality of first images are stitched together to obtain an initial stitched image; determining the first stitched image based on the initial stitched image; wherein the stitching operation comprises: for any second image included in the plurality of first images, performing the following operations: determining a third image from the plurality of first images, wherein a shooting area of a first sub-camera device that shoots the third image is adjacent to a shooting area of a second sub-camera device that shoots the second image; in the case where a first overlapping area exists between the second image and the third image, stitching the second image and the third image so that the first overlapping area of the second image and the third image coincide to obtain a stitched sub-image; updating the second image to the stitched sub-image and performing the stitching operation; in the case where the first overlapping area does not exist between the second image and the third image, controlling the first sub-camera device and / or the second sub-camera device to move in a second direction until a first overlapping area exists between the second image captured by the first sub-camera device and the third image captured by the second sub-camera device, and performing the stitching operation. In this embodiment, when the camera device includes multiple sub-camera devices, multiple first images can be collected, wherein the schematic diagram of the first image can be referred to in the attached Fig.12 ,like Fig.12 As shown, the first image includes image A, image B, image C, and image D, wherein the area in image A is right adjacent to the area in image B, the area in image B is right adjacent to the area in image C, the area in image C is right adjacent to the area in image D, area E is the overlapping area of image A and image B, area F is the overlapping area of image B and image C, and area G is the overlapping area of image C and image D, wherein areas E, F, and G represent the first overlapping areas that are continuously updated. The image stitching process can be seen in the attached Fig.13 ,like Fig.13As shown, during the stitching, image A can be determined as the second image. When image A is the second image, image B is the third image. It can be determined whether there is an overlapping area between image A and image B. If there is no overlapping area, the sub-camera device for shooting image A and / or the sub-camera device for shooting image B can be controlled to move in the horizontal direction until there is an overlapping area between image A and image B. When there is an overlapping area (i.e., the above-mentioned area E), image A and image B are stitched together so that the overlapping area between image A and image B coincides. After the stitching is completed, the image after the stitching of image A and image B can be determined as a whole (i.e., the above-mentioned stitched sub-image) as the second image. At this time, it can be determined that the third image is image C, and the second image is stitched with image C. At this time, if there is no overlapping area between the second image and image C, the sub-camera device for shooting image C can be controlled to move in the horizontal direction until there is an overlapping area with the second image (i.e., the above-mentioned overlapping area F), and then the stitching is performed. The stitched images are then regarded as a whole (stitched sub-image) as the second image. At this time, the third image determined is image D, and the second image can be stitched with image D. The above steps are repeated until all images are stitched.
[0085] In the above embodiment, the multiple first images are taken as an example for description. The schematic diagram of the target area can be found in the attached Fig.14 ,like Fig.14 As shown, the central viewpoint of the camera device is tree 1, and the image output by the sensor of the first sub-camera device can be seen in the attached Fig.15 The image output by the sensor of the second sub-camera device can be seen in the attached Fig.16 Since the first sub-camera device and the second sub-camera device rotate the target angle according to the first direction, the image output by the sensor is the rotated image. In order to facilitate the understanding of the field of view, the image captured by the first sub-camera device can be set as shown in the attached figure. Fig.17 As shown, the image captured by the second sub-camera device is as shown in the attached Fig.18 As shown, there is no overlapping area between the two eye pictures. In order to ensure that fusion and splicing can be performed, the left and right objective lenses and sensors can be horizontally translated to have overlapping areas. Among them, the first sub-camera device can be controlled to move, the second sub-camera device can be controlled to move, and the first sub-camera device and the second sub-camera device can be controlled to move. Each time, it can move a fixed distance, or it can move according to the gradient descent distance. Among them, the second direction of movement of the first sub-camera device and / or the second sub-camera device can be a horizontal direction or a vertical direction.
[0086] In the above embodiment, the image captured by the first sub-camera device after the movement can be seen in the attached Fig.19 The image captured by the second sub-camera device can be found in the attached Fig. 20 ,like Figure 19-20As shown in FIG. 1 , there is an overlapping area in the two images, so the images can be spliced in the vertical direction. The schematic diagram of the first spliced image can be found in the attached Fig.21 .
[0087] In an exemplary embodiment, stitching the second image with the third image includes: determining a complete first edge in the first overlapping region included in the second image, wherein the length of the first edge is greater than the length of an edge intersecting the first edge included in the second image; determining a complete second edge in the first overlapping region included in the third image, wherein the length of the second edge is greater than the length of an edge intersecting the second edge included in the third image; and stitching the second image with the third image in a direction perpendicular to the first edge and the second edge. In this embodiment, continue to refer to the attached Figure 19-20 , the complete first side in the first overlapping area is the long side of the second image, and the complete second side of the first overlapping area included in the third image is the long side of the third image. Therefore, the images can be spliced in a direction perpendicular to the first side and the second side to obtain a spliced image. That is, long-side splicing is achieved. While maintaining the center viewpoint of the picture unchanged, the monitoring field of view and aspect ratio have obvious changes, the left and right monitoring field of view is narrowed, and the upper and lower monitoring field of view is expanded.
[0088] In an exemplary embodiment, determining the first stitched image based on the initial stitched image includes: rotating the initial stitched image by the target angle in the opposite direction of the first direction to obtain the first stitched image. In this embodiment, since both the first sub-camera device and the second sub-camera device are rotated, the stitched image is also a rotated image. Therefore, after stitching, the image can be rotated in the opposite direction of the first direction to obtain a stitched image. That is, the images output by the left and right eyes can be stitched using the top and bottom stitching mode, that is, the software is switched to use the long edge for fusion stitching, and the stitched image is rotated by the target angle.
[0089] In an exemplary embodiment, after determining a stitching mode for stitching images captured by the camera device, the method further includes: when the stitching mode matches the target scene, controlling each of the sub-camera devices to capture images to obtain a plurality of second images; and stitching the plurality of second images according to the short sides included in the second images to obtain second stitched images. In this embodiment, if the target scene matches the stitching mode, image stitching can be performed directly. For example, when the target scene is a long and narrow scene, the sub-camera devices are controlled to capture images to obtain a plurality of second images. When the camera device includes a first sub-camera device and a second sub-camera device, the images captured by the first sub-camera device and the images captured by the second sub-camera device can be found in the attached Fig. 22 , the left and right eyes have overlapping areas in the horizontal direction. In the horizontal direction, the short sides of the original images of each eye are used for fusion and splicing to obtain the second spliced image. The schematic diagram of the second spliced image can be found in the attached Fig.23 ,like Fig.23 As shown, its horizontal left and right range of vision is larger.
[0090] In the above embodiment, the schematic diagram comparing the short side splicing and the long side splicing can be seen in the attached Fig.24 ,like Fig.24 As shown, while maintaining the central viewpoint of the picture unchanged, the monitoring field of view and aspect ratio have obvious changes. The left and right monitoring field of view of short-side splicing is narrowed, while the upper and lower monitoring field of view of long-side splicing is large.
[0091] In an exemplary embodiment, after determining the stitching mode for stitching the images captured by the camera device, the method further includes: when the target scene is a wide-angle scene and the stitching mode is the first mode, determining that the stitching mode does not match the target scene, wherein the aspect ratio of the image stitched according to the first mode is outside a predetermined interval; when the target scene is a wide-angle scene and the stitching mode is the second mode, determining that the stitching mode matches the target scene, wherein the aspect ratio of the image stitched according to the second mode is within the predetermined interval. In this embodiment, when the target scene is a wide-angle scene, the stitching mode that matches it may be the second mode, i.e., long-side stitching, i.e., the aspect ratio after stitching is within a predetermined interval, wherein the predetermined interval may be an area centered on 1, such as 1±0.5. When the target scene is a long and narrow scene, the mode that matches it may be the first mode, i.e., the short-side stitching model. For example, in a roundabout road, when vehicles are prohibited from passing, such as a red light, the second mode may be used. The second mode stitching schematic diagram may be found in the attached Fig.25 , and monitor pedestrians. When pedestrians are prohibited from passing, the first mode can be used for splicing to monitor vehicles.
[0092] The following describes the image stitching method in conjunction with a specific implementation method:
[0093] Fig.26 is a flow chart of an image stitching method according to a specific embodiment of the present invention, such as Fig.26 As shown, the process includes:
[0094] Step S2602, stop left and right fusion splicing.
[0095] Step S2604: a moving device is selected inside the camera to rotate the two image sensors 90° within the plane.
[0096] Step S2606: When the elliptical turbine rotates, the lens and the sensor move horizontally at the same time.
[0097] Step S2608, the software re-merges the upper and lower parts to output a panoramic image.
[0098] In the aforementioned embodiment, when monitoring the scene of the same viewpoint, there is no need to change the camera installation. By rotating the image sensor and lens inside the camera and changing the edge used for the stitching method, the effect of changing the monitoring field of view and the aspect ratio can be achieved. The multi-eye image sensor resources in one camera are fully utilized, and the long and short edges are switched to perform different modes of stitching to obtain different aspect ratios. The two monitoring field of view ranges can be switched remotely in real time to meet the user's different monitoring range requirements at different times.
[0099] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present invention.
[0100] In this embodiment, a device for stitching images is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0101] Fig. 27 is a structural block diagram of an image stitching device according to an embodiment of the present invention, such as Fig. 27 As shown, the device comprises:
[0102] A determination module 2702 is used to determine a stitching mode for stitching images captured by the camera device when it is determined that the scene of the target area photographed by the camera device is the target scene, wherein the camera device includes a plurality of sub-camera devices, the plurality of sub-camera devices include at least a first sub-camera device and a second sub-camera device, the first sub-camera device includes: a first lens barrel, a first sensor, a first bracket, and a first driving device, the first lens barrel is connected to the first sensor, the first driving device is connected to the first lens barrel, the first driving device is used to drive the first lens barrel and the first sensor to rotate along a first direction by a target angle, the second sub-camera device includes: a second lens barrel, a second sensor, a second bracket, and a second driving device, the second lens barrel is connected to the second sensor, the second driving device is connected to the second lens barrel, and the second driving device is used to drive the second lens barrel and the second sensor to rotate along the first direction by a target angle;
[0103] A first control module 2704 is used to control the sub-camera device included in the camera device to rotate a target angle according to a first direction when the stitching mode does not match the target scene, wherein the shooting area of the sub-camera device is the area included in the target area, and the shooting area of each sub-camera device is different;
[0104] A second control module 2706, configured to control each of the sub-camera devices to capture images to obtain a plurality of first images;
[0105] The stitching module 2708 is used to stitch the multiple first images according to the model matching the target scene to obtain a first stitched image.
[0106] In an exemplary embodiment, the stitching module 2708 can stitch the plurality of first images according to the model matching the target scene to obtain a first stitched image by: repeatedly performing the stitching operation until the images included in the plurality of first images are stitched together to obtain an initial stitched image; determining the first stitched image based on the initial stitched image; wherein the stitching operation includes: for any second image included in the plurality of first images, performing the following operations: determining a third image from the plurality of first images, wherein the shooting area of the first sub-camera device shooting the third image is the same as the shooting area of the second sub-camera device shooting the second image; The shooting area is adjacent to the shooting area; in the case that there is a first overlapping area between the second image and the third image, the second image and the third image are stitched together so that the second image and the first overlapping area of the third image coincide with each other to obtain a stitched sub-image; the second image is updated to the stitched sub-image, and the stitching operation is performed; in the case that the first overlapping area does not exist between the second image and the third image, the first sub-camera device and / or the second sub-camera device are controlled to move in the second direction until there is a first overlapping area between the second image captured by the first sub-camera device and the third image captured by the second sub-camera device, and the stitching operation is performed.
[0107] In an exemplary embodiment, the stitching module 2708 can stitch the second image with the third image in the following manner: determine a complete first edge in the first overlapping area included in the second image, wherein the length of the first edge is greater than the length of an edge intersecting with the first edge included in the second image; determine a complete second edge in the first overlapping area included in the third image, wherein the length of the second edge is greater than the length of an edge intersecting with the second edge included in the third image; and stitch the second image with the third image in a direction perpendicular to the first edge and the second edge.
[0108] In an exemplary embodiment, the stitching module 2708 may determine the first stitched image based on the initial stitched image in the following manner: rotating the initial stitched image by the target angle in the opposite direction of the first direction to obtain the first stitched image.
[0109] In an exemplary embodiment, the apparatus may also be used to, after determining a stitching mode for stitching images captured by the camera device, control each of the sub-camera devices to capture images when the stitching mode matches the target scene to obtain a plurality of second images; and stitch the plurality of second images according to the short sides included in the second images to obtain a second stitched image.
[0110] In an exemplary embodiment, the apparatus may also be used to, after determining a stitching mode for stitching images captured by the camera device, determine that the stitching mode does not match the target scene when the target scene is a wide-angle scene and the stitching mode is a first mode, wherein the aspect ratio of the image stitched according to the first mode is outside a predetermined range; and to determine that the stitching mode matches the target scene when the target scene is a wide-angle scene and the stitching mode is a second mode, wherein the aspect ratio of the image stitched according to the second mode is within the predetermined range.
[0111] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.
[0112] An embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.
[0113] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.
[0114] An embodiment of the present invention further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0115] In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0116] An embodiment of the present invention further provides a computer program product, including a computer program, which implements the steps of the method in each embodiment of the present application when the computer program is executed by a processor.
[0117] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.
[0118] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order than here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.
[0119] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for stitching images, characterized in that: include: In the case where it is determined that the scene of the target area photographed by the camera device is the target scene, a stitching mode for stitching the images collected by the camera device is determined, wherein the camera device includes a plurality of sub-camera devices, the plurality of sub-camera devices include at least a first sub-camera device and a second sub-camera device, the first sub-camera device includes: a first lens barrel, a first sensor, a first bracket and a first driving device, the first lens barrel is connected to the first sensor, the first driving device is connected to the first lens barrel, the first driving device is used to drive the first lens barrel and the first sensor to rotate along a first direction by a target angle, the second sub-camera device includes: a second lens barrel, a second sensor, a second bracket and a second driving device, the second lens barrel is connected to the second sensor, the second driving device is connected to the second lens barrel, and the second driving device is used to drive the second lens barrel and the second sensor to rotate along the first direction by a target angle; In the case where the stitching mode does not match the target scene, controlling the sub-camera device included in the camera device to rotate a target angle in a first direction, wherein the shooting area of the sub-camera device is an area included in the target area, and the shooting area of each sub-camera device is different; Controlling each of the sub-camera devices to capture images to obtain a plurality of first images; splicing the plurality of first images according to a model matching the target scene to obtain a first spliced image; The first direction is a direction in which the long side of the captured image is in a horizontal position and the long side is in a vertical position after the rotation, or a direction in which the long side of the captured image is in a vertical position and the long side is in a horizontal position after the rotation; The first bracket is provided with a first through hole, the width of the first through hole is equal to the outer diameter of the first lens barrel, the length of the first through hole is greater than the outer diameter of the first lens barrel, and the length direction of the first through hole is parallel to the line connecting the axes of the first lens barrel and the second lens barrel; the first lens barrel is inserted into the first through hole, and the first driving device is used to drive the first lens barrel and the first sensor to rotate along the first direction while driving the first lens barrel and the first sensor to move along the length direction of the first through hole, so that the images collected by the first sensor and the second sensor are partially overlapped or adjacent to each other; the second bracket is provided with a second through hole, the width of the second through hole is equal to the outer diameter of the second ... The second lens barrel has an outer diameter equal to that of the first lens barrel, a length of the second through hole is greater than an outer diameter of the second lens barrel, and a length direction of the second through hole is parallel to a line connecting the axes of the first lens barrel and the second lens barrel; the second lens barrel is inserted into the second through hole, and the second driving device is used for driving the second lens barrel and the second sensor to rotate along the first direction while driving the second lens barrel and the second sensor to move along the length direction of the second through hole, so that the images collected by the first sensor and the second sensor are partially overlapped or adjacent to each other; the length direction of the first through hole is parallel to a line connecting the axes of the first lens barrel and the second lens barrel; the length direction of the second through hole is parallel to a line connecting the axes of the first lens barrel and the second lens barrel.
2. The method according to claim 1, characterized in that: Stitching the plurality of first images according to a model matching the target scene to obtain a first stitched image includes: Repeating the stitching operation until the stitching of the images included in the plurality of first images is completed to obtain an initial stitched image; determining the first stitched image based on the initial stitched image; Wherein, the splicing operation includes: For any second image included in the plurality of first images, the following operations are performed: Determine a third image from the plurality of first images, wherein a shooting area of the first sub-camera device shooting the third image is adjacent to a shooting area of the second sub-camera device shooting the second image; In the case where there is a first overlapping area between the second image and the third image, stitching the second image and the third image so that the first overlapping area between the second image and the third image overlaps, thereby obtaining a stitched sub-image; Updating the second image to the stitching sub-image, and performing the stitching operation; When the first overlapping area does not exist between the second image and the third image, the first sub-camera device and / or the second sub-camera device is controlled to move in the second direction until a first overlapping area exists between the second image captured by the first sub-camera device and the third image captured by the second sub-camera device, and the stitching operation is performed.
3. The method according to claim 2, characterized in that Stitching the second image and the third image comprises: determining a complete first edge in the first overlapping area included in the second image, wherein a length of the first edge is greater than a length of an edge included in the second image that intersects with the first edge; determining a complete second edge in the first overlapping area included in the third image, wherein a length of the second edge is greater than a length of an edge included in the third image and intersecting with the second edge; The second image and the third image are spliced in a direction perpendicular to the first side and the second side.
4. The method according to claim 2, characterized in that: Determining the first stitched image based on the initial stitched image includes: The initial stitched image is rotated by the target angle in the opposite direction of the first direction to obtain the first stitched image.
5. The method according to claim 1, characterized in that After determining a stitching mode for stitching the images captured by the camera device, the method further includes: When the stitching mode matches the target scene, controlling each of the sub-camera devices to capture images to obtain a plurality of second images; The plurality of second images are spliced together according to the short sides included in the second images to obtain a second spliced image.
6. The method according to claim 1, characterized in that After determining a stitching mode for stitching the images captured by the camera device, the method further includes: When the target scene is a wide-angle scene and the stitching mode is a first mode, determining that the stitching mode does not match the target scene, wherein the aspect ratio of an image stitched according to the first mode is outside a predetermined range; When the target scene is a wide-angle scene and the stitching mode is a second mode, it is determined that the stitching mode matches the target scene, wherein the aspect ratio of the image stitched according to the second mode is within the predetermined range.
7. An image splicing device, characterized in that: include: A determination module, used for determining a stitching mode for stitching images captured by the camera device when it is determined that the scene of the target area photographed by the camera device is the target scene, wherein the camera device includes a plurality of sub-camera devices, the plurality of sub-camera devices include at least a first sub-camera device and a second sub-camera device, the first sub-camera device includes: a first lens barrel, a first sensor, a first bracket and a first driving device, the first lens barrel is connected to the first sensor, the first driving device is connected to the first lens barrel, the first driving device is used to drive the first lens barrel and the first sensor to rotate along a first direction by a target angle, the second sub-camera device includes: a second lens barrel, a second sensor, a second bracket and a second driving device, the second lens barrel is connected to the second sensor, the second driving device is connected to the second lens barrel, and the second driving device is used to drive the second lens barrel and the second sensor to rotate along the first direction by a target angle; A first control module is used to control the sub-camera device included in the camera device to rotate a target angle according to a first direction when the stitching mode does not match the target scene, wherein the shooting area of the sub-camera device is the area included in the target area, and the shooting area of each sub-camera device is different; A second control module, used for controlling each of the sub-camera devices to capture images to obtain a plurality of first images; A stitching module, used for stitching the plurality of first images according to a model matching the target scene to obtain a first stitched image; The first direction is a direction in which the long side of the captured image is in a horizontal position and the long side is in a vertical position after the rotation, or a direction in which the long side of the captured image is in a vertical position and the long side is in a horizontal position after the rotation; The first bracket is provided with a first through hole, the width of the first through hole is equal to the outer diameter of the first lens barrel, the length of the first through hole is greater than the outer diameter of the first lens barrel, and the length direction of the first through hole is parallel to the line connecting the axes of the first lens barrel and the second lens barrel; the first lens barrel is inserted into the first through hole, and the first driving device is used to drive the first lens barrel and the first sensor to rotate along the first direction while driving the first lens barrel and the first sensor to move along the length direction of the first through hole, so that the images collected by the first sensor and the second sensor are partially overlapped or adjacent to each other; the second bracket is provided with a second through hole, the width of the second through hole is equal to the outer diameter of the second ... The second lens barrel has an outer diameter equal to that of the first lens barrel, a length of the second through hole is greater than an outer diameter of the second lens barrel, and a length direction of the second through hole is parallel to a line connecting the axes of the first lens barrel and the second lens barrel; the second lens barrel is inserted into the second through hole, and the second driving device is used for driving the second lens barrel and the second sensor to rotate along the first direction while driving the second lens barrel and the second sensor to move along the length direction of the second through hole, so that the images collected by the first sensor and the second sensor are partially overlapped or adjacent to each other; the length direction of the first through hole is parallel to a line connecting the axes of the first lens barrel and the second lens barrel; the length direction of the second through hole is parallel to a line connecting the axes of the first lens barrel and the second lens barrel.
8. A camera device, characterized in that: include: A first sub-camera device, the first sub-camera device comprising: a first lens barrel, a first sensor, a first bracket and a first driving device, the first lens barrel is connected to the first sensor, the first driving device is connected to the first lens barrel, and the first driving device is used to drive the first lens barrel and the first sensor to rotate along a first direction by a target angle; A second sub-camera device, the second sub-camera device comprising: a second lens barrel, a second sensor, a second bracket and a second driving device, the second lens barrel is connected to the second sensor, the second driving device is connected to the second lens barrel, and the second driving device is used to drive the second lens barrel and the second sensor to rotate along the first direction to a target angle; The first direction is a direction in which the long side of the captured image is in a horizontal position and the long side is in a vertical position after the rotation, or a direction in which the long side of the captured image is in a vertical position and the long side is in a horizontal position after the rotation; The camera device determines a stitching mode for stitching images captured by the camera device when it is determined that the scene of the target area captured by the camera device is the target scene. When the stitching mode does not match the target scene, the camera device controls a first sub-camera device and a second sub-camera device included in the camera device to rotate a target angle in a first direction, wherein the shooting areas of the first sub-camera device and the second sub-camera device are areas included in the target area, and the shooting areas of each sub-camera device are different; each sub-camera device is controlled to capture images to obtain a plurality of first images; and the plurality of first images are stitched according to a model matching the target scene to obtain a first stitched image; The first bracket is provided with a first through hole, the width of the first through hole is equal to the outer diameter of the first lens barrel, the length of the first through hole is greater than the outer diameter of the first lens barrel, and the length direction of the first through hole is parallel to the line connecting the axes of the first lens barrel and the second lens barrel; the first lens barrel is inserted into the first through hole, and the first driving device is used to drive the first lens barrel and the first sensor to rotate along the first direction while driving the first lens barrel and the first sensor to move along the length direction of the first through hole, so that the images collected by the first sensor and the second sensor are partially overlapped or adjacent to each other; the second bracket is provided with a second through hole, the width of the second through hole is equal to the outer diameter of the second ... The second lens barrel has an outer diameter equal to that of the first lens barrel, a length of the second through hole is greater than an outer diameter of the second lens barrel, and a length direction of the second through hole is parallel to a line connecting the axes of the first lens barrel and the second lens barrel; the second lens barrel is inserted into the second through hole, and the second driving device is used for driving the second lens barrel and the second sensor to rotate along the first direction while driving the second lens barrel and the second sensor to move along the length direction of the second through hole, so that the images collected by the first sensor and the second sensor are partially overlapped or adjacent to each other; the length direction of the first through hole is parallel to a line connecting the axes of the first lens barrel and the second lens barrel; the length direction of the second through hole is parallel to a line connecting the axes of the first lens barrel and the second lens barrel.
9. The imaging device according to claim 8, characterized in that The first driving device comprises: a first motor, a first worm and a first turbine, the first motor is drivingly connected to the first worm, the first worm is meshed with the first turbine, and the first turbine is connected to the first lens barrel; the first turbine is in an elliptical arc shape, the center of the first turbine is located on the axis of the first lens barrel, a first slide groove is provided on the spokes of the first turbine, the first slide groove is in an elliptical arc shape, the major axis of the ellipse where the elliptical arc corresponding to the first slide groove is located coincides with the major axis of the first turbine, and the minor axis of the ellipse where the elliptical arc corresponding to the first slide groove is located coincides with the minor axis of the first turbine; a first positioning column is provided on the first bracket, and the first positioning column is slidably arranged in the first slide groove; The second driving device includes: a second motor, a second worm and a second turbine, the second motor is drivingly connected to the second worm, the second worm is meshing with the second turbine, and the second turbine is connected to the second lens barrel; the second turbine is in the shape of an elliptical arc, the center of the second turbine is located on the axis of the second lens barrel, a second slide groove is provided on the spokes of the second turbine, the second slide groove is in the shape of an elliptical arc, the major axis of the ellipse corresponding to the second slide groove where the elliptical arc is located coincides with the major axis of the second turbine, and the minor axis of the ellipse corresponding to the second slide groove where the elliptical arc is located coincides with the minor axis of the second turbine; a second positioning column is provided on the second bracket, and the second positioning column is slidably disposed in the second slide groove.
10. The imaging device according to claim 9, characterized in that The first slide groove extends from the major axis of the ellipse where the corresponding elliptical arc is located to the adjacent minor axis; the second slide groove extends from the major axis of the ellipse where the corresponding elliptical arc is located to the adjacent minor axis.
11. The imaging device according to claim 8, characterized in that The first sensor is rectangular, and before the first driving device drives the first lens barrel and the first sensor to rotate along the first direction by a target angle, the long side of the first sensor is parallel to the width direction of the first through hole; the second sensor is rectangular, and before the second driving device drives the second lens barrel and the second sensor to rotate along the first direction by a target angle, the long side of the second sensor is parallel to the width direction of the second through hole.
12. The imaging device according to claim 8, wherein: The first sensor is rectangular, and before the first driving device drives the first lens barrel and the first sensor to rotate along the first direction to a target angle, the long side of the first sensor is parallel to the length direction of the first through hole; the second sensor is rectangular, and before the second driving device drives the second lens barrel and the second sensor to rotate along the first direction to a target angle, the long side of the second sensor is parallel to the length direction of the second through hole; wherein the first through hole is provided on the first bracket, and the second through hole is provided on the second bracket.
13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program is configured to execute the method according to any one of claims 1 to 6 when executed.
14. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to perform the method according to any one of claims 1 to 6.
15. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method described in any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Panoramic monitoring device
CN211406105U