Optical axis offset correction method and device, electronic equipment, storage medium and program product

By calculating and cropping the display screen, adjusting the optical axis offset during optical zooming based on the optical axis offset function, the problems of low smoothness and insufficient reliability correction during optical zooming are solved, and the optical axis offset correction is realized The smooth and reliable correction of axis offset improves video quality and user experience.

CN119421056APending Publication Date: 2025-02-11VALUEHD CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411435753.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-15
Publication Date
2025-02-11

AI Technical Summary

Technical Problem

During optical zooming, the camera's optical axis may be offset, causing the close-up target to be unable to always be in the center of the picture, affecting the video quality and user experience. The prior art compensation methods have problems with low smoothness and insufficient reliability.

Method used

By obtaining the resolution, optical axis offset function and maximum optical axis offset of the target camera, the display resolution of the display screen is calculated, and the light corresponding to each step of optical zoom is calculated based on the optical axis offset function during the optical zoom process. Axis offset and cut out the corresponding display screen from the shooting screen for display to correct the optical axis offset.

Benefits of technology

It achieves smooth and reliable correction of optical axis offset, avoids jitter and wear problems caused by mechanical movement, ensures that the close-up target is always in the center of the picture, and improves video quality and user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119421056A_ABST
    Figure CN119421056A_ABST
Patent Text Reader

Abstract

The invention discloses an optical axis offset correction method and device, electronic equipment, a storage medium and a program product, and relates to the technical field of cameras. The optical axis offset correction method comprises the following steps: acquiring the resolution, the optical axis offset function and the maximum optical axis offset of a target camera; calculating the display resolution of the display picture according to the resolution and the maximum optical axis offset; in the optical zooming process of the target camera, the optical axis offset corresponding to each step of optical zooming is calculated based on the optical axis offset function, and the optical axis offset corresponding to each step of optical zooming is calculated according to the optical axis offset corresponding to each step of optical zooming and the display resolution. And cutting out a display picture corresponding to each step of optical zooming from the shot picture of the target camera for displaying so as to correct the optical axis offset of the target camera. According to the invention, smooth and reliable optical axis offset correction can be realized in the optical zooming process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of camera technology, and in particular to an optical axis offset correction method, device, electronic device, storage medium and program product. Background Art

[0002] With the development of digital camera technology, users have higher and higher requirements for video quality and user experience. During video shooting, the optical zoom function is widely used in various camera devices because it does not lose resolution. However, due to the limitations of lens design and manufacturing process, when taking close-up photos through optical zoom, the optical axis of the camera may shift, resulting in the close-up target not always being in the center of the picture. This phenomenon not only affects the quality of the video, but also reduces the user's shooting experience.

[0003] At present, the industry generally adopts two methods to compensate for the optical axis offset caused by zooming. One method is to correct the offset by physically moving the lens; the other method is to compensate by fine-tuning the position of the image sensor. However, both methods have their own shortcomings. For the method of physically moving the lens, although it can effectively correct the optical axis offset, in actual applications, the mechanical movement of the lens may cause obvious jitter or jump in the picture, especially when zooming quickly. For the method of fine-tuning the image sensor, although the problem of mechanical wear is avoided, due to the limited movement range of the sensor, when the optical axis offset is large, this method cannot ensure that the close-up target is always in the center of the picture.

[0004] In view of the above problems, a new method is urgently needed to smoothly and reliably realize the correction of optical axis offset during optical zooming. Summary of the invention

[0005] The main purpose of the present application is to provide a method, device, electronic device, storage medium and program product for correcting an optical axis offset, aiming to solve the technical problems of low smoothness and insufficient reliability of optical axis offset correction during optical magnification.

[0006] To achieve the above object, the present application provides a method for correcting an optical axis offset, the method comprising:

[0007] Obtain the resolution, optical axis offset function and maximum optical axis offset of the target camera;

[0008] Calculating the display resolution of the display image according to the resolution and the maximum optical axis offset;

[0009] During the process of optical magnification of the target camera, the optical axis offset corresponding to each step of optical magnification is calculated based on the optical axis offset function, and according to the optical axis offset corresponding to each step of optical magnification and the display resolution, the display picture corresponding to each step of optical magnification is cropped from the shooting picture of the target camera for display, so as to correct the optical axis offset of the target camera.

[0010] In one embodiment, the resolution includes an output resolution, the output resolution includes an output horizontal pixel amount and an output vertical pixel amount, the maximum optical axis offset is a maximum optical axis offset corresponding to the output resolution, and the maximum optical axis offset corresponding to the output resolution includes a maximum horizontal optical axis offset and a maximum vertical optical axis offset corresponding to the output resolution;

[0011] The step of calculating the display resolution of the display picture according to the resolution and the maximum optical axis offset comprises:

[0012] The display horizontal pixel quantity is obtained by subtracting the maximum horizontal optical axis offset corresponding to twice the output resolution from the output horizontal pixel quantity;

[0013] The display vertical pixel quantity is obtained by subtracting the maximum vertical optical axis offset corresponding to twice the output resolution from the output vertical pixel quantity;

[0014] The display horizontal pixel quantity and the display vertical pixel quantity are used as the display resolution of the display picture.

[0015] In one embodiment, the optical axis offset function is an optical axis offset function corresponding to the output resolution, and the captured image of the target camera is an output image corresponding to the output resolution;

[0016] The step of calculating the optical axis offset corresponding to each step of the optical zooming based on the optical axis offset function during the optical zooming of the target camera, and cropping the display picture corresponding to each step of the optical zooming from the captured picture of the target camera for display according to the optical axis offset corresponding to each step of the optical zooming and the display resolution, so as to correct the optical axis offset of the target camera, comprises:

[0017] During the process of optical magnification of the target camera, the horizontal optical axis offset and the vertical optical axis offset corresponding to each step of optical magnification at the output resolution are calculated based on the optical axis offset function corresponding to the output resolution, and according to the horizontal optical axis offset and the vertical optical axis offset corresponding to each step of optical magnification at the output resolution and the display resolution, the display picture corresponding to each step of optical magnification at the output resolution is cropped from the output picture for display, so as to correct the optical axis offset of the target camera.

[0018] In one embodiment, the step of cropping a display picture corresponding to each step of optical zoom at the output resolution from the output picture for display according to the horizontal optical axis offset and the vertical optical axis offset corresponding to each step of optical zoom at the output resolution and the display resolution, so as to correct the optical axis offset of the target camera, comprises:

[0019] Determine the pixel coordinates of the center point of the display image corresponding to each step of optical zoom at the output resolution according to the horizontal optical axis offset and the vertical optical axis offset corresponding to each step of optical zoom at the output resolution;

[0020] According to the center point pixel coordinates, the display horizontal pixel quantity and the display vertical pixel quantity, a display picture corresponding to each step of optical zoom at the output resolution is cropped from the output picture for display, so as to correct the optical axis offset of the target camera.

[0021] In one embodiment, the resolution further includes native resolution, and the step of obtaining the resolution, optical axis offset function and maximum optical axis offset of the target camera includes:

[0022] Obtaining a native resolution and an output resolution of the target camera, and calculating a ratio between the native resolution and the output resolution;

[0023] The optical axis offset function and the maximum optical axis offset corresponding to the native resolution are obtained, and the optical axis offset function and the maximum optical axis offset corresponding to the output resolution are calculated based on the ratio.

[0024] In one embodiment, the resolution includes a native resolution and an output resolution, the optical axis offset function is an optical axis offset function corresponding to the native resolution, the maximum optical axis offset is a maximum optical axis offset corresponding to the native resolution, and the captured image of the target camera is a native image corresponding to the native resolution;

[0025] The step of calculating the display resolution of the display picture according to the resolution and the maximum optical axis offset comprises:

[0026] Calculating the display resolution of the display picture according to the native resolution and the maximum optical axis offset corresponding to the native resolution;

[0027] The step of calculating the optical axis offset corresponding to each step of the optical zooming based on the optical axis offset function during the optical zooming of the target camera, and cropping the display picture corresponding to each step of the optical zooming from the captured picture of the target camera for display according to the optical axis offset corresponding to each step of the optical zooming and the display resolution, so as to correct the optical axis offset of the target camera, comprises:

[0028] Calculating a ratio between the native resolution and the output resolution;

[0029] During the process of optical magnification of the target camera, the optical axis offset corresponding to each step of optical magnification at the native resolution is calculated based on the optical axis offset function corresponding to the native resolution, and according to the optical axis offset corresponding to each step of optical magnification at the native resolution and the display resolution, the display image corresponding to each step of optical magnification is cropped from the native image, and the display image is downsampled according to the ratio to obtain the target image corresponding to each step of optical magnification at the output resolution for display, so as to correct the optical axis offset of the target camera.

[0030] In addition, to achieve the above-mentioned purpose, the present application also provides an optical axis deviation correction device, the optical axis deviation correction device comprising:

[0031] A data acquisition module is used to obtain the resolution, optical axis offset function and maximum optical axis offset of the target camera;

[0032] A resolution calculation module, used to calculate the display resolution of the display picture according to the resolution and the maximum optical axis offset;

[0033] The optical axis offset correction module is used to calculate the optical axis offset corresponding to each step of optical zoom based on the optical axis offset function during the process of optical zooming of the target camera, and to crop the display image corresponding to each step of optical zoom from the shooting image of the target camera according to the optical axis offset corresponding to each step of optical zoom and the display resolution for display, so as to correct the optical axis offset of the target camera.

[0034] In addition, to achieve the above-mentioned purpose, the present application also provides an electronic device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the computer program is executed by the processor, the steps of the optical axis offset correction method as described above are implemented.

[0035] In addition, to achieve the above-mentioned purpose, the present application also provides a storage medium, which is a computer-readable storage medium, and a computer program is stored on the computer-readable storage medium. When the computer program is executed by a processor, the steps of the optical axis offset correction method as described above are implemented.

[0036] In addition, to achieve the above-mentioned purpose, the present application also provides a program product, which is a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the steps of the optical axis offset correction method as described above are implemented.

[0037] The embodiments of the present application provide a method, device, electronic device, storage medium and program product for correcting an optical axis offset. The technical solution of the embodiments of the present application is to first obtain the resolution, optical axis offset function and maximum optical axis offset of the target camera, and then calculate the display resolution of the display picture based on the resolution and the maximum optical axis offset. Finally, in the process of optical zooming of the target camera, the optical axis offset corresponding to each step of optical zooming is calculated based on the optical axis offset function, and according to the optical axis offset and display resolution corresponding to each step of optical zooming, the display picture corresponding to each step of optical zooming is cropped from the captured picture of the target camera for display, so as to correct the optical axis offset of the target camera, so that the present application can be independent of mechanical devices such as physically moving lenses or sensors, effectively avoiding mechanical wear and potential jitter problems, and dynamically cropping and adjusting the display picture through software to cope with the optical axis offset during the optical zooming process, and realize smooth and reliable optical axis offset correction, thereby effectively solving the technical problems of low smoothness and insufficient reliability of optical axis offset correction during the optical zooming process. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0039] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the structures shown in these drawings without paying any creative work.

[0040] Figure 1 A schematic diagram of a flow chart of a first embodiment of the optical axis offset correction method of the present application;

[0041] Figure 2 A schematic diagram of a flow chart provided for the second embodiment of the optical axis offset correction method of the present application;

[0042] Figure 3 A schematic diagram of a flow chart provided for the third embodiment of the optical axis offset correction method of the present application;

[0043] Figure 4 This is a schematic diagram of the module structure of the optical axis offset correction device according to an embodiment of the present application;

[0044] Figure 5 Schematic diagram of the device structure of the hardware operating environment involved in the optical axis offset correction method in the embodiment of the present application.

[0045] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0046] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0047] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.

[0048] At present, the optical axis offset correction method in the related art has technical problems of low smoothness and insufficient reliability during the close-up process of optical zoom.

[0049] The main solution of the embodiment of the present application is: obtaining the resolution, optical axis offset function and maximum optical axis offset of the target camera; calculating the display resolution of the display image based on the resolution and the maximum optical axis offset; in the process of optical magnification of the target camera, calculating the optical axis offset corresponding to each step of optical magnification based on the optical axis offset function, and according to the optical axis offset and display resolution corresponding to each step of optical magnification, cropping the display image corresponding to each step of optical magnification from the captured image of the target camera for display, so as to correct the optical axis offset of the target camera.

[0050] The embodiments of the present application are independent of mechanical devices such as physically moving lenses or sensors, effectively avoiding mechanical wear and potential jitter problems, and adjusting the display image through dynamic software cropping to cope with optical axis offset during optical magnification, thereby achieving smooth and reliable correction of optical axis offset, thereby effectively solving the technical problems of low smoothness and insufficient reliability of optical axis offset correction during optical magnification.

[0051] It should be noted that the execution subject of the embodiment of the present application is the control device of the camera, which may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs (Televisions), desktop computers, etc., or any electronic device that can achieve the above functions, and the embodiment of the present application does not specifically limit this. The following embodiment of the present application is described by taking the electronic device as the execution subject as an example.

[0052] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.

[0053] Please refer to Figure 1 , Figure 1 A schematic diagram of a flow chart of the first embodiment of the optical axis offset correction method of the present application.

[0054] The present application proposes a first embodiment of an optical axis offset correction method. In this embodiment, the method includes steps S100 to S300:

[0055] Step S100, obtaining the resolution, optical axis offset function and maximum optical axis offset of the target camera;

[0056] It should be noted that, in the present embodiment, the target camera is a camera device (such as a digital camera, a camera phone, a surveillance camera, etc.) having an optical zoom function and having an optical axis offset during the optical zoom process. The optical axis offset function is used to reflect how the optical axis offset of the target camera changes with the change of the optical zoom step number. The maximum optical axis offset refers to the maximum value of the optical axis offset of the target camera in the process of changing with the change of the optical zoom step number. In general, the maximum optical axis offset is the offset of the optical axis of the target camera in the process of changing from the minimum optical zoom step number to the maximum optical zoom step number, and is measured in pixels.

[0057] Those skilled in the art will know that the optical axis offset function can be pre-calibrated using a professional optical axis offset calibration tool, and is a function between the number of optical zoom steps (or focal length, magnification) and the optical axis offset (or reference point pixel coordinates) at a specific resolution (generally the native resolution). The native resolution refers to the fixed resolution of the image sensor in the target camera.

[0058] It should be noted that, in actual applications, the user does not necessarily control the target camera to shoot at the native resolution, but can select a resolution to control the target camera to shoot through the corresponding setting interface.

[0059] In this embodiment, the self-selected resolution is the output resolution, and is less than or equal to the native resolution. The picture captured by the image sensor in the target camera at the native resolution is the native picture. After downsampling, the resolution of the native picture can be adjusted from the native resolution to the output resolution, thereby becoming the output picture. The output picture can be directly output and presented, or it can be cropped to obtain a display picture with a resolution less than the output resolution. The display picture is the picture finally presented to the user after the output picture is cropped. The resolution of the display picture can be called the display resolution.

[0060] It is worth mentioning that in addition to cropping the display screen from the output screen, the display screen can also be cropped from the native screen, and then downsampled according to the downsampling ratio between the native screen and the output screen to obtain a new screen (also called the target screen) for display, thereby achieving the effect of correcting the optical axis offset.

[0061] It should be noted that in this embodiment, a corresponding optical axis offset function can be pre-calibrated for each adjustable resolution of the target camera, and the corresponding maximum optical axis offset can be recorded. Alternatively, a corresponding optical axis offset function can be pre-calibrated only for the native resolution of the target camera, and the corresponding maximum optical axis offset can be recorded. Therefore, in the process of correcting the optical axis offset, the optical axis offset function and the maximum optical axis offset corresponding to the output resolution can be converted according to the ratio between the native resolution and the output resolution.

[0062] In this embodiment, when each resolution is calibrated with a corresponding optical axis offset function, step S100 may be to obtain the output resolution currently set by the user, and its corresponding calibrated optical axis offset function and the maximum optical axis offset; and when the optical axis offset function is calibrated only for the native resolution, step S100 may be to obtain the native resolution of the image sensor and the output resolution currently set by the user, and obtain the optical axis offset function and the maximum optical axis offset corresponding to the native resolution.

[0063] It should be noted that the maximum optical axis offset can be recorded in advance and directly obtained, or it can be calculated in real time through the optical axis offset function after the resolution and optical axis offset function of the target camera are obtained.

[0064] Step S200, calculating the display resolution of the display image according to the resolution and the maximum optical axis offset;

[0065] It should be noted that in order to ensure that the optical axis offset correction is completed smoothly and naturally during the optical zoom process, and to ensure that the target object requiring characteristics is always in the center of the display screen, the present embodiment directly calculates a screen size that can be stably presented under all optical zoom steps based on the maximum optical axis offset, that is, the display resolution of the display screen. Therefore, during the optical zoom process, only the screen of the display resolution size is cropped as the display screen, and then the pixel coordinates of the center point of the display screen are adjusted in accordance with the optical axis offset corresponding to each step of the optical zoom, to ensure that even in the most extreme case, the template object that needs a close-up is always in the center of the screen, so that the user will not feel any jump or instability in the display screen during the optical zoom process, the screen size is consistent, the overall calculation amount is small, there is no need to recalculate the display resolution for each zoom step, the complexity is low, the real-time performance is high, and it is more suitable for devices with limited computing power.

[0066] Step S300, during the process of optical zooming of the target camera, the optical axis offset corresponding to each step of optical zooming is calculated based on the optical axis offset function, and according to the optical axis offset corresponding to each step of optical zooming and the display resolution, the display picture corresponding to each step of optical zooming is cropped from the shooting picture of the target camera for display, so as to correct the optical axis offset of the target camera.

[0067] In this embodiment, at each step of optical zoom, the optical axis offset corresponding to the current step of optical zoom is calculated by the optical axis offset function, so that the pixel coordinates of the center point of the display screen are determined from the current shooting screen of the target camera according to the optical axis offset corresponding to the current step of optical zoom, that is, the pixel coordinates of the point that should be at the center of the shooting screen after being offset by the optical axis. Then, based on the pixel coordinates of the center point and the display resolution, the display screen corresponding to the current step of optical zoom is framed and cropped from the current shooting screen for display, so as to achieve the effect of correcting the optical axis offset and keeping the center of the screen unchanged.

[0068] Compared with the method of correcting the optical axis offset by physically moving the lens, this embodiment does not require moving mechanical parts, and will not let the user feel that the picture is moving. The software frame selection and cropping speed is faster, which can well match the speed of optical zoom, ensuring that the optical axis offset correction of each frame of the displayed picture is smooth.

[0069] Compared with the method of correcting the optical axis offset by fine-tuning the image sensor, the optical axis offset correction range of this embodiment is larger, which can ensure that the close-up target is always in the center of the picture during the optical zoom process.

[0070] In addition, this embodiment calculates the display resolution of the display picture from the very beginning, and during the optical zoom process, uses the display resolution to determine the pixel coordinates of the center point of the display picture according to the optical axis offset corresponding to each step of the optical zoom, and selects and crops the target picture from the current shooting picture for display. The overall calculation workload is small, and the real-time performance is higher. It can respond more quickly to the need for optical axis offset correction during the optical zoom process, and ensure that the close-up target is always in the center of the display picture, giving users a smoother, more natural, smoother and more reliable optical axis offset correction experience.

[0071] Based on the above first embodiment, a method for correcting optical axis deviation according to a second embodiment of the present application is proposed.

[0072] Please refer to Figure 2 , Figure 2 A schematic diagram of a flow chart provided for the second embodiment of the optical axis offset correction method of the present application;

[0073] In this embodiment, the same or similar contents as those of the first embodiment can be referred to the above introduction and will not be described in detail later.

[0074] In this embodiment, the resolution includes the output resolution, the output resolution includes the output horizontal pixel amount and the output vertical pixel amount, the maximum optical axis offset is the maximum optical axis offset corresponding to the output resolution, and the maximum optical axis offset corresponding to the output resolution includes the maximum horizontal optical axis offset and the maximum vertical optical axis offset corresponding to the output resolution;

[0075] Step S200 may include steps S210 to S230:

[0076] Step S210, obtaining the display horizontal pixel quantity by subtracting the maximum horizontal optical axis offset corresponding to twice the output resolution from the output horizontal pixel quantity;

[0077] Step S220, obtaining the display vertical pixel quantity by subtracting the maximum vertical optical axis offset corresponding to twice the output resolution from the output vertical pixel quantity;

[0078] In step S230, the horizontal pixel quantity and the vertical pixel quantity are displayed as the display resolution of the display picture.

[0079] Those skilled in the art will know that resolution is composed of image height and image width, wherein image height is also called vertical pixel quantity (i.e., the number of pixels in the vertical direction) and image width is also called horizontal pixel quantity (i.e., the number of pixels in the horizontal direction).

[0080] In this embodiment, the output horizontal pixel amount refers to the horizontal pixel amount of the output resolution, the output vertical pixel amount refers to the vertical pixel amount of the output resolution, the displayed horizontal pixel amount refers to the horizontal pixel amount of the display resolution, the displayed vertical pixel amount refers to the vertical pixel amount of the display resolution, the maximum horizontal optical axis offset refers to the component of the maximum optical axis offset in the horizontal direction, and the maximum vertical optical axis offset refers to the component of the maximum optical axis offset in the vertical direction, all in pixels.

[0081] This embodiment obtains the display horizontal pixel amount by outputting the horizontal pixel amount and subtracting the maximum horizontal optical axis offset corresponding to twice the output resolution, and obtains the display vertical pixel amount by outputting the vertical pixel amount and subtracting the maximum vertical optical axis offset corresponding to twice the output resolution, thereby using the display horizontal pixel amount and the display vertical pixel amount as the display resolution of the display screen, ensuring that even in the case of maximum optical axis offset, the target object can always remain in the center of the screen, thereby improving the consistency and visual effect of the image.

[0082] In addition, this embodiment only needs to calculate the display resolution once at the beginning, and there is no need to repeat the calculation during the subsequent zoom process, which simplifies the processing flow and reduces the consumption of computing resources. Moreover, since the need for real-time calculation is reduced, the system responds faster, the video streaming transmission is smoother, and the user experience is better.

[0083] This embodiment achieves effective correction of optical axis offset by pre-calculating and fixing the display resolution, which not only simplifies the processing flow and improves real-time performance and stability, but also ensures the centered display of the target object under various zoom conditions, greatly improving the user's shooting experience and making the correction of optical axis offset in the optical zoom process more smooth, natural, smooth and reliable.

[0084] Further, in a feasible implementation manner, the optical axis offset function is an optical axis offset function corresponding to the output resolution, and the captured image of the target camera is an output image corresponding to the output resolution;

[0085] Step S300 may include step S310:

[0086] Step S310, during the process of optical zooming of the target camera, based on the optical axis offset function corresponding to the output resolution, the horizontal optical axis offset and the vertical optical axis offset corresponding to each step of optical zooming at the output resolution are calculated, and according to the horizontal optical axis offset and the vertical optical axis offset corresponding to each step of optical zooming at the output resolution and the display resolution, the display picture corresponding to each step of optical zooming at the output resolution is cropped from the output picture for display, so as to correct the optical axis offset of the target camera.

[0087] In the case where the output resolution corresponds to an optical axis offset function, this embodiment starts from the output picture and calculates the optical axis offset for each step of optical magnification at the output resolution, including the horizontal optical axis offset and the vertical optical axis offset. Then, in combination with the display resolution of the display picture, the display picture is framed and cropped from the output picture for display, thereby achieving the same technical effect as the first embodiment mentioned above.

[0088] Further, in a feasible implementation manner, step S310 may include steps S311 to S312:

[0089] Step S311, determining the pixel coordinates of the center point of the display image corresponding to each step of optical zoom at the output resolution according to the horizontal optical axis offset and the vertical optical axis offset corresponding to each step of optical zoom at the output resolution;

[0090] Step S312 cuts out the display picture corresponding to each step of optical zoom at the output resolution from the output picture according to the center point pixel coordinates, the display horizontal pixel quantity and the display vertical pixel quantity, and displays the display picture to correct the optical axis offset of the target camera.

[0091] It should be noted that the center point pixel coordinates in this embodiment refer to the pixel coordinates of the center point of the display screen in the output screen.

[0092] This embodiment first calculates the pixel coordinates of the center point of the current step optical zoom display screen at the output resolution according to the horizontal optical axis offset and the vertical optical axis offset corresponding to each step of optical zoom at the output resolution. In combination with the display horizontal pixel amount and the display vertical display amount of the display resolution, the area of ​​the display screen corresponding to the current step optical zoom is determined from the output screen, and the area is framed and cropped for display. In the process of optical zooming of the target camera, the optical axis screen offset is corrected step by frame, so that the picture display is always natural and smooth, and it is ensured that the close-up target is always in the center of the display screen, giving the user an excellent optical zoom close-up experience. The overall technical effect is basically the same as the above-mentioned first embodiment.

[0093] Furthermore, in a feasible implementation manner, the resolution further includes a native resolution, and step S100 may include steps S110 to S120:

[0094] Step S110, obtaining the native resolution and output resolution of the target camera, and calculating the ratio between the native resolution and the output resolution;

[0095] Step S120, obtaining the optical axis offset function and the maximum optical axis offset corresponding to the native resolution, and combining the ratio to calculate the optical axis offset function and the maximum optical axis offset corresponding to the output resolution.

[0096] This embodiment calculates the scaling factor (i.e., the ratio) between the native resolution and the output resolution, and adjusts the optical axis offset function and the maximum optical axis offset accordingly. It can accurately adapt to the optical axis offset under different output resolutions, and obtain the optical axis offset function and maximum optical axis offset corresponding to different output resolutions, thereby ensuring that no matter what output resolution the user sets, the corresponding optical axis offset function and maximum optical axis offset can be obtained to correct the optical axis offset.

[0097] This implementation utilizes the special downsampling relationship between native resolution and output resolution and introduces the concept of scaling factor, so that the same set of optical axis offset functions can be applicable to a variety of different output resolutions of the target camera. It only needs to be calibrated once for the native resolution and can be easily applied to different output resolution configurations, thereby improving the versatility and portability of the algorithm.

[0098] Based on the above first embodiment, a method for correcting an optical axis offset according to a third embodiment of the present application is proposed.

[0099] Please refer to Figure 3 , Figure 3 A flowchart diagram of the third embodiment of the optical axis offset correction method of the present application is provided.

[0100] In this embodiment, the same or similar contents as those in the above embodiments can be referred to the above introduction and will not be described in detail later.

[0101] In this embodiment, the resolution includes the native resolution and the output resolution, the optical axis offset function is the optical axis offset function corresponding to the native resolution, the maximum optical axis offset is the maximum optical axis offset corresponding to the native resolution, and the captured image of the target camera is the native image corresponding to the native resolution;

[0102] Step S200 may further include step S240:

[0103] Step S240, calculating the display resolution of the display image according to the native resolution and the maximum optical axis offset corresponding to the native resolution;

[0104] This embodiment starts from the native resolution and the maximum optical axis offset corresponding to the native resolution, and adopts a method similar to steps S210 to S230 in the above-mentioned second embodiment to calculate the display resolution of the display screen. The technical effect is basically the same as that of the above-mentioned embodiment and will not be elaborated here.

[0105] Step S300 may further include steps S320 to S330:

[0106] Step S320, calculating the ratio between the native resolution and the output resolution;

[0107] Step S330, during the process of optical zooming of the target camera, the optical axis offset corresponding to each step of optical zooming at the native resolution is calculated based on the optical axis offset function corresponding to the native resolution, and according to the optical axis offset corresponding to each step of optical zooming at the native resolution and the display resolution, the display image corresponding to each step of optical zooming is cropped from the native image, and the display image is downsampled proportionally to obtain the target image corresponding to each step of optical zooming at the output resolution for display, so as to correct the optical axis offset of the target camera.

[0108] In this embodiment, when the optical axis offset function is pre-calibrated only for the native resolution, in addition to correcting the optical axis offset by converting the ratio between the native resolution and the output resolution to obtain the optical axis offset function corresponding to the output resolution, it is also possible to directly start from the native image and calculate the optical axis offset corresponding to each step of optical zoom at the native resolution. In combination with the display resolution, a method similar to the second embodiment is used to frame and crop the display image corresponding to each step of optical zoom. Then, according to the ratio between the native resolution and the output resolution, the display image is downsampled to obtain the target image corresponding to each step of optical zoom at the output resolution for display, thereby achieving the same effect of correcting the optical axis offset of the target camera as in the above embodiment, which will not be elaborated here.

[0109] In addition, please refer to Figure 4 , Figure 4 This is a schematic diagram of the module structure of the optical axis offset correction device according to an embodiment of the present application.

[0110] The embodiment of the present application further provides an optical axis deviation correction device, the optical axis deviation correction device comprising:

[0111] A data acquisition module 10 is used to acquire the resolution, optical axis offset function and maximum optical axis offset of the target camera;

[0112] A resolution calculation module 20, used to calculate the display resolution of the display picture according to the resolution and the maximum optical axis offset;

[0113] The optical axis offset correction module 30 is used to calculate the optical axis offset corresponding to each step of optical zoom based on the optical axis offset function during the process of optical zooming of the target camera, and to crop the display image corresponding to each step of optical zoom from the shooting image of the target camera according to the optical axis offset corresponding to each step of optical zoom and the display resolution for display, so as to correct the optical axis offset of the target camera.

[0114] The optical axis offset correction device provided in the embodiment of the present application adopts the optical axis offset correction method in the above embodiment, which can solve the technical problems of low smoothness and insufficient reliability of optical axis offset correction during optical zooming. Compared with the prior art, the beneficial effects of the optical axis offset correction device provided in the embodiment of the present application are the same as the beneficial effects of the optical axis offset correction method provided in the above embodiment, and the other technical features in the optical axis offset correction device are the same as the features disclosed in the above embodiment method, which will not be repeated here.

[0115] In addition, please refer to Figure 5 , Figure 5 Schematic diagram of the device structure of the hardware operating environment involved in the optical axis offset correction method in the embodiment of the present application.

[0116] The present application also provides an electronic device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the steps of the optical axis offset correction method in the above-mentioned embodiment.

[0117] Reference below Figure 5 , which shows a schematic diagram of the structure of an electronic device suitable for implementing the embodiment of the present application. The electronic device in the embodiment of the present application is a control device for a camera, and may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs (Televisions), desktop computers, etc., or any electronic device that can implement the above functions. Figure 5 The electronic device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0118] like Figure 5As shown, the electronic device may include a processing device 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the electronic device are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows an electronic device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have alternatively.

[0119] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.

[0120] The electronic device provided by the present application adopts the optical axis offset correction method in the above-mentioned embodiment, which can solve the technical problems of low smoothness and insufficient reliability of optical axis offset correction during optical zooming. Compared with the prior art, the beneficial effects of the electronic device provided by the present application are the same as the beneficial effects of the optical axis offset correction method provided by the above-mentioned embodiment, and other technical features in the electronic device are the same as the features disclosed in the optical axis offset correction method in the above-mentioned embodiment, which will not be described in detail here.

[0121] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0122] In addition, the present application also provides a storage medium, which is a computer-readable storage medium having computer-readable program instructions (i.e., a computer program) stored thereon. When the computer-readable program instructions are executed, they are used to implement the steps of the optical axis offset correction method in the above-mentioned embodiment.

[0123] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.

[0124] The computer-readable storage medium may be included in the electronic device, or may exist independently without being installed in the electronic device.

[0125] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by an electronic device, the electronic device:

[0126] Computer program code for performing the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0127] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0128] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.

[0129] The computer-readable storage medium provided by the present application stores computer-readable program instructions (i.e., computer programs) for executing the steps of the optical axis offset correction method in the above-mentioned embodiment, which can solve the technical problems of low smoothness and insufficient reliability of optical axis offset correction during optical zooming. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present application are the same as the beneficial effects of the optical axis offset correction method provided by the above-mentioned embodiment, and are not described in detail here.

[0130] In addition, an embodiment of the present application also provides a program product, which is a computer program product, including a computer program, and when the computer program is executed by a processor, the steps of the optical axis offset correction method in the above embodiment are implemented.

[0131] The computer program product provided by the present application can solve the technical problems of low smoothness and insufficient reliability of optical axis offset correction during optical zooming. Compared with the prior art, the beneficial effects of the computer program product provided by the embodiment of the present application are the same as the beneficial effects of the optical axis offset correction method provided by the above embodiment, and will not be described in detail here.

[0132] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.

Claims

1. A method for correcting optical axis deviation, characterized in that: The optical axis deviation correction method comprises: Obtain the resolution, optical axis offset function and maximum optical axis offset of the target camera; Calculating the display resolution of the display image according to the resolution and the maximum optical axis offset; During the process of optical magnification of the target camera, the optical axis offset corresponding to each step of optical magnification is calculated based on the optical axis offset function, and according to the optical axis offset corresponding to each step of optical magnification and the display resolution, the display picture corresponding to each step of optical magnification is cropped from the shooting picture of the target camera for display, so as to correct the optical axis offset of the target camera.

2. The optical axis deviation correction method according to claim 1, characterized in that: The resolution includes an output resolution, the output resolution includes an output horizontal pixel amount and an output vertical pixel amount, the maximum optical axis offset is a maximum optical axis offset corresponding to the output resolution, and the maximum optical axis offset corresponding to the output resolution includes a maximum horizontal optical axis offset and a maximum vertical optical axis offset corresponding to the output resolution; The step of calculating the display resolution of the display picture according to the resolution and the maximum optical axis offset comprises: The display horizontal pixel quantity is obtained by subtracting the maximum horizontal optical axis offset corresponding to twice the output resolution from the output horizontal pixel quantity; The display vertical pixel quantity is obtained by subtracting the maximum vertical optical axis offset corresponding to twice the output resolution from the output vertical pixel quantity; The display horizontal pixel quantity and the display vertical pixel quantity are used as the display resolution of the display picture.

3. The optical axis deviation correction method according to claim 2, characterized in that: The optical axis offset function is an optical axis offset function corresponding to the output resolution, and the shooting picture of the target camera is an output picture corresponding to the output resolution; The step of calculating the optical axis offset corresponding to each step of the optical zooming based on the optical axis offset function during the optical zooming of the target camera, and cropping the display picture corresponding to each step of the optical zooming from the captured picture of the target camera for display according to the optical axis offset corresponding to each step of the optical zooming and the display resolution, so as to correct the optical axis offset of the target camera, comprises: During the process of optical magnification of the target camera, the horizontal optical axis offset and the vertical optical axis offset corresponding to each step of optical magnification at the output resolution are calculated based on the optical axis offset function corresponding to the output resolution, and according to the horizontal optical axis offset and the vertical optical axis offset corresponding to each step of optical magnification at the output resolution and the display resolution, the display picture corresponding to each step of optical magnification at the output resolution is cropped from the output picture for display, so as to correct the optical axis offset of the target camera.

4. The optical axis deviation correction method according to claim 3, characterized in that: The step of cropping a display picture corresponding to each step of optical zoom at the output resolution from the output picture for display according to the horizontal optical axis offset and the vertical optical axis offset corresponding to each step of optical zoom at the output resolution and the display resolution, so as to correct the optical axis offset of the target camera, comprises: Determine the pixel coordinates of the center point of the display image corresponding to each step of optical zoom at the output resolution according to the horizontal optical axis offset and the vertical optical axis offset corresponding to each step of optical zoom at the output resolution; According to the center point pixel coordinates, the display horizontal pixel quantity and the display vertical pixel quantity, a display picture corresponding to each step of optical zoom at the output resolution is cropped from the output picture for display, so as to correct the optical axis offset of the target camera.

5. The optical axis deviation correction method according to claim 4, characterized in that: The resolution also includes native resolution, and the step of obtaining the resolution, optical axis offset function and maximum optical axis offset of the target camera includes: Obtaining a native resolution and an output resolution of the target camera, and calculating a ratio between the native resolution and the output resolution; The optical axis offset function and the maximum optical axis offset corresponding to the native resolution are obtained, and the optical axis offset function and the maximum optical axis offset corresponding to the output resolution are calculated based on the ratio.

6. The optical axis deviation correction method according to claim 1, characterized in that: The resolution includes a native resolution and an output resolution, the optical axis offset function is an optical axis offset function corresponding to the native resolution, the maximum optical axis offset is a maximum optical axis offset corresponding to the native resolution, and the captured image of the target camera is a native image corresponding to the native resolution; The step of calculating the display resolution of the display picture according to the resolution and the maximum optical axis offset comprises: Calculating the display resolution of the display picture according to the native resolution and the maximum optical axis offset corresponding to the native resolution; The step of calculating the optical axis offset corresponding to each step of the optical zooming based on the optical axis offset function during the optical zooming of the target camera, and cropping the display picture corresponding to each step of the optical zooming from the captured picture of the target camera for display according to the optical axis offset corresponding to each step of the optical zooming and the display resolution, so as to correct the optical axis offset of the target camera, comprises: Calculating a ratio between the native resolution and the output resolution; During the process of optical magnification of the target camera, the optical axis offset corresponding to each step of optical magnification at the native resolution is calculated based on the optical axis offset function corresponding to the native resolution, and according to the optical axis offset corresponding to each step of optical magnification at the native resolution and the display resolution, the display image corresponding to each step of optical magnification is cropped from the native image, and the display image is downsampled according to the ratio to obtain the target image corresponding to each step of optical magnification at the output resolution for display, so as to correct the optical axis offset of the target camera.

7. An optical axis deviation correction device, characterized in that: The optical axis deviation correction device comprises: A data acquisition module is used to obtain the resolution, optical axis offset function and maximum optical axis offset of the target camera; A resolution calculation module, used to calculate the display resolution of the display picture according to the resolution and the maximum optical axis offset; The optical axis offset correction module is used to calculate the optical axis offset corresponding to each step of optical zoom based on the optical axis offset function during the process of optical zooming of the target camera, and to crop the display image corresponding to each step of optical zoom from the shooting image of the target camera according to the optical axis offset corresponding to each step of optical zoom and the display resolution for display, so as to correct the optical axis offset of the target camera.

8. An electronic device, characterized in that: The electronic device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program implements the steps of the optical axis offset correction method as claimed in any one of claims 1 to 6 when executed by the processor.

9. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the computer-readable storage medium. When the computer program is executed by a processor, the steps of the optical axis offset correction method according to any one of claims 1 to 6 are implemented.

10. A program product, characterized in that The program product is a computer program product, and the computer program product includes a computer program. When the computer program is executed by a processor, the steps of the optical axis offset correction method according to any one of claims 1 to 6 are implemented.