WO2022083229A1 - 图像处理方法、电子装置及非易失性计算机可读存储介质 - Google Patents

图像处理方法、电子装置及非易失性计算机可读存储介质 Download PDF

Info

Publication number
WO2022083229A1
WO2022083229A1 PCT/CN2021/110631 CN2021110631W WO2022083229A1 WO 2022083229 A1 WO2022083229 A1 WO 2022083229A1 CN 2021110631 W CN2021110631 W CN 2021110631W WO 2022083229 A1 WO2022083229 A1 WO 2022083229A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
preset
resolution
processors
threshold
Prior art date
Application number
PCT/CN2021/110631
Other languages
English (en)
French (fr)
Inventor
朱成明
Original Assignee
深圳市锐尔觅移动通信有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳市锐尔觅移动通信有限公司 filed Critical 深圳市锐尔觅移动通信有限公司
Publication of WO2022083229A1 publication Critical patent/WO2022083229A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/40Scaling of whole images or parts thereof, e.g. expanding or contracting
    • G06T3/4007Scaling of whole images or parts thereof, e.g. expanding or contracting based on interpolation, e.g. bilinear interpolation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/50Image enhancement or restoration using two or more images, e.g. averaging or subtraction
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10004Still image; Photographic image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20212Image combination
    • G06T2207/20221Image fusion; Image merging

Definitions

  • the present application relates to the field of electronic technologies, and more particularly, to an image processing method, an electronic device, and a non-volatile computer-readable storage medium.
  • the zoom resolution of the camera is a very important selling point.
  • the most common implementation method on the market is to directly use the image obtained when taking pictures to process to obtain the target image.
  • the target image obtained in this way often has more noise and low definition.
  • Embodiments of the present application provide an image processing method, an electronic device, and a computer-readable storage medium.
  • the image processing method of the embodiment of the present application includes: in the preview mode, buffering multiple frames of first images, each of which has a first resolution; screening out at least one image with a resolution greater than a preset resolution threshold from the multiple frames of first images One frame is used as an intermediate image; when performing photographing, at least one frame of a second image is obtained, the second image has a second resolution, and the second resolution is smaller than the first resolution; and the second image and the intermediate image are processed to obtain the target image.
  • the electronic device includes one or more processors, and the one or more processors are configured to: in the preview mode, buffer multiple frames of first images, and the first images all have a first resolution; Screening out at least one frame whose clarity is greater than a preset clarity threshold in the image as an intermediate image; when performing photographing, obtain at least one frame of a second image, the second image has a second resolution, and the second resolution is smaller than the first resolution and processing the second image and the intermediate image to obtain the target image.
  • the non-volatile computer-readable storage medium of the embodiments of the present application includes a computer program, and when the computer program is executed by one or more processors, causes the one or more processors to execute the following image processing method: Frame a first image, and the first images all have a first resolution; screen out at least one frame with a clarity greater than a preset clarity threshold from the multiple frames of the first image as an intermediate image; when performing photographing, obtain at least one frame of the first image.
  • the second image has a second resolution, the second resolution is smaller than the first resolution; and the second image and the intermediate image are processed to obtain the target image.
  • the image processing method, electronic device, and non-volatile computer-readable storage medium of the embodiments of the present application may implement the following methods: in the preview mode, multiple frames of first images are cached, and multiple frames of first images are cached, and the first images have The first resolution; screening out at least one frame with a definition greater than a preset definition threshold from the multiple frames of the first image as an intermediate image; when performing photographing, acquiring at least one frame of a second image, and the second image has a second resolution the second resolution is smaller than the first resolution; and processing the second image and the intermediate image to obtain the target image.
  • FIG. 1 is a schematic flowchart of an image processing method according to some embodiments of the present application.
  • FIG. 2 is a schematic structural diagram of an electronic device according to some embodiments of the present application.
  • FIG. 3 is a schematic diagram of a first image buffer queue of an image processing method according to some embodiments of the present application.
  • FIG. 4 is a schematic flowchart of an image processing method according to some embodiments of the present application.
  • FIGS. 5 and 6 are schematic flowcharts of image processing methods according to some embodiments of the present application.
  • FIG. 7 is a schematic diagram of a connection state between a non-volatile computer-readable storage medium and a processor according to some embodiments of the present application.
  • the image processing method of the embodiment of the present application includes:
  • step 03 Screening out at least one frame with a definition greater than a preset definition threshold from the multiple frames of the first image as an intermediate image, including:
  • 07 Process the second image and the intermediate image to obtain the target image, which may include:
  • 072 Interpolate the fused image to obtain the target image.
  • the second image includes multiple frames
  • 07 Process the second image and the intermediate image to obtain the target image, including:
  • the intermediate image includes multiple frames
  • 076 Interpolate the fused image to obtain the target image.
  • the upper limit of the preset range is equal to the preset matching threshold.
  • the zoomed first image is displayed on the display screen 20 .
  • the electronic device 100 of the embodiments of the present application includes one or more processors 30 .
  • the one or more processors 30 are configured to: in the preview mode, cache multiple frames of first images, and the first images all have the first resolution; and filter out at least those whose resolution is greater than a preset resolution threshold from the multiple frames of the first images.
  • One frame is used as an intermediate image; when performing photographing, at least one frame of a second image is obtained, the second image has a second resolution, and the second resolution is smaller than the first resolution; the second image and the intermediate image are processed to obtain the target image .
  • one or more processors 30 are configured to: obtain the sharpness value of each frame of the first image by using a grayscale variance function; The first image serves as an intermediate image.
  • one or more processors 30 are configured to: when the degree of matching between the second image and the intermediate image is greater than a preset matching threshold, compare the second image with the intermediate image performing fusion processing on the images to obtain a fusion image; and performing interpolation processing on the fusion image to obtain a target image.
  • one or more processors 30 are configured to: the degree of matching between the second image and the intermediate image is within a preset range, and the current ambient brightness is less than a preset When the brightness threshold is set, the second images of multiple frames are fused to obtain a fused image; and the fused image is interpolated to obtain a target image.
  • one or more processors 30 are configured to: the degree of matching between the second image and the intermediate image is within a preset range, and the current ambient brightness is greater than a preset When the brightness threshold is set, the multi-frame intermediate images are fused to obtain a fused image; and the fused image is interpolated to obtain a target image.
  • one or more processors 30 are configured to: control the display screen 20 to display the zoomed first image.
  • the upper limit of the preset range is equal to the preset matching threshold.
  • the non-volatile computer-readable storage medium 400 includes a computer program 401, and when the computer program 401 is executed by the processor 30, causes The processor 30 executes: in the preview mode, caches multiple frames of first images, and the first images all have the first resolution; and selects at least one frame whose resolution is greater than a preset resolution threshold from the multiple frames of the first images as an intermediate frame image; when performing photographing, obtain at least one frame of a second image, the second image has a second resolution, and the second resolution is smaller than the first resolution; process the second image and the intermediate image to obtain the target image.
  • the processor 30 when the computer program 401 is executed by the processor 30, the processor 30 is caused to execute: use the grayscale variance function to obtain the sharpness value of the first image of each frame; The first image whose degree value is greater than the sharpness threshold is used as an intermediate image.
  • the processor 30 executes: when the degree of matching between the second image and the intermediate image is greater than a preset matching threshold, Perform fusion processing on the second image and the intermediate image to obtain a fusion image; and perform interpolation processing on the fusion image to obtain a target image.
  • fusion processing is performed on multiple frames of the second image to obtain a fusion image; and interpolation is performed on the fusion image Process to get the target image.
  • the processor 30 executes: controlling the display screen 20 to display the zoomed first image.
  • the upper limit of the preset range is equal to the preset matching threshold.
  • an embodiment of the present application provides an image processing method, and the image processing method includes:
  • an electronic device 100 includes a battery 10 , a display screen 20 , one or more processors 30 , a system bus 40 and a memory 50 .
  • the image processing method of the embodiment of the present application can be applied to the electronic device 100 of the embodiment of the present application.
  • the battery 10 is used for powering the electronic device 100 .
  • the display screen 20 is used to display images and application software.
  • One or more processors 30 are used to perform the methods in 01, 03, 05 and 07.
  • the one or more processors 30 are configured to: in the preview mode, cache multiple frames of first images, all of which have a first resolution; filter out the multiple frames of first images with a resolution greater than a preset resolution threshold At least one frame of the image is taken as an intermediate image; when performing photographing, at least one frame of a second image is acquired, the second image has a second resolution, and the second resolution is smaller than the first resolution; and the second image and the intermediate image are processed to Get the target image.
  • the system bus 40 is used to transmit the information that needs to be used in the electronic device 100 , and the system bus 40 can be electrically connected to at least one of the battery 10 , the display screen 20 , one or more processors 30 , and the memory 50 , the embodiment of the present application
  • the system bus 40 is electrically connected to the battery 10 , the display screen 20 , one or more processors 30 , and the memory 50 .
  • the memory 50 can be used to store the information that needs to be stored (including the need to be cached) on the electronic device 100 .
  • the electronic device 100 includes a device with a camera function, such as a mobile phone, a tablet computer, and a smart watch.
  • a device with a camera function such as a mobile phone, a tablet computer, and a smart watch.
  • the device using the periscope lens needs to use a reflective prism, the light will be attenuated to a certain extent, and the expressiveness in the dark place is poor; while the device using the crop and zoom functions will output the original image.
  • the corresponding noise points during the zooming process will be magnified.
  • the magnification is mostly realized by interpolation, but the details are lost a lot, and the zooming effect is poor.
  • the image processing method and the electronic device 100 provided by the embodiments of the present application process the second image obtained when taking a photo by screening at least one frame whose resolution is greater than a preset resolution threshold from the multiple frames of the first image cached in the preview mode as an intermediate image. image and the intermediate image to obtain the target image. Compared with the direct output of the second image, due to the fusion of the intermediate image with higher definition, the final output target image has less noise, richer details, and better image zoom effect. good.
  • one or more processors 30 of the electronic device 100 when the user switches to a specific multiple for zooming and taking pictures and is in the preview mode, it can follow the demosaicing (high resolution) ) mode to output the image data of the first image, on the one hand, the output multiple frames of the first image are stored in the memory 50, and on the other hand, can be displayed on the display screen 20 to be presented to the user for preview.
  • demosaicing high resolution
  • the multi-frame first images have the first resolution and are buffered in the RAW data queue in the memory 50.
  • the data queue updates the latest image data in real time.
  • the queue size is defined as M, and the unit is frame.
  • the size of M is controlled at Within a reasonable range, specifically, the size of 2 ⁇ M ⁇ 10.
  • M ⁇ 2 the number of frames in the first image is small, and it is difficult to ensure that the intermediate image with higher definition can be found, resulting in poor subsequent fusion effect, and the output target image still has more noise and details. Image zoom is not good.
  • M is greater than 10
  • the number of frames of the first image is large, which on the one hand occupies more storage space in the memory 50, and on the other hand slows down the process of filtering out intermediate images with higher definition, and the processing speed is slowed down.
  • 2 ⁇ M ⁇ 10 can avoid the loss of image quality caused by body or hand vibration when the user takes a zoom photo, so it can ensure that the output target image has less noise, rich details, and image zoom effect.
  • the storage space of the memory 50 is not occupied too much, and the processing speed is accelerated.
  • step 03 Screening out at least one frame with a definition greater than a preset definition threshold from the multiple frames of the first image as an intermediate image, which may include:
  • one or more processors 30 are further configured to perform the methods in 031 and 033 . That is, the one or more processors 30 are further configured to obtain the sharpness value of each frame of the first image by using the grayscale variance function and select the first image with sharpness greater than the sharpness threshold as the intermediate image.
  • the sharpness value of the first image of each frame is obtained by using a grayscale variance function.
  • the principle of the grayscale variance function is that when it is fully focused, the image is the clearest, and there are many high-frequency components in the image, so the grayscale change can be used as the basis for focusing evaluation.
  • the formula of the grayscale variance function is as follows:
  • f(x, y) represents the gray value of the image f at the corresponding pixel point (x, y)
  • D(f) is the image definition calculation result.
  • the grayscale variance function calculates the first images of each frame in the cache queue, obtains the sharpness values of all the first images in the buffer queue, and selects at least one frame whose sharpness is greater than the preset sharpness threshold as an intermediate image.
  • the resolutions of the first images of 10 frames are 95, 92, 91, 89, 85, 84, 82, 80, 79, and 78 respectively. If the degree threshold is 90, then the one or more processors 30 filter out the first images with the resolutions of 95, 92, and 91, respectively, as intermediate images. That is, the number of frames of the intermediate image is greater than or equal to one frame and less than the number of frames of the first image.
  • the one or more processors 30 may clear other first images that do not meet the conditions in the cache queue of the memory 50, and only Retain at least one frame of intermediate images obtained by screening to release the memory space of the memory 50. In this way, on the one hand, the memory space of the memory 50 can be saved; The execution performance of the multiple processors 30 further increases the processing speed.
  • the sharpness value of the first image may also be obtained through the following common sharpness calculation functions: Brenner gradient function, Tenengrad gradient function, and Laplacian gradient function.
  • the Brenner gradient function calculates the square of the grayscale difference between two adjacent pixels.
  • the formula of the Brenner gradient function is as follows:
  • the Tenengrad gradient function uses the Sobel operator to extract the gradient values in the horizontal and vertical directions respectively.
  • the formula of the Tenengrad gradient function is as follows:
  • G(x,y) has the following form:
  • T is the given edge detection threshold
  • G(x,y) is the convolution of Sobel's horizontal and vertical edge detection operators at the pixel point (x,y).
  • the Laplacian gradient function is basically the same as the Tenengrad gradient function.
  • the Sobel operator can be replaced by the Laplacian operator. The operator is defined as follows:
  • G(x,y) is the convolution of the Laplacian operator at the pixel (x,y).
  • the image processing method provided by the present application further includes:
  • the display screen 20 may be used to display the zoomed first image.
  • the demosaic mode can be used to output the first image.
  • the outputted first image does not need to be cropped in the electronic device 100, and only needs to be
  • the display screen 20 displays the zoomed (including reduced and enlarged) first image.
  • the display of the preview first image mostly adopts an image reduction technology, and the first image is reduced to fit the area of the display screen 20. make the display more normal.
  • one or more processors 30 are further configured to perform the method in 05 . That is, when photographing is performed, at least one frame of a second image is acquired, the second image has a second resolution, and the second resolution is smaller than the first resolution.
  • the electronic device 100 switches to a low-resolution output mode, such as a pixel binning (4-in-1, 8-in-1, or 16-in-1, etc.) output mode.
  • the photosensitive amount of the lens of the electronic device 100 increases, the expressiveness in the dark place is good, and the noise is less, and at least one frame of the second image is acquired at this time.
  • the electronic device 100 will switch to a corresponding output setting, and different zoom factors correspond to different second resolutions of the second image.
  • Table 1 is the correspondence table between zoom ratios and image output settings when taking pictures, where the larger the zoom range, the smaller the second resolution.
  • the second resolution of the second image obtained after taking the photo is 16M (the first resolution of the preview image at 1.5 times zoom is larger than 16M).
  • the second resolution of the second image obtained after taking the photo is 4M (the first resolution of the preview image at 3x zoom is greater than 4M, eg, 16M).
  • the second resolution of the second image obtained after taking the photo is 1M. (The first resolution of the preview image at 6x zoom is greater than 1M, for example, 16M).
  • 07 Process the second image and the intermediate image to obtain the target image, which may include:
  • 072 Interpolate the fused image to obtain the target image.
  • one or more processors 30 are further configured to execute the methods in 071 and 072 . That is, the one or more processors 30 are further configured to: when the degree of matching between the second image and the intermediate image is greater than the preset matching threshold, perform fusion processing on the second image and the intermediate image to obtain a fusion image; and The fused image is interpolated to obtain the target image.
  • SIFT scale-invariant feature transform
  • one or more processors 30 judge the degree of matching between the second image and the intermediate image, and when the degree of matching between the second image and the intermediate image is greater than the preset matching threshold, it indicates that the intermediate image is very similar to the second image. If the intermediate image with higher definition and the second image are used for fusion processing, the respective advantages of the intermediate image and the second image can be extracted, so that the noise of the final output target image is greatly reduced and the clarity is improved. Therefore, fusion processing is performed on the second image and the intermediate image, wherein the fusion processing includes multi-frame noise reduction algorithm processing, and the multi-frame noise reduction processing removes noise in the fusion image, so that the dark parts of the fusion image perform better.
  • the interpolation processing includes: neighborhood interpolation processing, bilinear interpolation processing and trilinear interpolation processing.
  • the neighborhood interpolation algorithm refers to: in the four adjacent pixels of the pixel to be determined, assign the grayscale of the pixel closest to the pixel to be determined to the pixel to be determined.
  • the coordinate position of the pixel to be determined in the final image needs to be determined. After rounding, the pixel value of the corresponding coordinate is the value of the pixel to be determined.
  • the bilinear interpolation algorithm refers to: performing linear interpolation in two directions respectively, and obtaining the pixel to be determined by interpolating four adjacent pixels.
  • the bilinear interpolation algorithm takes into account the influence of the correlation of the four directly adjacent pixels around the pixel to be determined, so it has a smoothing function and can effectively overcome the shortcomings of the neighborhood interpolation algorithm.
  • the trilinear interpolation algorithm Refers to: using the grayscale values of 16 pixels around the pixel to be calculated for cubic interpolation, not only considering the grayscale influence of the four directly adjacent points, but also considering the influence of the grayscale value change rate between adjacent points, Interpolation works best.
  • the Mean Absolute Differences (MAD) algorithm and the Speeded Up Robust Feastures (SURF) algorithm can also be used.
  • the MAD algorithm is to take a subgraph of the same size as the template graph in the search graph, and calculate the similarity between the subgraph and the template; traverse the entire search graph, and find the subgraph that is most similar to the template graph in all the subgraphs that can be obtained. The similarity corresponding to the graph is used as the final matching result.
  • the SURF algorithm includes: constructing Hessian, generating all interest points for feature extraction; constructing scale space; feature point location; feature point principal direction assignment; generating feature point description and feature point matching.
  • 07 Process the second image and the intermediate image to obtain the target image, which may include:
  • one or more processors 30 are further configured to perform the methods in 073 and 074 . That is, the one or more processors 30 are further configured to: fuse multiple frames of second images when the degree of matching between the second image and the intermediate image is within a preset range and the current ambient brightness is less than a preset brightness threshold processing to obtain a fused image; and performing interpolation processing on the fused image to obtain a target image.
  • the upper limit of the preset range may be equal to the preset matching threshold.
  • the preset matching threshold is 90
  • the preset range can be greater than 85 and less than or equal to 90; when the matching degree between the second image and the intermediate image is 88, the matching degree between the second image and the intermediate image is between within the preset range.
  • the matching degree between the second image and the intermediate image is within the preset range, and the current ambient brightness is less than the preset brightness threshold, since the multiple frames of the second image are output in the low-resolution mode, the expression in the dark place is better, and at the same time There is less noise.
  • the multi-frame second image is fused, and finally the fused image is interpolated to obtain the original size of the target image.
  • the fusion processing for the second image may be performed only on the one frame of noise reduction processing to further remove the noise in the second image, and finally the second image is subjected to interpolation processing to obtain The original size of the target image.
  • the original size in the original-sized target image is the same as explained above, and the interpolation processing is also explained as above, and detailed description is omitted here.
  • 07 Process the second image and the intermediate image to obtain the target image, which may include:
  • 076 Interpolate the fused image to obtain the target image.
  • one or more processors 30 are further configured to perform the methods in 075 and 076 . That is, the one or more processors 30 are further configured to: when the degree of matching between the second image and the intermediate image is within a preset range and the current ambient brightness is greater than the preset brightness threshold, perform fusion processing on the multiple frames of intermediate images , to obtain a fused image; and perform interpolation processing on the fused image to obtain a target image.
  • the upper limit of the preset range may be equal to the preset matching threshold.
  • the preset matching threshold is 90
  • the preset range can be greater than 85 and less than or equal to 90; when the matching degree between the second image and the intermediate image is 88, the matching degree between the second image and the intermediate image is between within the preset range.
  • the matching degree between the second image and the intermediate image is within the preset range, and the current ambient brightness is greater than the preset brightness threshold, since the multi-frame intermediate images are output in the demosaic mode, the definition is better.
  • the image is fused to obtain a fused image, and finally the fused image is interpolated to obtain a target image of the original size.
  • the fusion processing on the intermediate image may be noise reduction processing to remove noise in the intermediate image, and finally, the intermediate image is subjected to interpolation processing to obtain the original-sized target image.
  • the original size in the original-sized target image in this embodiment is the same as explained above, and the interpolation processing is also explained as above, and detailed description is omitted here.
  • a non-volatile computer-readable storage medium 400 containing a computer program 401 is also provided.
  • the computer program 401 When executed by one or more processors 30, the computer program 401 causes the one or more processors 30 to execute the image processing method of any one of the above-described embodiments.
  • the non-volatile computer-readable storage medium 400 can be set in the electronic device 100, and can also be set in a cloud server or other devices. At this time, the electronic device 100 can communicate with the cloud server or other devices to obtain the corresponding computer. Procedure 410.
  • FIG. 1 , FIG. 2 , FIG. 4 and FIG. 7 when the computer program 401 is executed by one or more processors 30 , the one or more processors 30 execute The methods of 033, 07, 071, 072, 073, 074, 075 and 076. For example, execute the following image processing methods:
  • the one or more processors 30 are caused to perform the following image processing methods:
  • 072 Interpolate the fused image to obtain the target image.
  • 076 Interpolate the fused image to obtain the target image.
  • computer program 401 when executed by one or more processors 30, causes one or more processors 30 to perform the following image processing methods:
  • 072 Interpolate the fused image to obtain the target image.
  • computer program 401 when executed by one or more processors 30, causes one or more processors 30 to perform the following image processing methods:
  • computer program 401 when executed by one or more processors 30, causes one or more processors 30 to perform the following image processing methods:
  • 076 Interpolate the fused image to obtain the target image.
  • computer program 401 when executed by one or more processors 30, causes one or more processors 30 to perform the following image processing methods:
  • 072 Interpolate the fused image to obtain the target image.
  • computer program 401 when executed by one or more processors 30, causes one or more processors 30 to perform the following image processing methods:
  • 072 Interpolate the fused image to obtain the target image.
  • 076 Interpolate the fused image to obtain the target image.
  • computer program 401 when executed by one or more processors 30, causes one or more processors 30 to perform the following image processing methods:
  • 076 Interpolate the fused image to obtain the target image.

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Image Processing (AREA)
  • Studio Devices (AREA)

Abstract

一种图像处理方法,电子装置和非易失性计算机可读存储介质。图像处理方法包括:在预览模式时,缓存多帧具有第一分辨率第一图像;从多帧第一图像中筛选出清晰度大于预设清晰阈值的至少一帧以作为中间图像;在执行拍照时,获取至少一帧第二图像,第二图像具有小于第一分辨率的第二分辨率;处理第二图像及中间图像以获取目标图像。

Description

图像处理方法、电子装置及非易失性计算机可读存储介质
优先权信息
本申请请求2020年10月23日向中国国家知识产权局提交的、专利申请号为202011146332.2的专利申请优先权和权益,并且通过参展将其全文并入此处。
技术领域
本申请涉及电子技术领域,更具体而言,涉及一种图像处理方法、电子装置及非易失性计算机可读存储介质。
背景技术
目前电子厂商为了打造相机的特色,相机的变焦清晰度是一个很重要的卖点。市面上最多的实现方式是直接利用拍照时获取的图像进行处理以得到目标图像,这样获取的目标图像往往噪点会比较多,清晰度不高。
发明内容
本申请实施方式提供一种图像处理方法、电子装置及计算机可读存储介质。
本申请实施方式的图像处理方法包括:在预览模式时,缓存多帧第一图像,第一图像均具有第一分辨率;从多帧第一图像中筛选出清晰度大于预设清晰阈值的至少一帧以作为中间图像;在执行拍照时,获取至少一帧第二图像,第二图像具有第二分辨率,第二分辨率小于第一分辨率;及处理第二图像及中间图像以获取目标图像。
本申请实施方式的电子装置包括一个或多个处理器,一个或多个处理器用于:在预览模式时,缓存多帧第一图像,第一图像均具有第一分辨率;从多帧第一图像中筛选出清晰度大于预设清晰阈值的至少一帧以作为中间图像;在执行拍照时,获取至少一帧第二图像,第二图像具有第二分辨率,第二分辨率小于第一分辨率;及处理第二图像及中间图像以获取目标图像。
本申请实施方式的非易失性计算机可读存储介质包括计算机程序,计算机程序被一个或多个处理器执行时,使得一个或多个处理器执行如下图像处理方法:在预览模式时,缓存多帧第一图像,第一图像均具有第一分辨率;从多帧第一图像中筛选出清晰度大于预设清晰阈值的至少一帧以作为中间图像;在执行拍照时,获取至少一帧第二图像,第二图像具有第二分辨率,第二分辨率小于第一分辨率;及处理第二图像及中间图像以获取目标图像。
本申请实施方式的图像处理方法、电子装置和非易失性计算机可读存储介质可实现以下方法:在预览模式时,缓存多帧第一图像,缓存多帧第一图像,第一图像均具有第一分辨率;从多帧第一图像中筛选出清晰度大于预设清晰阈值的至少一帧以作为中间图像;在执行拍照时,获取至少一帧第二图像,第二图像具有第二分辨率,第二分辨率小于第一分辨率;及处理第二图像及中间图像以获取目标图像。
本申请的附加方面和优点将在下面的描述中部分给出,部分将从下面的描述中变得明显,或通过本申请的实践了解到。
附图说明
本申请上述的和/或附加的方面和优点从下面结合附图对实施例的描述中将变得明显和容易理解,其中:
图1是本申请某些实施方式的图像处理方法的流程示意图;
图2是本申请某些实施方式的电子装置的结构示意图;
图3是本申请某些实施方式的图像处理方法的第一图像缓存队列示意图;
图4是本申请某些实施方式的图像处理方法的流程示意图;
图5和图6是本申请某些实施方式的图像处理方法的流程示意图;
图7是本申请某些实施方式的非易失性计算机可读存储介质和处理器的连接状态示意图。
具体实施方式
下面详细描述本申请的实施例,所述实施例的示例在附图中示出,其中自始至终相同或类似的标号表示相同或类似的元件或具有相同或类似功能的元件。下面通过参考附图描述的实施例是示例性的,旨在用于解释本申请,而不能理解为对本申请的限制。
下文的公开提供了许多不同的实施例或例子用来实现本申请的不同结构。为了简化本申请的公开,下文中对特定例子的部件和设置进行描述。当然,它们仅仅为示例,并且目的不在于限制本申请。此外,本申请可以在不同例子中重复参考数字和/或字母。这种重复是为了简化和清楚的目的,其本身不指示所讨论各种实施例和/或设置之间的关系。此外,本申请提供了的各种特定的工艺和材料的例子,但是本领域普通技术人员可以意识到其他工艺的可应用于性和/或其他材料的使用。
请参阅图1,本申请实施方式的图像处理方法包括:
01:在预览模式时,缓存多帧第一图像,第一图像均具有第一分辨率;
03:从多帧第一图像中筛选出清晰度大于预设清晰阈值的至少一帧以作为中间图像;
05:在执行拍照时,获取至少一帧第二图像,第二图像具有第二分辨率,第二分辨率小于第一分辨率;及
07:处理第二图像及中间图像以获取目标图像。
请参阅图4,在某些实施方式中,03:从多帧第一图像中筛选出清晰度大于预设清晰阈值的至少一帧以作为中间图像,包括:
031:采用灰度方差函数获取每帧第一图像的清晰度值;及
033:将清晰度值大于清晰阈值的第一图像作为中间图像。
请参阅图4,在某些实施方式中,07:处理第二图像及中间图像以获取目标图像,可包括:
071:在第二图像与中间图像之间的匹配度大于预设匹配阈值时,对第二图像与中间图像进行融合处理,以得到融合图像;及
072:对融合图像进行插值处理以得到目标图像。
请参阅图4,在某些实施方式中,第二图像包括多帧,07:处理第二图像及中间图像以获取目标图像,包括:
073:在第二图像与中间图像之间的匹配度在预设范围内,且当前环境亮度小于预设亮度阈值时,对多帧第二图像进行融合处理,以得到融合图像;及
074:对融合图像进行插值处理以得到目标图像。
请参阅图4,在某些实施方式中,中间图像包括多帧,07:处理第二图像及中间图像以获取目标图像,包括:
075:在第二图像与中间图像之间的匹配度在预设范围内,且当前环境亮度大于预设亮度阈值时,对多帧中间图像进行融合处理,以得到融合图像;及
076:对融合图像进行插值处理以得到目标图像。
在某些实施方式中,预设范围的上限等于预设匹配阈值。
请参阅图4,在某些实施方式中,在显示屏20上显示经过缩放后的第一图像。
请参阅图1和图2,在某些实施方式中,本申请实施方式的电子装置100包括一个或多个处理器30。一个或多个处理器30用于:在预览模式时,缓存多帧第一图像,第一图像均具有第一分辨率;从多帧第一图像中筛选出清晰度大于预设清晰阈值的至少一帧以作为中间图像;在执行拍照时,获取至少一帧第二图像,第二图像具有第二分辨率,第二分辨率小于第一分辨率;处理第二图像及中间图像以获取目标图像。
请参阅图2和图4,在某些实施方式中,一个或多个处理器30用于:采用灰度方差函数获取每帧第一图像的清晰度值;及将清晰度值大于清晰阈值的第一图像作为中间图像。
请参阅图2和图4,在某些实施方式中,一个或多个处理器30用于:在第二图像与中间图像之间的匹配度大于预设匹配阈值时,对第二图像与中间图像进行融合处理,以得到融合图像;及对融合图像进行插值处理以得到目标图像。
请参阅图2和图4,在某些实施方式中,一个或多个处理器30用于:在第二图像与中间图像之间的 匹配度在预设范围内,且当前环境亮度小于预设亮度阈值时,对多帧第二图像进行融合处理,以得到融合图像;及对融合图像进行插值处理以得到目标图像。
请参阅图2和图4,在某些实施方式中,一个或多个处理器30用于:在第二图像与中间图像之间的匹配度在预设范围内,且当前环境亮度大于预设亮度阈值时,对多帧中间图像进行融合处理,以得到融合图像;及对融合图像进行插值处理以得到目标图像。
请参阅图2和图4,在某些实施方式中,一个或多个处理器30用于:控制显示屏20显示经过缩放后的第一图像。
在某些实施方式中,预设范围的上限等于预设匹配阈值。
请参阅图1及图7,本申请实施方式的非易失性计算机可读存储介质400,非易失性计算机可读存储介质400包括计算机程序401,计算机程序401被处理器30执行时,使得处理器30执行:在预览模式时,缓存多帧第一图像,第一图像均具有第一分辨率;从多帧第一图像中筛选出清晰度大于预设清晰阈值的至少一帧以作为中间图像;在执行拍照时,获取至少一帧第二图像,第二图像具有第二分辨率,第二分辨率小于第一分辨率;处理第二图像及中间图像以获取目标图像。
请参阅图1及图7,在某些实施方式中,计算机程序401被处理器30执行时,使得处理器30执行:采用灰度方差函数获取每帧第一图像的清晰度值;及将清晰度值大于清晰阈值的第一图像作为中间图像。
请参阅图1及图7,在某些实施方式中,计算机程序401被处理器30执行时,使得处理器30执行:在第二图像与中间图像之间的匹配度大于预设匹配阈值时,对第二图像与中间图像进行融合处理,以得到融合图像;及对融合图像进行插值处理以得到目标图像。
在第二图像与中间图像之间的匹配度在预设范围内,且当前环境亮度小于预设亮度阈值时,对多帧第二图像进行融合处理,以得到融合图像;及对融合图像进行插值处理以得到目标图像。
在第二图像与中间图像之间的匹配度在预设范围内,且当前环境亮度大于预设亮度阈值时,对多帧中间图像进行融合处理,以得到融合图像;及对融合图像进行插值处理以得到目标图像。
请参阅图1及图7,在某些实施方式中,计算机程序401被处理器30执行时,使得处理器30执行:控制显示屏20显示经过缩放后的第一图像。
在某些实施方式中,预设范围的上限等于预设匹配阈值。
请参阅图1,本申请实施方式提供一种图像处理方法,该图像处理方法包括:
01:在预览模式时,缓存多帧第一图像,第一图像均具有第一分辨率;
03:从多帧第一图像中筛选出清晰度大于预设清晰阈值的至少一帧以作为中间图像;
05:在执行拍照时,获取至少一帧第二图像,第二图像具有第二分辨率,第二分辨率小于第一分辨率;及
07:处理第二图像及中间图像以获取目标图像。
请参阅图2,本申请实施方式的电子装置100,该电子装置100包括电池10、显示屏20、一个或多个处理器30、系统总线40和存储器50。本申请实施方式的图像处理方法可应用于本申请实施方式的电子装置100。其中,电池10用于为电子装置100供电。显示屏20用于显示图像和应用软件。一个或多个处理器30用于执行01、03、05和07中的方法。即,一个或多个处理器30用于:在预览模式时,缓存多帧第一图像,第一图像均具有第一分辨率;从多帧第一图像中筛选出清晰度大于预设清晰阈值的至少一帧以作为中间图像;在执行拍照时,获取至少一帧第二图像,第二图像具有第二分辨率,第二分辨率小于第一分辨率;及处理第二图像及中间图像以获取目标图像。系统总线40用于传输电子装置100中需要用到的信息,系统总线40可与电池10、显示屏20、一个或多个处理器30、和存储器50中的至少一个电连接,本申请实施方式中,系统总线40与电池10、显示屏20、一个或多个处理器30、和存储器50均电连接。存储器50可用于存储包含电子装置100上需要存储(包括需缓存)的信息。
电子装置100包括手机、平板电脑、智能手表等具有拍照功能的设备。当用户进行变焦拍照时,采用潜望式镜头的装置需要用到反射棱镜,光线会有一定程度的衰减,在暗处的表现力较差;而采用裁剪和缩放功能的装置对输出的原图进行操作,缩放过程中对应的噪点会被放大,同时放大大多采用插值方式来实现,细节反而损失很多,变焦效果较差。
本申请实施方式提供的图像处理方法及电子装置100通过从预览模式时缓存的多帧第一图像中筛选 清晰度大于预设清晰阈值的至少一帧作为中间图像,处理在拍照时获取的第二图像和中间图以获得目标图像,相较于直接输出第二图像而言,由于融合了清晰度较高的中间图像,使得最终输出的目标图像噪点较少,细节也更丰富,图像变焦效果更佳。
请参阅图2和图3,本申请实施方式的电子装置100的一个或多个处理器30,在用户切换到具体某个倍数进行变焦拍照并处于预览模式时,可按照去马赛克(高分辨率)模式输出第一图像的图像数据,输出的多帧第一图像一方面存储到存储器50中,一方面可以通过显示屏20显示出来以呈现给用户预览。
请参阅图4,多帧第一图像具有第一分辨率并且缓存在存储器50中的RAW数据队列中,数据队列实时更新最新图像数据,队列大小定义为M,单位为帧,M的大小控制在合理范围内,具体地,2≤M≤10的大小。当M<2,则第一图像的帧数较少,很难保证能够找出清晰度较高的中间图像,导致后续融合效果不佳,输出的目标图像噪点仍较多,细节也不丰富,图像变焦效果不佳。当M大于10,则第一图像的帧数较多,一方面会占据存储器50中较多的存储空间,另一方面会减缓筛选出清晰度较高的中间图像的进程,处理速度减慢。而本申请中2≤M≤10,可避免用户在变焦拍照时因身体或手部震动带来的图像质量的损失,因此可在保证输出的目标图像噪点仍较少,细节丰富,图像变焦效果较佳的同时,还不过多占据存储器50的存储空间,及加快处理速度。
请参阅图1和图4,在某些实施方式中,03:从多帧第一图像中筛选出清晰度大于预设清晰阈值的至少一帧以作为中间图像,可包括:
031:采用灰度方差函数获取每帧第一图像的清晰度值;及
033:将清晰度值大于清晰阈值的第一图像作为中间图像。
请参阅图2和图4,在某些实施方式中,一个或多个处理器30还用于执行031和033中的方法。即,一个或多个处理器30还用于采用灰度方差函数获取每帧第一图像的清晰度值和选择清晰度大于清晰阈值的第一图像作为中间图像。
在某些实施方式中,每帧第一图像的清晰度值通过采用灰度方差函数获取。灰度方差函数的原理为当完全聚焦时,图像最清晰,图像中的高频分量也很多,故可将灰度变化作为聚焦评价的依据。灰度方差函数的公式如下:
D(f)=∑ yx(|f(x,y)-f(x,y-1)|+|f(x,y)-f(x+1,y)|)        公式1
其中:f(x,y)表示图像f在对应像素点(x,y)的灰度值,D(f)为图像清晰度计算结果。灰度方差函数对缓存队列中每帧第一图像进行计算,得到缓存队列中所有第一图像的清晰度值,从中筛选出清晰度大于预设清晰阈值的至少一帧作为中间图像。
例如,假设M=10,通过灰度方差函数计算得到的,10帧第一图像的清晰度分别为95、92、91、89、85、84、82、80、79、78,若预设清晰度阈值为90,则一个或多个处理器30筛选出清晰度分别为95、92和91的第一图像作为中间图像。即中间图像的帧数大于等于一帧且小于第一图像的帧数。当一个或多个处理器30筛选得到清晰度大于预设清晰阈值的至少一帧中间图像之后,一个或多个处理器30可清除存储器50的缓存队列中不符合条件的其他第一图像,仅保留筛选得到的至少一帧中间图像以释放存储器50的内存空间,如此,一方面能够节省存储器50的存储空间,另一方面,可以方便一个或多个处理器30快速访问存储器50以提高一个或多个处理器30的执行性能,从而进一步加快处理速度。
第一图像的清晰度值还可以通过以下几种常见的清晰度计算函数获取:Brenner梯度函数、Tenengrad梯度函数和Laplacian梯度函数。Brenner梯度函数通过计算相邻两个像素灰度差的平方,Brenner梯度函数的公式如下:
D(f)=∑ yx|f(x+2,y)-f(x,y)| 2      公式2
Tenengrad梯度函数采用Sobel算子分别提取水平和垂直方向的梯度值,Tenengrad梯度函数的公式如下:
D(f)=∑ yx|G(x,y)|(G(x,y)>T)      公式3
G(x,y)的形式如下:
Figure PCTCN2021110631-appb-000001
其中,T是给定的边缘检测阈值,G(x,y)是像素点(x,y)处Sobel水平和垂直方向边缘检测算子的卷积。Laplacian梯度函数和Tenengrad梯度函数基本一致,用Laplacian算子替代Sobel算子即可,该算子 定义如下:
Figure PCTCN2021110631-appb-000002
Laplacian梯度函数的公式如下:
D(f)=∑ yx|G(x,y)|(G(x,y)>T)      公式6
其中,G(x,y)是像素点(x,y)处Laplacian算子的卷积。
请参阅图4,在某些实施方式中,本申请方式提供的图像处理方法还包括:
04:在显示屏上显示经过缩放后的第一图像。
请参阅图2,对应地,显示屏20可以用于显示经过缩放后的第一图像。
请结合图4及图5,由于预览场景是实时输出的,对实时性要求较高,可采用去马赛克模式输出第一图像,输出后的第一图像在电子装置100不必再裁剪,只需要在显示屏20显示经过缩放(包括缩小和放大)后的第一图像,本实施方式中,显示预览第一图像更多是采用图像缩小技术,缩小第一图像是为了适应显示屏20的区域大小,使得显示更为正常。
请参阅图1和图2,在某些实施方式中,一个或多个处理器30还用于执行05中的方法。即,在执行拍照时,获取至少一帧第二图像,第二图像具有第二分辨率,第二分辨率小于第一分辨率。
具体地,请参阅图6,在拍照瞬间,电子装置100切换到低分辨率输出模式,例如像素合并(4合1、8合1、或16合1等)输出模式,由于像素合并输出,则电子装置100的镜头的感光量变大,暗处的表现力好,同时噪点更少,此时获取至少一帧第二图像。在用户确定好变焦倍数并执行拍照时,电子装置100会切换到相应的输出设置,不同变焦倍数下对应不同的第二图像的第二分辨率。请参见下表1,为执行拍照时,变焦倍数与图像输出设置的对应关系表,其中,变焦范围越大,第二分辨率越小。例如,当用户切换到1.5倍变焦倍数时,执行拍照后获取的第二图像的第二分辨率为16M(1.5倍变焦时的预览图像的第一分辨率大于16M)。当用户切换到3倍变焦倍数时,执行拍照后获取的第二图像的第二分辨率为4M(3倍变焦时的预览图像的第一分辨率大于4M,例如为16M)。当用户切换到6倍变焦倍数时,执行拍照后获取的第二图像的第二分辨率为1M。(6倍变焦时的预览图像的第一分辨率大于1M,例如为16M)。
表1
变焦倍数 输出设置
1x<=zoom<=2x 16M
2x<=zoom<5x 4M
zoom>=5x 1M
请参阅图1和图4,在某些实施方式中,07:处理第二图像及中间图像以获取目标图像,可包括:
071:在第二图像与中间图像之间的匹配度大于预设匹配阈值时,对第二图像与中间图像进行融合处理,以得到融合图像;及
072:对融合图像进行插值处理以得到目标图像。
请参阅图2和图4,在某些实施方式中,一个或多个处理器30还用于执行071及072中的方法。即,一个或多个处理器30还用于:在第二图像与中间图像之间的匹配度大于预设匹配阈值时,对第二图像与中间图像进行融合处理,以得到融合图像;及对融合图像进行插值处理以得到目标图像。
请参阅图6,在对第二图像和中间图像进行匹配时,考虑到可能会有旋转,可以选择尺度不变特征转换(Scale-invariant feature transform,SIFT)方式实现匹配。SIFT实现思路是通过高斯微分函数识别所有兴趣点;构建尺度空间;特征点精确定位;特征点主方向分配;生成特征点描述子及特征点匹配。SIFT可实现同一目标在不同时间、不同分辨率、不同光照、不同位姿情况下所成的图像相对应,对光线、噪声、微视角改变的容忍度也相当高。匹配过程中,一个或多个处理器30对第二图像与中间图像的匹配度进行判断,当第二图像与中间图像的匹配度大于预设匹配阈值时,表明中间图像与第二图像极为相似,若利用清晰度较高的中间图像与第二图像进行融合处理,可以提取中间图像与第二图像中各自的优点,使得最终输出的目标图像的噪声大大降低,清晰度搞。因此,对第二图像和中间图像进行融合处理,其中,融合处理包括多帧降噪算法处理,多帧降噪处理去除融合图像中的噪点,使得融合图像的暗处表 现更好。最后再对融合图像进行插值处理得到需要尺寸大小的目标图像。目标图像的尺寸可以等于第一图像的尺寸,也可以第二第二图像的尺寸。插值处理包括:邻域插值处理、双线性插值处理和三线性插值处理。例如,邻域插值算法是指:在待求像素的四邻像素中,将距离待求像素最近的邻像素灰度赋给待求像素,一般的,将待求像素在最终图像中的坐标位置需进行取整处理,对应坐标的像素值即为待求像素的值。邻域插值算法容易实现,但该方法会在最终图像上出现明显的锯齿边缘和马赛克现象。双线性插值算法是指:在两个方向分别进行一次线性插值,通过四个相邻像素插值得到待求像素。双线性插值算法考虑了待求像素点周围四个直接相邻像素点对该待求像素点的相关性影响,因而具有平滑功能,能有效地克服邻域插值算法的不足,三线性插值算法是指:利用待求像素点周围16个像素点的灰度值作三次插值,不仅考虑到四个直接相邻点的灰度影响,而且考虑到各邻点间灰度值得变化率的影响,插值效果最佳。
另外,在对第二图像和中间图像进行匹配时,除了采用SIFT方式实现图像匹配外,还可采用平均绝对差(Mean Absolute Differences,MAD)算法和加速稳健特征(Speeded Up Robust Feastures,SURF)算法。MAD算法是在搜索图中,取与模板图一样大小的子图,计算子图与模板的相似度;遍历整个搜索图,在所有能够取到的子图中,找到与模板图最相似的子图对应的相似度作为最终匹配结果。SURF算法包括:构建Hessian,生成所有的兴趣点,用于特征的提取;构建尺度空间;特征点定位;特征点主方向分配;生成特征点描述及特征点匹配。
请再次参阅图1和图4,在某些实施方式中,07:处理第二图像及中间图像以获取目标图像,可包括:
073:在第二图像与中间图像之间的匹配度在预设范围内,且当前环境亮度小于预设亮度阈值时,对多帧第二图像进行融合处理,以得到融合图像;及
074:对融合图像进行插值处理以得到目标图像。
请再次参阅图2和图4,在某些实施方式中,一个或多个处理器30还用于执行073及074中的方法。即,一个或多个处理器30还用于:在第二图像与中间图像之间的匹配度在预设范围内,且当前环境亮度小于预设亮度阈值时,对多帧第二图像进行融合处理,以得到融合图像;及对融合图像进行插值处理以得到目标图像。
其中,预设范围的上限可等于预设匹配阈值。例如,假设预设匹配阈值为90,则预设范围可以是大于85小于等于90;当第二图像与中间图像之间的匹配度为88时,第二图像与中间图像之间的匹配度在预设范围内。当第二图像与中间图像的匹配度在预设范围内,且当前环境亮度小于预设亮度阈值时,由于多帧第二图像为低分辨率模式下输出的,暗处表现力更好,同时噪点更少,此时对多帧第二图像进行融合处理,最后对融合图像进行插值处理以得到原尺寸大小的目标图像。尤其地,当第二图像为一帧时,对第二图像进行融合处理可以是只针对该一帧降噪处理以进一步去除第二图像中的噪点,最后再对第二图像进行插值处理以得到原尺寸大小的目标图像。需要说明的是,本实施方式中的原尺寸大小的目标图像中的原尺寸同前解释,插值处理也同前解释,在此不再展开详细描述。
请参阅图1和图4,在某些实施方式中,07:处理第二图像及中间图像以获取目标图像,可包括:
075:在第二图像与中间图像之间的匹配度在预设范围内,且当前环境亮度大于预设亮度阈值时,对多帧中间图像进行融合处理,以得到融合图像;及
076:对融合图像进行插值处理以得到目标图像。
请参阅图1、图2和图4,在某些实施方式中,一个或多个处理器30还用于执行075及076中的方法。即,一个或多个处理器30还用于:在第二图像与中间图像之间的匹配度在预设范围内,且当前环境亮度大于预设亮度阈值时,对多帧中间图像进行融合处理,以得到融合图像;及对融合图像进行插值处理以得到目标图像。
其中,预设范围的上限可等于预设匹配阈值。例如,假设预设匹配阈值为90,则预设范围可以是大于85小于等于90;当第二图像与中间图像之间的匹配度为88时,第二图像与中间图像之间的匹配度在预设范围内。当第二图像与中间图像的匹配度在预设范围内,且当前环境亮度大于预设亮度阈值时,由于多帧中间图像为去马赛克模式输出的,清晰度更好,此时对多帧中间图像进行融合处理得到融合图像,最后对融合图像进行插值处理以得到原尺寸大小的目标图像。尤其地,当中间图像为一帧时,对中间图像进行融合处理可以是降噪处理以去除中间图像中的噪点,最后再对中间图像进行插值处理以得到原尺 寸大小的目标图像。需要说明的是,本实施方式中的原尺寸大小的目标图像中的原尺寸同前解释,插值处理也同前解释,在此不再展开详细描述。
请参阅图2和图7,在某些实施方式还提供一种包含计算机程序401的非易失性计算机可读存储介质400。当计算机程序401被一个或多个处理器30执行时,使得一个或多个处理器30执行上述任一实施方式的图像处理方法。非易失性计算机可读存储介质400可设置在电子装置100内,也可设置在云端服务器或其他装置中,此时,电子装置100能够与云端服务器或其他装置进行通讯来获取到相应的计算机程序410。
请结合图1、图2、图4及图7,例如,当计算机程序401被一个或多个处理器30执行时,使得一个或多个处理器30执行01、03、04、05、031、033、07、071、072、073、074、075及076中的方法。例如执行以下图像处理方法:
01:在预览模式时,缓存多帧第一图像,第一图像均具有第一分辨率;
03:从多帧第一图像中筛选出清晰度大于预设清晰阈值的至少一帧以作为中间图像;
05:在执行拍照时,获取至少一帧第二图像,第二图像具有第二分辨率,第二分辨率小于第一分辨率;及
07:处理第二图像及中间图像以获取目标图像。
又例如,当计算机程序401被一个或多个处理器30执行时,使得一个或多个处理器30执行以下图像处理方法:
01:在预览模式时,缓存多帧第一图像,第一图像均具有第一分辨率;031:采用灰度方差函数获取每帧第一图像的清晰度值;及
033:将清晰度值大于清晰阈值的第一图像作为中间图像。
04:在显示屏上显示经过缩放后的第一图像。
05:在执行拍照时,获取至少一帧第二图像,第二图像具有第二分辨率,第二分辨率小于第一分辨率;及
071:在第二图像与中间图像之间的匹配度大于预设匹配阈值时,对第二图像与中间图像进行融合处理,以得到融合图像;及
072:对融合图像进行插值处理以得到目标图像。
073:在第二图像与中间图像之间的匹配度在预设范围内,且当前环境亮度小于预设亮度阈值时,对多帧第二图像进行融合处理,以得到融合图像;及
074:对融合图像进行插值处理以得到目标图像。
075:在第二图像与中间图像之间的匹配度在预设范围内,且当前环境亮度大于预设亮度阈值时,对多帧中间图像进行融合处理,以得到融合图像;及
076:对融合图像进行插值处理以得到目标图像。
在某些场景中,当计算机程序401被一个或多个处理器30执行时,使得一个或多个处理器30执行以下图像处理方法:
01:在预览模式时,缓存多帧第一图像,第一图像均具有第一分辨率;
031:采用灰度方差函数获取每帧第一图像的清晰度值;及
033:将清晰度值大于清晰阈值的第一图像作为中间图像。
04:在显示屏上显示经过缩放后的第一图像。
05:在执行拍照时,获取至少一帧第二图像,第二图像具有第二分辨率,第二分辨率小于第一分辨率;及
071:在第二图像与中间图像之间的匹配度大于预设匹配阈值时,对第二图像与中间图像进行融合处理,以得到融合图像;及
072:对融合图像进行插值处理以得到目标图像。
在某些场景中,当计算机程序401被一个或多个处理器30执行时,使得一个或多个处理器30执行以下图像处理方法:
01:在预览模式时,缓存多帧第一图像,第一图像均具有第一分辨率;
031:采用灰度方差函数获取每帧第一图像的清晰度值;及
033:将清晰度值大于清晰阈值的第一图像作为中间图像。
04:在显示屏上显示经过缩放后的第一图像。
05:在执行拍照时,获取至少一帧第二图像,第二图像具有第二分辨率,第二分辨率小于第一分辨率;及
073:在第二图像与中间图像之间的匹配度在预设范围内,且当前环境亮度小于预设亮度阈值时,对多帧第二图像进行融合处理,以得到融合图像;及
074:对融合图像进行插值处理以得到目标图像。
在某些场景中,当计算机程序401被一个或多个处理器30执行时,使得一个或多个处理器30执行以下图像处理方法:
01:在预览模式时,缓存多帧第一图像,第一图像均具有第一分辨率;
031:采用灰度方差函数获取每帧第一图像的清晰度值;及
033:将清晰度值大于清晰阈值的第一图像作为中间图像。
04:在显示屏上显示经过缩放后的第一图像。
05:在执行拍照时,获取至少一帧第二图像,第二图像具有第二分辨率,第二分辨率小于第一分辨率;及
075:在第二图像与中间图像之间的匹配度在预设范围内,且当前环境亮度大于预设亮度阈值时,对多帧中间图像进行融合处理,以得到融合图像;及
076:对融合图像进行插值处理以得到目标图像。
在某些场景中,当计算机程序401被一个或多个处理器30执行时,使得一个或多个处理器30执行以下图像处理方法:
01:在预览模式时,缓存多帧第一图像,第一图像均具有第一分辨率;
031:采用灰度方差函数获取每帧第一图像的清晰度值;及
033:将清晰度值大于清晰阈值的第一图像作为中间图像。
04:在显示屏上显示经过缩放后的第一图像。
05:在执行拍照时,获取至少一帧第二图像,第二图像具有第二分辨率,第二分辨率小于第一分辨率;及
071:在第二图像与中间图像之间的匹配度大于预设匹配阈值时,对第二图像与中间图像进行融合处理,以得到融合图像;及
072:对融合图像进行插值处理以得到目标图像。
073:在第二图像与中间图像之间的匹配度在预设范围内,且当前环境亮度小于预设亮度阈值时,对多帧第二图像进行融合处理,以得到融合图像;及
074:对融合图像进行插值处理以得到目标图像。
在某些场景中,当计算机程序401被一个或多个处理器30执行时,使得一个或多个处理器30执行以下图像处理方法:
01:在预览模式时,缓存多帧第一图像,第一图像均具有第一分辨率;
031:采用灰度方差函数获取每帧第一图像的清晰度值;及
033:将清晰度值大于清晰阈值的第一图像作为中间图像。
04:在显示屏上显示经过缩放后的第一图像。
05:在执行拍照时,获取至少一帧第二图像,第二图像具有第二分辨率,第二分辨率小于第一分辨率;及
071:在第二图像与中间图像之间的匹配度大于预设匹配阈值时,对第二图像与中间图像进行融合处理,以得到融合图像;及
072:对融合图像进行插值处理以得到目标图像。
075:在第二图像与中间图像之间的匹配度在预设范围内,且当前环境亮度大于预设亮度阈值时,对多帧中间图像进行融合处理,以得到融合图像;及
076:对融合图像进行插值处理以得到目标图像。
在某些场景中,当计算机程序401被一个或多个处理器30执行时,使得一个或多个处理器30执行 以下图像处理方法:
01:在预览模式时,缓存多帧第一图像,第一图像均具有第一分辨率;
031:采用灰度方差函数获取每帧第一图像的清晰度值;及
033:将清晰度值大于清晰阈值的第一图像作为中间图像。
04:在显示屏上显示经过缩放后的第一图像。
05:在执行拍照时,获取至少一帧第二图像,第二图像具有第二分辨率,第二分辨率小于第一分辨率;及
073:在第二图像与中间图像之间的匹配度在预设范围内,且当前环境亮度小于预设亮度阈值时,对多帧第二图像进行融合处理,以得到融合图像;及
074:对融合图像进行插值处理以得到目标图像。
075:在第二图像与中间图像之间的匹配度在预设范围内,且当前环境亮度大于预设亮度阈值时,对多帧中间图像进行融合处理,以得到融合图像;及
076:对融合图像进行插值处理以得到目标图像。
在本说明书的描述中,参考术语“实施例”、“示例”等的描述意指结合该实施例或示例描述的具体特征、结构、材料或者特点包含于本申请的至少一个实施例或示例中。在本说明书中,对上述术语的示意性表述不一定指的是相同的实施例或示例。而且,描述的具体特征、结构、材料或者特点可以在任何的一个或多个实施例或示例中以合适的方式结合。
尽管已经示出和描述了本申请的实施例,本领域的普通技术人员可以理解:在不脱离本申请的原理和宗旨的情况下可以对这些实施例进行多种变化、修改、替换和变型,本申请的范围由权利要求及其等同物限定。

Claims (21)

  1. 一种图像处理方法,其特征在于,包括:
    在预览模式时,缓存多帧第一图像,所述第一图像均具有第一分辨率;
    从多帧所述第一图像中筛选出清晰度大于预设清晰阈值的至少一帧以作为中间图像;
    在执行拍照时,获取至少一帧第二图像,所述第二图像具有第二分辨率,所述第二分辨率小于所述第一分辨率;及
    处理所述第二图像及所述中间图像以获取目标图像。
  2. 根据权利要求1所述的图像处理方法,其特征在于,所述从多帧所述第一图像中筛选出清晰度大于预设清晰阈值的至少一帧以作为中间图像,包括:
    采用灰度方差函数获取每帧所述第一图像的清晰度值;及
    将清晰度值大于预设清晰阈值的所述第一图像作为中间图像。
  3. 根据权利要求1所述的图像处理方法,其特征在于,所述处理所述第二图像及所述中间图像以获取目标图像,包括:
    在所述第二图像与所述中间图像之间的匹配度大于预设匹配阈值时,对所述第二图像与所述中间图像进行融合处理,以得到融合图像;及
    对所述融合图像进行插值处理以得到所述目标图像。
  4. 根据权利要求1所述的图像处理方法,其特征在于,所述第二图像包括多帧,所述处理所述第二图像及所述中间图像以获取目标图像,包括:
    在所述第二图像与所述中间图像之间的匹配度在预设范围内,且当前环境亮度小于预设亮度阈值时,对多帧所述第二图像进行融合处理,以得到融合图像;及
    对所述融合图像进行插值处理以得到所述目标图像。
  5. 根据权利要求1所述的图像处理方法,其特征在于,所述中间图像包括多帧,所述处理所述第二图像及所述中间图像以获取目标图像,包括:
    在所述第二图像与所述中间图像之间的匹配度在预设范围内,且当前环境亮度大于预设亮度阈值时,对多帧所述中间图像进行融合处理,以得到融合图像;及
    对所述融合图像进行插值处理以得到所述目标图像。
  6. 根据权利要求1-5任意一项所述的图像处理方法,其特征在于,所述预设范围的上限等于所述预设匹配阈值。
  7. 根据权利要求1所述的图像处理方法,其特征在于,所述图像处理方法还包括:
    在显示屏上显示经过缩放后的所述第一图像。
  8. 一种电子装置,其特征在于,包括一个或多个处理器,一个或多个所述处理器用于:
    在预览模式时,缓存多帧第一图像,所述第一图像均具有第一分辨率;
    从多帧所述第一图像中筛选出清晰度大于预设清晰阈值的至少一帧以作为中间图像;
    在执行拍照时,获取至少一帧第二图像,所述第二图像具有第二分辨率,所述第二分辨率小于所述第一分辨率;及
    处理所述第二图像及所述中间图像以获取目标图像。
  9. 根据权利要求8所述的电子装置,其特征在于,一个或多个所述处理器还用于:
    采用灰度方差函数获取每帧所述第一图像的清晰度值;及
    将清晰度值大于预设清晰阈值的所述第一图像作为中间图像。
  10. 根据权利要求8所述的电子装置,其特征在于,一个或多个所述处理器还用于:
    在所述第二图像与所述中间图像之间的匹配度大于预设匹配阈值时,对所述第二图像与所述中间图像进行融合处理,以得到融合图像;及
    对所述融合图像进行插值处理以得到所述目标图像。
  11. 根据权利要求8所述的电子装置,其特征在于,一个或多个所述处理器还用于:
    在所述第二图像与所述中间图像之间的匹配度在预设范围内,且当前环境亮度小于预设亮度阈值时,对多帧所述第二图像进行融合处理,以得到融合图像;及
    对所述融合图像进行插值处理以得到所述目标图像。
  12. 根据权利要求8所述的电子装置,其特征在于,一个或多个所述处理器还用于:
    在所述第二图像与所述中间图像之间的匹配度在预设范围内,且当前环境亮度大于预设亮度阈值时,对多帧所述中间图像进行融合处理,以得到融合图像;及
    对所述融合图像进行插值处理以得到所述目标图像。
  13. 根据权利要求8-12任意一项所述的电子装置,其特征在于,所述预设范围的上限等于所述预设匹配阈值。
  14. 根据权利要求8所述的电子装置,其特征在于,一个或多个所述处理器还用于:控制显示屏上显示经过缩放后的所述第一图像。
  15. 一种包含计算机程序的非易失性计算机可读存储介质,其特征在于,所述计算机程序被一个或多个所述处理器执行时,使得一个或多个所述处理器执行:
    在预览模式时,缓存多帧第一图像,所述第一图像均具有第一分辨率;
    从多帧所述第一图像中筛选出清晰度大于预设清晰阈值的至少一帧以作为中间图像;
    在执行拍照时,获取至少一帧第二图像,所述第二图像具有第二分辨率,所述第二分辨率小于所述第一分辨率;及
    处理所述第二图像及所述中间图像以获取目标图像。
  16. 根据权利要求15所述的非易失性计算机可读存储介质,其特征在于,所述计算机程序被一个或多个所述处理器执行时,使得一个或多个所述处理器执行:
    采用灰度方差函数获取每帧所述第一图像的清晰度值;及
    将清晰度值大于预设清晰阈值的所述第一图像作为中间图像。
  17. 根据权利要求15所述的非易失性计算机可读存储介质,其特征在于,所述计算机程序被一个或多个所述处理器执行时,使得一个或多个所述处理器执行:
    在所述第二图像与所述中间图像之间的匹配度大于预设匹配阈值时,对所述第二图像与所述中间图像进行融合处理,以得到融合图像;及
    对所述融合图像进行插值处理以得到所述目标图像。
  18. 根据权利要求15所述的非易失性计算机可读存储介质,其特征在于,所述计算机程序被一个或多个所述处理器执行时,使得一个或多个所述处理器执行:
    在所述第二图像与所述中间图像之间的匹配度在预设范围内,且当前环境亮度小于预设亮度阈值时,对多帧所述第二图像进行融合处理,以得到融合图像;及
    对所述融合图像进行插值处理以得到所述目标图像。
  19. 根据权利要求15所述的非易失性计算机可读存储介质,其特征在于,所述计算机程序被一个或多个所述处理器执行时,使得一个或多个所述处理器执行:
    在所述第二图像与所述中间图像之间的匹配度在预设范围内,且当前环境亮度大于预设亮度阈值时,对多帧所述中间图像进行融合处理,以得到融合图像;及
    对所述融合图像进行插值处理以得到所述目标图像。
  20. 根据权利要求15-19任意一项所述的非易失性计算机可读存储介质,其特征在于,所述预设范围的上限等于所述预设匹配阈值。
  21. 根据权利要求15所述的非易失性计算机可读存储介质,其特征在于,所述计算机程序被一个或多个所述处理器执行时,使得一个或多个所述处理器执行:
    控制显示屏显示经过缩放后的所述第一图像。
PCT/CN2021/110631 2020-10-23 2021-08-04 图像处理方法、电子装置及非易失性计算机可读存储介质 WO2022083229A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011146332.2A CN112367459B (zh) 2020-10-23 2020-10-23 图像处理方法、电子装置及非易失性计算机可读存储介质
CN202011146332.2 2020-10-23

Publications (1)

Publication Number Publication Date
WO2022083229A1 true WO2022083229A1 (zh) 2022-04-28

Family

ID=74511881

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/110631 WO2022083229A1 (zh) 2020-10-23 2021-08-04 图像处理方法、电子装置及非易失性计算机可读存储介质

Country Status (2)

Country Link
CN (2) CN112367459B (zh)
WO (1) WO2022083229A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115426449A (zh) * 2022-07-30 2022-12-02 荣耀终端有限公司 一种拍照方法和终端

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112367459B (zh) * 2020-10-23 2022-05-13 深圳市锐尔觅移动通信有限公司 图像处理方法、电子装置及非易失性计算机可读存储介质
CN113014882B (zh) * 2021-03-08 2021-09-24 中国铁塔股份有限公司黑龙江省分公司 多源多协议视频融合监控系统
CN113378622A (zh) * 2021-04-06 2021-09-10 青岛以萨数据技术有限公司 一种特定人员识别方法、设备、系统及介质
CN113379633A (zh) * 2021-06-15 2021-09-10 支付宝(杭州)信息技术有限公司 多帧图像处理方法和装置
CN113676659B (zh) * 2021-08-11 2023-05-26 Oppo广东移动通信有限公司 图像处理方法及装置、终端及计算机可读存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107172296A (zh) * 2017-06-22 2017-09-15 维沃移动通信有限公司 一种图像拍摄方法及移动终端
US20180144448A1 (en) * 2016-11-18 2018-05-24 Samsung Electronics Co., Ltd. Image processing apparatus and control method thereof
CN111083359A (zh) * 2019-12-06 2020-04-28 Oppo广东移动通信有限公司 图像处理方法及其装置、电子设备和计算机可读存储介质
CN111131698A (zh) * 2019-12-23 2020-05-08 RealMe重庆移动通信有限公司 图像处理方法及装置、计算机可读介质、电子设备
CN112367459A (zh) * 2020-10-23 2021-02-12 深圳市锐尔觅移动通信有限公司 图像处理方法、电子装置及非易失性计算机可读存储介质

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20150109177A (ko) * 2014-03-19 2015-10-01 삼성전자주식회사 촬영 장치, 그 제어 방법, 및 컴퓨터 판독가능 기록매체
JP6333318B2 (ja) * 2016-07-29 2018-05-30 株式会社Screenホールディングス 画像処理方法、画像処理装置、および撮像装置
CN109863742B (zh) * 2017-01-25 2021-01-29 华为技术有限公司 图像处理方法和终端设备
CN107155059A (zh) * 2017-04-11 2017-09-12 深圳市金立通信设备有限公司 一种图像预览方法及终端
US11087504B2 (en) * 2017-05-19 2021-08-10 Google Llc Transforming grayscale images into color images using deep neural networks
CN110876014B (zh) * 2018-08-31 2022-04-08 北京小米移动软件有限公司 图像处理方法及装置、电子设备及存储介质
CN110049247B (zh) * 2019-04-28 2021-03-12 Oppo广东移动通信有限公司 图像优选方法、装置、电子设备及可读存储介质
CN110198417A (zh) * 2019-06-28 2019-09-03 Oppo广东移动通信有限公司 图像处理方法、装置、存储介质及电子设备

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180144448A1 (en) * 2016-11-18 2018-05-24 Samsung Electronics Co., Ltd. Image processing apparatus and control method thereof
CN107172296A (zh) * 2017-06-22 2017-09-15 维沃移动通信有限公司 一种图像拍摄方法及移动终端
CN111083359A (zh) * 2019-12-06 2020-04-28 Oppo广东移动通信有限公司 图像处理方法及其装置、电子设备和计算机可读存储介质
CN111131698A (zh) * 2019-12-23 2020-05-08 RealMe重庆移动通信有限公司 图像处理方法及装置、计算机可读介质、电子设备
CN112367459A (zh) * 2020-10-23 2021-02-12 深圳市锐尔觅移动通信有限公司 图像处理方法、电子装置及非易失性计算机可读存储介质

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115426449A (zh) * 2022-07-30 2022-12-02 荣耀终端有限公司 一种拍照方法和终端

Also Published As

Publication number Publication date
CN112367459A (zh) 2021-02-12
CN112367459B (zh) 2022-05-13
CN115052104B (zh) 2023-07-07
CN115052104A (zh) 2022-09-13

Similar Documents

Publication Publication Date Title
WO2022083229A1 (zh) 图像处理方法、电子装置及非易失性计算机可读存储介质
CN108898567B (zh) 图像降噪方法、装置及系统
WO2021073331A1 (zh) 基于终端设备的变焦虚化图像获取方法和装置
US9591237B2 (en) Automated generation of panning shots
US9619861B2 (en) Apparatus and method for improving quality of enlarged image
JP5036599B2 (ja) 撮像装置
WO2017016050A1 (zh) 一种图像的预览方法、装置及终端
CN107749944A (zh) 一种拍摄方法及装置
JP6308748B2 (ja) 画像処理装置、撮像装置及び画像処理方法
US20220222830A1 (en) Subject detecting method and device, electronic device, and non-transitory computer-readable storage medium
WO2018076460A1 (zh) 一种终端的拍照方法和终端
US10726524B2 (en) Low-resolution tile processing for real-time bokeh
CN109923850B (zh) 一种图像捕捉装置及方法
WO2018196854A1 (zh) 一种拍照方法、拍照装置及移动终端
WO2021078269A1 (zh) 一种图像处理方法、装置、航拍相机及存储介质
JP2020092315A (ja) 表示制御装置、撮像装置、表示装置の制御方法、プログラム、および記憶媒体
JP2017143354A (ja) 画像処理装置及び画像処理方法
WO2021103574A1 (zh) 一种图像缩放方法、装置、终端及存储介质
CN114219840A (zh) 图像配准融合方法、装置及计算机存储介质
CN113766090B (zh) 一种图像处理方法、终端以及存储介质
RU2792413C1 (ru) Способ обработки изображений и мобильный терминал
WO2021115014A1 (zh) 变焦方法、电子装置和计算机可读存储介质
JP2019047145A (ja) 画像処理装置、撮像装置、画像処理装置の制御方法およびプログラム
EP3866455A1 (en) Device and method for capturing images or video
TWI465108B (zh) 影像擷取裝置及影像處理方法

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21881648

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21881648

Country of ref document: EP

Kind code of ref document: A1