WO2021078276A1 - Method for obtaining continuously photographed photos, smart terminal, and storage medium - Google Patents

Method for obtaining continuously photographed photos, smart terminal, and storage medium Download PDF

Info

Publication number
WO2021078276A1
WO2021078276A1 PCT/CN2020/123355 CN2020123355W WO2021078276A1 WO 2021078276 A1 WO2021078276 A1 WO 2021078276A1 CN 2020123355 W CN2020123355 W CN 2020123355W WO 2021078276 A1 WO2021078276 A1 WO 2021078276A1
Authority
WO
WIPO (PCT)
Prior art keywords
photos
photo
difference value
sharpness
target area
Prior art date
Application number
PCT/CN2020/123355
Other languages
French (fr)
Chinese (zh)
Inventor
蒋佳
阮志峰
Original Assignee
Tcl科技集团股份有限公司
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 Tcl科技集团股份有限公司 filed Critical Tcl科技集团股份有限公司
Publication of WO2021078276A1 publication Critical patent/WO2021078276A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/64Computer-aided capture of images, e.g. transfer from script file into camera, check of taken image quality, advice or proposal for image composition or decision on when to take image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/80Camera processing pipelines; Components thereof

Definitions

  • This application belongs to the field of computer technology, and in particular relates to a method for obtaining continuous photographs, an intelligent terminal and a storage medium.
  • One of the objectives of the embodiments of the present application is to provide a method for acquiring continuous photographs, an intelligent terminal, and a storage medium, so as to solve the problem of inefficient and inefficient selection of continuous photographs.
  • the first aspect of the embodiments of the present application provides a method for acquiring continuous photographs, including:
  • the respectively performing blurring processing on each of the first photos to obtain a respective blurred photo corresponding to each of the first photos includes:
  • the target area of each of the first photos is detected separately, and the target area includes a face image and /2 or an object image; the respective target areas corresponding to each of the first photos are subjected to fuzzy filtering processing to obtain each Fuzzy photos corresponding to each of the first photos.
  • the separately detecting the target area of each of the first photos includes:
  • a trained image detection model is used to detect the target area of each photo, and the trained image detection model is a neural network model.
  • the determining the sharpness of each of the first photos based on the difference value, and obtaining a second photo from the first photos based on the sharpness includes:
  • the sharpness of each of the first photos is determined based on the difference value, and a second photo with the highest sharpness is obtained from all the first photos.
  • the determining the sharpness of each of the first photos based on the difference value, and obtaining the second photo with the highest sharpness from all the first photos includes:
  • Calculate the peak signal-to-noise ratio of the difference value determine the sharpness of each of the first photos according to the peak signal-to-noise ratio; obtain the second photo with the highest sharpness from all the first photos.
  • the calculating the peak signal-to-noise ratio of the image difference value includes:
  • the peak signal-to-noise ratio of the differential value is calculated based on a preset peak signal-to-noise ratio calculation formula, and the preset peak signal-to-noise ratio calculation formula is:
  • a ij represents the distance between the first pixel with the pixel coordinate (i, j) corresponding to the grayscale image of the first photo and the second pixel with the pixel coordinate (i, j) of the corresponding blurred photo
  • the difference value of i represents the abscissa of the pixel
  • j represents the ordinate of the pixel
  • n represents the width of the current photo
  • m represents the length of the current photo.
  • the respectively performing blurring processing on each of the first photos to obtain a respective blurred photo corresponding to each of the first photos includes:
  • Gaussian filtering processing is performed on each of the first photos respectively to obtain respective blurred photos corresponding to each of the first photos.
  • the calculating the difference value between each of the first photos and the respective corresponding blurred photos includes:
  • a second aspect of the embodiments of the present application provides a device for acquiring continuous photographs, including:
  • the first obtaining module 501 is configured to obtain the first photo continuously shot
  • the processing module 502 is configured to perform blurring processing on each of the first photos to obtain respective blurred photos corresponding to each of the first photos;
  • the calculation module 503 is configured to calculate the difference value between each of the first photos and the corresponding blurred photos
  • the second acquisition module 504 is configured to determine the sharpness of each of the first photos based on the difference value, and obtain a second photo from the first photos based on the sharpness.
  • the processing module 502 includes:
  • a detection unit configured to separately detect a target area of each of the first photos, where the target area includes a face image and/or an object image;
  • the first processing unit is configured to perform blur filtering processing on the respective target regions corresponding to each of the first photos to obtain respective blurred photos corresponding to each of the first photos.
  • the detection unit is specifically used for:
  • a trained image detection model is used to detect the target area of each photo, and the trained image detection model is a neural network model.
  • the second acquiring module 504 is specifically configured to:
  • the sharpness of each of the first photos is determined based on the difference value, and a second photo with the highest sharpness is obtained from all the first photos.
  • the second acquisition module 504 includes:
  • the first calculation unit is configured to calculate the peak signal-to-noise ratio of the difference value
  • a determining unit configured to determine the sharpness of each of the first photos according to the peak signal-to-noise ratio
  • the obtaining unit is configured to obtain the second photo with the highest definition from all the first photos.
  • the calculation unit is specifically used for:
  • the peak signal-to-noise ratio of the differential value is calculated based on a preset peak signal-to-noise ratio calculation formula, and the preset peak signal-to-noise ratio calculation formula is:
  • a ij represents the distance between the first pixel with the pixel coordinate (i, j) corresponding to the grayscale image of the first photo and the second pixel with the pixel coordinate (i, j) of the corresponding blurred photo
  • the difference value of i represents the abscissa of the pixel
  • j represents the ordinate of the pixel
  • n represents the width of the current photo
  • m represents the length of the current photo.
  • the processing module 502 is specifically configured to: respectively perform Gaussian filtering processing on each of the first photos to obtain respective fuzzy photos corresponding to each of the first photos.
  • the calculation module 503 includes:
  • the second processing unit is configured to perform grayscale processing on each of the first photos to obtain a grayscale image corresponding to each of the first photos;
  • the second calculation unit is configured to calculate the difference value between the grayscale image corresponding to each first photo and the blurred photo corresponding to each first photo.
  • the third aspect of the embodiments of the present application provides an intelligent terminal, including a memory, a processor, and a computer program stored in the memory and running on the processor.
  • the processor executes the computer program, The steps of the method for obtaining continuous shots as described in the first aspect are implemented.
  • a fourth aspect of the embodiments of the present application provides a computer-readable storage medium, the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the continuous shooting of photos as described in the first aspect is achieved. Method steps.
  • the method for acquiring continuous shots has the following beneficial effects: by acquiring the first continuous shot; blurring each of the first photos to obtain each The fuzzy photos corresponding to each of the first photos; calculate the difference value between each of the first photos and the corresponding fuzzy photos; determine the sharpness of each of the first photos based on the difference value, based on The sharpness derives a second photo from the first photo.
  • the difference value between each of the first photos and the corresponding blurred photos is calculated, and each of the first photos is determined based on the difference value.
  • the sharpness of the first photo, and the second photo is obtained from the first photo based on the sharpness. It is realized that the second photo based on the sharpness is obtained from the first photos of the continuous shooting quickly and accurately, and the efficiency of selecting a clear photo from the multiple continuous photos is improved.
  • the terminal provided in the second aspect of the present application and the computer-readable storage medium provided in the fourth aspect have beneficial effects.
  • the method for acquiring continuous photographs provided in the first aspect of the present application has The beneficial effects are the same and will not be repeated here.
  • FIG. 1 is an implementation process of a method for acquiring continuous shots provided by an embodiment of the present application
  • FIG. 2 is a flow chart of the specific implementation of S102 in Figure 1;
  • FIG. 3 is a flow chart of the specific implementation of S103 in Figure 1;
  • Figure 4 is a flow chart of the specific implementation of S104 in Figure 1;
  • FIG. 5 is a schematic diagram of the device for acquiring continuous photographs provided by the present application.
  • Fig. 6 is a schematic diagram of a terminal provided by the present application.
  • the terminal can automatically and quickly determine the best photo from multiple continuous photos and store it, it can save a lot of time for users to select photos.
  • some methods for automatically identifying the image definition have been proposed.
  • the common traditional algorithm is the edge detection algorithm, which is based on the assumption that the image is blurry, then the edge information will be blurred, and the corresponding detected edge information will be less.
  • the variance calculation method is used to calculate the variance of the edge picture.
  • a picture with a relatively small variance is regarded as a blurred picture, and a picture with a relatively large variance is regarded as a clear picture.
  • the present invention provides a new method for blurring photos.
  • FIG. 1 it is a flow chart of the method for acquiring continuous shots provided by the first embodiment of the present application, and the execution subject of this embodiment is a terminal. The details are as follows:
  • the shooting button when the user sees his favorite scenery or captures some specific actions for his family and friends, he will quickly press the shooting button to start the shooting function to shoot. At this time, the shooting will be detected.
  • the first photo continuously taken when it is detected that the photo is taken, the first photo continuously taken can be obtained.
  • S102 Perform blurring processing on each of the first photos, respectively, to obtain a blurry photo corresponding to each of the first photos.
  • the sharpness of each first photo can be determined by detecting the target area included in each first photo, and by the sharpness of the target area.
  • the first photo includes a human face image and/or an object image
  • the target area is the human face image and/or an object image.
  • FIG. 2 is a flowchart of specific implementation of S102 in FIG. 1.
  • S102 includes:
  • S1021 Detect a target area of each of the first photos, where the target area includes a face image and/or an object image.
  • the trained image detection model detects the target area of each photo, and the trained image detection model is a neural network model.
  • the detecting the target area of each of the first photos separately includes: inputting each of the first photos into the neural network model to perform target area detection, and obtaining each output of the neural network model The target area of the first photo.
  • the training process of the trained image detection model includes: obtaining a first preset number of target photos, where the target photos are the first photos marked with the target area, and the first photos include human face images and /Or an object image, and the target area is a human face image and/or an object image.
  • the pre-established model structure is usually selected, for example, the structure of the neural network model in this embodiment, and then the training samples are input into the pre-established model structure for training.
  • the training samples are the first preset number of target photos.
  • the first preset number of target photos are all the target photos marked with the target area. Narrate the first photo.
  • the training process of the neural network model includes: obtaining a first preset target photo; inputting the first preset number of target photos into a pre-established neural network model for training, and obtaining the neural network model after training.
  • Network model acquiring a second preset number of target photos, and sequentially inputting the second preset number of target photos into the neural network model after training for analysis, and obtaining the annotations output by the neural network model after training.
  • the target photo of the target area if the target photo marked with the target area is compared with the preset target photo marked with the target area, the probability that the target area overlaps is greater than the preset probability threshold, then determine
  • the neural network model after training is a trained neural network model; if the target photo with the target area is compared with the preset target photo with the target area, the probability that the target area overlaps is less than Or equal to the preset probability threshold, then increase the first preset number of target photos, and perform training by inputting the first preset number of target photos into a pre-established neural network model to obtain
  • the first photo of the unlabeled target area is input into the trained neural network model for target area labeling, and the output of the trained neural network model with the target area marked will be obtained.
  • the first photo is input into the trained neural network model for target area labeling, and the output of the trained neural network model with the target area marked.
  • S1022 Perform fuzzy filtering processing on the target area corresponding to each of the first photos respectively, to obtain respective blurred photos corresponding to each of the first photos.
  • the image is further subjected to blur filtering processing, corresponding to the loss of sharpness of the image with blurring.
  • the respective target regions corresponding to each of the first photos are respectively subjected to blur filtering processing to obtain respective blurred photos corresponding to each of the first photos.
  • Gaussian filtering processing is performed on the target area corresponding to each of the first photos to obtain the fuzzy photos corresponding to each of the first photos.
  • the characteristics of different loss of images of different definitions by blur filtering are used, and the definition of the original image is determined by calculating the difference value between each of the first photos and the corresponding blurred photos.
  • the difference value of the image corresponds to the pixel difference value obtained by subtracting the corresponding pixel values of the two images.
  • S103 includes:
  • S1031 Perform grayscale processing on each of the first photos to obtain a grayscale image corresponding to each of the first photos.
  • the first photo is an image of three primary colors (RGB, where R represents the red channel, G represents the green channel, and B represents the blue channel) image
  • the blurred photo corresponding to each of the first photos is gray
  • the input images have the same type and size. Therefore, it is necessary to perform grayscale processing on each of the first photos first.
  • the specific method of gray-scale processing for each of the first photos is not limited here.
  • S1032 Calculate the difference value between the grayscale image corresponding to each first photo and the blurred photo corresponding to each first photo.
  • each of the first photos can be directly
  • the grayscale image corresponding to each first photo is subtracted from the fuzzy photo corresponding to each first photo to obtain a difference image, and the pixel value corresponding to each pixel of the difference image is the difference value.
  • the grayscale image and the blurred photo corresponding to each of the first photos may be normalized separately, and then the normalized image may be calculated after the normalization process.
  • the difference value between the grayscale image of and the blurred photo after normalization processing is not specifically limited.
  • the purpose of the normalization processing is to make the value of each pixel of the grayscale image and each pixel of the blurred photo They are between [0,1].
  • S104 Determine the sharpness of each of the first photos based on the difference value, and obtain a second photo from the first photos based on the sharpness.
  • the difference value is each of the difference images.
  • the pixel value of the pixel is often not clear to determine the sharpness of the image by comparing the size of the pixel value of each pixel of the image. Therefore, in this embodiment, the peak signal-to-noise ratio corresponding to the difference value is further calculated. , To determine the sharpness of each of the first photos.
  • the S104 specifically includes: determining the sharpness of each first photo based on the difference value, from all The second photo with the highest definition is obtained among the first photos.
  • S104 includes:
  • the peak signal-to-noise ratio is often used to indicate the measurement of pixel reconstruction quality in the fields of image compression and the like.
  • the peak signal-to-noise ratio of the differential value is calculated to determine the value of each first photo. Clarity.
  • the peak signal-to-noise ratio of the differential value is calculated based on a preset peak signal-to-noise ratio calculation formula. Further, the preset peak signal-to-noise ratio calculation formula is:
  • a ij represents the distance between the first pixel with the pixel coordinate (i, j) corresponding to the grayscale image of the first photo and the second pixel with the pixel coordinate (i, j) of the corresponding blurred photo
  • the difference value of i represents the abscissa of the pixel
  • j represents the ordinate of the pixel
  • n represents the width of the current photo
  • m represents the length of the current photo.
  • the common peak signal-to-noise ratio is a negative number.
  • the preset peak signal-to-noise ratio formula is based on the traditional peak signal-to-noise ratio.
  • the noise ratio formula evolved, and its value is positive.
  • S1042 Determine the sharpness of each first photo according to the peak signal-to-noise ratio.
  • the peak signal-to-noise ratio when the peak signal-to-noise ratio is larger, the corresponding first photo is blurred, and the peak signal-to-noise ratio is smaller, which means the corresponding first photo is clearer.
  • the remaining first photos are deleted to release cache space.
  • the method for acquiring continuous photographs obtains the first photograph of the continuous photograph; and blurs each of the first photographs to obtain the corresponding blurred photograph of each of the first photographs.
  • the difference value between each of the first photos and the corresponding blurred photos is calculated, and each of the first photos is determined based on the difference value.
  • the sharpness of the first photo, and the second photo is obtained from the first photo based on the sharpness. It is realized that the second photo based on the sharpness is obtained from the first photos continuously shot quickly and accurately, and the efficiency of selecting clear photos from the multiple consecutive photos is improved.
  • Fig. 5 is a schematic diagram of the device for acquiring continuous photographs provided by the present application.
  • the continuous-photograph acquisition device 5 of this embodiment includes: a first acquisition module 501, a processing module 502, a calculation module 503, and a second acquisition module 504. among them,
  • the first obtaining module 501 is configured to obtain the first photo continuously shot
  • the processing module 502 is configured to perform blurring processing on each of the first photos to obtain respective blurred photos corresponding to each of the first photos;
  • the calculation module 503 is configured to calculate the difference value between each of the first photos and the corresponding blurred photos
  • the second acquisition module 504 is configured to determine the sharpness of each of the first photos based on the difference value, and obtain a second photo from the first photos based on the sharpness.
  • the processing module 502 includes:
  • a detection unit configured to separately detect a target area of each of the first photos, where the target area includes a face image and/or an object image;
  • the first processing unit is configured to perform blur filtering processing on the respective target regions corresponding to each of the first photos to obtain respective blurred photos corresponding to each of the first photos.
  • the detection unit is specifically configured to: use a trained image detection model to detect the target area of each photo, and the trained image detection model is a neural network model.
  • the second obtaining module 504 is specifically configured to: determine the sharpness of each of the first photos based on the difference value, and obtain the second photo with the highest sharpness from all the first photos.
  • the second acquisition module 504 includes:
  • the first calculation unit is configured to calculate the peak signal-to-noise ratio of the difference value
  • a determining unit configured to determine the sharpness of each of the first photos according to the peak signal-to-noise ratio
  • the obtaining unit is configured to obtain the second photo with the highest definition from all the first photos.
  • the calculation unit is specifically configured to: calculate the peak signal-to-noise ratio of the differential value based on a preset peak signal-to-noise ratio calculation formula, and the preset peak signal-to-noise ratio calculation formula is:
  • a ij represents the distance between the first pixel with the pixel coordinate (i, j) corresponding to the grayscale image of the first photo and the second pixel with the pixel coordinate (i, j) of the corresponding blurred photo
  • the difference value of i represents the abscissa of the pixel
  • j represents the ordinate of the pixel
  • n represents the width of the current photo
  • m represents the length of the current photo.
  • the processing module 502 is specifically configured to: respectively perform Gaussian filtering processing on each of the first photos to obtain respective fuzzy photos corresponding to each of the first photos.
  • the calculation module 503 includes:
  • the second processing unit is configured to perform grayscale processing on each of the first photos to obtain a grayscale image corresponding to each of the first photos;
  • the second calculation unit is configured to calculate the difference value between the grayscale image corresponding to each first photo and the blurred photo corresponding to each first photo.
  • Fig. 6 is a schematic diagram of a terminal provided by the present application.
  • the terminal 6 of this embodiment includes a processor 60, a memory 61, and a computer program 62 stored in the memory 61 and running on the processor 60, such as a continuous photo acquisition program.
  • the processor 60 executes the computer program 62, the steps in the foregoing embodiments of the method for acquiring continuous photographs are implemented, for example, steps 101 to 104 shown in FIG. 1.
  • the processor 60 executes the computer program 62
  • the functions of the modules/units in the embodiment of the apparatus for acquiring continuous photographs are realized, for example, the functions of the modules 501 to 504 shown in FIG. 5.
  • the computer program 62 may be divided into one or more modules/units, and the one or more modules/units are stored in the memory 61 and executed by the processor 60 to complete This application.
  • the one or more modules/units may be a series of computer program instruction segments capable of completing specific functions, and the instruction segments are used to describe the execution process of the computer program 62 in the terminal 6.
  • the computer program 62 may be divided into a first acquisition module, a processing module, a calculation module, and a second acquisition module (a module in a virtual device), and the specific functions of each module are as follows:
  • the first acquisition module is used to acquire the first photo continuously shot
  • a processing module which is configured to perform blur processing on each of the first photos to obtain a blurry photo corresponding to each of the first photos;
  • a calculation module configured to calculate the difference between each of the first photos and the corresponding blurred photos
  • the second acquisition module is configured to determine the sharpness of each of the first photos based on the pixel difference value, and acquire and store the second photo with the highest sharpness from all the first photos.
  • the terminal further includes a photographing module, and the photographing module is used to photograph the first photo.
  • the disclosed device/terminal device and method may be implemented in other ways.
  • the device/terminal device embodiments described above are only illustrative.
  • the division of the modules or units is only a logical function division, and there may be other divisions in actual implementation, such as multiple units.
  • components can be combined or integrated into another system, or some features can be omitted or not implemented.
  • the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple communication units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
  • the functional units in the various embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
  • the above-mentioned integrated unit can be implemented in the form of hardware or software functional unit. If the integrated module/unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on this understanding, this application implements all or part of the processes in the above-mentioned embodiments and methods, and can also be completed by instructing relevant hardware through a computer program.
  • the computer program can be stored in a computer-readable storage medium. When the program is executed by the processor, it can implement the steps of the foregoing method embodiments.
  • the computer program includes computer program code
  • the computer program code may be in the form of source code, object code, executable file, or some intermediate forms.
  • the computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory) , Random Access Memory (RAM, Random Access Memory), electrical carrier signal, telecommunications signal, and software distribution media, etc.
  • ROM Read-Only Memory
  • RAM Random Access Memory
  • electrical carrier signal telecommunications signal
  • software distribution media etc.
  • the content contained in the computer-readable medium can be appropriately added or deleted according to the requirements of the legislation and patent practice in the jurisdiction.
  • the computer-readable medium Does not include electrical carrier signals and telecommunication signals.

Abstract

The present application is applicable to the technical field of computers, and provides a method for obtaining continuously photographed photos. The method comprises: obtaining continuously photographed first photos; blurring each first photo separately to obtain a blurred photo respectively corresponding to each first photo; calculating a difference value between each first photo and the respectively corresponding blurred photo; determining the definition of each first photo on the basis of the difference value, and obtaining a second photo from the first photos on the basis of the definition. Because after each of the continuously photographed first photos is blurred, the difference value between each first photo and the respectively corresponding blurred photo is calculated, and the definition of each first photo is determined on the basis of the difference value and the second photo is obtained from the first photos on the basis of the definition. The second photo is quickly and accurately obtained from the continuously photographed first photos on the basis of the definition, so as to improve the efficiency of selecting a clear photo from multiple continuously photographed photos.

Description

连拍照片获取方法、智能终端及存储介质Continuous photo acquisition method, intelligent terminal and storage medium
本申请要求于2019年10月25日在中国专利局提交的、申请号为201911025549.5、发明名称为“连拍照片获取方法、智能终端及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application filed at the Chinese Patent Office on October 25, 2019, with the application number 201911025549.5, and the title of the invention "Methods for obtaining continuous shots, smart terminals and storage media", all of which are approved The reference is incorporated in this application.
技术领域Technical field
本申请属于计算机技术领域,尤其涉及一种连拍照片获取方法、智能终端及存储介质。This application belongs to the field of computer technology, and in particular relates to a method for obtaining continuous photographs, an intelligent terminal and a storage medium.
背景技术Background technique
在手机的照相功能越来越强大的今天,很多人都选择用手机而不是用摄像机来进行拍照。这就对手机拍照功能的稳定性,智能性,提出了越来越高的需求。通常在抓拍场景下,都会有一定的模糊效果,因此用户习惯连拍多张照片,来选出相对清晰的照片,该过程需要浪费大量的时间,效率低下。Today, as the camera function of mobile phones is becoming more and more powerful, many people choose to use mobile phones instead of cameras to take pictures. This puts forward higher and higher demands for the stability and intelligence of the camera function of mobile phones. Usually, in the capture scene, there will be a certain blur effect. Therefore, users are used to taking multiple photos in succession to select relatively clear photos. This process takes a lot of time and is inefficient.
技术问题technical problem
本申请实施例的目的之一在于:提供一种连拍照片获取方法、智能终端及存储介质,旨在解连拍照片选择需要浪费大量的时间,效率低下的问题。One of the objectives of the embodiments of the present application is to provide a method for acquiring continuous photographs, an intelligent terminal, and a storage medium, so as to solve the problem of inefficient and inefficient selection of continuous photographs.
技术解决方案Technical solutions
本申请实施例的第一方面提供了一种连拍照片获取方法,包括:The first aspect of the embodiments of the present application provides a method for acquiring continuous photographs, including:
获取连拍的第一照片;Get the first photo of the continuous shooting;
分别对每张所述第一照片进行模糊处理,得到每张所述第一照片各自对应的模糊照片;Performing blurring processing on each of the first photos, respectively, to obtain a blurry photo corresponding to each of the first photos;
计算每张所述第一照片与各自对应的所述模糊照片之间的差分值;基于所述差分值确定每张所述第一照片的清晰度,基于所述清晰度从所述第一照片中得到第二照片。Calculate the difference value between each of the first photos and the corresponding blurred photos; determine the sharpness of each of the first photos based on the difference value, and determine the sharpness of each of the first photos based on the sharpness from the first photos To get the second photo.
可选地,所述分别对每张所述第一照片进行模糊处理,得到每张所述第一照片各自对应的模糊照片,包括:Optionally, the respectively performing blurring processing on each of the first photos to obtain a respective blurred photo corresponding to each of the first photos includes:
分别检测出每张所述第一照片的目标区域,所述目标区域包含人脸图像和/2或物体图像;分别对每张所述第一照片各自对应的目标区域进行模糊滤波处理,得到每张所述第一照片各自对应的模糊照片。The target area of each of the first photos is detected separately, and the target area includes a face image and /2 or an object image; the respective target areas corresponding to each of the first photos are subjected to fuzzy filtering processing to obtain each Fuzzy photos corresponding to each of the first photos.
可选地,所述分别检测出每张所述第一照片的目标区域,包括:Optionally, the separately detecting the target area of each of the first photos includes:
利用经训练的图像检测模型检测出所述每张照片的目标区域,所述经训练的图像检测模型为神经网络模型。A trained image detection model is used to detect the target area of each photo, and the trained image detection model is a neural network model.
可选地,所述基于所述差分值确定每张所述第一照片的清晰度,基于所述清晰度从所述第一照片中得到第二照片,包括:Optionally, the determining the sharpness of each of the first photos based on the difference value, and obtaining a second photo from the first photos based on the sharpness includes:
基于所述差分值确定每张所述第一照片的清晰度,从所有所述第一照片中获取清晰度最高的第二照片。The sharpness of each of the first photos is determined based on the difference value, and a second photo with the highest sharpness is obtained from all the first photos.
可选地,所述基于所述差分值确定每张所述第一照片的清晰度,从所有所述第一照片中获取清晰度最高的第二照片,包括:Optionally, the determining the sharpness of each of the first photos based on the difference value, and obtaining the second photo with the highest sharpness from all the first photos includes:
计算所述差分值的峰值信噪比;根据所述峰值信噪比确定每张所述第一照片的清晰度;从所有所述第一照片中获取清晰度最高的第二照片。Calculate the peak signal-to-noise ratio of the difference value; determine the sharpness of each of the first photos according to the peak signal-to-noise ratio; obtain the second photo with the highest sharpness from all the first photos.
可选地,所述计算所述像差分值的峰值信噪比,包括:Optionally, the calculating the peak signal-to-noise ratio of the image difference value includes:
基于预设的峰值信噪比计算公式计算所述差分值的峰值信噪比,所述预设的峰值信噪比计算公式为:The peak signal-to-noise ratio of the differential value is calculated based on a preset peak signal-to-noise ratio calculation formula, and the preset peak signal-to-noise ratio calculation formula is:
Figure PCTCN2020123355-appb-000001
Figure PCTCN2020123355-appb-000001
其中,a ij表示第一照片的灰度图对应的像素点坐标为(i,j)的第一像素点与对应的模糊照片的像素点坐标为(i,j)的第二像素点之间的差分值,i表示像素点的横坐标,j表示像素点的纵坐标,n表示当前照片的宽度,m表示当前照片的长度。 Among them, a ij represents the distance between the first pixel with the pixel coordinate (i, j) corresponding to the grayscale image of the first photo and the second pixel with the pixel coordinate (i, j) of the corresponding blurred photo The difference value of i represents the abscissa of the pixel, j represents the ordinate of the pixel, n represents the width of the current photo, and m represents the length of the current photo.
可选地,所述分别对每张所述第一照片进行模糊处理,得到每张所述第一照片各自对应的模糊照片,包括:Optionally, the respectively performing blurring processing on each of the first photos to obtain a respective blurred photo corresponding to each of the first photos includes:
分别对每张所述第一照片进行高斯滤波处理,得到每张所述第一照片各自对应的模糊照片。Gaussian filtering processing is performed on each of the first photos respectively to obtain respective blurred photos corresponding to each of the first photos.
可选地,所述计算每张所述第一照片与各自对应的所述模糊照片之间的差分值,包括:Optionally, the calculating the difference value between each of the first photos and the respective corresponding blurred photos includes:
分别将每张所述第一照片进行灰度化处理,得到每张所述第一照片各自对应的灰度图;分别计算每张所述第一照片各自对应的所述灰度图与每张所述第一照片各自对应的所述模糊照片之间的差分值。Perform grayscale processing on each of the first photos to obtain a grayscale image corresponding to each of the first photos; respectively calculate the grayscale image and each grayscale image corresponding to each first photo. The difference value between the blurred photos corresponding to each of the first photos.
本申请实施例的第二方面提供了一种连拍照片获取装置,包括:A second aspect of the embodiments of the present application provides a device for acquiring continuous photographs, including:
第一获取模块501,用于获取连拍的第一照片;The first obtaining module 501 is configured to obtain the first photo continuously shot;
处理模块502,用于分别对每张所述第一照片进行模糊处理,得到每张所述第一照片各自对应的模糊照片;The processing module 502 is configured to perform blurring processing on each of the first photos to obtain respective blurred photos corresponding to each of the first photos;
计算模块503,用于计算每张所述第一照片与各自对应的所述模糊照片之间的差分值;The calculation module 503 is configured to calculate the difference value between each of the first photos and the corresponding blurred photos;
第二获取模块504,用于基于所述像差分值确定每张所述第一照片的清晰度,基于所述清晰度从所述第一照片中得到第二照片。The second acquisition module 504 is configured to determine the sharpness of each of the first photos based on the difference value, and obtain a second photo from the first photos based on the sharpness.
优选地,处理模块502包括:Preferably, the processing module 502 includes:
检测单元,用于分别检测出每张所述第一照片的目标区域,所述目标区域包含人脸图像和/或物体图像;A detection unit, configured to separately detect a target area of each of the first photos, where the target area includes a face image and/or an object image;
第一处理单元,用于分别对每张所述第一照片各自对应的目标区域进行模糊滤波处理,得到每张所述第一照片各自对应的模糊照片。The first processing unit is configured to perform blur filtering processing on the respective target regions corresponding to each of the first photos to obtain respective blurred photos corresponding to each of the first photos.
优选地,检测单元具体用于:Preferably, the detection unit is specifically used for:
利用经训练的图像检测模型检测出所述每张照片的目标区域,所述经训练的图像检测模型为神经网络模型。A trained image detection model is used to detect the target area of each photo, and the trained image detection model is a neural network model.
优选地,所述第二获取模块504具体用于:Preferably, the second acquiring module 504 is specifically configured to:
基于所述差分值确定每张所述第一照片的清晰度,从所有所述第一照片中获取清晰度最高的第二照片。The sharpness of each of the first photos is determined based on the difference value, and a second photo with the highest sharpness is obtained from all the first photos.
优选地,所述第二获取模块504,包括:Preferably, the second acquisition module 504 includes:
第一计算单元,用于计算所述差分值的峰值信噪比;The first calculation unit is configured to calculate the peak signal-to-noise ratio of the difference value;
确定单元,用于根据所述峰值信噪比确定每张所述第一照片的清晰度;A determining unit, configured to determine the sharpness of each of the first photos according to the peak signal-to-noise ratio;
获取单元,用于从所有所述第一照片中获取清晰度最高的第二照片。The obtaining unit is configured to obtain the second photo with the highest definition from all the first photos.
优选地,计算单元具体用于:Preferably, the calculation unit is specifically used for:
基于预设的峰值信噪比计算公式计算所述差分值的峰值信噪比,所述预设的峰值信噪比计算公式为:The peak signal-to-noise ratio of the differential value is calculated based on a preset peak signal-to-noise ratio calculation formula, and the preset peak signal-to-noise ratio calculation formula is:
Figure PCTCN2020123355-appb-000002
Figure PCTCN2020123355-appb-000002
其中,a ij表示第一照片的灰度图对应的像素点坐标为(i,j)的第一像素点与对应的模糊照片的像素点坐标为(i,j)的第二像素点之间的差分值,i表示像素点的横坐标,j表示像素点的纵坐标,n表示当前照片的宽度,m表示当前照片的长度。 Among them, a ij represents the distance between the first pixel with the pixel coordinate (i, j) corresponding to the grayscale image of the first photo and the second pixel with the pixel coordinate (i, j) of the corresponding blurred photo The difference value of i represents the abscissa of the pixel, j represents the ordinate of the pixel, n represents the width of the current photo, and m represents the length of the current photo.
优选地,处理模块502具体用于:分别对每张所述第一照片进行高斯滤波处理,得到每张所述第一照片各自对应的模糊照片。Preferably, the processing module 502 is specifically configured to: respectively perform Gaussian filtering processing on each of the first photos to obtain respective fuzzy photos corresponding to each of the first photos.
优选地,计算模块503包括:Preferably, the calculation module 503 includes:
第二处理单元,用于分别将每张所述第一照片进行灰度化处理,得到每张所述第一照片各自对应的灰度图;The second processing unit is configured to perform grayscale processing on each of the first photos to obtain a grayscale image corresponding to each of the first photos;
第二计算单元,用于分别计算每张所述第一照片各自对应的所述灰度图与每张所述第一照片各自对应的所述模糊照片之间的差分值。The second calculation unit is configured to calculate the difference value between the grayscale image corresponding to each first photo and the blurred photo corresponding to each first photo.
本申请实施例的第三方面提供了一种智能终端,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现如上第一方面所述连拍照片获取方法的步骤。The third aspect of the embodiments of the present application provides an intelligent terminal, including a memory, a processor, and a computer program stored in the memory and running on the processor. When the processor executes the computer program, The steps of the method for obtaining continuous shots as described in the first aspect are implemented.
本申请实施例的第四方面提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时实现如上第一方面所述连拍照片获取方法的步骤。A fourth aspect of the embodiments of the present application provides a computer-readable storage medium, the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the continuous shooting of photos as described in the first aspect is achieved. Method steps.
本申请第一方面提供的连拍照片获取方法与现有技术相比存在的有益效果是:通过获取连拍的第一照片;分别对每张所述第一照片进行模糊处理,得到每张所述第一照片各自对应的模糊照片;计算每张所述第一照片与各自对应的所述模糊照片之间的差分值;基于所述差分值确定每张所述第一照片的清晰度,基于所述清晰度从所述第一照片中得到第二照片。由于对连拍的每张所述第一照片进行模糊处理之后,计算每张所述第一照片与各自对应的所述模糊照片之间的差分值,并基于所述差分值确定每张所述第一照片的清晰度,基于所述清晰度从所述第一照片中得到第二照片。实现了快速准确地从连拍的所述第一照片中基于清晰度得到第二照片,提高了从多张连拍照片中选出清晰照片的效率。Compared with the prior art, the method for acquiring continuous shots provided by the first aspect of the application has the following beneficial effects: by acquiring the first continuous shot; blurring each of the first photos to obtain each The fuzzy photos corresponding to each of the first photos; calculate the difference value between each of the first photos and the corresponding fuzzy photos; determine the sharpness of each of the first photos based on the difference value, based on The sharpness derives a second photo from the first photo. After the blurring process is performed on each of the first photos in the continuous shooting, the difference value between each of the first photos and the corresponding blurred photos is calculated, and each of the first photos is determined based on the difference value. The sharpness of the first photo, and the second photo is obtained from the first photo based on the sharpness. It is realized that the second photo based on the sharpness is obtained from the first photos of the continuous shooting quickly and accurately, and the efficiency of selecting a clear photo from the multiple continuous photos is improved.
本申请第二方面提供的终端以及第四方面提供的计算机可读存储介质与现有技术相比,存在的有益效果与本申请第一方面提供的连拍照片获取方法与现有技术相比存在的有益效果相同,在此不再重述。Compared with the prior art, the terminal provided in the second aspect of the present application and the computer-readable storage medium provided in the fourth aspect have beneficial effects. Compared with the prior art, the method for acquiring continuous photographs provided in the first aspect of the present application has The beneficial effects are the same and will not be repeated here.
附图说明Description of the drawings
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly describe the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only of the present application. For some embodiments, those of ordinary skill in the art can obtain other drawings based on these drawings without creative labor.
图1是本申请实施例提供的连拍照片获取方法的实现流程;FIG. 1 is an implementation process of a method for acquiring continuous shots provided by an embodiment of the present application;
图2是图1中S102的具体实施流程图;Figure 2 is a flow chart of the specific implementation of S102 in Figure 1;
图3是图1中S103的具体实施流程图;Figure 3 is a flow chart of the specific implementation of S103 in Figure 1;
图4是图1中S104的具体实施流程图;Figure 4 is a flow chart of the specific implementation of S104 in Figure 1;
图5是本申请提供的连拍照片获取装置的装置示意图;FIG. 5 is a schematic diagram of the device for acquiring continuous photographs provided by the present application;
图6是本申请提供的终端的示意图。Fig. 6 is a schematic diagram of a terminal provided by the present application.
具体实施方式Detailed ways
以下描述中,为了说明而不是为了限定,提出了诸如特定系统结构、技术之类的具体细节,以便透彻理解本申请实施例。然而,本领域的技术人员应当清楚,在没有这些具体细节的其它实施例中也可以实现本申请。在其它情况中,省略对众所周知的系统、装置、电路以及方法的详细说明,以免不必要的细节妨碍本申请的描述。In the following description, for the purpose of illustration rather than limitation, specific details such as a specific system structure and technology are proposed for a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application can also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to avoid unnecessary details from obstructing the description of this application.
需要说明的是,在终端,例如手机,PAD等的照相功能越来越强大的今天,很多人都选择用终端而不是用摄像机来进行拍照。这就对终端的拍照功能的稳定性,智能性,提出了越来越高的需求。目前,在终端拍摄中,由于一些拍摄问题会出现不同程度的模糊,例如,由于拍摄时终端抖动引起的抖动模糊,由于拍摄目标移动引起的移动模糊,或者由于对焦不清晰导致的失焦模糊等。用户为了能够拍摄出满意的照片,通常选择连拍多张照片 来降低拍摄模糊的概率,提升清晰照片的选择范围。但是,连拍照片通常有7-20张左右,需要用户进行逐张选择,浪费大量的时间,选片效率低下。It should be noted that today, as the camera functions of terminals, such as mobile phones and PADs, are becoming more and more powerful, many people choose to use terminals instead of cameras to take pictures. This puts increasing demands on the stability and intelligence of the camera function of the terminal. At present, in terminal shooting, different degrees of blur will occur due to some shooting problems, for example, the blur caused by the shaking of the terminal during shooting, the motion blur caused by the movement of the shooting target, or the out-of-focus blur caused by the lack of focus, etc. . In order to be able to take satisfactory photos, users usually choose to take multiple photos continuously to reduce the probability of blurring and increase the range of clear photos. However, there are usually about 7-20 photos in continuous shooting, which requires the user to select one by one, which wastes a lot of time and is inefficient in film selection.
针对上述问题,如果终端能够自动快速从多张连拍照片中判断出最佳的照片,并进行存储,则可以为用户节省大量挑选照片的时间。目前,提出了一些自动识别图片清晰度的方法,常见的传统算法为边缘检测算法,其依据的是假设图片很模糊,那么边缘信息就会比较模糊,相应检测到的边缘信息就少的思想,将图片进行边缘检测之后,再通过求方差的方法,对边缘图片统计出方差大小。将方差比较小的图片作为模糊图片,方差比较大的图片作为清晰图片。但是在现实生活拍照中,常常会出现摩尔纹效应,或者光线敏感变化,或者照片内容的变化,导致上述通过边缘检测算法进行图片情绪度判断时存在正确率不高的问题。针对上述问题,本发明针对照片模糊,给出新的方法。In view of the above problems, if the terminal can automatically and quickly determine the best photo from multiple continuous photos and store it, it can save a lot of time for users to select photos. At present, some methods for automatically identifying the image definition have been proposed. The common traditional algorithm is the edge detection algorithm, which is based on the assumption that the image is blurry, then the edge information will be blurred, and the corresponding detected edge information will be less. After the edge detection of the picture, the variance calculation method is used to calculate the variance of the edge picture. A picture with a relatively small variance is regarded as a blurred picture, and a picture with a relatively large variance is regarded as a clear picture. However, in real-life photography, moiré effects, changes in light sensitivity, or changes in photo content often occur, leading to the problem of low accuracy when the edge detection algorithm is used to judge the mood of the picture. In view of the above-mentioned problems, the present invention provides a new method for blurring photos.
为了说明本申请所述的技术方案,下面通过具体实施例来进行说明。如图1所示,是本申请第一实施例提供的连拍照片获取方法的实现流程图,本实施例的执行主体为终端。详述如下:In order to illustrate the technical solution described in the present application, specific embodiments are used for description below. As shown in FIG. 1, it is a flow chart of the method for acquiring continuous shots provided by the first embodiment of the present application, and the execution subject of this embodiment is a terminal. The details are as follows:
S101,获取连拍的第一照片。S101: Acquire the first photo continuously shot.
可以理解地,用户在看见自己喜欢的景物或者是为家人朋友抓拍一些特定动作时,会快速按下拍摄键,启动拍摄功能进行拍摄,此时,会检测到拍摄照片。在本实施例中,当检测到拍摄照片后,可以获取连拍的第一照片。Understandably, when the user sees his favorite scenery or captures some specific actions for his family and friends, he will quickly press the shooting button to start the shooting function to shoot. At this time, the shooting will be detected. In this embodiment, when it is detected that the photo is taken, the first photo continuously taken can be obtained.
S102,分别对每张所述第一照片进行模糊处理,得到每张所述第一照片各自对应的模糊照片。S102: Perform blurring processing on each of the first photos, respectively, to obtain a blurry photo corresponding to each of the first photos.
可以理解地,在拍摄照片过程中,人们最关心的往往是拍摄目标的清晰度,例如人物照片中的人脸清晰度,包括面部表情是否自然,例如是否存在眨眼,张嘴等影响照片美观的动作,或者是物体取景是否清晰等。因此,在本实例中,进一步地,可以通过检测出每张所述第一照片包含的目标区域,通过目标区域的清晰度,来确定每张所述第一照片的清晰度。具体地,所述第一照片包含有人脸图像和/或物体图像,在本实施例中,所述目标区域为所述人脸图像和/或物体图像。Understandably, in the process of taking photos, people are most concerned about the clarity of the shooting target, such as the clarity of the face in the photo of a person, including whether the facial expression is natural, such as whether there are actions that affect the beauty of the photo, such as blinking and opening the mouth. , Or whether the framing of the object is clear, etc. Therefore, in this example, further, the sharpness of each first photo can be determined by detecting the target area included in each first photo, and by the sharpness of the target area. Specifically, the first photo includes a human face image and/or an object image, and in this embodiment, the target area is the human face image and/or an object image.
具体地,图2是图1中S102的具体实施流程图。由图2可知,S102包括:Specifically, FIG. 2 is a flowchart of specific implementation of S102 in FIG. 1. As can be seen from Figure 2, S102 includes:
S1021,分别检测出每张所述第一照片的目标区域,所述目标区域包含人脸图像和/或物体图像。S1021: Detect a target area of each of the first photos, where the target area includes a face image and/or an object image.
需要说明的是,目前常见的人脸图像和/或物体图像检测方法有很多,例如,通过机器学习模型进行人脸检测和/或物体图像检测,具体地,在本实施例中,可以利用经训练的图像检测模型检测出所述每张照片的目标区域,所述经训练的图像检测模型为神经网络模型。It should be noted that there are many common face image and/or object image detection methods. For example, face detection and/or object image detection are performed through machine learning models. Specifically, in this embodiment, The trained image detection model detects the target area of each photo, and the trained image detection model is a neural network model.
具体地,所述分别检测出每张所述第一照片的目标区域,包括:将每张所述第一照片输入所述神经网络模型进行目标区域检测,得到所述神经网络模型输出的每张所述第一照片的目标区域。Specifically, the detecting the target area of each of the first photos separately includes: inputting each of the first photos into the neural network model to perform target area detection, and obtaining each output of the neural network model The target area of the first photo.
所述经训练的图像检测模型的训练过程,包括:获取第一预设数量的目标照片,所述目标照片为标注了目标区域的所述第一照片,所述第一照片包含有人脸图像和/或物体图像,所述目标区域为人脸图像和/或物体图像。The training process of the trained image detection model includes: obtaining a first preset number of target photos, where the target photos are the first photos marked with the target area, and the first photos include human face images and /Or an object image, and the target area is a human face image and/or an object image.
可以理解地,在图像检测模型的训练过程中,通常选择预先建立的模型结构,例如,在本实施例中为神经网络模型的结构,然后将训练样本输入预先建立的模型结构进行训练,在本实施例中,训练样本为所述第一预设数量的目标照片,具体地,为了提高图像检测模型训练的效率及准确性,所述第一预设数量的目标照片为标注了目标区域的所述第一照片。Understandably, in the training process of the image detection model, the pre-established model structure is usually selected, for example, the structure of the neural network model in this embodiment, and then the training samples are input into the pre-established model structure for training. In an embodiment, the training samples are the first preset number of target photos. Specifically, in order to improve the efficiency and accuracy of image detection model training, the first preset number of target photos are all the target photos marked with the target area. Narrate the first photo.
具体地,所述神经网络模型的训练过程包括:获取第一预设的目标照片;将所述第一预设数量的目标照片输入预先建立的神经网络模型进行训练,获得训练之后的所述神经网络模型;获取第二预设数量的目标照片,将所述第二预设数量的目标照片依次输入训练之后的所述神经网络模型进行分析,得到训练之后的所述神经网络模型输出的标注了目标区域的所述目标照片;若标注了目标区域的所述目标照片与预设的标注了目标区域的所述目 标照片相比,所述目标区域重合的概率大于预设的概率阈值,则确定训练之后的所述神经网络模型为训练完成的神经网络模型;若标注了目标区域的所述目标照片与预设的标注了目标区域的所述目标照片相比,所述目标区域重合的概率小于或等于预设的概率阈值,则增加所述第一预设数量的目标照片,并执行将所述第一预设数量的目标照片输入预先建立的神经网络模型进行训练,获得训练之后的所述神经网络模型。Specifically, the training process of the neural network model includes: obtaining a first preset target photo; inputting the first preset number of target photos into a pre-established neural network model for training, and obtaining the neural network model after training. Network model; acquiring a second preset number of target photos, and sequentially inputting the second preset number of target photos into the neural network model after training for analysis, and obtaining the annotations output by the neural network model after training The target photo of the target area; if the target photo marked with the target area is compared with the preset target photo marked with the target area, the probability that the target area overlaps is greater than the preset probability threshold, then determine The neural network model after training is a trained neural network model; if the target photo with the target area is compared with the preset target photo with the target area, the probability that the target area overlaps is less than Or equal to the preset probability threshold, then increase the first preset number of target photos, and perform training by inputting the first preset number of target photos into a pre-established neural network model to obtain the training Neural network model.
通常,模型在训练完成之后,将未标注目标区域的所述第一照片输入经训练的所述神经网络模型进行目标区域标注,会获得训练完成的所述神经网络模型输出的标注了目标区域的所述第一照片。Generally, after the training of the model is completed, the first photo of the unlabeled target area is input into the trained neural network model for target area labeling, and the output of the trained neural network model with the target area marked will be obtained. The first photo.
S1022,分别对每张所述第一照片各自对应的目标区域进行模糊滤波处理,得到每张所述第一照片各自对应的模糊照片。S1022: Perform fuzzy filtering processing on the target area corresponding to each of the first photos respectively, to obtain respective blurred photos corresponding to each of the first photos.
通常,当图像中有模糊现象时,对图像进一步进行模糊滤波处理,对应对该具有模糊现象的图像的清晰度损失较小。Generally, when there is a blur in the image, the image is further subjected to blur filtering processing, corresponding to the loss of sharpness of the image with blurring.
在本实例中,利用模糊滤波的该特性,通过分别对每张所述第一照片各自对应的目标区域进行模糊滤波处理,得到每张所述第一照片各自对应的模糊照片。具体地,对每张所述第一照片各自对应的目标区域进行高斯滤波处理,得到每张所述第一照片各自对应的模糊照片。In this example, using this characteristic of blur filtering, the respective target regions corresponding to each of the first photos are respectively subjected to blur filtering processing to obtain respective blurred photos corresponding to each of the first photos. Specifically, Gaussian filtering processing is performed on the target area corresponding to each of the first photos to obtain the fuzzy photos corresponding to each of the first photos.
S103,计算每张所述第一照片与各自对应的所述模糊照片之间的差分值。S103: Calculate the difference value between each of the first photos and the corresponding blurred photos.
需要说明的是,由于对原本模糊的图像进行模糊滤波处理,对其清晰度的损失较小,对原本清晰的图像进行模糊滤波处理,对其清晰度的损失较大,因此对模糊照片进行模糊滤波处理之后,其与原图的差分值较小,相应地,图像越清晰,对其进行模糊滤波处理之后,其与原图的差分值越大。It should be noted that since the original blurry image is subjected to blur filter processing, the loss of its sharpness is small, and the original clear image is subjected to blur filter processing, and its sharpness loss is greater, so the blurred picture is blurred After the filtering process, the difference value between it and the original image is smaller. Correspondingly, the clearer the image, after the fuzzy filtering process is performed on it, the difference value between it and the original image is larger.
在本实施例中,利用模糊滤波对不同清晰度图像的损失不同的特性,通过计算每张所述第一照片与各自对应的所述模糊照片之间的差分值来确定原图的清晰度。具体地,图像的差分值对应为两幅图像的对应像素值相减,得到的像素差值。In this embodiment, the characteristics of different loss of images of different definitions by blur filtering are used, and the definition of the original image is determined by calculating the difference value between each of the first photos and the corresponding blurred photos. Specifically, the difference value of the image corresponds to the pixel difference value obtained by subtracting the corresponding pixel values of the two images.
具体地,如图3所示,是图1中S103的具体实施流程图。由图3可知,S103包括:Specifically, as shown in FIG. 3, it is a flowchart of the specific implementation of S103 in FIG. It can be seen from Figure 3 that S103 includes:
S1031,分别将每张所述第一照片进行灰度化处理,得到每张所述第一照片各自对应的灰度图。S1031: Perform grayscale processing on each of the first photos to obtain a grayscale image corresponding to each of the first photos.
需要说明的是,所述第一照片为三原色(RGB,其中R代表红色通道,G代表绿色通道,B代表蓝色通道)图像,每张所述第一照片各自对应的所述模糊照片为灰度图像,而在计算图像差分时,要求输入图像具有相同的类型和大小,因此,首先需要将每张所述第一照片进行灰度化处理。具体地,对每张所述第一照片进行灰度化处理的具体方式在此不做限制,作为示例而非限定,可以通过预设的灰度化公式,例Gray=R*0.299+G*0.587+B*0.114,对每张所述第一照片进行灰度化处理,其中,在该灰度化处理的过程中,R表示红色通道的像素值,G表示绿色通道的像素值,B表示蓝色通道的像素值,Gray表示灰度化处理之后的单通道像素值。It should be noted that the first photo is an image of three primary colors (RGB, where R represents the red channel, G represents the green channel, and B represents the blue channel) image, and the blurred photo corresponding to each of the first photos is gray When calculating the image difference, it is required that the input images have the same type and size. Therefore, it is necessary to perform grayscale processing on each of the first photos first. Specifically, the specific method of gray-scale processing for each of the first photos is not limited here. As an example and not a limitation, a preset gray-scale formula can be used, for example, Gray=R*0.299+G* 0.587+B*0.114, grayscale processing is performed on each of the first photos, where in the grayscale processing process, R represents the pixel value of the red channel, G represents the pixel value of the green channel, and B represents The pixel value of the blue channel, Gray represents the single-channel pixel value after grayscale processing.
S1032,分别计算每张所述第一照片各自对应的所述灰度图与每张所述第一照片各自对应的所述模糊照片之间的差分值。S1032: Calculate the difference value between the grayscale image corresponding to each first photo and the blurred photo corresponding to each first photo.
具体地,由于每张所述第一照片各自对应的所述灰度图与每张所述第一照片各自对应的所述模糊照片具有相同的类型和大小,因此,可以直接将每张所述第一照片各自对应的所述灰度图与每张所述第一照片各自对应的所述模糊照片进行相减,得到差分图像,所述差分图像每个像素点对应的像素值为所述差分值。Specifically, since the grayscale image corresponding to each of the first photos has the same type and size as the fuzzy photos corresponding to each of the first photos, each of the first photos can be directly The grayscale image corresponding to each first photo is subtracted from the fuzzy photo corresponding to each first photo to obtain a difference image, and the pixel value corresponding to each pixel of the difference image is the difference value.
进一步地,在一种可以实现的实施方式中,可以对每张所述第一照片各自对应的所述灰度图和所述模糊照片分别进行归一化处理之后,再计算归一化处理之后的所述灰度图与归一化处理之后的所述模糊照片之间的差分值。具体地,归一化处理的过程不做具体限制,具体地,所述归一化处理的目的是使得所述灰度图的每个像素点以及所述模糊照片的每个像素点的取值分别为[0,1]之间。Further, in an achievable embodiment, the grayscale image and the blurred photo corresponding to each of the first photos may be normalized separately, and then the normalized image may be calculated after the normalization process. The difference value between the grayscale image of and the blurred photo after normalization processing. Specifically, the process of normalization processing is not specifically limited. Specifically, the purpose of the normalization processing is to make the value of each pixel of the grayscale image and each pixel of the blurred photo They are between [0,1].
S104,基于所述差分值确定每张所述第一照片的清晰度,基于所述清晰度从所述第一照片中得到第二照片。S104: Determine the sharpness of each of the first photos based on the difference value, and obtain a second photo from the first photos based on the sharpness.
具体地,根据前面分析可知,越模糊的图像进行模糊滤波处理之后,对原图的清晰度损失越小,因此,计算得到的所述差分值越小,通常,差分值是差分图像的每个像素点的像素值,通过比较图像每个像素点的像素值的大小确定图像的清晰度,往往不是特别清楚,因此,在本实施例中,进一步通过计算所述差分值对应的峰值信噪比,来确定每张所述第一照片的清晰度。Specifically, according to the previous analysis, it can be known that the more blurry image is subjected to blur filter processing, the less the loss of sharpness of the original image is, therefore, the calculated difference value is smaller. Generally, the difference value is each of the difference images. The pixel value of the pixel is often not clear to determine the sharpness of the image by comparing the size of the pixel value of each pixel of the image. Therefore, in this embodiment, the peak signal-to-noise ratio corresponding to the difference value is further calculated. , To determine the sharpness of each of the first photos.
可以理解地,用户通常清晰度较高的照片,因此,在一种可选的实现方式中,所述S104具体包括:基于所述差分值确定每张所述第一照片的清晰度,从所有所述第一照片中获取清晰度最高的第二照片。It is understandable that users usually have high-definition photos. Therefore, in an optional implementation manner, the S104 specifically includes: determining the sharpness of each first photo based on the difference value, from all The second photo with the highest definition is obtained among the first photos.
具体地,如图4所示,是图1中S104的具体实施流程图。由图4可知S104包括:Specifically, as shown in FIG. 4, it is a flowchart of the specific implementation of S104 in FIG. It can be seen from Figure 4 that S104 includes:
S1041,计算所述差分值的峰值信噪比。S1041: Calculate the peak signal-to-noise ratio of the difference value.
具体地,峰值信噪比经常用来表示图像压缩等领域中像素重建质量的测量,在本实施例中,通过计算所述差分值的峰值信噪比,来确定每张所述第一照片的清晰度。Specifically, the peak signal-to-noise ratio is often used to indicate the measurement of pixel reconstruction quality in the fields of image compression and the like. In this embodiment, the peak signal-to-noise ratio of the differential value is calculated to determine the value of each first photo. Clarity.
具体地,基于预设的峰值信噪比计算公式计算所述差分值的峰值信噪比,进一步地,所述预设的峰值信噪比计算公式为:Specifically, the peak signal-to-noise ratio of the differential value is calculated based on a preset peak signal-to-noise ratio calculation formula. Further, the preset peak signal-to-noise ratio calculation formula is:
Figure PCTCN2020123355-appb-000003
Figure PCTCN2020123355-appb-000003
其中,a ij表示第一照片的灰度图对应的像素点坐标为(i,j)的第一像素点与对应的模糊照片的像素点坐标为(i,j)的第二像素点之间的差分值,i表示像素点的横坐标,j表示像素点的纵坐标,n表示当前照片的宽度,m表示当前照片的长度。 Among them, a ij represents the distance between the first pixel with the pixel coordinate (i, j) corresponding to the grayscale image of the first photo and the second pixel with the pixel coordinate (i, j) of the corresponding blurred photo The difference value of i represents the abscissa of the pixel, j represents the ordinate of the pixel, n represents the width of the current photo, and m represents the length of the current photo.
需要说明的是,常见的峰值信噪比为负数,在本实例中,为了更方便确定每张所述第一照片的清晰度,所述预设的峰值信噪比公式为基于传统的峰值信噪比公式演变而来,其取值为正。It should be noted that the common peak signal-to-noise ratio is a negative number. In this example, in order to more conveniently determine the sharpness of each of the first photos, the preset peak signal-to-noise ratio formula is based on the traditional peak signal-to-noise ratio. The noise ratio formula evolved, and its value is positive.
S1042,根据所述峰值信噪比确定每张所述第一照片的清晰度。S1042: Determine the sharpness of each first photo according to the peak signal-to-noise ratio.
具体地,在本实例中,当所述峰值信噪比越大,说明对应的所述第一照片越模糊,所述峰值信噪比越小,说明对应的所述第一照片越清晰。Specifically, in this example, when the peak signal-to-noise ratio is larger, the corresponding first photo is blurred, and the peak signal-to-noise ratio is smaller, which means the corresponding first photo is clearer.
S1043,从所有所述第一照片中获取清晰度最高的第二照片。S1043: Obtain a second photo with the highest definition from all the first photos.
可选地,从所有所述第一照片中获取清晰度最高的第二照片进行存储之后,将其余所述第一照片从删除,以释放缓存空间。Optionally, after the second photo with the highest definition is obtained from all the first photos for storage, the remaining first photos are deleted to release cache space.
应理解,上述实施例中各步骤的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。It should be understood that the size of the sequence number of each step in the foregoing embodiment does not mean the order of execution. The execution sequence of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present application.
通过上述分析可知,本申请提出的连拍照片获取方法,通过获取连拍的第一照片;分别对每张所述第一照片进行模糊处理,得到每张所述第一照片各自对应的模糊照片;计算每张所述第一照片与各自对应的所述模糊照片之间的差分值;基于所述差分值确定每张所述第一照片的清晰度,基于所述清晰度从所述第一照片中得到第二照片。由于对连拍的每张所述第一照片进行模糊处理之后,计算每张所述第一照片与各自对应的所述模糊照片之间的差分值,并基于所述差分值确定每张所述第一照片的清晰度,基于所述清晰度从所述第一照片中得到第二照片。实现了快速准确地从连拍的所述第一照片中基于清晰度得到第二照片,提高了从多张连拍照片中选出清晰照片的效率。From the above analysis, it can be seen that the method for acquiring continuous photographs proposed in this application obtains the first photograph of the continuous photograph; and blurs each of the first photographs to obtain the corresponding blurred photograph of each of the first photographs. Calculate the difference between each of the first photos and the respective corresponding blurred photos; determine the sharpness of each of the first photos based on the difference value, and determine the sharpness of each of the first photos based on the sharpness from the first Get the second photo in the photo. After the blurring process is performed on each of the first photos in the continuous shooting, the difference value between each of the first photos and the corresponding blurred photos is calculated, and each of the first photos is determined based on the difference value. The sharpness of the first photo, and the second photo is obtained from the first photo based on the sharpness. It is realized that the second photo based on the sharpness is obtained from the first photos continuously shot quickly and accurately, and the efficiency of selecting clear photos from the multiple consecutive photos is improved.
图5是本申请提供的连拍照片获取装置的装置示意图。如图5所示,该实施例的连拍照片获取装置5包括:第一获取模块501、处理模块502、计算模块503以及第二获取模块504。其中,Fig. 5 is a schematic diagram of the device for acquiring continuous photographs provided by the present application. As shown in FIG. 5, the continuous-photograph acquisition device 5 of this embodiment includes: a first acquisition module 501, a processing module 502, a calculation module 503, and a second acquisition module 504. among them,
第一获取模块501,用于获取连拍的第一照片;The first obtaining module 501 is configured to obtain the first photo continuously shot;
处理模块502,用于分别对每张所述第一照片进行模糊处理,得到每张所述第一照片各自对应的模糊照片;The processing module 502 is configured to perform blurring processing on each of the first photos to obtain respective blurred photos corresponding to each of the first photos;
计算模块503,用于计算每张所述第一照片与各自对应的所述模糊照片之间的差分值;The calculation module 503 is configured to calculate the difference value between each of the first photos and the corresponding blurred photos;
第二获取模块504,用于基于所述像差分值确定每张所述第一照片的清晰度,基于所述清晰度从所述第一照片中得到第二照片。The second acquisition module 504 is configured to determine the sharpness of each of the first photos based on the difference value, and obtain a second photo from the first photos based on the sharpness.
优选地,处理模块502包括:Preferably, the processing module 502 includes:
检测单元,用于分别检测出每张所述第一照片的目标区域,所述目标区域包含人脸图像和/或物体图像;A detection unit, configured to separately detect a target area of each of the first photos, where the target area includes a face image and/or an object image;
第一处理单元,用于分别对每张所述第一照片各自对应的目标区域进行模糊滤波处理,得到每张所述第一照片各自对应的模糊照片。The first processing unit is configured to perform blur filtering processing on the respective target regions corresponding to each of the first photos to obtain respective blurred photos corresponding to each of the first photos.
优选地,检测单元具体用于:利用经训练的图像检测模型检测出所述每张照片的目标区域,所述经训练的图像检测模型为神经网络模型。Preferably, the detection unit is specifically configured to: use a trained image detection model to detect the target area of each photo, and the trained image detection model is a neural network model.
优选地,所述第二获取模块504具体用于:基于所述差分值确定每张所述第一照片的清晰度,从所有所述第一照片中获取清晰度最高的第二照片。Preferably, the second obtaining module 504 is specifically configured to: determine the sharpness of each of the first photos based on the difference value, and obtain the second photo with the highest sharpness from all the first photos.
优选地,所述第二获取模块504,包括:Preferably, the second acquisition module 504 includes:
第一计算单元,用于计算所述差分值的峰值信噪比;The first calculation unit is configured to calculate the peak signal-to-noise ratio of the difference value;
确定单元,用于根据所述峰值信噪比确定每张所述第一照片的清晰度;A determining unit, configured to determine the sharpness of each of the first photos according to the peak signal-to-noise ratio;
获取单元,用于从所有所述第一照片中获取清晰度最高的第二照片。The obtaining unit is configured to obtain the second photo with the highest definition from all the first photos.
优选地,计算单元具体用于:基于预设的峰值信噪比计算公式计算所述差分值的峰值信噪比,所述预设的峰值信噪比计算公式为:Preferably, the calculation unit is specifically configured to: calculate the peak signal-to-noise ratio of the differential value based on a preset peak signal-to-noise ratio calculation formula, and the preset peak signal-to-noise ratio calculation formula is:
Figure PCTCN2020123355-appb-000004
Figure PCTCN2020123355-appb-000004
其中,a ij表示第一照片的灰度图对应的像素点坐标为(i,j)的第一像素点与对应的模糊照片的像素点坐标为(i,j)的第二像素点之间的差分值,i表示像素点的横坐标,j表示像素点的纵坐标,n表示当前照片的宽度,m表示当前照片的长度。 Among them, a ij represents the distance between the first pixel with the pixel coordinate (i, j) corresponding to the grayscale image of the first photo and the second pixel with the pixel coordinate (i, j) of the corresponding blurred photo The difference value of i represents the abscissa of the pixel, j represents the ordinate of the pixel, n represents the width of the current photo, and m represents the length of the current photo.
优选地,处理模块502具体用于:分别对每张所述第一照片进行高斯滤波处理,得到每张所述第一照片各自对应的模糊照片。Preferably, the processing module 502 is specifically configured to: respectively perform Gaussian filtering processing on each of the first photos to obtain respective fuzzy photos corresponding to each of the first photos.
优选地,计算模块503包括:Preferably, the calculation module 503 includes:
第二处理单元,用于分别将每张所述第一照片进行灰度化处理,得到每张所述第一照片各自对应的灰度图;The second processing unit is configured to perform grayscale processing on each of the first photos to obtain a grayscale image corresponding to each of the first photos;
第二计算单元,用于分别计算每张所述第一照片各自对应的所述灰度图与每张所述第一照片各自对应的所述模糊照片之间的差分值。The second calculation unit is configured to calculate the difference value between the grayscale image corresponding to each first photo and the blurred photo corresponding to each first photo.
图6是本申请提供的终端的示意图。如图6所示,该实施例的终端6包括:处理器60、存储器61以及存储在所述存储器61中并可在所述处理器60上运行的计算机程序62,例如连拍照片获取程序。所述处理器60执行所述计算机程序62时实现上述各个连拍照片获取方法实施例中的步骤,例如图1所示的步骤101至104。或者,所述处理器60执行所述计算机程序62时实现上述连拍照片获取装置实施例中各模块/单元的功能,例如图5所示模块501至504的功能。Fig. 6 is a schematic diagram of a terminal provided by the present application. As shown in FIG. 6, the terminal 6 of this embodiment includes a processor 60, a memory 61, and a computer program 62 stored in the memory 61 and running on the processor 60, such as a continuous photo acquisition program. When the processor 60 executes the computer program 62, the steps in the foregoing embodiments of the method for acquiring continuous photographs are implemented, for example, steps 101 to 104 shown in FIG. 1. Alternatively, when the processor 60 executes the computer program 62, the functions of the modules/units in the embodiment of the apparatus for acquiring continuous photographs are realized, for example, the functions of the modules 501 to 504 shown in FIG. 5.
示例性的,所述计算机程序62可以被分割成一个或多个模块/单元,所述一个或者多个模块/单元被存储在所述存储器61中,并由所述处理器60执行,以完成本申请。所述一个或多个模块/单元可以是能够完成特定功能的一系列计算机程序指令段,该指令段用于描述所述计算机程序62在终端6中的执行过程。例如,所述计算机程序62可以被分割成第一获取模块、处理模块、计算模块以及第二获取模块(虚拟装置中的模块),各模块具体功能如下:Exemplarily, the computer program 62 may be divided into one or more modules/units, and the one or more modules/units are stored in the memory 61 and executed by the processor 60 to complete This application. The one or more modules/units may be a series of computer program instruction segments capable of completing specific functions, and the instruction segments are used to describe the execution process of the computer program 62 in the terminal 6. For example, the computer program 62 may be divided into a first acquisition module, a processing module, a calculation module, and a second acquisition module (a module in a virtual device), and the specific functions of each module are as follows:
第一获取模块,用于获取连拍的第一照片;The first acquisition module is used to acquire the first photo continuously shot;
处理模块,用于分别对每张所述第一照片进行模糊处理,得到每张所述第一照片各自对应的模糊照片;A processing module, which is configured to perform blur processing on each of the first photos to obtain a blurry photo corresponding to each of the first photos;
计算模块,用于计算每张所述第一照片与各自对应的所述模糊照片之间的差分值;A calculation module, configured to calculate the difference between each of the first photos and the corresponding blurred photos;
第二获取模块,用于基于所述像素差值确定每张所述第一照片的清晰度,从所有所述第一照片中获取清晰度最高的第二照片进行存储。The second acquisition module is configured to determine the sharpness of each of the first photos based on the pixel difference value, and acquire and store the second photo with the highest sharpness from all the first photos.
优选地,所述终端还包括拍摄模块,所述拍摄模块用于拍摄所述第一照片。Preferably, the terminal further includes a photographing module, and the photographing module is used to photograph the first photo.
所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,仅以上述各功能单元、模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能单元、模块完成,即将所述装置的内部结构划分成不同的功能单元或模块,以完成以上描述的全部或者部分功能。实施例中的各功能单元、模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中,上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。另外,各功能单元、块的具体名称也只是为了便于相互区分,并不用于限制本申请的保护范围。上述系统中单元、模块的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述或记载的部分,可以参见其它实施例的相关描述。Those skilled in the art can clearly understand that, for the convenience and conciseness of description, only the division of the above functional units and modules is used as an example. In practical applications, the above functions can be allocated to different functional units and modules as needed. Module completion, that is, the internal structure of the device is divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist alone physically, or two or more units can be integrated into one unit. The above-mentioned integrated units can be hardware-based Formal realization can also be realized in the form of software functional units. In addition, the specific names of the functional units and blocks are only used to facilitate distinguishing each other, and are not used to limit the protection scope of the present application. For the specific working process of the units and modules in the foregoing system, reference may be made to the corresponding process in the foregoing method embodiment, which will not be repeated here. In the above-mentioned embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail or recorded in an embodiment, reference may be made to related descriptions of other embodiments.
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。A person of ordinary skill in the art may realize that the units and algorithm steps of the examples described in combination with the embodiments disclosed herein can be implemented by electronic hardware or a combination of computer software and electronic hardware. Whether these functions are performed by hardware or software depends on the specific application and design constraint conditions of the technical solution. Professionals and technicians can use different methods for each specific application to implement the described functions, but such implementation should not be considered beyond the scope of this application.
在本申请所提供的实施例中,应该理解到,所揭露的装置/终端设备和方法,可以通过其它的方式实现。例如,以上所描述的装置/终端设备实施例仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通讯连接可以是通过一些接口,装置或单元的间接耦合或通讯连接,可以是电性,机械或其它的形式。In the embodiments provided in this application, it should be understood that the disclosed device/terminal device and method may be implemented in other ways. For example, the device/terminal device embodiments described above are only illustrative. For example, the division of the modules or units is only a logical function division, and there may be other divisions in actual implementation, such as multiple units. Or components can be combined or integrated into another system, or some features can be omitted or not implemented. In addition, the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个通信单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple communication units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。所述集成的模块/单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实现上述实施例方法中的全部或部分流程,也可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一计算机可读存储介质中,该计算机程序在被处理器执行时,可实现上述各个方法实施例的步骤。其中,所述计算机程序包括计算机程序代码,所述计算机程序代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。所述计算机可读介质可以包括:能够携带所述计算机程序代码的任何实体或装置、记录介质、U盘、移动硬盘、磁碟、光盘、计算机存储器、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、电载波信号、电信信号以及软件分发介质等。需要说明的是,所述计算机可读介质包含的内容可以根据司法管辖区内立法和专利实践的要求进行适当的增减,例如在某些司法管辖区,根据立法和专利实践,计算机可读介质不包括电载波信号和电信信号。In addition, the functional units in the various embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or software functional unit. If the integrated module/unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on this understanding, this application implements all or part of the processes in the above-mentioned embodiments and methods, and can also be completed by instructing relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the program is executed by the processor, it can implement the steps of the foregoing method embodiments. Wherein, the computer program includes computer program code, and the computer program code may be in the form of source code, object code, executable file, or some intermediate forms. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory) , Random Access Memory (RAM, Random Access Memory), electrical carrier signal, telecommunications signal, and software distribution media, etc. It should be noted that the content contained in the computer-readable medium can be appropriately added or deleted according to the requirements of the legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to the legislation and patent practice, the computer-readable medium Does not include electrical carrier signals and telecommunication signals.
以上所述实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围,均应包含在本申请的保护范围之内。The above-mentioned embodiments are only used to illustrate the technical solutions of the present application, not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, a person of ordinary skill in the art should understand that it can still implement the foregoing The technical solutions recorded in the examples are modified, or some of the technical features are equivalently replaced; these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the application, and should be included in Within the scope of protection of this application.

Claims (20)

  1. 一种连拍照片获取方法,其特征在于,包括:A method for obtaining continuous photographs, which is characterized in that it comprises:
    获取连拍的第一照片;Get the first photo of the continuous shooting;
    分别对每张所述第一照片进行模糊处理,得到每张所述第一照片各自对应的模糊照片;Performing blurring processing on each of the first photos, respectively, to obtain a blurry photo corresponding to each of the first photos;
    计算每张所述第一照片与各自对应的所述模糊照片之间的差分值;Calculating a difference value between each of the first photos and the corresponding blurred photos;
    基于所述差分值确定每张所述第一照片的清晰度,基于所述清晰度从所述第一照片中得到第二照片。The sharpness of each of the first photos is determined based on the difference value, and a second photo is obtained from the first photos based on the sharpness.
  2. 如权利要求1所述的连拍照片获取方法,其特征在于,所述分别对每张所述第一照片进行模糊处理,得到每张所述第一照片各自对应的模糊照片,包括:8. The method for acquiring continuous shot photos according to claim 1, wherein said respectively performing blur processing on each of said first photos to obtain respective blurred photos corresponding to each of said first photos comprises:
    分别检测出每张所述第一照片的目标区域,所述目标区域包含人脸图像和/或物体图像;Respectively detecting a target area of each of the first photos, where the target area includes a face image and/or an object image;
    分别对每张所述第一照片各自对应的目标区域进行模糊滤波处理,得到每张所述第一照片各自对应的模糊照片。A fuzzy filtering process is performed on the target area corresponding to each of the first photos, respectively, to obtain a fuzzy photo corresponding to each of the first photos.
  3. 如权利要求2所述的连拍照片获取方法,其特征在于,所述分别检测出每张所述第一照片的目标区域,包括:3. The method for acquiring continuous shooting photos according to claim 2, wherein said detecting the target area of each of said first photos respectively comprises:
    利用经训练的图像检测模型检测出所述每张照片的目标区域,所述经训练的图像检测模型为神经网络模型。A trained image detection model is used to detect the target area of each photo, and the trained image detection model is a neural network model.
  4. 如权利要求1所述的连拍照片获取方法,其特征在于,所述基于所述差分值确定每张所述第一照片的清晰度,基于所述清晰度从所述第一照片中得到第二照片,包括:The method for acquiring continuous shooting photos according to claim 1, wherein the sharpness of each of the first photos is determined based on the difference value, and the first photo is obtained from the first photos based on the sharpness. Two photos, including:
    基于所述差分值确定每张所述第一照片的清晰度,从所有所述第一照片中获取清晰度最高的第二照片。The sharpness of each of the first photos is determined based on the difference value, and a second photo with the highest sharpness is obtained from all the first photos.
  5. 如权利要求4所述的连拍照片获取方法,其特征在于,所述基于所述差分值确定每张所述第一照片的清晰度,从所有所述第一照片中获取清晰度最高的第二照片,包括:The method for obtaining continuous shooting photos according to claim 4, wherein the definition of each of the first photos is determined based on the difference value, and the first photo with the highest definition is obtained from all the first photos. Two photos, including:
    计算所述差分值的峰值信噪比;Calculating the peak signal-to-noise ratio of the difference value;
    根据所述峰值信噪比确定每张所述第一照片的清晰度;Determining the sharpness of each of the first photos according to the peak signal-to-noise ratio;
    从所有所述第一照片中获取清晰度最高的第二照片。Obtain the second picture with the highest definition from all the first pictures.
  6. 如权利要求5所述的连拍照片获取方法,其特征在于,所述计算所述差分值的峰值信噪比,包括:8. The method for acquiring continuous shooting photos according to claim 5, wherein the calculating the peak signal-to-noise ratio of the difference value comprises:
    基于预设的峰值信噪比计算公式计算所述差分值的峰值信噪比,所述预设的峰值信噪比计算公式为:The peak signal-to-noise ratio of the differential value is calculated based on a preset peak signal-to-noise ratio calculation formula, and the preset peak signal-to-noise ratio calculation formula is:
  7. 如权利要求1所述的连拍照片获取方法,其特征在于,所述分别对每张所述第一照片进行模糊处理,得到每张所述第一照片各自对应的模糊照片,包括:8. The method for acquiring continuous shot photos according to claim 1, wherein said respectively performing blur processing on each of said first photos to obtain respective blurred photos corresponding to each of said first photos comprises:
    分别对每张所述第一照片进行高斯滤波处理,得到每张所述第一照片各自对应的模糊照片。Gaussian filtering processing is performed on each of the first photos respectively to obtain respective blurred photos corresponding to each of the first photos.
  8. 如权利要求2所述的连拍照片获取方法,其特征在于,所述分别对每张所述第一照片进行模糊处理,得到每张所述第一照片各自对应的模糊照片,包括:3. The method for acquiring continuous shooting photos according to claim 2, wherein said respectively performing blur processing on each of said first photos to obtain respective blurred photos corresponding to each of said first photos comprises:
    分别对每张所述第一照片进行高斯滤波处理,得到每张所述第一照片各自对应的模糊照片。Gaussian filtering processing is performed on each of the first photos respectively to obtain respective blurred photos corresponding to each of the first photos.
  9. 如权利要求7所述的连拍照片获取方法,其特征在于,所述计算每张所述第一照片与各自对应的所述模糊照片之间的差分值,包括:8. The method for acquiring continuous shot photos according to claim 7, wherein said calculating the difference value between each of said first photos and said corresponding blurred photos comprises:
    分别将每张所述第一照片进行灰度化处理,得到每张所述第一照片各自对应的灰度图;Performing grayscale processing on each of the first photos to obtain a grayscale image corresponding to each of the first photos;
    分别计算每张所述第一照片各自对应的所述灰度图与每张所述第一照片各自对应的所述模糊照片之间的差分值。The difference value between the grayscale image corresponding to each of the first photos and the fuzzy photo corresponding to each of the first photos is calculated respectively.
  10. 一种智能终端,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,其特征在于,所述处理器执行所述计算机程序时实现如下步骤:An intelligent terminal includes a memory, a processor, and a computer program stored in the memory and capable of running on the processor, wherein the processor implements the following steps when the processor executes the computer program:
    获取连拍的第一照片;Get the first photo of the continuous shooting;
    分别对每张所述第一照片进行模糊处理,得到每张所述第一照片各自对应的模糊照片;Performing blurring processing on each of the first photos, respectively, to obtain a blurry photo corresponding to each of the first photos;
    计算每张所述第一照片与各自对应的所述模糊照片之间的差分值;Calculating a difference value between each of the first photos and the corresponding blurred photos;
    基于所述差分值确定每张所述第一照片的清晰度,基于所述清晰度从所述第一照片中得到第二照片。The sharpness of each of the first photos is determined based on the difference value, and a second photo is obtained from the first photos based on the sharpness.
  11. 如权利要求10所述的智能终端,其特征在于,所述分别对每张所述第一照片进行模糊处理,得到每张所述第一照片各自对应的模糊照片,包括:The smart terminal according to claim 10, wherein said respectively performing blur processing on each of said first photos to obtain respective fuzzy photos corresponding to each of said first photos comprises:
    分别检测出每张所述第一照片的目标区域,所述目标区域包含人脸图像和/或物体图像;Respectively detecting a target area of each of the first photos, where the target area includes a face image and/or an object image;
    分别对每张所述第一照片各自对应的目标区域进行模糊滤波处理,得到每张所述第一照片各自对应的模糊照片。A fuzzy filtering process is performed on the target area corresponding to each of the first photos, respectively, to obtain a fuzzy photo corresponding to each of the first photos.
  12. 如权利要求11所述的智能终端,其特征在于,所述分别检测出每张所述第一照片的目标区域,包括:The smart terminal of claim 11, wherein the detecting the target area of each of the first photos respectively comprises:
    利用经训练的图像检测模型检测出所述每张照片的目标区域,所述经训练的图像检测模型为神经网络模型。A trained image detection model is used to detect the target area of each photo, and the trained image detection model is a neural network model.
  13. 如权利要求10所述的智能终端,其特征在于,所述基于所述差分值确定每张所述第一照片的清晰度,基于所述清晰度从所述第一照片中得到第二照片,包括:The smart terminal according to claim 10, wherein said determining the sharpness of each of said first photos based on said difference value, and obtaining a second photo from said first photos based on said sharpness, include:
    基于所述差分值确定每张所述第一照片的清晰度,从所有所述第一照片中获取清晰度最高的第二照片。The sharpness of each of the first photos is determined based on the difference value, and a second photo with the highest sharpness is obtained from all the first photos.
  14. 如权利要求13所述的智能终端,其特征在于,所述基于所述差分值确定每张所述第一照片的清晰度,从所有所述第一照片中获取清晰度最高的第二照片,包括:The smart terminal according to claim 13, wherein said determining the sharpness of each of the first photos based on the difference value, and obtaining the second photo with the highest sharpness from all the first photos, include:
    计算所述差分值的峰值信噪比;Calculating the peak signal-to-noise ratio of the difference value;
    根据所述峰值信噪比确定每张所述第一照片的清晰度;Determining the sharpness of each of the first photos according to the peak signal-to-noise ratio;
    从所有所述第一照片中获取清晰度最高的第二照片。Obtain the second picture with the highest definition from all the first pictures.
  15. 如权利要求14所述的智能终端,其特征在于,所述计算所述差分值的峰值信噪比,包括:The smart terminal of claim 14, wherein the calculating the peak signal-to-noise ratio of the difference value comprises:
    基于预设的峰值信噪比计算公式计算所述差分值的峰值信噪比,所述预设的峰值信噪比计算公式为:The peak signal-to-noise ratio of the differential value is calculated based on a preset peak signal-to-noise ratio calculation formula, and the preset peak signal-to-noise ratio calculation formula is:
  16. 如权利要求10所述的智能终端,其特征在于,所述分别对每张所述第一照片进行模糊处理,得到每张所述第一照片各自对应的模糊照片,包括:The smart terminal according to claim 10, wherein said respectively performing blur processing on each of said first photos to obtain respective fuzzy photos corresponding to each of said first photos comprises:
    分别对每张所述第一照片进行高斯滤波处理,得到每张所述第一照片各自对应的模糊照片。Gaussian filtering processing is performed on each of the first photos respectively to obtain respective blurred photos corresponding to each of the first photos.
  17. 如权利要求16所述的智能终端,其特征在于,所述计算每张所述第一照片与各自对应的所述模糊照片之间的差分值,包括:The smart terminal according to claim 16, wherein said calculating the difference value between each of said first photos and the respective corresponding blurred photos comprises:
    分别将每张所述第一照片进行灰度化处理,得到每张所述第一照片各自对应的灰度图;Performing grayscale processing on each of the first photos to obtain a grayscale image corresponding to each of the first photos;
    分别计算每张所述第一照片各自对应的所述灰度图与每张所述第一照片各自对应的所述模糊照片之间的差分值。The difference value between the grayscale image corresponding to each of the first photos and the fuzzy photo corresponding to each of the first photos is calculated respectively.
  18. 一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现如下步骤:A computer-readable storage medium that stores a computer program, and is characterized in that, when the computer program is executed by a processor, the following steps are implemented:
    获取连拍的第一照片;Get the first photo of the continuous shooting;
    分别对每张所述第一照片进行模糊处理,得到每张所述第一照片各自对应的模糊照片;Performing blurring processing on each of the first photos, respectively, to obtain a blurry photo corresponding to each of the first photos;
    计算每张所述第一照片与各自对应的所述模糊照片之间的差分值;Calculating a difference value between each of the first photos and the corresponding blurred photos;
    基于所述差分值确定每张所述第一照片的清晰度,基于所述清晰度从所述第一照片中得到第二照片。The sharpness of each of the first photos is determined based on the difference value, and a second photo is obtained from the first photos based on the sharpness.
  19. 如权利要求18所述的计算机可读存储介质,其特征在于,所述分别对每张所述第一照片进行模糊处理,得到每张所述第一照片各自对应的模糊照片,包括:18. The computer-readable storage medium according to claim 18, wherein said respectively performing blur processing on each of said first photos to obtain respective blurred photos corresponding to each of said first photos comprises:
    分别检测出每张所述第一照片的目标区域,所述目标区域包含人脸图像和/或物体图像;Respectively detecting a target area of each of the first photos, where the target area includes a face image and/or an object image;
    分别对每张所述第一照片各自对应的目标区域进行模糊滤波处理,得到每张所述第一照片各自对应的模糊照片。A fuzzy filtering process is performed on the target area corresponding to each of the first photos, respectively, to obtain a fuzzy photo corresponding to each of the first photos.
  20. 如权利要求19所述的计算机可读存储介质,其特征在于,所述分别检测出每张所述第一照片的目标区域,包括:19. The computer-readable storage medium of claim 19, wherein said detecting the target area of each of the first photos respectively comprises:
    利用经训练的图像检测模型检测出所述每张照片的目标区域,所述经训练的图像检测模型为神经网络模型。A trained image detection model is used to detect the target area of each photo, and the trained image detection model is a neural network model.
PCT/CN2020/123355 2019-10-25 2020-10-23 Method for obtaining continuously photographed photos, smart terminal, and storage medium WO2021078276A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201911025549.5A CN112714246A (en) 2019-10-25 2019-10-25 Continuous shooting photo obtaining method, intelligent terminal and storage medium
CN201911025549.5 2019-10-25

Publications (1)

Publication Number Publication Date
WO2021078276A1 true WO2021078276A1 (en) 2021-04-29

Family

ID=75540889

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/123355 WO2021078276A1 (en) 2019-10-25 2020-10-23 Method for obtaining continuously photographed photos, smart terminal, and storage medium

Country Status (2)

Country Link
CN (1) CN112714246A (en)
WO (1) WO2021078276A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113658135A (en) * 2021-08-17 2021-11-16 中国矿业大学 Fuzzy PID (proportion integration differentiation) -based self-adaptive dimming belt foreign matter detection method and system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013206175A (en) * 2012-03-28 2013-10-07 Fujitsu Ltd Image determination device, image determination method and computer program for image determination
CN103581662A (en) * 2012-07-26 2014-02-12 腾讯科技(深圳)有限公司 Video definition measuring method and system
CN105531988A (en) * 2013-09-09 2016-04-27 苹果公司 Automated selection of keeper images from a burst photo captured set
CN105654463A (en) * 2015-11-06 2016-06-08 乐视移动智能信息技术(北京)有限公司 Image processing method applied to continuous shooting process and apparatus thereof
CN106570028A (en) * 2015-10-10 2017-04-19 比亚迪股份有限公司 Mobile terminal, fuzzy image deletion method and fuzzy picture deletion device

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2017500792A (en) * 2014-10-06 2017-01-05 テレフオンアクチーボラゲット エルエム エリクソン(パブル) Evaluation measure for HDR video frames
CN104394377B (en) * 2014-12-08 2018-03-02 浙江省公众信息产业有限公司 A kind of fuzzy abnormal recognition methods of monitoring image and device
CN106934806B (en) * 2017-03-09 2019-09-10 东南大学 It is a kind of based on text structure without with reference to figure fuzzy region dividing method out of focus
CN109215010B (en) * 2017-06-29 2021-08-31 沈阳新松机器人自动化股份有限公司 Image quality judgment method and robot face recognition system
CN108346139A (en) * 2018-01-09 2018-07-31 阿里巴巴集团控股有限公司 A kind of method for screening images and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013206175A (en) * 2012-03-28 2013-10-07 Fujitsu Ltd Image determination device, image determination method and computer program for image determination
CN103581662A (en) * 2012-07-26 2014-02-12 腾讯科技(深圳)有限公司 Video definition measuring method and system
CN105531988A (en) * 2013-09-09 2016-04-27 苹果公司 Automated selection of keeper images from a burst photo captured set
CN106570028A (en) * 2015-10-10 2017-04-19 比亚迪股份有限公司 Mobile terminal, fuzzy image deletion method and fuzzy picture deletion device
CN105654463A (en) * 2015-11-06 2016-06-08 乐视移动智能信息技术(北京)有限公司 Image processing method applied to continuous shooting process and apparatus thereof

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113658135A (en) * 2021-08-17 2021-11-16 中国矿业大学 Fuzzy PID (proportion integration differentiation) -based self-adaptive dimming belt foreign matter detection method and system
CN113658135B (en) * 2021-08-17 2024-02-02 中国矿业大学 Fuzzy PID-based self-adaptive dimming belt foreign matter detection method and system

Also Published As

Publication number Publication date
CN112714246A (en) 2021-04-27

Similar Documents

Publication Publication Date Title
US11336840B2 (en) Matching foreground and virtual background during a video communication session
JP6395810B2 (en) Reference image selection for motion ghost filtering
JP6905602B2 (en) Image lighting methods, devices, electronics and storage media
JP5389903B2 (en) Optimal video selection
CN111327824B (en) Shooting parameter selection method and device, storage medium and electronic equipment
WO2022183902A1 (en) Image definition determination method and apparatus, and device and storage medium
CN103716547A (en) Smart mode photographing method
JP2007087253A (en) Image correction method and device
US11917158B2 (en) Static video recognition
CN107911625A (en) Light measuring method, device, readable storage medium storing program for executing and computer equipment
US20210390341A1 (en) Image denoising model training method, imaging denoising method, devices and storage medium
CN110807759A (en) Method and device for evaluating photo quality, electronic equipment and readable storage medium
CN110266954A (en) Image processing method, device, storage medium and electronic equipment
WO2019029573A1 (en) Image blurring method, computer-readable storage medium and computer device
WO2022151813A1 (en) Electronic device, front image signal processor, and image processing method
WO2017177559A1 (en) Image management method and apparatus
CN106773453B (en) Camera exposure method and device and mobile terminal
WO2021078276A1 (en) Method for obtaining continuously photographed photos, smart terminal, and storage medium
WO2015196681A1 (en) Picture processing method and electronic device
JP2018084861A (en) Information processing apparatus, information processing method and information processing program
JP6977483B2 (en) Image processing equipment, image processing methods, image processing systems and programs
WO2021128593A1 (en) Facial image processing method, apparatus, and system
Zhu et al. No-reference image quality assessment for photographic images of consumer device
WO2023273111A1 (en) Image processing method and apparatus, and computer device and storage medium
US20080199073A1 (en) Red eye detection in digital images

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: 20879997

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: 20879997

Country of ref document: EP

Kind code of ref document: A1