Image adjustment method, device, computer equipment and storage medium

Through the image adjustment method based on camera calibration parameters and motion vectors, the problems of delay and low imaging quality during digital image adjustment in the prior art are solved, and efficient image correction and anti-shake processing during shooting of handheld devices are realized, which improves the Imaging quality.

CN116017155BActive Publication Date: 2024-12-06SHENZHEN KANDAO TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211548342.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-05
Publication Date
2024-12-06
Estimated Expiration
2042-12-05

AI Technical Summary

Technical Problem

The existing digital image adjustment technology has problems of time-lapse and high complexity in improving imaging quality, or it is low in complexity and low in imaging quality, making it difficult to effectively solve the blur problem caused by image jitter during shooting by handheld devices.

Method used

By determining the correction crop ratio and anti-shake crop ratio based on the camera calibration parameters, the target image is corrected and anti-shake processing is performed, and the frame number and preset threshold of the lost picture area are detected. Comparison, adjust the image to improve imaging quality.

Benefits of technology

It realizes improving the imaging quality of image adjustment without increasing equipment costs, solving the problem of low imaging quality caused by image jitter, and providing better user experience and imaging effects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116017155B_ABST
    Figure CN116017155B_ABST
Patent Text Reader

Abstract

The present application relates to the field of image processing technology, and discloses an image adjustment method, device, computer equipment and storage medium, wherein the method comprises determining a correction cropping ratio based on an optical center offset, and correcting a target image based on the correction cropping ratio; when it is detected that the corrected target image does not meet a preset anti-shake effect, anti-shake processing is performed on the target image according to a motion vector and an anti-shake cropping ratio; when the target image after anti-shake processing does not meet the anti-shake effect, a correction anti-shake cropping ratio is determined based on a lens translation range and a flip angle, and the target image is adjusted based on the correction anti-shake cropping ratio. The present application obtains the number of frames of the lost picture area between the edge area and the middle area of ​​the target image, compares it with a preset threshold, and adjusts the target image according to the comparison result, thereby improving the imaging quality through image adjustment, and solves the current technical problem of low imaging quality caused by image jitter.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to an image adjustment method, device, computer equipment and storage medium. Background Art

[0002] At present, more and more mobile devices are equipped with image capture functions. In the process of shooting images or videos, especially in the process of shooting with handheld electronic devices, the electronic device will shake to a certain extent, resulting in a certain degree of shaking in the captured image or video, resulting in blurry captured images or videos. For this reason, image adjustment (anti-shaking) technology is usually used to improve image quality. Image adjustment systems can generally be divided into optical image adjustment (Optical Image Stabilization, referred to as OIS) systems and / or digital image adjustment (Digital Image Stabilization, referred to as DIS) systems. The OIS system is relatively expensive, and configuring such an OIS system will significantly increase the cost of the equipment. The DIS system is implemented using software and has a lower cost. However, the existing DIS technology either has high computational complexity, resulting in a long delay, affecting the user experience; or has low complexity but cannot obtain high imaging quality. Therefore, how to improve imaging quality through image adjustment has become a technical problem that needs to be solved urgently. Summary of the invention

[0003] The present application provides an image adjustment method, apparatus, computer equipment and storage medium to improve imaging quality through image adjustment.

[0004] In a first aspect, the present application provides an image adjustment method, the image adjustment method comprising:

[0005] Determining a correction cropping ratio corresponding to a target image based on an optical center offset corresponding to a camera calibration parameter, and performing correction processing on the target image based on the correction cropping ratio;

[0006] When it is detected that the target image after the correction processing does not meet the preset anti-shake effect, anti-shake processing is performed on the target image according to the motion vector corresponding to the target image and the preset anti-shake cropping ratio;

[0007] When the target image after anti-shake processing does not meet the anti-shake effect, a correction anti-shake cropping ratio is determined based on the lens translation range and flip angle corresponding to the camera calibration parameters, and the target image is adjusted based on the correction anti-shake cropping ratio.

[0008] Further, after determining a correction cropping ratio corresponding to the target image based on the optical center offset corresponding to the camera calibration parameter, and performing correction processing on the target image based on the correction cropping ratio, the method further includes:

[0009] When the target image shakes, detecting whether the first middle area of ​​the target image shakes to the edge area of ​​the target image;

[0010] When it is detected that the first middle area shakes to the edge area, determining the overlapping part as a lost picture area, and obtaining the frame number of the lost picture area;

[0011] Based on the relationship between the number of frames in the lost picture area and a preset frame number threshold, the target image is adjusted to correct the target image.

[0012] Further, based on the relationship between the number of frames in the lost picture area and a preset frame number threshold, adjusting the target image to correct the target image includes:

[0013] If a first condition is met within a preset time period, the picture frames of the lost picture area are discarded, wherein the first condition is that the number of frames in the lost picture area is not greater than a first preset threshold or the number of lost picture frames is not greater than a second preset threshold.

[0014] Further, based on the relationship between the number of frames in the lost picture area and a preset frame number threshold, adjusting the target image to correct the target image includes:

[0015] If the second condition is met within the preset time period, the first intermediate area is adjusted based on the motion vector of the target image so that the adjusted second intermediate area meets the first condition, wherein the second condition is that the number of frames in the lost picture area is greater than a first preset threshold or the number of consecutive lost picture frames is greater than a second preset threshold.

[0016] Further, within the preset time period, if a second condition is met, the first intermediate area is adjusted based on the motion vector of the target image so that the adjusted second intermediate area meets the first condition, wherein the second condition is that the number of frames in the lost picture area is greater than a first preset threshold or the number of consecutive lost picture frames is greater than a second preset threshold, including:

[0017] Based on the direction corresponding to the motion vector of the target image, the first middle area is controlled to move toward the edge area of ​​the target image.

[0018] Further, after controlling the first middle area to move toward the edge area of ​​the target image based on the direction corresponding to the motion vector of the target image, the method further includes:

[0019] When the first condition and the second condition are not met, the first middle area is reduced according to a preset reduction ratio to generate a third middle area, so that the third middle area meets the first condition;

[0020] Based on a preset magnification ratio, the reduced third middle area is magnified to generate a fourth middle area, and the fourth middle area is determined as the middle area of ​​the target image.

[0021] Furthermore, the image adjustment method further includes:

[0022] Clipping the edge area of ​​the target image and retaining the middle area of ​​the target image;

[0023] The middle area is enlarged according to a preset enlargement ratio to adapt to the corresponding display device.

[0024] In a second aspect, the present application further provides an image adjustment device, the image adjustment device comprising:

[0025] A correction processing module, used to determine a correction cropping ratio corresponding to a target image based on an optical center offset corresponding to a camera calibration parameter, and perform correction processing on the target image based on the correction cropping ratio;

[0026] An anti-shake processing module, configured to perform anti-shake processing on the target image according to a motion vector corresponding to the target image and a preset anti-shake cropping ratio when it is detected that the target image after correction processing does not meet a preset anti-shake effect;

[0027] The correction and anti-shake module is used to determine the correction anti-shake cropping ratio based on the lens translation range and flip angle corresponding to the camera calibration parameters when the target image after anti-shake processing does not meet the anti-shake effect, and adjust the target image based on the correction anti-shake cropping ratio.

[0028] In a third aspect, the present application further provides a computer device, comprising a memory and a processor; the memory is used to store a computer program; the processor is used to execute the computer program and implement the image adjustment method as described above when executing the computer program.

[0029] In a fourth aspect, the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor implements the image adjustment method as described above.

[0030] The present application discloses an image adjustment method, device, computer equipment and storage medium, wherein the image adjustment method includes determining the correction cropping ratio corresponding to the target image based on the optical center offset corresponding to the camera calibration parameters, and performing correction processing on the target image based on the correction cropping ratio; when it is detected that the target image after the correction processing does not meet the preset anti-shake effect, the target image is anti-shake processed according to the motion vector corresponding to the target image and the preset anti-shake cropping ratio; when the target image after the anti-shake processing does not meet the anti-shake effect, the correction anti-shake cropping ratio is determined based on the lens translation range and flip angle corresponding to the camera calibration parameters, and the target image is adjusted based on the correction anti-shake cropping ratio. The present application obtains the number of frames of the lost picture area between the edge area and the middle area of ​​the target image, compares it with a preset threshold, and adjusts the target image according to the comparison result, thereby improving the imaging quality through image adjustment, and solves the current technical problem of low imaging quality caused by image jitter. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0032] Figure 1 A schematic flow chart of an image adjustment method provided for the first embodiment of the present application;

[0033] Figure 2 A schematic flow chart of an image adjustment method provided for the second embodiment of the present application;

[0034] Figure 3 This is a schematic diagram of the target image not being jittered to the outside of the edge area;

[0035] Figure 4 A schematic flow chart of an image adjustment method provided for the third embodiment of the present application;

[0036] Figure 5 This is a schematic diagram of the target image being jittered to the outside of the edge area;

[0037] Figure 6 A schematic block diagram of an image adjustment device provided in an embodiment of the present application;

[0038] Figure 7 A schematic block diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0039] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0040] The flowcharts shown in the accompanying drawings are only examples and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may also be decomposed, combined or partially merged, so the actual execution order may change according to actual conditions.

[0041] It should be understood that the terms used in this application specification are only for the purpose of describing specific embodiments and are not intended to limit the application. As used in this application specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.

[0042] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0043] The embodiments of the present application provide an image adjustment method, apparatus, computer equipment and storage medium. The image adjustment method can be applied to a server to improve the image quality through image adjustment, thereby solving the current technical problem of low image quality caused by image jitter. The server can be an independent server or a server cluster.

[0044] In conjunction with the accompanying drawings, some embodiments of the present application are described in detail below. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.

[0045] See also Figure 1 , Figure 1 This is a schematic flow chart of an image adjustment method provided in the first embodiment of the present application. The image adjustment method can be applied to a server to improve the image quality through image adjustment and solve the current technical problem of low image quality caused by image jitter.

[0046] like Figure 1 As shown, the image adjustment method specifically includes steps S10 to S30.

[0047] S10, determining a correction cropping ratio corresponding to a target image based on an optical center offset corresponding to a camera calibration parameter, and performing correction processing on the target image based on the correction cropping ratio;

[0048] S20, when it is detected that the target image after the correction processing does not meet the preset anti-shake effect, anti-shake processing is performed on the target image according to the motion vector corresponding to the target image and the preset anti-shake cropping ratio;

[0049] S30: When the target image after anti-shake processing does not meet the anti-shake effect, determine a correction anti-shake cropping ratio based on the lens translation range and flip angle corresponding to the camera calibration parameters, and adjust the target image based on the correction anti-shake cropping ratio.

[0050] In a specific embodiment, if the camera itself has an optical center offset, the lens translation range and flip angle are calculated according to the camera calibration file, that is, the camera default LUT Map table, so as to achieve image correction. Single correction usage scenario: For fixed camera positions, single anti-shake is suitable, such as shooting with a tripod or an anti-shake gimbal;

[0051] The shaking frequency of a handheld camera is 0-20Hz, and the camera IMU acquisition frequency is 1KHz. Therefore, IMU data can be applied to video stabilization. Based on the IMU motion vector of the video, the lens translation range and flip angle are calculated, and then the LUT Map table is calculated. Input the LUT Map into the LDC module to achieve GYRO mode stabilization. Single stabilization usage scenario: After single calibration, the user is not satisfied with the stabilization effect of the video, and single stabilization processing will be performed at this time;

[0052] On the one hand, the basic lens translation range and flip angle are given according to the camera calibration file. Secondly, the LUT Map table is calculated in combination with the IMU data while the picture is being corrected. The LDC module is input to implement the correction and anti-shake of the GYRO mode. Calibration and anti-shake usage scenario: When the user is shooting handheld, the camera video is in a slightly shaking state, and it is suitable to directly perform calibration and anti-shake processing.

[0053] Specifically, the LUT table is related to grid_size and grid_size_h configured by the LDC parameters.

[0054] For example, for 2K_32x32.json, the LUT table is a 32x32 two-dimensional array of float data, and its corresponding pseudo code is abbreviated as:

[0055] float lut_data

[32]

[32] ;

[0056] For single correction, LUT specific data is generated from camera calibration parameters according to LDC parameter configuration. Single correction is achieved by correcting camera principal point offset and lens distortion.

[0057] For single image stabilization, LUT calculates motion acceleration based on the IMU data of video frames in the previous and next period of time, obtains rotation and translation motion vectors, and generates LUT. The purpose is to obtain the translation and flip angles of camera movement and cut them out to achieve single image stabilization.

[0058] For correction and anti-shake, LUT calculates the motion acceleration based on the IMU data of the video frames in the previous and subsequent periods, superimposes the effects of the camera's principal point offset and lens distortion, and gives a LUT table to achieve camera coordinate system conversion, projection and cropping of the captured image, thereby achieving correction and anti-shake functions.

[0059] The present application discloses an image adjustment method, device, computer equipment and storage medium, wherein the image adjustment method includes determining the correction cropping ratio corresponding to the target image based on the optical center offset corresponding to the camera calibration parameters, and performing correction processing on the target image based on the correction cropping ratio; when it is detected that the target image after the correction processing does not meet the preset anti-shake effect, the target image is anti-shake processed according to the motion vector corresponding to the target image and the preset anti-shake cropping ratio; when the target image after the anti-shake processing does not meet the anti-shake effect, the correction anti-shake cropping ratio is determined based on the lens translation range and flip angle corresponding to the camera calibration parameters, and the target image is adjusted based on the correction anti-shake cropping ratio. The present application obtains the number of frames of the lost picture area between the edge area and the middle area of ​​the target image, compares it with a preset threshold, and adjusts the target image according to the comparison result, thereby improving the imaging quality through image adjustment, and solves the current technical problem of low imaging quality caused by image jitter.

[0060] See also Figure 2 , Figure 2 This is a schematic flow chart of an image adjustment method provided in the second embodiment of the present application. The image adjustment method can be applied to a server to improve the image quality through image adjustment and solve the current technical problem of low image quality caused by image jitter.

[0061] based on Figure 2 In the embodiment shown, in this embodiment, after step S10, steps S11 to S13 are also included:

[0062] S11, when the target image shakes, detecting whether the first middle area of ​​the target image shakes to the edge area of ​​the target image;

[0063] S12, when it is detected that the first middle area shakes to the edge area, determining the overlapping part as a lost picture area, and obtaining the frame number of the lost picture area;

[0064] S13: Based on the relationship between the number of frames in the lost picture area and a preset frame number threshold, adjust the target image to correct the target image.

[0065] Specifically, Figure 3 As shown, Figure 3 This is a schematic diagram of a target image that has not been shaken to the outside of the edge area. The target image includes a middle area and an edge area. When displayed normally, the edge area will be cropped and the middle area will be enlarged for display. When the image shakes, if the edge of the middle area has not been shaken to the outside of the edge area, the captured content of the original middle area is obtained based on the motion vector of the entire image. If the edge of the middle area is shaken to the outside of the edge area, it means that at least part of the content of the middle area has been lost.

[0066] based on Figure 2 In the embodiment shown, in this embodiment, step S13 includes:

[0067] If a first condition is met within a preset time period, the picture frames of the lost picture area are discarded, wherein the first condition is that the number of frames in the lost picture area is not greater than a first preset threshold or the number of lost picture frames is not greater than a second preset threshold.

[0068] Based on the above-mentioned embodiments, in this embodiment, the following is specifically included:

[0069] If the second condition is met within the preset time period, the first intermediate area is adjusted based on the motion vector of the target image so that the adjusted second intermediate area meets the first condition, wherein the second condition is that the number of frames in the lost picture area is greater than a first preset threshold or the number of consecutive lost picture frames is greater than a second preset threshold.

[0070] Specifically, based on the direction corresponding to the motion vector of the target image, the first middle area is controlled to move toward the edge area of ​​the target image.

[0071] The middle area is moved toward the edge area of ​​the entire picture according to the direction of the motion vector of the picture, so that the number of picture frames discarded according to the first condition is minimized.

[0072] The target image is divided into NxN blocks, and then each block is searched for the best matching block within the search range of each frame after dithering according to a certain matching criterion. The obtained displacement is the motion vector, among which the most preferred moving direction is the direction with the least frame discarded according to the first condition after moving.

[0073] The present application discloses an image adjustment method, device, computer equipment and storage medium, wherein the image adjustment method includes, when it is detected that the first middle area does not shake to the edge area, based on the motion vector of the target image, obtaining the image content of the middle area before shaking; within a preset time period, if a first condition is met, then discarding the picture frame of the lost picture area, wherein the first condition is that the number of frames of the lost picture area is not greater than a first preset threshold or the number of consecutive lost picture frames is not greater than a second preset threshold; within the preset time period, if a second condition is met, then adjusting the first middle area based on the motion vector of the target image so that the adjusted second middle area meets the first condition, wherein the second condition is that the number of frames of the lost picture area is greater than the first preset threshold or the number of consecutive lost picture frames is greater than the second preset threshold. The present application obtains the number of frames of the lost picture area between the edge area and the middle area of ​​the target image, compares it with the preset threshold, and adjusts the target image according to the comparison result, so as to improve the imaging quality through image adjustment, thereby solving the current technical problem of low imaging quality caused by image shaking.

[0074] See also Figure 4 , Figure 4 This is a schematic flow chart of an image adjustment method provided in the third embodiment of the present application. The image adjustment method can be applied to a server to improve the image quality through image adjustment and solve the current technical problem of low image quality caused by image jitter.

[0075] Based on the above embodiment, this embodiment further includes step S01 to step S02.

[0076] S01. When the first condition and the second condition are not met, the first middle area is reduced according to a preset reduction ratio to generate a third middle area, so that the third middle area meets the first condition;

[0077] S02. Based on a preset magnification ratio, enlarge the reduced third middle area to generate a fourth middle area, and determine the fourth middle area as the middle area of ​​the target image.

[0078] Specifically, Figure 5 This is a schematic diagram of the target image being jittered to the outside of the edge area.

[0079] Based on all the above embodiments, in this embodiment, the image adjustment method further includes:

[0080] Clipping the edge area of ​​the target image and retaining the middle area of ​​the target image;

[0081] The middle area is enlarged according to a preset enlargement ratio to adapt to the corresponding display device.

[0082] The present application discloses an image adjustment method, apparatus, computer equipment and storage medium, wherein the image adjustment method includes, when the first condition and the second condition are not satisfied, reducing the first intermediate area according to a preset reduction ratio to generate a third intermediate area, so that the third intermediate area satisfies the first condition; based on a preset magnification ratio, enlarging the reduced third intermediate area to generate a fourth intermediate area, and determining the fourth intermediate area as the intermediate area of ​​the target image. The present application obtains the number of frames of the lost picture area between the edge area and the intermediate area of ​​the target image, compares it with a preset threshold, and adjusts the target image according to the comparison result, thereby improving the imaging quality through image adjustment, and solves the current technical problem of low imaging quality caused by image jitter.

[0083] See also Figure 6 , Figure 6 The embodiment of the present application provides a schematic block diagram of an image adjustment device, which is used to execute the above-mentioned image adjustment method. The image adjustment device can be configured on a server.

[0084] like Figure 6 As shown, the image adjustment device 400 specifically includes:

[0085] A correction processing module 10, used to determine a correction cropping ratio corresponding to a target image based on an optical center offset corresponding to a camera calibration parameter, and perform correction processing on the target image based on the correction cropping ratio;

[0086] The anti-shake processing module 20 is used to perform anti-shake processing on the target image according to the motion vector corresponding to the target image and the preset anti-shake cropping ratio when it is detected that the target image after the correction processing does not meet the preset anti-shake effect;

[0087] The correction and anti-shake module 30 is used to determine the correction anti-shake cropping ratio based on the lens translation range and flip angle corresponding to the camera calibration parameters when the target image after anti-shake processing does not meet the anti-shake effect, and adjust the target image based on the correction anti-shake cropping ratio.

[0088] Furthermore, the image adjustment device further includes:

[0089] A shaking detection module, used for detecting whether the first middle area of ​​the target image shakes to the edge area of ​​the target image when the target image shakes;

[0090] A frame number acquisition module, configured to determine the overlapping portion as a lost picture area when detecting that the first middle area shakes to the edge area, and acquire the frame number of the lost picture area;

[0091] The image correction module is used to adjust the target image to correct the target image based on the relationship between the number of frames in the lost picture area and a preset frame number threshold.

[0092] Furthermore, the image adjustment device further includes a first condition judgment module, which specifically includes:

[0093] The first condition judgment unit is used to discard the picture frames of the lost picture area if the first condition is met within a preset time period, wherein the first condition is that the number of frames in the lost picture area is not greater than a first preset threshold or the number of lost picture frames is not greater than a second preset threshold.

[0094] Furthermore, the image adjustment device further includes a second condition judgment module, specifically including:

[0095] The second condition judgment unit is used to adjust the first intermediate area based on the motion vector of the target image when the second condition is met within the preset time period, so that the adjusted second intermediate area meets the first condition, wherein the second condition is that the number of frames in the lost picture area is greater than the first preset threshold or the number of consecutive lost picture frames is greater than the second preset threshold.

[0096] Furthermore, the second condition judgment unit further includes:

[0097] The motion vector subunit is used to control the first middle area to move toward the edge area of ​​the target image based on the direction corresponding to the motion vector of the target image.

[0098] Furthermore, the second condition judgment unit further includes:

[0099] an image reduction subunit, configured to reduce the first intermediate region according to a preset reduction ratio to generate a third intermediate region when the first condition and the second condition are not satisfied, so that the third intermediate region satisfies the first condition;

[0100] The image magnification subunit is used to magnify the reduced third middle area based on a preset magnification ratio to generate a fourth middle area, and determine the fourth middle area as the middle area of ​​the target image.

[0101] Furthermore, the image adjustment device further includes:

[0102] An edge region clipping module, used for clipping the edge region of the target image and retaining the middle region of the target image;

[0103] The enlargement module is used to enlarge the middle area according to a preset enlargement ratio to adapt to the corresponding display device.

[0104] It should be noted that those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described device and each module can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0105] The above-mentioned device can be implemented in the form of a computer program. Figure 7 Runs on the computer device shown.

[0106] See also Figure 7 , Figure 7 1 is a schematic block diagram of a computer device provided in an embodiment of the present application. The computer device may be a server.

[0107] See also Figure 7 The computer device includes a processor, a memory and a network interface connected through a system bus, wherein the memory may include a non-volatile storage medium and an internal memory.

[0108] The non-volatile storage medium can store an operating system and a computer program. The computer program includes program instructions, and when the program instructions are executed, the processor can execute any image adjustment method.

[0109] The processor is used to provide computing and control capabilities and support the operation of the entire computer equipment.

[0110] The internal memory provides an environment for the operation of the computer program in the non-volatile storage medium. When the computer program is executed by the processor, the processor can execute any image adjustment method.

[0111] The network interface is used for network communication, such as sending assigned tasks, etc. Those skilled in the art will understand that Figure 7 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0112] It should be understood that the processor may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0113] In one embodiment, the processor is used to run a computer program stored in the memory to implement the following steps:

[0114] Determining a correction cropping ratio corresponding to a target image based on an optical center offset corresponding to a camera calibration parameter, and performing correction processing on the target image based on the correction cropping ratio;

[0115] When it is detected that the target image after the correction processing does not meet the preset anti-shake effect, anti-shake processing is performed on the target image according to the motion vector corresponding to the target image and the preset anti-shake cropping ratio;

[0116] When the target image after anti-shake processing does not meet the anti-shake effect, a correction anti-shake cropping ratio is determined based on the lens translation range and flip angle corresponding to the camera calibration parameters, and the target image is adjusted based on the correction anti-shake cropping ratio.

[0117] In one embodiment, based on the optical center offset corresponding to the camera calibration parameter, a correction cropping ratio corresponding to the target image is determined, and after the target image is corrected based on the correction cropping ratio, it is also used to achieve:

[0118] When the target image shakes, detecting whether the first middle area of ​​the target image shakes to the edge area of ​​the target image;

[0119] When it is detected that the first middle area shakes to the edge area, determining the overlapping part as a lost picture area, and obtaining the frame number of the lost picture area;

[0120] Based on the relationship between the number of frames in the lost picture area and a preset frame number threshold, the target image is adjusted to correct the target image.

[0121] In one embodiment, based on the relationship between the number of frames of the lost picture area and a preset frame number threshold, the target image is adjusted to correct the target image, so as to achieve:

[0122] If a first condition is met within a preset time period, the picture frames of the lost picture area are discarded, wherein the first condition is that the number of frames in the lost picture area is not greater than a first preset threshold or the number of lost picture frames is not greater than a second preset threshold.

[0123] In one embodiment, based on the relationship between the number of frames of the lost picture area and a preset frame number threshold, the target image is adjusted to correct the target image, so as to achieve:

[0124] If the second condition is met within the preset time period, the first intermediate area is adjusted based on the motion vector of the target image so that the adjusted second intermediate area meets the first condition, wherein the second condition is that the number of frames in the lost picture area is greater than a first preset threshold or the number of consecutive lost picture frames is greater than a second preset threshold.

[0125] In one embodiment, within the preset time period, if the second condition is met, the first middle area is adjusted based on the motion vector of the target image so that the adjusted second middle area meets the first condition, wherein the second condition is that the number of frames in the lost picture area is greater than a first preset threshold or the number of consecutive lost picture frames is greater than a second preset threshold, so as to achieve:

[0126] Based on the direction corresponding to the motion vector of the target image, the first middle area is controlled to move toward the edge area of ​​the target image.

[0127] In one embodiment, after controlling the first middle area to move toward the edge area of ​​the target image based on the direction corresponding to the motion vector of the target image, it is further used to implement:

[0128] When the first condition and the second condition are not met, the first middle area is reduced according to a preset reduction ratio to generate a third middle area, so that the third middle area meets the first condition;

[0129] Based on a preset magnification ratio, the reduced third middle area is magnified to generate a fourth middle area, and the fourth middle area is determined as the middle area of ​​the target image.

[0130] In one embodiment, the image adjustment method is further used to implement:

[0131] Clipping the edge area of ​​the target image and retaining the middle area of ​​the target image;

[0132] The middle area is enlarged according to a preset enlargement ratio to adapt to the corresponding display device.

[0133] A computer-readable storage medium is also provided in an embodiment of the present application. The computer-readable storage medium stores a computer program. The computer program includes program instructions. The processor executes the program instructions to implement any image adjustment method provided in the embodiment of the present application.

[0134] The computer-readable storage medium may be an internal storage unit of the computer device described in the foregoing embodiment, such as a hard disk or memory of the computer device. The computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a smart memory card (SmartMedia Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc., equipped on the computer device.

[0135] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.

Claims

1. An image adjustment method, characterized in that: The image adjustment method comprises: Determining a correction cropping ratio corresponding to a target image based on an optical center offset corresponding to a camera calibration parameter, and performing correction processing on the target image based on the correction cropping ratio; When it is detected that the target image after the correction processing does not meet the preset anti-shake effect, anti-shake processing is performed on the target image according to the motion vector corresponding to the target image and the preset anti-shake cropping ratio; When the target image after anti-shake processing does not meet the anti-shake effect, a correction anti-shake cropping ratio is determined based on the lens translation range and flip angle corresponding to the camera calibration parameters, and the target image is adjusted based on the correction anti-shake cropping ratio.

2. The image adjustment method according to claim 1, characterized in that: After determining the correction cropping ratio corresponding to the target image based on the optical center offset corresponding to the camera calibration parameter, and performing correction processing on the target image based on the correction cropping ratio, the method further includes: When the target image shakes, detecting whether the first middle area of ​​the target image shakes to the edge area of ​​the target image; When it is detected that the first middle area shakes to the edge area, determining the overlapping part as a lost picture area, and obtaining the frame number of the lost picture area; Based on the relationship between the number of frames in the lost picture area and a preset frame number threshold, the target image is adjusted to correct the target image.

3. The image adjustment method according to claim 2, characterized in that: The step of adjusting the target image to correct the target image based on the relationship between the number of frames in the lost picture area and a preset frame number threshold comprises: If a first condition is met within a preset time period, the picture frames of the lost picture area are discarded, wherein the first condition is that the number of frames in the lost picture area is not greater than a first preset threshold or the number of lost picture frames is not greater than a second preset threshold.

4. The image adjustment method according to claim 3, characterized in that: The step of adjusting the target image to correct the target image based on the relationship between the number of frames in the lost picture area and a preset frame number threshold comprises: If the second condition is met within the preset time period, the first intermediate area is adjusted based on the motion vector of the target image so that the adjusted second intermediate area meets the first condition, wherein the second condition is that the number of frames in the lost picture area is greater than a first preset threshold or the number of consecutive lost picture frames is greater than a second preset threshold.

5. The image adjustment method according to claim 4, characterized in that: In the case where the second condition is met within the preset time period, the first intermediate area is adjusted based on the motion vector of the target image so that the adjusted second intermediate area meets the first condition, wherein the second condition is that the number of frames in the lost picture area is greater than a first preset threshold or the number of consecutive lost picture frames is greater than a second preset threshold, including: Based on the direction corresponding to the motion vector of the target image, the first middle area is controlled to move toward the edge area of ​​the target image.

6. The image adjustment method according to claim 5, characterized in that: After controlling the first middle area to move toward the edge area of ​​the target image based on the direction corresponding to the motion vector of the target image, the method further includes: When the first condition and the second condition are not met, the first middle area is reduced according to a preset reduction ratio to generate a third middle area, so that the third middle area meets the first condition; Based on a preset magnification ratio, the reduced third middle area is magnified to generate a fourth middle area, and the fourth middle area is determined as the middle area of ​​the target image.

7. The image adjustment method according to any one of claims 1 to 6, characterized in that: The image adjustment method further includes: Clipping the edge area of ​​the target image and retaining the middle area of ​​the target image; The middle area is enlarged according to a preset enlargement ratio to adapt to the corresponding display device.

8. An image adjustment device, characterized in that: The image adjustment device comprises: A correction processing module, used to determine a correction cropping ratio corresponding to a target image based on an optical center offset corresponding to a camera calibration parameter, and perform correction processing on the target image based on the correction cropping ratio; An anti-shake processing module, configured to perform anti-shake processing on the target image according to a motion vector corresponding to the target image and a preset anti-shake cropping ratio when it is detected that the target image after correction processing does not meet a preset anti-shake effect; The correction and anti-shake module is used to determine the correction anti-shake cropping ratio based on the lens translation range and flip angle corresponding to the camera calibration parameters when the target image after anti-shake processing does not meet the anti-shake effect, and adjust the target image based on the correction anti-shake cropping ratio.

9. A computer device, characterized in that: The computer device includes a memory and a processor; The memory is used to store computer programs; The processor is configured to execute the computer program and implement the image adjustment method according to any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor implements the image adjustment method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Camera calibration method and device, electronic equipment and computer readable storage medium

    CN109598764A

  • Image correction method and device, electronic equipment and computer readable storage medium

    CN109714536A