Optical axis offset correction method and system, camera, storage medium and product

By obtaining the current multiple of the camera in real time and determining the offset based on the preset curve, and performing field of view cropping or gimbal parameter adjustment, the problem of optical axis offset when the camera zooms or zooms is solved, and the accuracy of the algorithm is improved.

CN119729232APending Publication Date: 2025-03-28VALUEHD CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411820280.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-11
Publication Date
2025-03-28

AI Technical Summary

Technical Problem

When the camera zooms or zooms, the optical axis may deflect and displace, causing the coordinates of the object in the center of the field of view to change, which in turn affects the accuracy of algorithms such as AI tracking.

Method used

By obtaining the current multiple in real time, the horizontal and vertical offsets are determined based on the preset optical axis offset compensation curve, and whether these offsets are less than or equal to the preset threshold value. If it is less than the threshold, the field of view is cropped; if it is exceeded, the gimbal parameters are adjusted and the field of view is cropped after adjustment to correct the optical axis offset.

Benefits of technology

It effectively corrects the offset of the optical axis during zooming or zooming, ensuring that objects at the center of the field of view before zooming or zooming are still at the center of the field of view after zooming or zooming, improving the accuracy of algorithms such as AI tracking.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119729232A_ABST
    Figure CN119729232A_ABST
Patent Text Reader

Abstract

The invention discloses an optical axis offset correction method and system, a camera, a storage medium and a product, and relates to the technical field of cameras, and the disclosed optical axis offset correction method comprises the steps: obtaining a current multiple in real time during zooming or zooming; determining the horizontal offset and the vertical offset of the current multiple based on the optical axis offset compensation curve; if it is detected that the horizontal offset is smaller than or equal to a horizontal offset threshold value and the vertical offset is smaller than or equal to a vertical offset threshold value, cutting the view corresponding to the current multiple based on the horizontal offset and the vertical offset; if it is detected that the horizontal offset is larger than a horizontal offset threshold value, or it is detected that the vertical offset is larger than a vertical offset threshold value, the holder parameter corresponding to the current multiple is adjusted based on the horizontal offset and the vertical offset, and the view corresponding to the current multiple is cut after adjustment. The technical scheme of the invention aims to solve the technical problem of how to correct the offset of the optical axis.
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, system, camera, storage medium and product. Background Art

[0002] A camera is made up of multiple parts, each of which plays an important role in capturing images. However, if the precision of the camera lens or other key parts is not high enough, the optical axis may deflect and shift when the lens is zooming and focusing, causing the coordinates of objects that were originally at the center of the field of view to change, which in turn leads to a high error rate in algorithms such as AI tracking that calculate based on coordinates.

[0003] Therefore, how to correct the offset of the optical axis when the camera is magnified or zoomed is a technical problem that has yet to be solved by those skilled in the art. Summary of the invention

[0004] The main purpose of this application is to provide an optical axis offset correction method, system, camera, storage medium and product, aiming to solve the technical problem of how to correct the offset of the optical axis.

[0005] To achieve the above objectives, the present application proposes a method for correcting optical axis deviation, the method comprising:

[0006] When the magnification or zoom is detected, the current magnification is obtained in real time;

[0007] Determine a horizontal offset and a vertical offset corresponding to the current magnification based on a preset optical axis offset compensation curve, and detect the horizontal offset and the vertical offset;

[0008] If it is detected that the horizontal offset is less than or equal to a preset horizontal offset threshold, and if it is detected that the vertical offset is less than or equal to a preset vertical offset threshold, the field of view corresponding to the current magnification is cropped based on the horizontal offset and the vertical offset to perform optical axis offset correction;

[0009] If it is detected that the horizontal offset is greater than the horizontal offset threshold, or if it is detected that the vertical offset is greater than the vertical offset threshold, the gimbal parameters corresponding to the current magnification are adjusted based on the horizontal offset and the vertical offset, and the field of view corresponding to the current magnification is cropped after the adjustment to correct the optical axis offset.

[0010] In one embodiment, the step of clipping the field of view corresponding to the current magnification based on the horizontal offset and the vertical offset includes:

[0011] Determine a horizontal compensation direction and a horizontal compensation length according to the horizontal offset, and determine a vertical compensation direction and a vertical compensation length according to the vertical offset;

[0012] According to the horizontal compensation direction and the horizontal compensation length, cropping the field of view corresponding to the current multiple in the horizontal direction;

[0013] The field of view corresponding to the current multiple is cropped in the vertical direction according to the vertical compensation direction and the vertical compensation length.

[0014] In one embodiment, the gimbal parameters include: a translation angle and a pitch angle; and the step of adjusting the gimbal parameters corresponding to the current multiple based on the horizontal offset and the vertical offset includes:

[0015] Determine a horizontal compensation direction and a horizontal compensation length according to the horizontal offset, and determine a vertical compensation direction and a vertical compensation length according to the vertical offset;

[0016] Based on the correspondence between the preset rotation angle in the horizontal direction and the compensation length, determine the target horizontal rotation angle corresponding to the horizontal compensation length, and based on the correspondence between the preset rotation angle in the vertical direction and the compensation length, determine the target vertical rotation angle corresponding to the vertical compensation length;

[0017] The translation angle is adjusted according to the horizontal compensation direction and the target horizontal rotation angle, and the pitch angle is adjusted according to the vertical compensation direction and the target vertical rotation angle.

[0018] In one embodiment, the optical axis offset compensation curve includes: a horizontal compensation curve and a vertical compensation curve. Before the step of determining the horizontal offset and the vertical offset corresponding to the current multiple based on the preset optical axis offset compensation curve, the method further includes:

[0019] Get the default horizontal offset and default vertical offset corresponding to different magnifications;

[0020] Constructing a horizontal compensation curve according to each of the magnifications and the default horizontal offsets corresponding to each of the magnifications, and constructing a vertical compensation curve according to each of the magnifications and the default vertical offsets corresponding to each of the magnifications;

[0021] The step of determining the horizontal offset and the vertical offset corresponding to the current magnification based on a preset optical axis offset compensation curve comprises:

[0022] The horizontal offset corresponding to the current multiple is determined according to the horizontal compensation curve, and the vertical offset corresponding to the current multiple is determined according to the vertical compensation curve.

[0023] In one embodiment, the step of determining the horizontal offset corresponding to the current multiple according to the horizontal compensation curve, and determining the vertical offset corresponding to the current multiple according to the vertical compensation curve includes:

[0024] Get the initial magnification before zooming or changing the magnification, and determine whether the initial magnification is the default magnification;

[0025] When it is determined that the initial multiple is a default multiple, taking the offset in the horizontal compensation curve corresponding to the current multiple as the horizontal offset, and taking the offset in the vertical compensation curve corresponding to the current multiple as the vertical offset;

[0026] When it is determined that the initial multiple is not the default multiple, the difference between the offset corresponding to the initial multiple in the horizontal compensation curve and the offset corresponding to the current multiple is used as the horizontal offset, and the difference between the offset corresponding to the initial multiple in the vertical compensation curve and the offset corresponding to the current multiple is used as the vertical offset.

[0027] In one embodiment, the step of cropping the field of view corresponding to the current magnification after adjustment includes:

[0028] Detecting the current position of the central object in the current field of view, wherein the central object is the object at the center of the field of view before the camera zooms or changes magnification;

[0029] Determine a horizontal cropping length and a vertical cropping length based on the center position of the current field of view and the current position;

[0030] The field of view corresponding to the current multiple is cropped according to the horizontal cropping length and the vertical cropping length.

[0031] In addition, to achieve the above-mentioned purpose, the present application also proposes an optical axis offset correction system, the optical axis offset correction system comprising:

[0032] A magnification conversion module is used to obtain the current magnification in real time when a magnification or zoom is detected;

[0033] An offset confirmation module, used to determine a horizontal offset and a vertical offset corresponding to the current multiple based on a preset optical axis offset compensation curve, and to detect the horizontal offset and the vertical offset;

[0034] A first correction module, configured to, if it is detected that the horizontal offset is less than or equal to a preset horizontal offset threshold, and if it is detected that the vertical offset is less than or equal to a preset vertical offset threshold, crop the field of view corresponding to the current magnification based on the horizontal offset and the vertical offset to perform optical axis offset correction;

[0035] The second correction module is used to adjust the gimbal parameters corresponding to the current magnification based on the horizontal offset and the vertical offset if it is detected that the horizontal offset is greater than the horizontal offset threshold, or the vertical offset is detected to be greater than the vertical offset threshold, and to crop the field of view corresponding to the current magnification after the adjustment to perform optical axis offset correction.

[0036] In addition, to achieve the above-mentioned purpose, the present application also proposes a camera, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the optical axis offset correction method as described above.

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

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

[0039] In the embodiment of the present application, by acquiring the current magnification in real time when detecting the magnification or zoom, it is convenient to determine the correction method according to the size of the current magnification; then the horizontal offset and the vertical offset corresponding to the current magnification are determined based on the preset optical axis offset compensation curve, and the horizontal offset and the vertical offset are detected, so that the horizontal offset for correction in the horizontal direction and the vertical offset for correction in the vertical direction can be obtained; then if it is detected that the horizontal offset is less than or equal to the preset horizontal offset threshold, and the vertical offset is detected to be less than or equal to the preset vertical offset threshold, then based on the horizontal offset The field of view corresponding to the current magnification is cropped according to the horizontal offset and the vertical offset to correct the optical axis offset; if it is detected that the horizontal offset is greater than the horizontal offset threshold, or if it is detected that the vertical offset is greater than the vertical offset threshold, the gimbal parameters corresponding to the current magnification are adjusted based on the horizontal offset and the vertical offset, and the field of view corresponding to the current magnification is cropped after the adjustment to correct the optical axis offset. By cropping and / or adjusting the gimbal parameters, an object that is at the center of the field of view before zooming or magnifying is still at the center of the field of view after zooming or magnifying, thereby achieving the purpose of correcting the offset of the optical axis. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] 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.

[0041] 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, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

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

[0043] Figure 2 A schematic diagram of a gimbal parameter adjustment process according to an embodiment of an optical axis offset correction method of the present application;

[0044] Figure 3 A schematic diagram of a flow chart provided for Embodiment 2 of the optical axis offset correction method of the present application;

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

[0046] 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.

[0047] 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

[0048] 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.

[0049] 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.

[0050] Today, cameras are made up of multiple components, each of which plays an important role in capturing images. However, if the precision of the camera lens or other key components is not high enough, the optical axis may deflect and shift when the lens is zooming and focusing, causing the coordinates of objects that were originally at the center of the field of view to change, which in turn leads to a high error rate in algorithms such as AI tracking that calculate based on coordinates.

[0051] Therefore, how to correct the offset of the optical axis when the camera is magnified or zoomed is a technical problem that has yet to be solved by those skilled in the art.

[0052] In order to solve the above problems, the present application obtains the current magnification in real time when detecting the magnification or zoom, so as to determine the correction method according to the size of the current magnification; then determines the horizontal offset and vertical offset corresponding to the current magnification based on the preset optical axis offset compensation curve, and detects the horizontal offset and the vertical offset to obtain the horizontal offset for correction in the horizontal direction and the vertical offset for correction in the vertical direction; then, if it is detected that the horizontal offset is less than or equal to the preset horizontal offset threshold, and if it is detected that the vertical offset is less than or equal to the preset vertical offset threshold, then based on the horizontal offset, the horizontal offset and the vertical offset are corrected. The field of view corresponding to the current magnification is cropped based on the horizontal offset and the vertical offset to correct the optical axis offset; if it is detected that the horizontal offset is greater than the horizontal offset threshold, or if it is detected that the vertical offset is greater than the vertical offset threshold, the gimbal parameters corresponding to the current magnification are adjusted based on the horizontal offset and the vertical offset, and the field of view corresponding to the current magnification is cropped after the adjustment to correct the optical axis offset. By cropping and / or adjusting the gimbal parameters, an object that is at the center of the field of view before zooming or magnifying is still at the center of the field of view after zooming or magnifying, thereby achieving the purpose of correcting the offset of the optical axis.

[0053] It should be noted that the execution subject of the optical axis offset correction method of the present application may be a camera with data processing, network communication and program running functions, or the execution subject of the optical axis offset correction method of the present application may also be an electronic device with video or photo function, such as a mobile phone, camera, etc. The following takes a camera as an example to illustrate various embodiments of the optical axis offset correction method of the present application.

[0054] Based on this, the present application embodiment provides a method for correcting optical axis offset, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the optical axis offset correction method of the present application.

[0055] In this embodiment, the optical axis offset correction method includes steps S10 to S40:

[0056] Step S10, when a magnification or zoom is detected, the current magnification is obtained in real time;

[0057] It should be noted that the current magnification refers to the magnification obtained after the magnification or zoom operation.

[0058] It is understandable that during the zooming process, the field of view will change, and the object that was at the center of the field of view before the zooming will no longer be at the center of the field of view after the zooming. Therefore, in this embodiment, the current zooming multiple needs to be obtained.

[0059] Step S20, determining a horizontal offset and a vertical offset corresponding to the current magnification based on a preset optical axis offset compensation curve, and detecting the horizontal offset and the vertical offset;

[0060] It should be noted that the optical axis offset compensation curve refers to a curve including the corresponding relationship between the multiple and the offset.

[0061] It is understandable that the premise of correction is to know the offset of the current magnification compared to the magnification before zooming or changing the magnification. Therefore, in a feasible implementation, the horizontal offset and vertical offset corresponding to the current magnification can be determined based on a preset optical axis offset compensation curve, so as to perform optical axis offset compensation according to the horizontal offset and vertical offset.

[0062] In addition, detecting the horizontal offset and the vertical offset refers to comparing the horizontal offset with a preset horizontal offset threshold and comparing the vertical offset with a preset vertical offset threshold, wherein the horizontal offset threshold and the vertical offset threshold are preset parameter values ​​for determining whether the central object has deviated from the field of view.

[0063] Step S30: if it is detected that the horizontal offset is less than or equal to a preset horizontal offset threshold, and if it is detected that the vertical offset is less than or equal to a preset vertical offset threshold, the field of view corresponding to the current magnification is cropped based on the horizontal offset and the vertical offset to perform optical axis offset correction;

[0064] It can be understood that the horizontal offset is less than or equal to the horizontal offset threshold and the vertical offset is less than or equal to the vertical offset threshold, indicating that the horizontal offset can be used to crop the current field of view in the horizontal direction, and the vertical offset can be used to crop the current field of view in the vertical direction, so that the central object is in the center of the current field of view.

[0065] In a feasible implementation manner, the above step S30 includes:

[0066] Step S301, determining a horizontal compensation direction and a horizontal compensation length according to the horizontal offset, and determining a vertical compensation direction and a vertical compensation length according to the vertical offset;

[0067] It should be noted that the horizontal compensation direction refers to the direction that needs to be compensated in the horizontal direction, and the horizontal compensation length refers to the pixel distance that needs to be compensated in the horizontal direction; similarly, the vertical compensation direction refers to the direction that needs to be compensated in the vertical direction, and the vertical compensation length refers to the pixel distance that needs to be compensated in the vertical direction.

[0068] It is understandable that, in the field of view after zooming or changing the magnification, the position of the central object not only has differences in the horizontal and vertical coordinates compared to the position before zooming or changing the magnification, but also has leftward and rightward offsets in the horizontal direction, and upward and downward offsets in the vertical direction. Therefore, the specific compensation direction and compensated pixel distance can be determined according to the horizontal offset and the vertical offset, respectively.

[0069] Exemplarily, assuming that the position of the central object after zooming is shifted to the left by 10 pixels compared to the position of the central object before zooming, the horizontal compensation direction is to the right, and the horizontal compensation length is 10 pixels.

[0070] Step S302, cropping the field of view corresponding to the current multiple in the horizontal direction according to the horizontal compensation direction and the horizontal compensation length;

[0071] Step S303 , vertically cropping the field of view corresponding to the current magnification according to the vertical compensation direction and the vertical compensation length.

[0072] For example, when the horizontal compensation direction is to the right and the horizontal compensation length is 10 pixels, then for the current magnification of the field of view, the right side of the field of view can be cut off by a length of 10 pixels; if the vertical compensation direction is downward and the vertical compensation length is 15 pixels, then for the current magnification of the field of view, the lower field of view can be cut off by a length of 15 pixels.

[0073] Therefore, in the case where the central object is still in the field of view after zooming or changing the magnification, the present application can achieve the purpose of compensating for the optical axis offset by cropping.

[0074] Step S40, if it is detected that the horizontal offset is greater than the horizontal offset threshold, or if it is detected that the vertical offset is greater than the vertical offset threshold, the gimbal parameters corresponding to the current magnification are adjusted based on the horizontal offset and the vertical offset, and the field of view corresponding to the current magnification is cropped after the adjustment to correct the optical axis offset.

[0075] It is understandable that the horizontal offset threshold may be the distance between the center position of the field of view and the leftmost or rightmost side of the field of view; the vertical offset threshold may be the distance between the center position of the field of view and the topmost or bottommost side of the field of view. In a feasible implementation, the horizontal offset threshold may be slightly smaller than the distance between the center position of the field of view and the leftmost or rightmost side of the field of view, and the vertical offset threshold may be slightly smaller than the distance between the center position of the field of view and the topmost or bottommost side of the field of view. At this point, the central object can be corrected when it is about to deviate from the field of view, which can improve the user experience.

[0076] Please refer to Figure 2 , Figure 2 The following is a schematic diagram of the gimbal parameter adjustment process of an embodiment of the optical axis offset correction method of the present application. In a feasible implementation, the gimbal parameters include: a translation angle (Pan) and a pitch angle (Tilt); the above step S40 includes:

[0077] Step S401, determining a horizontal compensation direction and a horizontal compensation length according to the horizontal offset, and determining a vertical compensation direction and a vertical compensation length according to the vertical offset;

[0078] It should be noted that the horizontal compensation direction, horizontal compensation length, vertical compensation direction, and vertical compensation length in this embodiment have the same meanings as those in the above-mentioned cropping method, and will not be repeated in this application.

[0079] Step S402, based on the correspondence between the preset rotation angle in the horizontal direction and the compensation length, determining the target horizontal rotation angle corresponding to the horizontal compensation length, and based on the correspondence between the preset rotation angle in the vertical direction and the compensation length, determining the target vertical rotation angle corresponding to the vertical compensation length;

[0080] It should be noted that the target horizontal rotation angle refers to the angle that needs to be adjusted in the horizontal direction, and the target vertical rotation angle refers to the angle that needs to be adjusted in the vertical direction. For example, when the target horizontal rotation angle is 5°, the translation angle needs to be rotated 5° based on the horizontal compensation direction.

[0081] It is understandable that different pan angles correspond to different angles of view in the horizontal direction, and different pitch angles correspond to different angles of view in the vertical direction. When it is detected that the central object is no longer in the current field of view, it is necessary to adjust the gimbal parameters so that the central object remains in the center of the field of view.

[0082] Step S403: adjusting the translation angle according to the horizontal compensation direction and the target horizontal rotation angle, and adjusting the pitch angle according to the vertical compensation direction and the target vertical rotation angle.

[0083] For example, assuming that the horizontal compensation direction is rightward, the target horizontal rotation angle is 5°, and the horizontal compensation direction is rightward, the angle increases, then the adjusted translation angle = the translation angle before adjustment + 5°. Assuming that the vertical compensation direction is downward, the target vertical rotation angle is 6°, and the vertical compensation direction is downward, the angle decreases, then the adjusted pitch angle = the pitch angle before adjustment - 6°.

[0084] In one embodiment, the above step S40 further includes:

[0085] Step S404, detecting the current position of the central object in the current field of view, wherein the central object is the object at the center of the field of view before the camera zooms or changes magnification;

[0086] Step S405, determining a horizontal cropping length and a vertical cropping length based on the center position of the current field of view and the current position;

[0087] Step S406: cropping the field of view corresponding to the current multiple according to the horizontal cropping length and the vertical cropping length.

[0088] It is understandable that after adjusting the gimbal parameters, the central object is in the current field of view, but may not be in the center. Therefore, the horizontal coordinate difference between the center position and the current position can be used as the horizontal cropping length, and the vertical coordinate difference can be used as the vertical cropping length. Then, cropping can be performed based on the horizontal cropping length and the vertical cropping length.

[0089] In the embodiment of the present application, by acquiring the current magnification in real time when detecting the magnification or zoom, it is convenient to determine the correction method according to the size of the current magnification; then the horizontal offset and the vertical offset corresponding to the current magnification are determined based on the preset optical axis offset compensation curve, and the horizontal offset and the vertical offset are detected, so that the horizontal offset for correction in the horizontal direction and the vertical offset for correction in the vertical direction can be obtained; then if it is detected that the horizontal offset is less than or equal to the preset horizontal offset threshold, and the vertical offset is detected to be less than or equal to the preset vertical offset threshold, then based on the horizontal offset The field of view corresponding to the current magnification is cropped according to the horizontal offset and the vertical offset to correct the optical axis offset; if it is detected that the horizontal offset is greater than the horizontal offset threshold, or if it is detected that the vertical offset is greater than the vertical offset threshold, the gimbal parameters corresponding to the current magnification are adjusted based on the horizontal offset and the vertical offset, and the field of view corresponding to the current magnification is cropped after the adjustment to correct the optical axis offset. By cropping and / or adjusting the gimbal parameters, an object that is at the center of the field of view before zooming or magnifying is still at the center of the field of view after zooming or magnifying, thereby achieving the purpose of correcting the offset of the optical axis.

[0090] Furthermore, based on the above-mentioned first embodiment of the optical axis offset correction method of the present application, a second embodiment of the optical axis offset correction method of the present application is proposed.

[0091] Please refer to Figure 3 In this embodiment, the optical axis offset compensation curve includes: a horizontal compensation curve and a vertical compensation curve. Before the above step S20, the method further includes:

[0092] Step S100, obtaining the default horizontal offset and the default vertical offset corresponding to different magnifications;

[0093] It should be noted that the default horizontal offset refers to the distance between the horizontal coordinate of the central object at different magnifications and the horizontal coordinate of the central object at the default magnification; similarly, the default vertical offset refers to the distance between the vertical coordinate of the central object at different magnifications and the vertical coordinate of the central object at the default magnification.

[0094] Step S200, constructing a horizontal compensation curve according to each magnification and the default horizontal offset corresponding to each magnification, and constructing a vertical compensation curve according to each magnification and the default vertical offset corresponding to each magnification;

[0095] It is understandable that after obtaining the default horizontal offsets corresponding to each magnification, a horizontal compensation curve can be obtained by curve fitting, and a vertical compensation curve can also be constructed by curve fitting based on the default vertical offsets corresponding to each magnification.

[0096] Based on this, the above step S20 includes:

[0097] Step S201, determining a horizontal offset corresponding to the current multiple according to the horizontal compensation curve, and determining a vertical offset corresponding to the current multiple according to the vertical compensation curve.

[0098] It is understandable that after obtaining the horizontal compensation curve and the vertical compensation curve, the value corresponding to the current multiple in the horizontal compensation curve can be read to obtain the horizontal offset; and the value corresponding to the current multiple in the vertical compensation curve can also be read to obtain the vertical offset.

[0099] In a feasible implementation manner, the above step S201 includes:

[0100] Step S2011, obtaining the initial magnification before zooming or changing the magnification, and determining whether the initial magnification is the default magnification;

[0101] It should be noted that the initial magnification refers to the magnification before the magnification or zoom operation.

[0102] Step S2012, when it is determined that the initial multiple is a default multiple, taking the offset in the horizontal compensation curve corresponding to the current multiple as the horizontal offset, and taking the offset in the vertical compensation curve corresponding to the current multiple as the vertical offset;

[0103] It can be understood that since the horizontal compensation curve and the vertical compensation curve are set based on the position of the central object under the default magnification, if the initial magnification is the default magnification, the values ​​corresponding to the current magnification in the horizontal compensation curve and the vertical compensation curve can be directly used as the offset.

[0104] Step S2013, when it is determined that the initial multiple is not the default multiple, the difference between the offset corresponding to the initial multiple in the horizontal compensation curve and the offset corresponding to the current multiple is used as the horizontal offset, and the difference between the offset corresponding to the initial multiple in the vertical compensation curve and the offset corresponding to the current multiple is used as the vertical offset.

[0105] It is understandable that when the magnification before the zoom or zoom operation is not the default magnification, it is incorrect to directly use the values ​​corresponding to the current magnification in the horizontal compensation curve and the vertical compensation curve as the offset. Therefore, it is necessary to obtain the value corresponding to the initial magnification in the horizontal compensation curve, and obtain the value corresponding to the current magnification in the horizontal compensation curve, and use the difference between the values ​​as the horizontal offset; then, the vertical offset can be obtained by a basically similar method. Therefore, when the initial magnification is not the default magnification, the present application can also obtain accurate horizontal offsets and vertical offsets.

[0106] In this embodiment, the present application can fit the non-integer multiple offset by curve fitting the integer multiples and the offset, so as to compensate for the non-integer multiple optical axis offset. In addition, the present application also avoids the problem of compensation error caused by directly reading the value on the curve as the offset by obtaining the initial multiple.

[0107] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the optical axis offset correction method of the present application. More simple transformations based on this technical concept are all within the protection scope of the present application.

[0108] This application also provides an optical axis offset correction system, please refer to Figure 4 , the optical axis deviation correction system comprises:

[0109] The magnification conversion module 10 is used to obtain the current magnification in real time when a magnification change or zoom is detected;

[0110] An offset confirmation module 20, used to determine a horizontal offset and a vertical offset corresponding to the current multiple based on a preset optical axis offset compensation curve, and to detect the horizontal offset and the vertical offset;

[0111] A first correction module 30 is configured to, if it is detected that the horizontal offset is less than or equal to a preset horizontal offset threshold, and if it is detected that the vertical offset is less than or equal to a preset vertical offset threshold, crop the field of view corresponding to the current magnification based on the horizontal offset and the vertical offset to perform optical axis offset correction;

[0112] The second correction module 40 is used to adjust the gimbal parameters corresponding to the current magnification based on the horizontal offset and the vertical offset if it is detected that the horizontal offset is greater than the horizontal offset threshold, or if it is detected that the vertical offset is greater than the vertical offset threshold, and to crop the field of view corresponding to the current magnification after the adjustment to perform optical axis offset correction.

[0113] In one embodiment, the first correction module 30 is further configured to:

[0114] Determine a horizontal compensation direction and a horizontal compensation length according to the horizontal offset, and determine a vertical compensation direction and a vertical compensation length according to the vertical offset;

[0115] According to the horizontal compensation direction and the horizontal compensation length, cropping the field of view corresponding to the current multiple in the horizontal direction;

[0116] The field of view corresponding to the current multiple is cropped in the vertical direction according to the vertical compensation direction and the vertical compensation length.

[0117] In one embodiment, the gimbal parameters include: a translation angle and a pitch angle, and the second correction module 40 is further used for:

[0118] Determine a horizontal compensation direction and a horizontal compensation length according to the horizontal offset, and determine a vertical compensation direction and a vertical compensation length according to the vertical offset;

[0119] Based on the correspondence between the preset rotation angle in the horizontal direction and the compensation length, determine the target horizontal rotation angle corresponding to the horizontal compensation length, and based on the correspondence between the preset rotation angle in the vertical direction and the compensation length, determine the target vertical rotation angle corresponding to the vertical compensation length;

[0120] The translation angle is adjusted according to the horizontal compensation direction and the target horizontal rotation angle, and the pitch angle is adjusted according to the vertical compensation direction and the target vertical rotation angle.

[0121] In one embodiment, the optical axis offset compensation curve includes: a horizontal compensation curve and a vertical compensation curve, and the optical axis offset correction system further includes:

[0122] An offset acquisition module is used to acquire the default horizontal offset and the default vertical offset corresponding to different magnifications;

[0123] A curve construction module, used to construct a horizontal compensation curve according to each of the magnifications and the default horizontal offsets corresponding to each of the magnifications, and to construct a vertical compensation curve according to each of the magnifications and the default vertical offsets corresponding to each of the magnifications;

[0124] Based on this, the offset confirmation module 20 is also used for:

[0125] The horizontal offset corresponding to the current multiple is determined according to the horizontal compensation curve, and the vertical offset corresponding to the current multiple is determined according to the vertical compensation curve.

[0126] In one embodiment, the offset confirmation module 20 is further configured to:

[0127] Get the initial magnification before zooming or changing the magnification, and determine whether the initial magnification is the default magnification;

[0128] When it is determined that the initial multiple is a default multiple, taking the offset in the horizontal compensation curve corresponding to the current multiple as the horizontal offset, and taking the offset in the vertical compensation curve corresponding to the current multiple as the vertical offset;

[0129] When it is determined that the initial multiple is not the default multiple, the difference between the offset corresponding to the initial multiple in the horizontal compensation curve and the offset corresponding to the current multiple is used as the horizontal offset, and the difference between the offset corresponding to the initial multiple in the vertical compensation curve and the offset corresponding to the current multiple is used as the vertical offset.

[0130] In one embodiment, the second correction module 40 is further configured to:

[0131] Detecting the current position of the central object in the current field of view, wherein the central object is the object at the center of the field of view before the camera zooms or changes magnification;

[0132] Determine a horizontal cropping length and a vertical cropping length based on the center position of the current field of view and the current position;

[0133] The field of view corresponding to the current multiple is cropped according to the horizontal cropping length and the vertical cropping length.

[0134] The optical axis offset correction system provided by the present application adopts the optical axis offset correction method in the above embodiment, which can solve the technical problem of how to correct the offset of the optical axis. Compared with the prior art, the beneficial effects of the optical axis offset correction system provided by the present application are the same as the beneficial effects of the optical axis offset correction method provided by the above embodiment, and other technical features of the optical axis offset correction system are the same as the features disclosed in the above embodiment method, which will not be repeated here.

[0135] The present application provides a camera, which includes: at least one processor; and a memory that is communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed 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 optical axis offset correction method in the above-mentioned embodiment one.

[0136] Reference below Figure 5 , which shows a schematic structural diagram of a camera suitable for implementing an embodiment of the present application. Figure 5 The camera 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.

[0137] like Figure 5 As shown, the camera 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 On ly Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In the RAM 1004, various programs and data required for the camera operation are also stored. The processing device 1001, the ROM 1002, and the RAM 1004 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 Disp l ay), 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 camera to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows a camera 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.

[0138] 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.

[0139] The camera provided by the present application adopts the optical axis offset correction method in the above embodiment, which can solve the technical problem of how to correct the offset of the optical axis. Compared with the prior art, the beneficial effects of the camera provided by the present application are the same as the beneficial effects of the optical axis offset correction method provided by the above embodiment, and the other technical features in the camera are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.

[0140] 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.

[0141] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0142] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the optical axis offset correction method in the above-mentioned embodiment.

[0143] 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 computer-readable 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: Erasable Programmab le Read On ly Memory or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM: CD-Read On ly Memory), 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 computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency: Radio Frequency), etc., or any suitable combination of the above.

[0144] The computer-readable storage medium may be included in the camera; or may exist independently without being installed in the camera.

[0145] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by the camera, the camera: obtains the current magnification in real time when detecting a magnification or a zoom; determines the horizontal offset and the vertical offset corresponding to the current magnification based on a preset optical axis offset compensation curve, and detects the horizontal offset and the vertical offset; if it is detected that the horizontal offset is less than or equal to a preset horizontal offset threshold, and if it is detected that the vertical offset is less than or equal to a preset vertical offset threshold, then the field of view corresponding to the current magnification is cropped based on the horizontal offset and the vertical offset to correct the optical axis offset; if it is detected that the horizontal offset is greater than the horizontal offset threshold, or if it is detected that the vertical offset is greater than the vertical offset threshold, then the gimbal parameters corresponding to the current magnification are adjusted based on the horizontal offset and the vertical offset, and the field of view corresponding to the current magnification is cropped after the adjustment to correct the optical axis offset.

[0146] 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 via 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).

[0147] 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.

[0148] 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.

[0149] The readable storage medium provided in the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned optical axis offset correction method, and can solve the technical problem of how to correct the offset of the optical axis. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in the present application are the same as the beneficial effects of the optical axis offset correction method provided in the above-mentioned embodiment, and will not be repeated here.

[0150] The present application also provides a computer program product, including a computer program, which implements the steps of the optical axis offset correction method as described above when executed by a processor.

[0151] The computer program product provided by the present application can solve the technical problem of how to correct the offset of the optical axis. Compared with the prior art, the beneficial effects of the computer program product provided by the present application are the same as the beneficial effects of the optical axis offset correction method provided by the above embodiment, which will not be repeated here.

[0152] 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 offset correction method comprises: When the magnification or zoom is detected, the current magnification is obtained in real time; Determine a horizontal offset and a vertical offset corresponding to the current magnification based on a preset optical axis offset compensation curve, and detect the horizontal offset and the vertical offset; If it is detected that the horizontal offset is less than or equal to a preset horizontal offset threshold, and if it is detected that the vertical offset is less than or equal to a preset vertical offset threshold, the field of view corresponding to the current magnification is cropped based on the horizontal offset and the vertical offset to perform optical axis offset correction; If it is detected that the horizontal offset is greater than the horizontal offset threshold, or if it is detected that the vertical offset is greater than the vertical offset threshold, the gimbal parameters corresponding to the current magnification are adjusted based on the horizontal offset and the vertical offset, and the field of view corresponding to the current magnification is cropped after the adjustment to correct the optical axis offset.

2. The optical axis deviation correction method according to claim 1, wherein: The step of clipping the field of view corresponding to the current magnification based on the horizontal offset and the vertical offset includes: Determine a horizontal compensation direction and a horizontal compensation length according to the horizontal offset, and determine a vertical compensation direction and a vertical compensation length according to the vertical offset; According to the horizontal compensation direction and the horizontal compensation length, cropping the field of view corresponding to the current multiple in the horizontal direction; The field of view corresponding to the current multiple is cropped in the vertical direction according to the vertical compensation direction and the vertical compensation length.

3. The optical axis deviation correction method according to claim 1, wherein: The gimbal parameters include: a translation angle and a pitch angle; the step of adjusting the gimbal parameters corresponding to the current multiple based on the horizontal offset and the vertical offset includes: Determine a horizontal compensation direction and a horizontal compensation length according to the horizontal offset, and determine a vertical compensation direction and a vertical compensation length according to the vertical offset; Based on the correspondence between the preset rotation angle in the horizontal direction and the compensation length, determine the target horizontal rotation angle corresponding to the horizontal compensation length, and based on the correspondence between the preset rotation angle in the vertical direction and the compensation length, determine the target vertical rotation angle corresponding to the vertical compensation length; The translation angle is adjusted according to the horizontal compensation direction and the target horizontal rotation angle, and the pitch angle is adjusted according to the vertical compensation direction and the target vertical rotation angle.

4. The optical axis deviation correction method according to claim 1, wherein: The optical axis offset compensation curve includes: a horizontal compensation curve and a vertical compensation curve. Before the step of determining the horizontal offset and the vertical offset corresponding to the current multiple based on the preset optical axis offset compensation curve, the method further includes: Get the default horizontal offset and default vertical offset corresponding to different magnifications; Constructing a horizontal compensation curve according to each of the magnifications and the default horizontal offsets corresponding to each of the magnifications, and constructing a vertical compensation curve according to each of the magnifications and the default vertical offsets corresponding to each of the magnifications; The step of determining the horizontal offset and the vertical offset corresponding to the current magnification based on a preset optical axis offset compensation curve comprises: The horizontal offset corresponding to the current multiple is determined according to the horizontal compensation curve, and the vertical offset corresponding to the current multiple is determined according to the vertical compensation curve.

5. The optical axis deviation correction method according to claim 4, characterized in that: The step of determining the horizontal offset corresponding to the current multiple according to the horizontal compensation curve, and determining the vertical offset corresponding to the current multiple according to the vertical compensation curve, comprises: Get the initial magnification before zooming or changing the magnification, and determine whether the initial magnification is the default magnification; When it is determined that the initial multiple is a default multiple, taking the offset in the horizontal compensation curve corresponding to the current multiple as the horizontal offset, and taking the offset in the vertical compensation curve corresponding to the current multiple as the vertical offset; When it is determined that the initial multiple is not the default multiple, the difference between the offset corresponding to the initial multiple in the horizontal compensation curve and the offset corresponding to the current multiple is used as the horizontal offset, and the difference between the offset corresponding to the initial multiple in the vertical compensation curve and the offset corresponding to the current multiple is used as the vertical offset.

6. The optical axis deviation correction method according to claim 1, wherein: The step of cropping the field of view corresponding to the current magnification after adjustment includes: Detecting the current position of the central object in the current field of view, wherein the central object is the object at the center of the field of view before the camera zooms or changes magnification; Determine a horizontal cropping length and a vertical cropping length based on the center position of the current field of view and the current position; The field of view corresponding to the current multiple is cropped according to the horizontal cropping length and the vertical cropping length.

7. An optical axis deviation correction system, characterized in that: The optical axis deviation correction system comprises: A magnification conversion module is used to obtain the current magnification in real time when a magnification or zoom is detected; An offset confirmation module, used to determine a horizontal offset and a vertical offset corresponding to the current multiple based on a preset optical axis offset compensation curve, and to detect the horizontal offset and the vertical offset; A first correction module, configured to, if it is detected that the horizontal offset is less than or equal to a preset horizontal offset threshold, and if it is detected that the vertical offset is less than or equal to a preset vertical offset threshold, crop the field of view corresponding to the current magnification based on the horizontal offset and the vertical offset to perform optical axis offset correction; The second correction module is used to adjust the gimbal parameters corresponding to the current magnification based on the horizontal offset and the vertical offset if it is detected that the horizontal offset is greater than the horizontal offset threshold, or the vertical offset is detected to be greater than the vertical offset threshold, and to crop the field of view corresponding to the current magnification after the adjustment to perform optical axis offset correction.

8. A camera, characterized in that: The camera comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the optical axis offset correction method according to any one of claims 1 to 6.

9. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the 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 computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the optical axis deviation correction method according to any one of claims 1 to 6 are implemented.