Image processing method and device, and computer readable storage medium

By grabing multi -frame image data in smart device cameras and selecting a frame with the highest definition, the image clarity problem caused by hand shake is significantly improved, and the quality of the image is significantly improved.

CN115942130BActive Publication Date: 2025-01-28SPREADTRUM COMMUNICATION (SHANGHAI) CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202211666434.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-23
Publication Date
2025-01-28
Estimated Expiration
2042-12-23

AI Technical Summary

Technical Problem

The image obtained by the camera in the smart device is poor in the process of taking pictures due to hand shaking.

Method used

After the focus is detected, grab the N frame image data, and compare it with a clarity, and select a frame image data with the highest definition for follow -up processing and output.

Benefits of technology

By selecting a frame with the highest sharpness from the multi -frame image data, the clarity of the obtained image is effectively improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115942130B_ABST
    Figure CN115942130B_ABST
Patent Text Reader

Abstract

An image processing method and device, and a computer-readable storage medium, the image processing method comprising: after detecting that the focus is completed, grabbing N frames of image data; N ≥ 2 and N is a positive integer; performing clarity comparison on the N frames of image data, selecting a frame of image data with the highest clarity; processing the frame of image data with the highest clarity and then outputting it. The above scheme can obtain an image with higher clarity.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing technology, and in particular to an image processing method and device, and a computer-readable storage medium. Background Art

[0002] With the improvement of hardware performance of smart devices (such as smartphones) and the rapid development of artificial intelligence (AI) technology, the functions of image acquisition devices (such as cameras) on smart devices are becoming more and more abundant.

[0003] However, since most smart devices are handheld smart devices, when taking pictures with the camera in the smart device, slight shaking of the human hand will cause the acquired image to become blurred and the image clarity is poor. Summary of the invention

[0004] The embodiment of the present invention solves the technical problem of how to obtain an image with higher definition.

[0005] To solve the above technical problems, an embodiment of the present invention provides an image processing method, comprising: after detecting that focusing is completed, capturing N frames of image data; N ≥ 2 and N is a positive integer; performing clarity comparison on the N frames of image data, and selecting the frame of image data with the highest clarity; processing the frame of image data with the highest clarity and outputting it.

[0006] Optionally, the value of N is determined by the following steps: obtaining a scene detection result; and determining the value of N according to the scene detection result.

[0007] Optionally, the scene detection result includes a scene jitter parameter; the jitter parameter is positively correlated with the value of N.

[0008] Optionally, the jitter parameter includes at least one of the following: jitter frequency and jitter amplitude.

[0009] Optionally, the scene detection result includes at least one of the following: a current shooting scene, the brightness of the current shooting scene, and a sensor frame rate of an image acquisition device; the current shooting scene includes an indoor scene and / or an outdoor scene.

[0010] Optionally, performing clarity comparison on the N frames of image data includes: performing clarity comparison on the N frames of image data based on at least one of the following parameters: contrast, sharpness, and image edge data.

[0011] Optionally, performing clarity comparison on the N frames of image data includes: compressing the N frames of image data; and performing clarity comparison on the compressed N frames of image data.

[0012] An embodiment of the present invention also provides an image processing device, including: a capture unit, used to capture N frames of image data after detecting that focus is completed; N ≥ 2 and N is a positive integer; a comparison and selection unit, used to perform clarity comparison on the N frames of image data and select the frame of image data with the highest clarity; and a processing and output unit, used to process and output the frame of image data with the highest clarity.

[0013] An embodiment of the present invention further provides a computer-readable storage medium, which is a non-volatile storage medium or a non-transient storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned image processing methods are executed.

[0014] An embodiment of the present invention further provides another image processing device, including a memory and a processor, wherein the memory stores a computer program executable on the processor, and the processor executes the steps of any one of the above-mentioned image processing methods when running the computer program.

[0015] Compared with the prior art, the technical solution of the embodiment of the present invention has the following beneficial effects:

[0016] After the focus is detected, N frames of image data are captured, and a frame of image data with the highest definition is selected for subsequent processing and output. Since the frame of image data with the highest definition is obtained from the N frames of captured image data, the definition of the acquired image can be effectively improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 is a flow chart of an image processing method in an embodiment of the present invention;

[0018] Figure 2 It is a structural schematic diagram of an image processing device in an embodiment of the present invention. DETAILED DESCRIPTION

[0019] Take the smart device as a smartphone as an example. The smartphone has a built-in image acquisition device (hereinafter referred to as a camera). Usually, the camera's photo processing process is as follows: the user operates the smartphone through the human interaction interface (such as the touch screen of the smartphone), triggering the camera application (APP) to initiate a photo request; the photo request is transmitted to the underlying driver, and the underlying driver starts the photo processing process after receiving the photo request. It first determines whether the focus function needs to be started based on the current scene information. When the focus function needs to be started, the focus function is started and waits for the focus to be completed. After the focus is completed, the focus operation is locked and the image data is captured.

[0020] After the image data is captured, some preset post-processing operations are performed on the image data. The purpose of these post-processing operations is to improve the effect of the photographed image. Finally, it is encoded into a JPEG file through the JPEG encoder and notified to the camera application. The camera application saves the received JPEG file in the corresponding storage location.

[0021] In daily life, users usually hold their smartphones to take photos. Between focusing and capturing image data, factors such as hand shaking are inevitable, causing the captured image data to be blurry, affecting the user's photo-taking experience.

[0022] In the embodiment of the present invention, after the focus is detected, N frames of image data are captured, and a frame of image data with the highest definition is selected for subsequent processing and output. Since the frame of image data with the highest definition is obtained from the N frames of captured image data, the definition of the image finally obtained can be effectively improved.

[0023] In order to make the above-mentioned objects, features and beneficial effects of the present invention more obvious and easy to understand, specific embodiments of the present invention are described in detail below with reference to the accompanying drawings.

[0024] The embodiment of the present invention provides an image processing method, referring to Figure 1 , the following is a detailed description through specific steps.

[0025] Step 101: After detecting that the focus is completed, capture N frames of image data.

[0026] In a specific implementation, N is a positive integer and N≥2. That is, after it is detected that the focus is completed, two or more frames of image data can be captured continuously.

[0027] After capturing N frames of image data, the captured image data may be cached in a memory, or in a pre-set memory, for example, the captured data may be cached in a double rate dynamic random access memory (DDR).

[0028] In the embodiment of the present invention, the value of N can be adjusted accordingly according to the specific application scenario. That is, the value of N can be different for different application scenarios.

[0029] In a specific implementation, scene detection can be performed before focusing is detected to obtain a scene detection result. The scene detection result can characterize the application scene in which the current image capture is performed. According to the scene detection result, the corresponding N value is determined. Different scene detection results may correspond to different N values.

[0030] In a specific implementation, the scene detection result may include a jitter parameter, and the jitter parameter may be positively correlated with the value of N. That is, the larger the jitter parameter is, the larger the value of N may be.

[0031] In the embodiment of the present invention, the jitter parameter may include a jitter amplitude. The larger the jitter amplitude, the larger the value of N. Conversely, the smaller the jitter amplitude, the smaller the value of N.

[0032] In specific applications, a larger jitter amplitude means that the captured image is more likely to be blurry. Therefore, setting a larger N value and selecting the highest definition frame from as many frames of image data as possible can increase the probability of selecting high-definition new image data.

[0033] Accordingly, a smaller jitter amplitude means that the captured image is more likely to be clear. Therefore, setting a smaller N value and selecting a frame of image data with the highest clarity from fewer frames of image data can reduce the amount of image data that needs to be compared for clarity.

[0034] For example, a jitter amplitude threshold is preset. When the jitter amplitude is greater than the preset jitter amplitude threshold, N is set to 5; when the jitter amplitude is less than the preset jitter amplitude threshold, N is set to 3.

[0035] For another example, a first jitter amplitude threshold and a second jitter amplitude threshold are pre-set, and the first jitter amplitude threshold is greater than the second jitter amplitude threshold. When the jitter amplitude is greater than the first jitter amplitude threshold, N=5 is set; when the jitter amplitude is between the first jitter amplitude threshold and the second jitter amplitude threshold, N=4 is set; when the jitter amplitude is less than the first jitter amplitude threshold, N=2 is set.

[0036] In the embodiment of the present invention, the jitter parameter may include a jitter frequency. The greater the jitter frequency, the greater the value of N. Conversely, the smaller the jitter frequency, the smaller the value of N.

[0037] In specific applications, a higher jitter frequency means that the captured image is more likely to be blurry. Therefore, setting a larger N value and selecting the highest definition frame from as many frames of image data as possible can increase the probability of selecting high-definition new image data.

[0038] Accordingly, a smaller jitter frequency means that the captured image is more likely to be clear. Therefore, by setting a smaller N value and selecting a frame of image data with the highest clarity from fewer frames of image data, the amount of image data that needs to be compared for clarity can be reduced.

[0039] For example, a jitter frequency threshold is preset. When the jitter frequency is greater than the preset jitter frequency threshold, N is set to 5; when the jitter frequency is less than the preset jitter frequency threshold, N is set to 3.

[0040] It can be understood that the correspondence between the above jitter parameters and the values ​​of N can be set according to specific application scenarios and is not limited to the above examples.

[0041] In a specific implementation, the jitter parameters can be detected and obtained by using a gyroscope and an acceleration sensor installed in a smart device. Specifically, the specific implementation principle and process of obtaining jitter parameters by using a gyroscope and an acceleration sensor can refer to the prior art and will not be described in detail here.

[0042] In a specific implementation, the scene detection result may also include one or more of the current shooting scene, the brightness of the current shooting scene, and the sensor frame rate of the image acquisition device (such as a camera), etc. Specifically, the current shooting scene may include an indoor scene and / or an outdoor scene.

[0043] For different shooting scenes, different brightness, sensor frame rates of different image acquisition devices and their combinations, corresponding N values ​​can be set respectively.

[0044] For example, when the current shooting scene is an indoor scene, considering that the brightness of the indoor scene is poor, N=5 is set; when the current shooting scene is an outdoor scene, considering that the brightness of the outdoor scene is high, N=3 is set.

[0045] Furthermore, when the current shooting scene is an indoor scene, the scene brightness of the indoor scene is detected. If the scene brightness is greater than the preset brightness value, it is determined that the indoor scene is relatively bright, so N=4 is set; if the scene brightness is lower than the preset brightness value, it is determined that the indoor scene is relatively dark, so N=6 is set.

[0046] When the current shooting scene is an outdoor scene, the scene brightness of the outdoor scene is detected. If the scene brightness is greater than the preset brightness value, it is determined that the outdoor scene is relatively bright, so N=3 is set; if the scene brightness is lower than the preset brightness value, it is determined that the outdoor scene is relatively dark (such as night scene mode), so N=5 is set.

[0047] It is understandable that the above content only gives examples of N values ​​under some scene detection results. In specific applications, the correspondence between the scene detection results and the N values ​​can be set and stored in advance. Before capturing image data, the value of N can be determined based on the acquired scene detection results and the above pre-set mapping relationship.

[0048] In a specific implementation, when determining the value of N according to the scene detection result, the balance between the image clarity requirement and the shooting speed can be comprehensively considered to determine the value of N accordingly. If the image clarity requirement is low, a smaller N value can be used to achieve a faster shooting speed; if the image clarity requirement is high, a larger N value can be used to achieve clearer shooting.

[0049] In a specific implementation, the N frames of image data captured by the image acquisition device are in an image file (RAW) format. The N frames of image data are subjected to RAW domain data processing, RAW domain to RGB domain conversion, RGB domain processing, RGB domain to YUV domain conversion, and YUV domain processing to obtain YUV image data, and the obtained YUV image data is stored in DDR.

[0050] It is understandable that the specific process of processing the captured N frames of image data can refer to the prior art and will not be described in detail here.

[0051] Step 102, compare the clarity of N frames of image data, and select a frame of image data with the highest clarity.

[0052] In the embodiment of the present invention, after N frames of image data are captured, a clarity comparison may be performed on the N frames of image data, and a frame of image data with the highest clarity may be selected from the N frames of image data.

[0053] In a specific implementation, a frame of image data with the highest definition may be selected from N frames of image data based on a definition comparison algorithm in an image file (RAW) domain or a definition comparison algorithm in a YUV domain.

[0054] In one embodiment of the present invention, the clarity comparison of N frames of image data may be performed based on at least one parameter such as contrast, sharpness, image edge data, etc.

[0055] For example, a frame of image data with the highest contrast and sharpness is selected as a frame of image data with the highest clarity.

[0056] In specific implementation, the specific algorithm for image clarity comparison can be selected by comprehensively considering the balance between the image clarity requirement and the algorithm complexity. If the image clarity requirement is high, a more complex image clarity comparison algorithm can be selected; if the shooting speed requirement is high, a simpler image clarity comparison algorithm can be selected, which has lower calculation complexity and faster calculation speed.

[0057] Specifically, the specific algorithm implementation for performing clarity comparison on N frames of image data can refer to the prior art and will not be described in detail here.

[0058] Step 103, processing the frame of image data with the highest definition and then outputting it.

[0059] In a specific implementation, after obtaining a frame of image data with the highest definition, the image data with the highest definition can be post-processed and output.

[0060] In a specific application, it can be known that post-processing a frame of image data with the highest definition may include JPEG encoding the YUV image data corresponding to the image data to obtain a JPEG code stream, and then processing the obtained JPEG code stream to output the final image.

[0061] In summary, after the focus is detected, N frames of image data are captured, and the frame of image data with the highest definition is selected for subsequent processing and output. Since the frame of image data with the highest definition is obtained from the N frames of captured image data, the definition of the acquired image can be effectively improved.

[0062] Reference Figure 2 , an image processing device 20 in an embodiment of the present invention is given, comprising: a capture unit 201, a comparison and selection unit 202 and a processing and output unit 203, wherein:

[0063] The capture unit 201 is used to capture N frames of image data after detecting that the focus is completed; N ≥ 2 and N is a positive integer;

[0064] A comparison and selection unit 202, configured to compare the clarity of the N frames of image data and select a frame of image data with the highest clarity;

[0065] The processing and outputting unit 203 is used to process and output the frame of image data with the highest definition.

[0066] In a specific implementation, the specific execution process of the above-mentioned capture unit 201, the comparison and selection unit 202 and the processing and output unit 203 can correspond to the above-mentioned steps 101 to 103, which will not be repeated here.

[0067] In a specific implementation, each module / unit included in each device or product described in the above embodiments may be a software module / unit or a hardware module / unit, or may be partly a software module / unit and partly a hardware module / unit.

[0068] For example, for each device or product applied to or integrated in a chip, each module / unit contained therein may be implemented in the form of hardware such as circuits, or at least some of the modules / units may be implemented in the form of software programs, which run on a processor integrated inside the chip, and the remaining (if any) modules / units may be implemented in the form of hardware such as circuits; for each device or product applied to or integrated in a chip module, each module / unit contained therein may be implemented in the form of hardware such as circuits, and different modules / units may be located in the same component (such as a chip, circuit module, etc.) or different components of the chip module, or at least some of the modules / units may be implemented in the form of software programs. The element can be implemented in the form of a software program, which runs on a processor integrated inside the chip module, and the remaining (if any) modules / units can be implemented in the form of hardware such as circuits; for various devices and products applied to or integrated in the terminal, the various modules / units contained therein can be implemented in the form of hardware such as circuits, and different modules / units can be located in the same component (for example, chip, circuit module, etc.) or in different components in the terminal, or, at least some modules / units can be implemented in the form of a software program, which runs on a processor integrated inside the terminal, and the remaining (if any) modules / units can be implemented in the form of hardware such as circuits.

[0069] An embodiment of the present invention further provides a computer-readable storage medium, which is a non-volatile storage medium or a non-transient storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the image processing method provided in steps 101 to 103 are executed.

[0070] An embodiment of the present invention further provides an image processing device, including a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the processor runs the computer program, the steps of the image processing method provided in steps 101 to 103 are executed.

[0071] A person skilled in the art may understand that all or part of the steps in the various methods of the above embodiments may be completed by instructing the relevant hardware through a program, and the program may be stored in a computer-readable storage medium, which may include: ROM, RAM, disk or CD, etc.

[0072] Although the present invention is disclosed as above, the present invention is not limited thereto. Any person skilled in the art can make various changes and modifications without departing from the spirit and scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the scope defined by the claims.

Claims

1. An image processing method, characterized in that: include: After detecting that the focus is completed, capture N frames of image data; N≥2 and N is a positive integer; the value of N is determined by the following steps: obtaining a scene detection result; Determine a value of N according to the scene detection result; the scene detection result includes a jitter parameter, and the jitter parameter is positively correlated with the value of N; Comparing the clarity of the N frames of image data, and selecting a frame of image data with the highest clarity; The frame of image data with the highest definition is processed and then output.

2. The image processing method according to claim 1, characterized in that: The jitter parameter includes at least one of the following: jitter frequency and jitter amplitude.

3. The image processing method according to claim 1, characterized in that: The scene detection result includes at least one of the following: a current shooting scene, the brightness of the current shooting scene, and a sensor frame rate of an image acquisition device; the current shooting scene includes an indoor scene and / or an outdoor scene.

4. The image processing method according to claim 1, wherein: The performing clarity comparison on the N frames of image data includes: The N frames of image data are compared for clarity based on at least one of the following parameters: contrast, sharpness, and image edge data.

5. The image processing method according to claim 1, wherein: The performing clarity comparison on the N frames of image data includes: Compressing the N frames of image data; Perform clarity comparison on the compressed N frames of image data.

6. An image processing device, characterized in that: include: A capture unit, used for capturing N frames of image data after detecting that the focus is completed; N≥2 and N is a positive integer; the value of N is determined by the following steps: obtaining a scene detection result; determining the value of N according to the scene detection result; the scene detection result includes a jitter parameter, and the jitter parameter is positively correlated with the value of N; A comparison and selection unit, used for performing clarity comparison on the N frames of image data and selecting a frame of image data with the highest clarity; The processing and output unit is used to process and output the frame of image data with the highest definition.

7. A computer-readable storage medium, wherein the computer-readable storage medium is a non-volatile storage medium or a non-transient storage medium, and a computer program is stored thereon, wherein: When the computer program is executed by a processor, the steps of the image processing method according to any one of claims 1 to 5 are executed.

8. A device comprising a memory and a processor, wherein the memory stores a computer program executable on the processor, wherein: When the processor runs the computer program, the steps of the image processing method according to any one of claims 1 to 5 are performed.

Citation Information

Patent Citations

  • Image photographing method and mobile terminal

    CN107172296A

  • Photographing method and mobile terminal

    CN107509034A

  • Photographing problem searching method, problem searching device and terminal equipment

    CN108289176A