Image processing method for 3D camera, and corresponding storage medium
By calculating parallax compensation parameters to perform parallax compensation processing on the left and right lens images of the 3D camera, the 3D consistency problem in the existing image stabilization process is solved, improving image processing quality and user experience.
Patent Information
- Application Number
- PCT/CN2024/116624
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-06-25
- Filing Date
- 2024-09-03
- Publication Date
- 2026-01-02
AI Technical Summary
Existing technologies cannot ensure 3D consistency between the left and right lens images while stabilizing 3D cameras, which not only leads to incorrect 3D experience for users, but can also cause physiological discomfort in severe cases.
By acquiring stabilized images from the left and right lenses at the same time frame, and combining the lens baseline, focal length, stabilized rotation angle, and camera distance, parallax compensation parameters are calculated and parallax compensation is performed to ensure that the images from the left and right lenses remain consistent during the stabilization process.
It achieves 3D consistency between the left and right camera images during image stabilization, improving image processing quality and the user's viewing experience.
Smart Images

Figure CN2024116624_02012026_PF_FP_ABST
Abstract
Description
Image processing method for 3D camera and corresponding storage medium TECHNICAL FIELD
[0001] The present application relates to the technical field of image processing, in particular to an image processing method and a storage medium. BACKGROUND
[0002] A 3D camera is a new type of camera that can capture 3D stereoscopic pictures. Unlike traditional single-lens cameras, a 3D camera has two completely identical lenses. When shooting, the two lenses will simultaneously and synchronously shoot the scene content, forming a set of left and right lens pictures or videos. Such pictures and videos containing left and right lens pictures can be further viewed through 3D glasses, 3D displays, VR headsets and other devices, so as to experience the real 3D effect. In order to ensure that the 3D effect viewed conforms to the human eye perspective, the distance between the two lenses of the 3D camera needs to be close to the average human eye pupil distance (about 65 mm).
[0003] For consumer cameras, because they often do not have professional stabilizers when shooting, the videos shot usually have various types of shaking, which affects the viewing experience of the videos. Therefore, video stabilization has become a necessary function. Video stabilization is to process the video pictures through image algorithms to eliminate picture shaking and keep the picture content stable. 3D cameras also need video stabilization, but because they have left and right lenses, the prior art cannot ensure that the 3D consistency of the left and right lens pictures is not destroyed while stabilizing. The parallax of the left and right lens pictures after stabilization will change compared to the original video parallax. There is no vertical parallax in the original video before stabilization, only horizontal parallax, and the parallax is constant in consecutive videos. However, in the video after stabilization, not only does additional vertical parallax appear, but the horizontal parallax also relatively decreases. Moreover, this parallax change is not fixed, but constantly changes according to the different stabilization degrees of each frame of picture. This constantly changing parallax fluctuation will bring the viewer an incorrect and inconsistent 3D feeling, and even cause physiological discomfort, seriously affecting the user's 3D viewing experience. TECHNICAL PROBLEM
[0004] The main purpose of the present application is to provide an image processing method, device and storage medium for a 3D camera, which aims to solve the problem that the prior art cannot ensure that the 3D consistency of the left and right lens pictures is not destroyed while stabilizing the 3D camera, resulting in incorrect 3D feeling of the user when viewing the 3D picture, and even causing physiological discomfort.
[0005] To achieve the above purpose, the present application provides an image processing method for a 3D camera, which is applied to an image acquisition device, the image acquisition device comprising a left lens and a right lens, and the method comprising:
[0006] obtaining a left anti-shake picture of the left lens and a right anti-shake picture of the right lens in the same time frame;
[0007] obtaining a lens baseline, a lens focal length, an anti-shake rotation angle and a photographing distance of the image acquisition device; wherein the anti-shake rotation angle is determined based on a deflection angle of a photographed object in the left lens and the right lens relative to a corresponding lens center when the image acquisition device generates shaking; and the photographing distance is a distance between a photographed object and the lens corresponding to a photographed picture;
[0008] substituting the camera focal length, the baseline length and the distance between the camera and the photographed object into a preset parallax change formula to calculate a parallax change parameter, wherein the preset parallax change formula is: , wherein, is a horizontal parallax change amount, is a vertical parallax change amount; f is the camera focal length, b is the baseline length, is the anti-shake rotation angle, and D is the photographing distance;
[0009] the left anti-shake picture moves away from the right anti-shake picture by the horizontal parallax change amount in the horizontal direction; and the left anti-shake picture moves close to the right anti-shake picture by the vertical parallax change amount in the vertical direction.
[0010] To achieve the above object, the present application further provides an image processing method for a 3D camera, which is applied to an image acquisition device including a left lens and a right lens, and the method comprises:
[0011] obtaining a left anti-shake picture of the left lens and a right anti-shake picture of the right lens in the same time frame;
[0012] obtaining a lens baseline, a lens focal length, an anti-shake rotation angle and a photographing distance of the image acquisition device;
[0013] determining image parallax compensation parameters of the left lens and the right lens based on the lens baseline, the lens focal length, the anti-shake rotation angle and the photographing distance of the image acquisition device;
[0014] performing parallax compensation processing on the left anti-shake picture and the right anti-shake picture based on the image parallax compensation parameters.
[0015] In addition, to achieve the above object, the present application further provides a computer readable storage medium, which stores an image processing program, and the image processing program, when executed by a processor, implements the steps of the image processing method as described above.
[0016] The application provides an image processing method for a 3D camera and a computer readable storage medium. BRIEF DESCRIPTION OF DRAWINGS BRIEF DESCRIPTION OF DRAWINGS
[0017] Fig. 1 is a system structure schematic diagram of a hardware running environment related to an embodiment of the application;
[0018] Fig. 2 is a flowchart of an embodiment of the image processing method of the application;
[0019] Fig. 3 is a schematic diagram of image disparity variation in an embodiment of the image processing method of the application;
[0020] Fig. 4 is an example diagram of left and right lens picture disparity in an embodiment of the image processing method of the application;
[0021] Fig. 5 is an example diagram of black edge phenomenon and black edge cutting in an embodiment of the image processing method of the application;
[0022] Fig. 6 is an example diagram of left and right lens picture black edge cutting in an embodiment of the image processing method of the application. BEST MODE FOR CARRYING OUT THE INVENTION
[0023] It should be understood that the specific embodiments described herein merely set forth preferred combinations of components and / or other features, and that persons of ordinary skill in the art will be able to make various changes and modifications to the preferred embodiments without departing from the scope of the application, which is defined by the claims and their equivalents.
[0024] The technical solutions in the embodiments of the application will be clearly and completely described below with reference to the drawings in the embodiments of the application. Obviously, the described embodiments are only a part of the embodiments of the application, rather than all the embodiments of the application. Based on the embodiments in the application, all the other embodiments obtained by a person of ordinary skill in the art without creative work fall within the protection scope of the application.
[0025] In the prior art, 3D consistency of left and right lens pictures cannot be ensured not to be destroyed while the 3D camera is anti-shaking, which leads to incorrect 3D feeling of a user when the user watches 3D pictures, and even serious physiological discomfort.
[0026] In order to solve the above technical problems, the present application provides an image processing method for a 3D camera, in which the left anti-shake picture of a left lens and the right anti-shake picture of a right lens of the same time frame are acquired; the lens baseline, the lens focal length, the anti-shake rotation angle and the photographing distance of the image acquisition device are acquired; the image disparity compensation parameters of the left lens and the right lens are determined based on the lens baseline, the lens focal length, the anti-shake rotation angle and the photographing distance of the image acquisition device; and the left anti-shake picture and the right anti-shake picture are subjected to disparity compensation processing based on the image disparity compensation parameters. In this way, the picture disparity of the left lens and the right lens is identified while anti-shake is realized, and the left anti-shake picture and the right anti-shake picture are subjected to compensation processing, so that the picture disparity of the two is eliminated, the picture consistency is ensured not to be damaged, the image processing quality and effect are improved, and the viewing experience is improved.
[0027] As shown in Fig. 1, Fig. 1 is a system structure diagram of a hardware running environment related to an embodiment of the present application.
[0028] The terminal of the embodiment of the present application can be a terminal device with computing capability, can also be a PC, and can further be a smart phone, a tablet computer, an e-book reader, an MP3 (Moving Picture Experts Group Audio Layer III) player, an MP4 (Moving Picture Experts Group Audio Layer IV) player, a portable computer and other movable terminal devices with display function.
[0029] As shown in Fig. 1, the terminal can include a processor 1001 such as a CPU, a network interface 1004, a user interface 1003, a memory 1005 and a communication bus 1002. The communication bus 1002 is used to realize the connection and communication among the components. The user interface 1003 can include a display screen (Display) and an input unit such as a keyboard (Keyboard). The optional user interface 1003 can further include a standard wired interface and a wireless interface. The network interface 1004 can optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 can be a high-speed RAM memory or a stable memory (non-volatile memory) such as a disk memory. The memory 1005 can optionally be a storage device independent of the aforementioned processor 1001.
[0030] Optionally, the terminal can further include a camera, an RF (Radio Frequency) circuit, a sensor, an audio circuit, a WiFi module, and the like. The sensor can include, for example, a light sensor, a motion sensor, and other sensors. Specifically, the light sensor can include an ambient light sensor and a proximity sensor, wherein the ambient light sensor can adjust the brightness of the display screen according to the brightness of ambient light, and the proximity sensor can turn off the display screen and / or backlight when the terminal is moved to the ear. As one of the motion sensors, the gravity acceleration sensor can detect the size of acceleration in each direction (generally three axes), and can detect the size and direction of gravity when at rest, and can be used for identifying the posture of the terminal (such as switching between horizontal and vertical screens, related games, magnetometer posture calibration), vibration identification related functions (such as pedometers, tapping), and the like. Of course, the terminal can also be configured with a gyroscope, a barometer, a hygrometer, a thermometer, an infrared sensor, and other sensors, which will not be described here.
[0031] Those skilled in the art can understand that the terminal structure shown in FIG. 1 does not constitute a limitation on the terminal, and can include more or fewer components than shown, or combine certain components, or different component arrangements.
[0032] As shown in FIG. 1, the memory 1005 as a computer storage medium can include an operating system, a network communication module, a user interface module, and an image processing program.
[0033] In the terminal shown in FIG. 1, the network interface 1004 is mainly used to connect to a background server and communicate data with the background server; the user interface 1003 is mainly used to connect to a client (user end) and communicate data with the client; and the processor 1001 can be used to call the image processing program stored in the memory 1005 and perform the following operations:
[0034] obtaining a left anti-shake picture of a left lens and a right anti-shake picture of a right lens of the same time frame;
[0035] obtaining a lens baseline, a lens focal length, an anti-shake rotation angle, and a photographing distance of the image acquisition device;
[0036] determining an image parallax compensation parameter of the left lens and the right lens based on the lens baseline, the lens focal length, the anti-shake rotation angle, and the photographing distance of the image acquisition device;
[0037] performing parallax compensation processing on the left anti-shake picture and the right anti-shake picture based on the image parallax compensation parameter.
[0038] Referring to FIG. 2, FIG. 2 is a flowchart of an embodiment of the image processing method, and in some embodiments, the image processing method includes:
[0039] Step S10, acquiring a left anti-shake picture of the left lens and a right anti-shake picture of the right lens of the same time frame.
[0040] The image processing method of the present application can be applied to the image collected by a 3D camera, the left lens and the right lens are two lenses of the 3D camera, and can be applied to the processing of the photo collected by the 3D camera and the processing of the video data collected by the 3D camera. The processing object is the left anti-shake picture of the left lens and the right anti-shake picture of the right lens of the same time frame each time. The anti-shake picture refers to the image picture after the image is processed by anti-shake.
[0041] Step S20, acquiring the lens baseline, lens focal length, anti-shake rotation angle and imaging distance of the image collection device.
[0042] As shown in FIG. 3, which is the image parallax change diagram in the embodiment of the image processing method of the present application. As shown, the baseline refers to the line connecting the lens centers of the left lens and the right lens of the camera. The anti-shake rotation angle refers to the deflection angle of the object photographed in the left lens and the right lens of the camera relative to the lens center when the camera is shaken, which is the included angle θ as shown. The length of the current camera baseline can be acquired by measuring the length of the line connecting the lens centers of the left lens and the right lens of the camera (or directly reading the fixed parameter of the baseline length of the camera, which is fixed when the camera is manufactured); the imaging distance is the distance D between the main object of the photographed picture and the lens.
[0043] Step S30, determining the image parallax compensation parameters of the left lens and the right lens based on the lens baseline, lens focal length, anti-shake rotation angle and imaging distance of the image collection device.
[0044] The parallax compensation parameter of the image refers to a parameter for compensating the parallax of the image. The 3D camera needs to additionally ensure that the 3D consistency of the left and right lens pictures is not destroyed while being anti-shake. Otherwise, the user will have an incorrect 3D experience when watching the 3D picture, and even a physiological discomfort. The so-called 3D consistency simply needs to ensure that the parallax of the left and right lenses is consistent with the parallax of the original video before anti-shake. The parallax refers to the difference in the positions of the objects in the left and right lens pictures. As shown in FIG. 3, the parallax of the left and right lens pictures after anti-shake will change compared with the parallax of the original video. There is no vertical parallax in the original video before anti-shake, only horizontal parallax, and the parallax is constant in the continuous video. However, in the video after anti-shake, not only the additional vertical parallax appears, but also the horizontal parallax relatively decreases. Moreover, the parallax change is not fixed, but changes constantly according to the anti-shake degree of each frame picture. The constantly changing parallax fluctuation will bring the viewer an incorrect and inconsistent 3D experience, and even a physiological discomfort, which seriously affects the 3D viewing experience of the user. As shown in FIG. 4, which is an example diagram of the parallax of the left and right lens pictures in the embodiment of the image processing method of the application, when we superimpose the left and right lens pictures together, it can be found that the objects of the left and right lenses cannot perfectly coincide, and the distance between them is the parallax. The objects at different distances from the camera lens have different parallaxes, which conforms to the law that the near is large and the far is small, and tends to zero at infinity. People produce 3D experience through parallax, and the consistency and stability of the parallax ensure the correctness and comfort of the 3D experience.
[0045] In this step, the image parallax compensation parameter for compensating the above parallax is calculated by the lens baseline, lens focal length, anti-shake rotation angle and imaging distance obtained in step S20.
[0046] Specifically, in some embodiments, step S30 includes:
[0047] In step S31, the camera focal length, baseline length and distance between the camera and the shooting object are substituted into a preset parallax change formula to calculate the parallax change parameter, wherein the preset parallax change formula is:
[0048] , wherein, is the horizontal parallax change amount, is the vertical parallax change amount; f is the camera focal length, b is the baseline length, is the anti-shake rotation angle, and D is the imaging distance.
[0049] As shown in FIG. 3, the line connecting the centers of the left and right lenses is called the camera baseline, and the baseline length is denoted as Before anti-shake, the left and right lens pictures only have horizontal parallax. According to the parallax formula, the horizontal parallax can be obtained as:
[0050] wherein is the parallax, is the camera focal length, is the object distance from the camera.
[0051] After the anti-shake, the left and right lens pictures change, and when calculating the lens shake, the change angle of the left and right lens pictures with the rotation of the center of the left and right lenses is , that is, the anti-shake rotation angle, and if it is set that
[0052] Through the parallax formula, it can be obtained that the horizontal and vertical parallax after the anti-shake is:
[0053] Compared with before the anti-shake, the horizontal and vertical parallax changes are:
[0054] In the calculation of the above formula, the camera baseline length and the object distance from the camera will take the actual distance unit (such as meters), and the camera focal length will take the equivalent pixel distance. The parallax change calculated in this way is also in the unit of pixel distance. According to the horizontal parallax change amount h and the vertical parallax change amount v , the parallax compensation parameters are determined, and in some embodiments, the horizontal parallax change amount and the vertical parallax change amount can be directly used as the parallax compensation parameters.
[0055] In the above image processing method, the preset parallax change formula is used to calculate the horizontal and vertical parallax change amounts respectively, which are used as the parallax compensation parameters, so that the parallax change of the image can be accurately determined, and then the parallax compensation parameters can be accurately determined, so that the image can be accurately compensated based on the calculation result.
[0056] In some embodiments, step S30 can further include:
[0057] Step S32, determining the real-time distance gear based on the shooting distance and the preset distance gear;
[0058] Step S33, determining the image parallax compensation parameter according to the corresponding relationship between the real-time distance gear, the real-time anti-shake rotation angle and the preset distance gear.
[0059] In the specific implementation of the image processing method of the present application, the object distance from the camera is not a fixed value, so that the parallax compensation amount The parallax compensation is different for different distances. To achieve perfect parallax compensation, the distance of each object in the image needs to be calculated, and different parallax compensations need to be applied respectively, which is very difficult and time-consuming in practice. Therefore, we adopt a compromise solution: we first determine different distance levels, such as close distance (1 meter), medium distance (5 meters), and far distance (10 meters to infinity), and then the user selects the appropriate distance level according to the distance of the subject content being shot, and finally calculates the parallax compensation amount corresponding to the distance and applies it to the video after anti-shake. In this way, the parallax compensation can be quickly calculated based on the approximate distance of the subject content. Since the user's observation focus is on the subject content and the surrounding objects of the subject content, distance estimation and image parallax compensation parameter calculation for all objects in the specific image are not required here, and the horizontal parallax change and the vertical parallax change (image parallax compensation parameters) of the entire image can be directly set based on the distance level.
[0060] In the above image processing method, the real-time distance level is determined based on the shooting distance and the preset distance level; and the image parallax compensation parameters are determined according to the corresponding relationship between the real-time distance level, the real-time anti-shake rotation angle, and the preset distance level. Through the above method, the calculation and processing of the horizontal parallax change and the vertical parallax change can be simplified, the processing efficiency is improved while the accuracy of the result is ensured.
[0061] Step S40, performing parallax compensation processing on the left anti-shake picture and the right anti-shake picture based on the image parallax compensation parameters.
[0062] In some embodiments, step S40 includes:
[0063] Step S41, moving the left anti-shake picture away from the right anti-shake picture by the horizontal parallax change in the horizontal direction; and moving the left anti-shake picture closer to the right anti-shake picture by the vertical parallax change in the vertical direction.
[0064] Specifically, in specific implementation, for the left and right lens pictures after anti-shake, we respectively apply the opposite movement of the pixel value in the horizontal direction, so as to compensate the horizontal parallax to the original parallax value ; and we respectively apply the opposite movement of the pixel value in the vertical direction, so as to eliminate the vertical parallax to 0. Through the above method, parallax compensation in the vertical and horizontal directions is achieved, the image parallax is accurately eliminated, and the image processing effect is improved.
[0065] In the image processing method, the left anti-shake picture of the left lens and the right anti-shake picture of the right lens of the same time frame are acquired; the lens baseline, the lens focal length, the anti-shake rotation angle and the photographing distance of the image acquisition device are acquired; the image parallax compensation parameter of the left lens and the right lens is determined based on the lens baseline, the lens focal length, the anti-shake rotation angle and the photographing distance of the image acquisition device; and the left anti-shake picture and the right anti-shake picture are subjected to parallax compensation processing based on the image parallax compensation parameter. In this way, the picture parallax of the left lens and the right lens is identified while anti-shake is implemented, and the left anti-shake picture and the right anti-shake picture are subjected to compensation processing, so that the picture parallax of the two is eliminated, the picture consistency is ensured not to be damaged, the image processing quality and effect are improved, and the viewing experience is improved.
[0066] In some embodiments, step S40 is preceded by:
[0067] Step S50, cutting the black edges of the images of the left lens and the right lens respectively to obtain the maximum inscribed rectangular images.
[0068] Video anti-shake needs to consider black edge cutting. As shown in FIG. 5, which is an example diagram of black edge phenomenon and black edge cutting in the image processing method embodiment of the application, the so-called black edge is that some invalid areas are generated at the edges of the video after anti-shake, which are parts outside the original video that are not shot. These parts are usually filled with black edges. The reason for the generation of black edges is that the anti-shake algorithm changes the video picture, producing effects similar to rotation and translation, so that the content outside the picture enters the video after anti-shake. Black edge cutting is a further cutting of the anti-shake picture with black edges to output a video picture without black edges to the user, as shown by the dashed box in FIG. 3. Black edge cutting will lose part of the picture content, resulting in an output picture resolution lower than the original picture resolution. Therefore, the cutting picture ratio should not be too large. Generally, the maximum inscribed rectangle of the non-black edge area is selected as the output picture size.
[0069] Specifically, step S50 includes:
[0070] Step S51, determining the black edge area of each anti-shake image respectively;
[0071] Step S52, taking the union of each black edge area to obtain the black edge area union;
[0072] Step S53, determining the maximum inscribed rectangular image of each anti-shake image based on the black edge area union.
[0073] Specifically, as shown in FIG. 6, FIG. 6 is an example diagram of black edge cutting of left and right lens pictures in the image processing method of the present application. In 3D video anti-shake, pictures of the left and right lenses will all produce black edges, so black edge cutting needs to be performed on both. In order to ensure consistency of 3D parallax, the picture size of the left and right lens cutting needs to be kept completely consistent, otherwise the left and right pictures will produce an additional increment in the horizontal or vertical direction on the basis of the original parallax, causing parallax deviation. First, the black edge regions of the left anti-shake picture and the right anti-shake picture of the left and right lenses are determined, then the black edge regions of the left and right lenses are taken as a union, and then the largest inscribed rectangle (the rectangle shown by the dashed line in FIG. 6) in the effective picture remaining after the black edge union is selected as the output picture size of the left and right lenses.
[0074] In step S60, the 3D image is synthesized based on the largest inscribed rectangle images of the left lens and the right lens.
[0075] After the largest inscribed rectangle images of the left lens and the right lens are obtained based on the above steps, 3D image synthesis processing is performed based on the two largest inscribed rectangle images of the left lens and the right lens, and a processed 3D image is obtained.
[0076] In the above image processing method, the black edges of the images of the left lens and the right lens are cut to obtain the largest inscribed rectangle images; the 3D image is synthesized based on the largest inscribed rectangle images of the left lens and the right lens, specifically by determining the black edge regions of the anti-shake pictures of each lens; the union of the black edge regions is obtained; and the largest inscribed rectangle images of each anti-shake picture are determined based on the union of the black edge regions. Through the above cutting method of taking the union of the left and right anti-shake pictures, the picture size can be kept consistent, additional picture parallax can be avoided, the cutting picture size can be prevented from being too large to affect the image resolution, and thus the image processing effect and quality are improved.
[0077] In addition, the present application also provides a computer readable storage medium.
[0078] The image processing program is stored on the computer readable storage medium of the present application, and when the image processing program is executed by the processor, the steps of the above image processing method are realized.
[0079] The method realized when the image processing program running on the processor is executed can refer to the embodiments of the image processing method of the present application, and will not be described here.
[0080] It should be noted that, in this document, the terms "comprises", "comprising", or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but can also include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element preceded by "comprises... a" does not, without more constraints, foreclose the existence of additional identical elements in the process, method, article, or system that comprises the recited element.
[0081] The above-mentioned embodiment numbers of the present application are only for description, and do not represent the advantages and disadvantages of the embodiments.
[0082] From the above description of the embodiments, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be realized by means of software and the necessary general hardware platform, and of course, they can also be realized by hardware, but in many cases, the former is a better embodiment. Based on such understanding, the technical solutions of the present application can be embodied in the form of a software product, which is stored in a storage medium (such as a ROM / RAM, a magnetic disk, or an optical disk) as described above, and includes a number of instructions for making a terminal device (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) execute the methods described in the various embodiments of the present application.
[0083] The above is only the preferred embodiment of the present application, and does not limit the patent scope of the present application, and any equivalent structure or equivalent process transformation, or direct or indirect application in other related technical fields, is also included in the patent protection scope of the present application.
Claims
1. An image processing method for a 3D camera, applied to an image acquisition device, the image acquisition device including a left lens and a right lens, the method comprising: Acquire the left stabilized image of the left camera and the right stabilized image of the right camera at the same time frame. The lens baseline, lens focal length, image stabilization rotation angle, and camera distance of the image acquisition device are obtained; wherein the image stabilization rotation angle is determined based on the deflection angle of the objects in the left and right lenses relative to the corresponding lens centers when the image acquisition device shakes; and the camera distance is the distance between the subject of the captured image and the lens. The parallax change parameters are calculated by substituting the camera focal length, baseline length, and distance between the camera and the subject into a preset parallax change formula, wherein the preset parallax change formula is: ,in, This represents the change in horizontal parallax. ρ is the vertical parallax variation; f is the camera focal length; b is the baseline length. The rotation angle is for image stabilization; D is the camera distance. The left stabilized image moves away from the right stabilized image in the horizontal direction by the horizontal parallax change amount; the left stabilized image moves closer to the right stabilized image in the vertical direction by the vertical parallax change amount.
2. The image processing method as described in claim 1, wherein the method further comprises: The real-time distance setting is determined based on the camera distance and the preset distance setting; The image parallax compensation parameters are determined based on the correspondence between the real-time distance level, the real-time anti-shake rotation angle, and the preset distance level.
3. The image processing method as described in claim 1, wherein the method further comprises: The black borders are cropped from the images of the left and right lenses respectively to obtain the largest inscribed rectangle image; A 3D image is synthesized based on the maximum inscribed rectangle images of the left and right lenses.
4. The image processing method as described in claim 3, wherein the step of cropping the black borders of the images from the left lens and the right lens respectively to obtain the maximum inscribed rectangle image includes: Determine the black border area of the image stabilized for each lens separately; Take the union of each black border region to obtain the union of black border regions; The maximum inscribed rectangle image of each of the image stabilization images is determined based on the union of the black border regions.
5. An image processing method for a 3D camera, applied to an image acquisition device, the image acquisition device including a left lens and a right lens, the method comprising: Acquire the left stabilized image of the left camera and the right stabilized image of the right camera at the same time frame. Acquire the lens baseline, lens focal length, image stabilization rotation angle, and camera distance of the image acquisition device; The image parallax compensation parameters for the left and right lenses are determined based on the lens baseline, lens focal length, image stabilization rotation angle, and camera distance of the image acquisition device. Based on the image parallax compensation parameters, parallax compensation processing is performed on the left stabilized image and the right stabilized image.
6. The image processing method as described in claim 5, wherein the method for obtaining the anti-shake rotation angle includes: The anti-shake rotation angle is determined based on the deflection angle of the objects in the left and right lenses relative to the center of the corresponding lenses when the image acquisition device shakes.
7. The image processing method as described in claim 5, wherein the camera distance is the distance between the subject being photographed and the lens corresponding to the captured image.
8. The image processing method as described in claim 5, wherein the step of determining the image parallax compensation parameters between the left lens and the right lens based on the lens baseline, lens focal length, image stabilization rotation angle, and camera distance of the image acquisition device includes: The parallax change parameters are calculated by substituting the camera focal length, baseline length, and distance between the camera and the subject into a preset parallax change formula, wherein the preset parallax change formula is: ,in, This represents the change in horizontal parallax. ρ is the vertical parallax variation; f is the camera focal length; b is the baseline length. The rotation angle is for image stabilization, and D is the camera distance.
9. The image processing method as described in claim 5, wherein the step of performing parallax compensation processing on the left stabilized image and the right stabilized image based on the image parallax compensation parameters includes: The left stabilized image moves away from the right stabilized image in the horizontal direction by the horizontal parallax change amount; The left stabilized image moves closer to the right stabilized image in the vertical direction by the amount of vertical parallax change.
10. The image processing method of claim 5, wherein the step of determining the image parallax compensation parameters of the left lens and the right lens based on the stabilization rotation angle and the camera distance includes: The real-time distance setting is determined based on the camera distance and the preset distance setting; The image parallax compensation parameters are determined based on the correspondence between the real-time distance level, the real-time anti-shake rotation angle, and the preset distance level.
11. The image processing method of claim 5, wherein the step of performing parallax compensation processing on the images of the left lens and the right lens based on the image parallax compensation parameters includes, after: The black borders are cropped from the images of the left and right lenses respectively to obtain the largest inscribed rectangle image; A 3D image is synthesized based on the maximum inscribed rectangle images of the left and right lenses.
12. The image processing method of claim 11, wherein the step of cropping the black borders of the images from the left lens and the right lens respectively to obtain the maximum inscribed rectangle image includes: Determine the black border area of the image stabilized for each lens separately; Take the union of each black border region to obtain the union of black border regions; The maximum inscribed rectangle image of each of the image stabilization images is determined based on the union of the black border regions.
13. A computer-readable storage medium storing an image processing program that, when executed by a processor, implements the steps of the image processing method as claimed in claim 1.
Citation Information
Patent Citations
Compensation method and device for optical axis deviation of anti-shake movement and storage medium
CN109788277A
Method and device for compensating offset of optical anti-shake lens and storage medium
CN112118386A
Image processing method and device, electronic equipment and readable storage medium
CN115278071A
Anti-shake method for binocular camera
CN117998205A