CN117119318A - Image processing method and device - Google Patents

Image processing method and device Download PDF

Info

Publication number
CN117119318A
CN117119318A CN202310183258.9A CN202310183258A CN117119318A CN 117119318 A CN117119318 A CN 117119318A CN 202310183258 A CN202310183258 A CN 202310183258A CN 117119318 A CN117119318 A CN 117119318A
Authority
CN
China
Prior art keywords
image
processed
type
images
definition
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CN202310183258.9A
Other languages
Chinese (zh)
Inventor
宋凯乐
陈珂
黄蓉
郝智翔
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Honor Device Co Ltd
Original Assignee
Honor Device Co Ltd
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 Honor Device Co Ltd filed Critical Honor Device Co Ltd
Priority to CN202310183258.9A priority Critical patent/CN117119318A/en
Publication of CN117119318A publication Critical patent/CN117119318A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/95Computational photography systems, e.g. light-field imaging systems
    • H04N23/951Computational photography systems, e.g. light-field imaging systems by using two or more images to influence resolution, frame rate or aspect ratio
    • 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/62Control of parameters via user interfaces
    • 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/63Control of cameras or camera modules by using electronic viewfinders
    • H04N23/631Graphical user interfaces [GUI] specially adapted for controlling image capture or setting capture parameters
    • 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/63Control of cameras or camera modules by using electronic viewfinders
    • H04N23/631Graphical user interfaces [GUI] specially adapted for controlling image capture or setting capture parameters
    • H04N23/632Graphical user interfaces [GUI] specially adapted for controlling image capture or setting capture parameters for displaying or modifying preview images prior to image capturing, e.g. variety of image resolutions or capturing parameters
    • 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/68Control of cameras or camera modules for stable pick-up of the scene, e.g. compensating for camera body vibrations
    • H04N23/682Vibration or motion blur correction
    • H04N23/683Vibration or motion blur correction performed by a processor, e.g. controlling the readout of an image memory

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Human Computer Interaction (AREA)
  • Computing Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Studio Devices (AREA)

Abstract

The application provides an image processing method and device, which are applied to electronic equipment, wherein the electronic equipment comprises a camera application and a gallery application, and a first image of a shooting object is displayed in a preview interface of the camera application in response to opening operation of the camera application, and the first image has first definition; after shooting of the shooting object is completed, a second image of the shooting object is displayed in response to clicking operation of a thumbnail of the shooting object, the second image has second definition, the second definition is larger than the first definition, and the second image is stored in a gallery application, so that although the definition of the first image displayed on a preview interface of the camera application is poor, the second image with higher definition can be stored in the gallery application by the electrons, and the definition of the image stored by the electronic equipment is improved. The higher the definition of the image, the greater the possibility that the user uses the image, and the greater the available number of images stored by the electronic device, thereby improving the film forming rate of the electronic device.

Description

Image processing method and device
Technical Field
The present application relates to the field of image processing technologies, and in particular, to an image processing method and apparatus.
Background
The electronic equipment shoots the shooting object through the camera to obtain an image, and the image at least comprises the shooting object shot by the camera. Because the factors such as the environment is darker when shooting, the electronic equipment shakes when shooting influence, lead to the definition of image poor, and then make the problem that the film rate of electronic equipment reduces, the film rate is the probability of the usable quantity of the image that the camera shot.
Disclosure of Invention
The application provides an image processing method and device, and aims to solve the problems of poor definition of an image and reduced film forming rate of electronic equipment. In order to achieve the above object, the present application provides the following technical solutions:
in a first aspect, the present application provides an image processing method, applied to an electronic device, where the electronic device includes a camera application and a gallery application, the method including: in response to an opening operation of the camera application, displaying a first image of a photographic subject in a preview interface of the camera application, the first image having a first sharpness; after shooting of the shooting object is completed, a second image of the shooting object is displayed in response to clicking operation of a thumbnail of the shooting object, the second image has second definition, the second definition is larger than the first definition, and the second image is stored in a gallery application, so that although the definition of the first image displayed on a preview interface of the camera application is poor, the second image with higher definition can be stored in the gallery application by the electrons, and the definition of the image stored by the electronic equipment is improved. The higher the definition of the image, the greater the possibility that the user uses the image, and the greater the available number of images stored by the electronic device, thereby improving the film forming rate of the electronic device.
In some examples, the clicking operation on the thumbnail of the shooting object may be a clicking operation on a thumbnail control in a preview interface of the album application, where the thumbnail control is used to display a thumbnail of a currently shot image after the electronic device finishes shooting the image. In some examples, the click operation on the thumbnail of the photographic subject may be a click operation on the thumbnail of the photographic subject in a gallery application. After the electronic device completes image capture, the thumbnail control of the preview interface and the gallery application may display a thumbnail of the second image. The first image may or may not be stored in the gallery application.
In one possible implementation, the method further includes: after shooting of the shooting object is completed, a thumbnail of the second image is displayed in a preview interface of the camera application, for example, the electronic equipment can display the thumbnail of the second image in a thumbnail control of the preview interface, so that the purpose of displaying the thumbnail of the second image with higher definition is achieved, wherein the thumbnail of the second image can be associated with the second image, and after a user clicks the thumbnail of the second image, the electronic equipment can display the second image. In some examples, the electronic device may display a thumbnail of the first image in the preview interface, the thumbnail of the first image being associable with the second image, the electronic device may display the second image after the user clicks on the thumbnail of the second image.
In one possible implementation, the photographic subject includes a first subject, the first subject being in motion; the presentation of the first object in the first image is different from the presentation of the first object in the second image.
In one possible implementation, the position of the first object in the first image is different from the position of the first object in the second image; and/or the pose of the first object in the first image is different from the pose of the first object in the second image.
In one possible implementation, the second image is generated according to at least two images to be processed of the shooting object, the at least two images to be processed are shot through the camera in response to one click operation of the shooting control in the preview interface, and exposure amounts of the at least two images to be processed are different. In this embodiment, the user clicks the shooting control once, the electronic device may shoot the to-be-processed images with different exposure amounts through the camera, and then the to-be-processed images generate the second image with higher definition, so as to achieve the purpose of improving the definition of the image and the film forming rate of the electronic device.
In one possible implementation, the at least two images to be processed include: the method comprises the steps of at least one first type of to-be-processed image, at least two second type of to-be-processed images and at least one third type of to-be-processed image, wherein the exposure of the first type of to-be-processed image is larger than that of the second type of to-be-processed image, the exposure of the second type of to-be-processed image is larger than that of the third type of to-be-processed image, and one of the at least two second type of to-be-processed images is a reference image of a shooting object; the second image is generated according to at least two images to be processed of the shooting object, and the second image comprises the following steps: reselecting a reference image of a shooting object from at least partial images among the first type of image to be processed, the second type of image to be processed and the third type of image to be processed; screening at least part of the first type of images to be processed, the second type of images to be processed and the third type of images to be processed by using a preset screening rule, wherein the preset screening rule is used for removing images affecting definition; and generating a second image by using the reserved first-class to-be-processed image, the reserved second-class to-be-processed image and the reserved third-class to-be-processed image.
In this embodiment, before the second image is generated, the electronic device removes the image that may affect the sharpness among the first type of image to be processed, the second type of image to be processed, and the third type of image to be processed, so that the electronic device can generate the second image of the shooting object by using the clearer various types of images, and the sharpness of the image and the film rate of the electronic device are improved. In addition, the electronic device can also reselect the reference image of the shooting object so as to select the reference image which is most useful for improving the definition from all the images to be processed, thereby further improving the definition of the image and the film forming rate of the electronic device. The reference image which is most useful for improving the definition may be a larger (such as the largest) image among the first type of image to be processed, the second type of image to be processed and the third type of image to be processed, or the reference image of the shooting object may be a larger (such as the largest) second type of image to be processed in the second type of image to be processed, so that the electronic device can refer to the reference image with the largest definition, and the definition of the image and the film rate of the electronic device are further improved.
In one possible implementation, the re-selecting the reference image of the photographic subject from at least some of the first, second, and third types of images includes: determining the definition of each second-class image to be processed, and selecting the second-class image to be processed, the definition of which meets the preset condition, as a reference image of a shooting object. The exposure time of the first type of to-be-processed image is longer, and in the longer exposure time, the electronic equipment can have larger jitter, so that the problem that the first type of to-be-processed image is blurred and the details are poor is solved, the third type of to-be-processed image has dark areas because the exposure amount is smaller, and the image quality of the second type of to-be-processed image is superior to that of the first type of to-be-processed image and the third type of to-be-processed image, so that the electronic equipment can select the reference image from the second type of to-be-processed image so as to ensure the image quality of the reference image, such as ensuring the definition and the included details of the reference image. In the process of generating the second image, the electronic device can process other images with reference to the reference image, so that the definition and included details of the other images can be improved, the electronic device can generate the second image by using the images with clearer definition and more details, and the definition of the images and the film forming rate of the electronic device are improved.
In one possible implementation, the reference image of the subject is the second-class image with the greatest sharpness among all the second-class images.
In one possible implementation manner, filtering at least part of the first type of image to be processed, the second type of image to be processed and the third type of image to be processed by using a preset filtering rule includes: replacing the second type of image to be processed by using the reference image of the shooting object; and/or discarding the first type of to-be-processed image with the definition smaller than or equal to the preset second definition, wherein the first type of to-be-processed image with the definition smaller than or equal to the preset second definition is the first type of to-be-processed image with the information content smaller than or equal to the second threshold value.
The first type of to-be-processed images with the information amount smaller than or equal to the second threshold value have high possibility of overexplosion, so that some brighter white areas exist in the first type of to-be-processed images, the brighter white areas contain less details and influence the definition of the first type of to-be-processed images, and the electronic equipment can discard the first type of to-be-processed images with the information amount smaller than or equal to the second threshold value, so that the influence of the images is avoided in the process of generating the images of the shot object. The second threshold may be determined according to the information amounts of all the first-class to-be-processed images of the photographic subject. Some second-class processed images may have poor and less detail, and the replacement of these second-class processed images with reference images is to remove the poor-definition and less-detail-containing images from the second-class processed images, so as to avoid the influence of these images in the process of generating the second-class captured images.
In one possible implementation, replacing the second class of pending images with reference images of the photographic subject includes: and replacing the second type of to-be-processed image with the definition smaller than or equal to the preset first definition by using the reference image of the shot object, wherein the second type of to-be-processed image with the definition smaller than or equal to the preset first definition is the second type of to-be-processed image with the information content smaller than or equal to the first threshold. The second class of the to-be-processed images with the information amount smaller than or equal to the first threshold value have poor definition and contain less details, and the influence of the images on the second image can be avoided by replacing the images by the reference images. The first threshold may be determined according to the information amounts of all the second class of the to-be-processed images of the photographic subject. The amount of information of the reference image is greater than a first threshold.
In one possible implementation manner, filtering at least part of the first type of image to be processed, the second type of image to be processed, and the third type of image to be processed by using a preset filtering rule further includes: discarding the third class of to-be-processed images with the definition smaller than or equal to the preset third definition, wherein the third class of to-be-processed images with the definition smaller than or equal to the preset third definition are the third class of to-be-processed images with the information content smaller than or equal to a third threshold value.
In some examples, the electronic device does not filter the third class of pending images. In some examples, the third class of images to be processed is discarded when the amount of information of the third class of images to be processed is less than or equal to a third threshold. The third threshold may be determined according to the information amounts of all the third-class to-be-processed images of the photographic subject. The third type of to-be-processed image with the information amount smaller than or equal to the third threshold value has a high possibility of underexplosion (underexposure refers to underexposure), so that black areas exist in the third type of to-be-processed image, the black areas contain less details and influence the definition of the third type of to-be-processed image, and the electronic equipment can discard the third type of to-be-processed image with the information amount smaller than or equal to the third threshold value, thereby avoiding the influence of the images in the process of generating the second image.
In one possible implementation manner, the re-selecting the reference image of the shooting object from at least part of the first type of image to be processed, the second type of image to be processed and the third type of image to be processed, and the filtering at least part of the first type of image to be processed, the second type of image to be processed and the third type of image to be processed by using a preset filtering rule includes: after the second class of to-be-processed images are acquired for the nth time, selecting the second class of to-be-processed images with definition meeting the preset condition from all the acquired second class of to-be-processed images as reference images of shooting objects; and replacing a second type of to-be-processed image with definition smaller than or equal to a preset first definition in the first image set by using a reference image of the shot object, wherein the second type of to-be-processed image with definition smaller than or equal to the preset first definition is a second type of to-be-processed image with information less than or equal to a first threshold, the first image set comprises all acquired second type of to-be-processed images, or the first image set comprises an N-th acquired second type of to-be-processed image and a second type of to-be-processed image acquired between the N-th and N-M-th, N is a natural number larger than 1, and M is a natural number larger than or equal to 1.
In one possible implementation, the sharpness is determined by the amount of information, where the amount of information is the sum of the image gradients, or the amount of information is the total number of preset types of pixels in the binary image. Taking the first type of to-be-processed image as an example, the information amount of the first type of to-be-processed image may be the sum of image gradients of the first type of to-be-processed image, or the total number of preset type pixels in the binary image of the first type of to-be-processed image, and the preset type pixels may be white pixels, that is, the color of the pixels is white.
In a second aspect, the present application provides an electronic device, including: one or more processors and memory;
the memory is used to store computer program code comprising computer instructions that, when executed by the one or more processors, cause the electronic device to perform the image processing method described above.
In a third aspect, the present application provides a computer-readable storage medium storing a computer program which, when executed, implements the above-described image processing method.
Drawings
FIG. 1 is a hardware block diagram of an electronic device provided by the present application;
fig. 2 is a software architecture diagram of an electronic device according to the present application;
FIG. 3 is a schematic diagram of software and hardware interactions in an electronic device provided by the present application;
FIG. 4 is a flowchart of an image processing method provided by the present application;
FIGS. 5-9 are schematic diagrams of a re-selection of reference images and a replacement of normally exposed images with reference images provided by the present application;
fig. 10 and 11 are schematic diagrams illustrating effects of the image processing method provided by the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. The terminology used in the following examples is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in the specification of the application and the appended claims, the singular forms "a," "an," "the," and "the" are intended to include, for example, "one or more" such forms of expression, unless the context clearly indicates to the contrary. It should also be understood that in embodiments of the present application, "one or more" means one, two, or more than two; "and/or", describes an association relationship of the association object, indicating that three relationships may exist; for example, a and/or B may represent: a alone, a and B together, and B alone, wherein A, B may be singular or plural. The character "/" generally indicates that the context-dependent object is an "or" relationship.
Reference in the specification to "one embodiment" or "some embodiments" or the like means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," and the like in the specification are not necessarily all referring to the same embodiment, but mean "one or more but not all embodiments" unless expressly specified otherwise. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless expressly specified otherwise.
The plurality of the embodiments of the present application is greater than or equal to two. It should be noted that, in the description of the embodiments of the present application, the terms "first," "second," and the like are used for distinguishing between the descriptions and not necessarily for indicating or implying a relative importance, or alternatively, for indicating or implying a sequential order.
The electronic device may include an image capturing device such as a camera, and the image capturing device may be aligned with at least one subject and capture an image of the subject by the image capturing device. When the image shooting device shoots an image of a shooting object, the image shooting device can shoot a plurality of images to be processed of the shooting object after receiving a shooting instruction, and the electronic equipment fuses the plurality of images to be processed of the shooting object to obtain the image of the shooting object, and the image of the shooting object can be stored in a gallery application, so that a user can view the image of the shooting object in the gallery application.
The exposure amounts (EV) of the partial images to be processed in the plurality of images to be processed of the photographic subject are different, for example, in some examples, the image capturing device may capture a first type of image to be processed of the photographic subject, a second type of image to be processed of the photographic subject, and a third type of image to be processed of the photographic subject, and the first type of image to be processed, the second type of image to be processed, and the third type of image to be processed may be plural. The EV of the first type of the to-be-processed image is larger than the EV of the second type of the to-be-processed image, the EV of the second type of the to-be-processed image is larger than the EV of the third type of the to-be-processed image, the first type of the to-be-processed image can be called a Long exposure (Long EV) image, the second type of the to-be-processed image can be called a Normal exposure (Normal EV) image, and the third type of the to-be-processed image can be called a Short exposure (Short EV) image.
The long exposure image is marked with a first label, the long exposure image is marked with a second label, the normal exposure image is marked with a third label, and the short exposure image is marked with a third label. In addition, in some examples, the long exposure, the normal exposure, and the short exposure each correspond to one exposure range, and thus the exposure amounts of the same type of image to be processed may also be different, for example, the exposure amounts of at least part of the long exposure images in a plurality of long exposure images of one photographic subject may be different.
The exposure time of the long exposure image is longer, and in the longer exposure time, the electronic equipment may have larger jitter, and the jitter causes the problems of blurring and detail deterioration of the long exposure image, and the short exposure image has a dark area because the exposure amount is smaller, so that details of a shooting object and brightness of the shooting object in the fused image of the long exposure image, the normal exposure image and the short exposure image are influenced, the definition of the fused image is poor, and the film forming rate of the electronic equipment is reduced. And in fusing the long-exposure image, the normal-exposure image, and the short-exposure image, the electronic device may process these images with a reference image, which is one of the long-exposure image, the normal-exposure image, and the short-exposure image. Under the condition that the definition of the reference image is poor, the definition of the image fused by the electronic equipment is also affected, so that the definition of the fused image is further reduced, and the film forming rate of the electronic equipment is reduced.
In view of the above problems, the present application provides an image processing method that can select a reference image of a photographic subject from a long-exposure image, a normal-exposure image, and a short-exposure image, the sharpness of the reference image being greater than that of an image that is not used as the reference image; screening the long exposure image of the shooting object, the normal exposure image of the shooting object and the short exposure image of the shooting object by using a preset screening rule to remove images which possibly affect definition; and generating an image of the shooting object by using the long exposure image reserved after screening, the normal exposure image reserved after screening and the short exposure image reserved after screening.
In the application, before the electronic equipment obtains the image of the shooting object, the image which possibly influences definition in the long exposure image, the normal exposure image and the short exposure image is removed, so that the electronic equipment can generate the image of the shooting object by utilizing various types of relatively clear images, and the definition of the image of the shooting object and the film forming rate of the electronic equipment are improved. The reference image of the shooting object may be a larger (e.g., largest) image of the long exposure image, the normal exposure image, and the short exposure image, or the reference image of the shooting object may be a larger (e.g., largest) normal exposure image of the normal exposure image, so that the electronic device may refer to the reference image with the largest definition, thereby further improving the definition of the image of the shooting object and the film forming rate of the electronic device.
It will be appreciated that: the long exposure image, the normal exposure image, and the short exposure image are only one example of the classification of the electronic device according to the exposure amount, and the electronic device may divide the plurality of images to be processed into two types, four types, or more than four types according to the exposure amount, and the present embodiment is not limited. In addition, the reference image has two identifiers, one for indicating the exposure amount of the reference image and the other for indicating that it is the reference image.
In some examples, the electronic device may select the reference image from the normally exposed images. The information amount of the normal exposure image, such as the sum of image gradients of the normal exposure image, or the total number of white pixels in the binary image of the normal exposure image, may be considered in selecting the reference image. The larger the information quantity is, the higher the definition of the normal exposure image is, and the more details the normal exposure image comprises, then the electronic equipment can select the normal exposure image with the largest information quantity, and determine the normal exposure image with the largest information quantity as a reference image, so that the electronic equipment can process other images with reference to the reference image in the process of obtaining the image of the shooting object, so that the definition and the included details of the other images can be improved, the electronic equipment can generate the image of the shooting object by using the clearer and more-detail-containing images, and the definition of the image of the shooting object and the film forming rate of the electronic equipment are improved.
In some examples, the screening manner of the electronic device on the normally exposed image of the shooting object may be: the electronic device replaces the normal exposure image with the reference image; the electronic device replacing the normal-exposure image with the reference image may be to replace the normal-exposure image with the reference image when the information amount of the normal-exposure image is less than or equal to the first threshold. The first threshold value may be determined according to the information amounts of all normally exposed images of the photographic subject. As the first threshold value, the average value of the information amounts of all the normally exposed images, or the median value of the information amounts of all the normally exposed images.
The normal exposure images whose information amount is less than or equal to the first threshold value are inferior in definition and contain less details, and the replacement of these normal exposure images with the reference image is to remove the images of the normal exposure images that are inferior in definition and contain less details, thereby avoiding the influence of these images in the process of generating the images of the photographic subject.
In some examples, the manner of screening the long exposure image of the shooting object by the electronic device may be: when the information amount of the long-exposure image is less than or equal to the second threshold value, the long-exposure image is discarded. The second threshold value may be determined according to the information amounts of all long exposure images of the photographic subject. Such as the average value of the information amounts of all the long-exposure images as the second threshold value, or the median value of the information amounts of all the long-exposure images as the second threshold value.
The long exposure image with the information amount smaller than or equal to the second threshold value has a high possibility of overexposure, so that some brighter white areas exist in the long exposure image, the brighter white areas contain less details and influence the definition of the long exposure image, and the electronic device can discard the long exposure image with the information amount smaller than or equal to the second threshold value, thereby avoiding the influence of the images in the process of generating the image of the shooting object.
In some examples, the electronic device does not filter the short-exposure image of the photographic subject. In some examples, the short-exposure image is discarded when the amount of information of the short-exposure image is less than or equal to a third threshold. The third threshold value may be determined according to the information amounts of all short-exposure images of the photographic subject. Such as the average value of the information amounts of all short-exposure images as the third threshold value, or the median value of the information amounts of all short-exposure images as the third threshold value. Short-exposure images with information less than or equal to the third threshold have a high possibility of underexplosion (underexposure refers to underexposure), so that black areas exist in the short-exposure images, the black areas contain less details and influence the definition of the third type of images to be processed, and the electronic equipment can discard the third type of images to be processed with information less than or equal to the third threshold, so that the influence of the images is avoided in the process of generating the images of the photographed object.
In the present application, the image processing method may be applied to an electronic device. In some embodiments, the electronic device may be a cell phone, tablet, desktop, laptop, notebook, ultra-mobile personal computer (UMPC), handheld computer, netbook, personal digital assistant (Personal Digital Assistant, PDA), wearable electronic device, smart watch, or the like. The specific form of the electronic device is not particularly limited in the present application.
As shown in fig. 1, the electronic device may include: processor, external memory interface, internal memory, universal serial bus (universal serial bus, USB) interface, charge management module, power management module, battery, antenna 1, antenna 2, mobile communication module, wireless communication module, sensor module, keys, motor, indicator, camera, display screen, and subscriber identity module (subscriber identification module, SIM) card interface, etc. Wherein the audio module may include a speaker, a receiver, a microphone, an earphone interface, etc., and the sensor module may include a pressure sensor, a gyro sensor, a barometric sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, etc.
It is to be understood that the configuration illustrated in this embodiment does not constitute a specific limitation on the electronic apparatus. In other embodiments, the electronic device may include more or fewer components than shown, or certain components may be combined, or certain components may be split, or different arrangements of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
The processor may include one or more processing units, such as: the processors may include application processors (Application Processor, AP), modem processors, graphics processors (Graphics Processing Unit, GPU), image signal processors (Image Signal Processor, ISP), controllers, video codecs, digital signal processors (Digital Signal Processor, DSP), baseband processors, and/or Neural network processors (Neural-network Processing Unit, NPU), etc. Wherein the different processing units may be separate devices or may be integrated in one or more processors. The processor is a nerve center and a command center of the electronic equipment, and the controller can generate operation control signals according to instruction operation codes and time sequence signals to finish instruction fetching and instruction execution control.
The display screen is used to display images, videos, a series of graphical user interfaces (Graphical User Interface, GUI) and the like, such as images captured by a camera.
The external memory interface may be used to connect an external memory card, such as a Micro SD card, to enable expansion of the memory capabilities of the electronic device. The external memory card communicates with the processor through an external memory interface to realize the data storage function. The internal memory may be used to store computer-executable program code that includes instructions. The processor executes the instructions stored in the internal memory to perform various functional applications of the electronic device and data processing. For example, in the present application, the processor causes the electronic device to execute the image processing method provided by the present application by executing the instructions stored in the internal memory. In addition, the internal memory may store data, such as a first threshold, a second threshold, a third threshold, etc., or may temporarily store a first type of image to be processed, a second type of image to be processed, and a third type of image to be processed, where the images are automatically deleted after the electronic device generates the image of the shooting object. Of course, the internal memory may be an image of the subject generated by the electronic device, or the like.
Cameras are used to capture still images or video. The object generates an optical image through the lens and projects the optical image onto the photosensitive element. The photosensitive element may be a charge coupled device (Charge Coupled Device, CCD) or a Complementary Metal Oxide Semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, which is then transferred to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV, or the like format. In some embodiments, the electronic device may include 1 or N cameras, N being a positive integer greater than 1.
In addition, an operating system is run on the components. Such as the iOS operating system developed by apple corporation, the Android open source operating system developed by *** corporation, the Windows operating system developed by microsoft corporation, etc. An operating application may be installed on the operating system.
The operating system of the electronic device may employ a layered architecture, an event driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture. In the embodiment of the application, an Android system with a layered architecture is taken as an example, and the software structure of the electronic equipment is illustrated. Fig. 2 is a block diagram of the hardware and software architecture of the electronic device. The software structure adopts a layered architecture, the layered architecture divides the software into a plurality of layers, and each layer has clear roles and division work. The layers communicate with each other through a software interface. Taking an Android system as an example, in some embodiments, the Android system is divided into five layers, namely an application layer, an application Framework layer (Framework), a An Zhuoyun row (Android run) and system library, a Hardware Abstraction Layer (HAL) and a system Kernel layer (Kernel).
The application layer may include a series of application packages, among other things. Application packages may include APP for cameras, gallery, calendar, talk, map, navigation, WLAN, bluetooth, music, video, short message, etc. The application framework layer provides an application programming interface (Application Programming Interface, API) and programming framework for application programs of the application layer. The application framework layer includes a number of predefined functions. For example, the application framework layer may include a window manager, a content provider, a view system, a telephony manager, a resource manager, a notification manager, and the like.
Android run time includes a core library and virtual machines. Android run time is responsible for scheduling and management of the Android system.
The core library consists of two parts: one part is a function which needs to be called by java language, and the other part is a core library of android.
The application layer and the application framework layer run in a virtual machine. The virtual machine executes java files of the application program layer and the application program framework layer as binary files. The virtual machine is used for executing the functions of object life cycle management, stack management, thread management, security and exception management, garbage collection and the like.
The system library may include a plurality of functional modules. For example: surface manager (surface manager), media Libraries (Media Libraries), three-dimensional graphics processing Libraries (e.g., openGL ES), 2D graphics engines (e.g., SGL), etc.
The HAL may comprise a plurality of library modules, each of which may implement a set of interfaces for a particular type of hardware component, e.g. the HAL comprises an image processing module having a set of interfaces, the APP of the application layer may invoke the interfaces of the image processing module for performing the image processing method according to the application. For example, the camera application of the application program layer may call the image processing module, send an image processing instruction to the image processing module through an interface of the image processing module, and the image processing module generates an image of the photographic subject after receiving the image processing instruction.
The kernel layer is a layer between hardware and software. The inner core layer at least comprises a display driver, a camera driver, an audio driver and a sensor driver.
Fig. 3 shows an interaction process between software and hardware, in which the image processing method provided by the present application is executed by an image processing module, and the process may include the following steps:
1) After the camera application is opened, the camera application sends a shooting instruction to the camera through the camera drive, and the camera shoots the shooting object to obtain a first type of to-be-processed image of the shooting object, a second type of to-be-processed image of the shooting object and a third type of to-be-processed image of the shooting object. The first type of image to be processed, the second type of image to be processed and the third type of image to be processed are stored in a first storage space of a memory, labels indicating exposure are respectively marked on the first type of image to be processed, the second type of image to be processed and the third type of image to be processed, one image in the images is used as a reference image, and the reference image is marked with the labels indicating the exposure and the labels indicating the exposure as the reference image.
2) The camera application sends image processing instructions to the image processing module.
In the application, the camera application can also send a starting instruction to the image processing module, and the image processing module starts to operate under the action of the starting instruction; after the camera application is closed, the camera application can send a closing instruction to the image processing module, and the image processing module stops running under the action of the closing instruction, so that the occupation of the image processing module on resources is reduced.
3) The image processing module responds to the image processing instruction, acquires a first type of image to be processed, a second type of image to be processed and a third type of image to be processed from the temporary storage space, and selects an image with the largest definition from the images as a reference image. And removing the images affecting the definition in the first type of images to be processed, the second type of images to be processed and the third type of images to be processed by utilizing a preset screening rule.
4) The image processing module generates an image of a shooting object by using the first class of the images to be processed reserved after screening, the second class of the images to be processed reserved after screening and the third class of the images to be processed reserved after screening. The image of the shooting object can be stored in a second storage space of the memory, and the second storage space is used for storing the image under the gallery application. After the gallery application is opened, the gallery application reads the image of the photographic subject from the second storage space to display the image of the photographic subject on the display screen. After the image of the shooting object is generated, the first type of the image to be processed, the second type of the image to be processed and the third type of the image to be processed of the shooting object stored in the first storage space are deleted.
The image processing method provided by the present application will be described below with reference to the accompanying drawings, fig. 4 shows a flow of the image processing method provided by the present application, and the image processing module may execute the image processing method according to the flow shown in fig. 4, where the image processing method may include the following steps:
11. Images photographed under different exposure amounts are input. After a user clicks a shooting control of the camera once, the camera can shoot images corresponding to different exposure. Although the camera can shoot images corresponding to different exposure amounts at a time, the shooting time of the images of different exposure amounts may be different, and the shooting time of the images of different exposure amounts is shorter, so that the difference between the images of different exposure amounts is smaller.
The images shot under different exposure amounts can be understood as follows: the electronic equipment sequentially reads images corresponding to different exposure values from the first storage control of the memory.
12. And classifying the images photographed under different exposure amounts. The electronic device may perform image classification according to the exposure amount of the image, where the image captured by the camera may indicate the exposure amount of the image by using the tag, for example, the first tag corresponds to a long exposure, the second tag corresponds to a normal exposure, the third tag corresponds to a short exposure, the long exposure, the normal exposure, and the short exposure respectively correspond to different exposure ranges, and the minimum value of the exposure range of the long exposure is greater than the maximum value of the exposure range of the normal exposure, and the minimum value of the exposure range of the normal exposure is greater than the maximum value of the exposure range of the short exposure, so that the exposure amount of the image is indicated by using the tag, and thus the electronic device may perform image classification by using the tag, as in fig. 4, the electronic device may classify the image captured by the camera into the first type of the image to be processed, the second type of the image to be processed, and the third type of the image to be processed.
The first type of image to be processed, the second type of image to be processed, and the third type of image to be processed are merely examples, and the present embodiment does not limit the classification of images and the division of exposure amounts.
13. If the input image is determined to be the first type of image to be processed through image classification, judging whether the information quantity of the first type of image to be processed is larger than a second threshold value, and if the information quantity of the first type of image to be processed is larger than the second threshold value, carrying out subsequent processing on the first type of image to be processed; and discarding the first type of image to be processed if the information amount of the first type of image to be processed is less than or equal to the second threshold.
14. And if the input image is determined to be the second type of image to be processed through image classification, reselecting the reference image.
15. After the reference image is reselected, whether the information amount of the currently input second-class image to be processed is smaller than a first threshold value is judged. If the information quantity of the currently input second-class to-be-processed image is larger than the first threshold value, carrying out subsequent processing on the second-class to-be-processed image; and if the information quantity of the currently input second-class to-be-processed image is smaller than or equal to the first threshold value, replacing the currently input second-class to-be-processed image by using the reference image. Wherein the information amount of the reference image may be greater than the first threshold.
16. And if the input image is determined to be the third type of image to be processed through image classification, carrying out subsequent processing on the third type of image to be processed.
The subsequent processing includes preprocessing an input image, such as image filtering, adjusting with reference to a reference image, and the like, and after preprocessing all the images is completed, fusing all the preprocessed images to generate an image of a subject.
In this embodiment, the information amount may represent the definition of the image, and the definition of each image is indirectly determined by the information amount of each image, so that the reference image can be reselected through the definition between the images, and operations such as image discarding and image replacement are performed on images other than the reference image through threshold value determination, so that the reference image definition is optimal (may also become the definition maximum), and other blurred images are discarded or replaced. The second type of to-be-processed image with the information amount smaller than or equal to the first threshold value can be regarded as a blurred image, and the first type of to-be-processed image with the information amount smaller than or equal to the second threshold value can be regarded as a blurred image.
It will be appreciated that: the reselection reference image in fig. 4 may be: the electronic equipment calculates the information quantity of all the second-class to-be-processed images, and selects the second-class to-be-processed image with the largest information quantity from all the second-class to-be-processed images as a reference image; after the reference image is determined, judging whether the information quantity of the second-class image to be processed is smaller than a first threshold value, and if the information quantity of the second-class image to be processed is smaller than or equal to the first threshold value, replacing the second-class image to be processed by the reference image; and if the information quantity of the second type of to-be-processed images is larger than the first threshold value, reserving the second type of to-be-processed images. That is, one understanding of the reselection of the reference image in fig. 4 may be that the electronic device reselects the reference image when all of the second type of pending images are acquired. Whether the information amount of the second type of the image to be processed is smaller than the first threshold in fig. 4 may be that after the reference image is reselected, it is determined whether the information amount of the second type of the image to be processed after the reference image is divided is smaller than the first threshold.
It will be appreciated that: the reselection reference image in fig. 4 may be: the electronic device may perform a reselection of the reference image once every time it is determined that the currently input image is the second type of image to be processed, or may trigger a reselection of the reference image when it is determined that the currently input image is the second type of image to be processed and the electronic device knows the reference image. That is, another understanding of the reselection of the reference picture in fig. 4 is that: at least when the currently input image is determined to be the second type of image to be processed, the reference image is reselected, and at this time, the electronic device may not acquire all the second type of image to be processed.
In some examples, reselecting the reference image may include: and calculating the information quantity of each input second-class image to be processed, and selecting a reference image according to the information quantity of each second-class image to be processed. And if the second type of the to-be-processed image with the largest information amount is selected as the reference image. For example, 4 second-class to-be-processed images are input, the information quantity of the 4 second-class to-be-processed images is calculated, the information quantity of the 4 second-class to-be-processed images is compared, the information quantity of the second-class to-be-processed image input for the 3 rd time is determined to be the largest, and then the second-class to-be-processed image input for the 3 rd time is selected as the reference image.
In some examples, reselecting the reference image may include: and calculating the information quantity of the currently input second-class to-be-processed image, and reselecting the reference image according to the information quantity of the currently input second-class to-be-processed image and the information quantity of the reference image determined before the currently input second-class to-be-processed image. For example, the second type of image to be processed is input for the 5 th time, the second type of image to be processed input for the 3 rd time is determined to be the reference image before the second type of image to be processed is input for the 5 th time, and then the information amount of the second type of image to be processed input for the 5 th time is compared with the information amount of the second type of image to be processed input for the 3 rd time. And if the information quantity of the second-class to-be-processed image input for the 5 th time is larger than the information quantity of the second-class to-be-processed image input for the 3 rd time, selecting the second-class to-be-processed image input for the 5 th time as the reference image. And if the information quantity of the second-class to-be-processed image input for the 5 th time is smaller than or equal to the information quantity of the second-class to-be-processed image input for the 3 rd time, selecting the second-class to-be-processed image input for the 3 rd time as the reference image.
Because the reselection of the reference image may result in a change in the reference image, i.e., the presence of an old reference image and a new reference image, the electronic device may process the image previously replaced with the old reference image in the following manner: the images are maintained unchanged, i.e. replaced with the old reference image or replaced with the new reference image.
In this embodiment, the processing manners of reselecting the reference image and replacing the second type of to-be-processed image with the reference image by the electronic device include, but are not limited to, the following processing manners:
the first processing mode is as follows: the electronic equipment compares the information quantity of the second type of the currently input to-be-processed image with the information quantity of the known reference image, and selects the image with the largest information quantity from the second type of the currently input to-be-processed image and the known reference image as the reference image, wherein the known reference image can be the image marked as the reference image when the camera shoots, and if the reference image is changed after the information quantity comparison, the known reference image is changed into the reference image determined after the information quantity comparison. If the reference image is still a known reference image, it is further determined whether the amount of information of the currently input second type of image to be processed is less than a first threshold. If the information quantity of the second type of to-be-processed image is smaller than or equal to a first threshold value, replacing the second type of to-be-processed image by the determined reference image; and if the information amount of the second type of to-be-processed image is larger than the first threshold value, reserving the second type of to-be-processed image, wherein the second type of to-be-processed image does not need to be replaced by the reference image. If the reference image is changed to the second type of the currently input image to be processed, i.e. one reference image is reselected, the electronic device may be replaced with the reselected reference image, or the previous replacement relationship may not be changed.
The second processing mode is as follows: the second type of to-be-processed image currently input by the electronic device is not marked as a reference image, the electronic device can compare the information amount of the second type of to-be-processed image with the information amount of the second type of to-be-processed image input before the second type of to-be-processed image, and the second type of to-be-processed image with the largest information amount and larger than the first threshold value is selected from the second type of to-be-processed images as the reference image. Further judging whether the information quantity of the currently input second-class to-be-processed image is smaller than a first threshold value. If the information quantity of the second type of to-be-processed image is smaller than or equal to a first threshold value, replacing the second type of to-be-processed image by the determined reference image; and if the information amount of the second type of to-be-processed image is larger than the first threshold value, reserving the second type of to-be-processed image, wherein the second type of to-be-processed image does not need to be replaced by the reference image.
And then, continuously inputting the second type of to-be-processed image to the electronic equipment, wherein the electronic equipment can compare the information quantity of the second type of to-be-processed image with the information quantity of the second type of to-be-processed image input before the second type of to-be-processed image again, or compare the information quantity of the second type of to-be-processed image with the information quantity of the reference image so as to reselect the reference image. If the reselected reference image changes, the electronic device may be replaced with the reselected reference image or may not change the previous replacement relationship.
The third processing mode is as follows: and if the second type of to-be-processed image currently input by the electronic equipment is not marked as the reference image, the electronic equipment judges whether the information quantity of the second type of to-be-processed image is smaller than a first threshold value. Temporarily retaining the second type of image to be processed if the information amount of the second type of image to be processed is smaller than or equal to a first threshold value, so that the second type of image to be processed is replaced by the reference image after the reference image is determined; and if the information amount of the second type of to-be-processed image is larger than the first threshold value, reserving the second type of to-be-processed image, wherein the second type of to-be-processed image does not need to be replaced by the reference image.
And the second type of to-be-processed image which is currently input by the electronic equipment is marked as a reference image, the information quantity of the second type of to-be-processed image is compared with the information quantity of the second type of to-be-processed image which is input before the second type of to-be-processed image, and the second type of to-be-processed image with the largest information quantity is selected from the second type of to-be-processed images as the reference image. The electronic device may replace the previously temporarily retained second type of pending image with the reference image.
And then, continuously inputting the second type of to-be-processed image to the electronic equipment, wherein the electronic equipment can compare the information quantity of the second type of to-be-processed image with the information quantity of the second type of to-be-processed image input before the second type of to-be-processed image again, or compare the information quantity of the second type of to-be-processed image with the information quantity of the reference image so as to reselect the reference image. If the reselected reference image changes, the electronic device may be replaced with the reselected reference image or may not change the previous replacement relationship.
For example, all second-class images to be processed captured by the camera include: a second type of pending image 1, a second type of pending image 2, a second type of pending image 3, a second type of pending image 4, and a second type of pending image 5. The electronic device may process these second class of pending images as follows:
the drawing corresponding to the first processing mode is shown in fig. 7: the electronic equipment determines the second type of to-be-processed image 3 as a reference image according to the fact that the information quantity of the second type of to-be-processed image 3 is larger than a first threshold value; the process is as follows:
the second type of to-be-processed image 1 is input, the electronic equipment compares the information quantity of the second type of to-be-processed image 1 with the information quantity of the second type of to-be-processed image 3 serving as a reference image, and the information quantity of the second type of to-be-processed image 1 is smaller than the information quantity of the second type of to-be-processed image 3 after comparison, and the reference image is still the second type of to-be-processed image 3.
The electronic equipment judges whether the information quantity of the second-class to-be-processed image 1 is smaller than a first threshold value, and the second-class to-be-processed image 1 is replaced by the second-class to-be-processed image 3 after judging that the information quantity of the second-class to-be-processed image 1 is smaller than the first threshold value.
The second type of to-be-processed image 2 is input, the electronic equipment compares the information quantity of the second type of to-be-processed image 2 with the information quantity of the second type of to-be-processed image 3, and the information quantity of the second type of to-be-processed image 2 is determined to be smaller than the information quantity of the second type of to-be-processed image 3 through comparison, and the second type of to-be-processed image 3 is continuously used as a reference image. The electronic equipment judges whether the information quantity of the second-class to-be-processed image 2 is smaller than a first threshold value, and the second-class to-be-processed image 2 is reserved after judging that the information quantity of the second-class to-be-processed image 2 is larger than the first threshold value.
And inputting the second-class to-be-processed image 3, the electronic equipment can compare the information quantity of the second-class to-be-processed image 2 with the information quantity of the second-class to-be-processed image 3 again, and can also directly reserve the second-class to-be-processed image 3.
Inputting a second type of to-be-processed image 4, comparing the information amount of the second type of to-be-processed image 4 with the information amount of the second type of to-be-processed image 3 by the electronic equipment, determining that the information amount of the second type of to-be-processed image 4 is larger than the information amount of the second type of to-be-processed image 3 through comparison, and determining the second type of to-be-processed image 4 as a reference image, wherein the second type of to-be-processed image 3 is not used as the reference image any more. But the second type of pending image 1 continues to be replaced with the second type of pending image 3. The second type of the image to be processed 4 remains because the amount of information of the second type of the image to be processed 4 is larger than the amount of information of the second type of the image to be processed 3, and the amount of information of the second type of the image to be processed 3 is larger than the first threshold.
And inputting the second-class to-be-processed image 5, comparing the information quantity of the second-class to-be-processed image 5 with the information quantity of the second-class to-be-processed image 4 by the electronic equipment, and determining that the information quantity of the second-class to-be-processed image 5 is smaller than the information quantity of the second-class to-be-processed image 4 through comparison, wherein the reference image is still the second-class to-be-processed image 4.
The electronic device judges whether the information amount of the second-class to-be-processed image 5 is smaller than a first threshold value, and determines that the information amount of the second-class to-be-processed image 5 is smaller than the first threshold value through judgment, and the second-class to-be-processed image 5 is replaced by the second-class to-be-processed image 4.
After processing in the manner shown in fig. 5, the comparison results before and after processing of all the second type of images to be processed are shown in table 1:
table 1 comparison results before and after processing of all second class of pending images
/>
Fig. 6 shows another processing flow of the first processing manner, which is different from the first processing manner shown in fig. 5 in that, after determining that the reference image is changed from the second-type to-be-processed image 3 to the second-type to-be-processed image 4, the electronic device replaces the second-type to-be-processed image which is input before the second-type to-be-processed image 4 and whose information amount is smaller than the first threshold value with the second-type to-be-processed image.
As shown in fig. 6, the second-type to-be-processed image which is input before the second-type to-be-processed image 4 and has an information amount smaller than the first threshold value only includes the second-type to-be-processed image 1, and when the reference image is the second-type to-be-processed image 3, the second-type to-be-processed image 3 is used to replace the second-type to-be-processed image 1. But after the reference image is changed from the second-type to-be-processed image 3 to the second-type to-be-processed image 4, the replacement relation of the second-type to-be-processed image 1 is modified, and the second-type to-be-processed image 4 is used for replacing the second-type to-be-processed image 1.
After processing in the manner shown in fig. 6, the comparison results before and after processing of all the second type of images to be processed are shown in table 2:
TABLE 2 comparison results before and after processing of all second class of pending images
Fig. 7 shows a procedure corresponding to the second processing mode in a scene where the reference image is unknown, the procedure is as follows:
the second type of the to-be-processed image 1 is input, and the electronic equipment can only acquire the information quantity of the second type of the to-be-processed image 1 because the second type of the to-be-processed image 1 is the first second type of the to-be-processed image input to the electronic equipment and the reference image is unknown, so that the information quantity of the to-be-processed image 1 cannot be compared with the information quantity of other images. The electronic device may determine whether the information amount of the second type of to-be-processed image 1 is smaller than the first threshold, and determine that the information amount of the second type of to-be-processed image 1 is smaller than the first threshold after the determination, but the reference image is unknown, and the electronic device may only temporarily retain the second type of to-be-processed image 1, as shown in (1) in fig. 7. After the reference image is determined, the second type of image to be processed 1 is replaced with the reference image.
And inputting the second type of to-be-processed image 2, and comparing the information quantity of the second type of to-be-processed image 2 with the information quantity of the second type of to-be-processed image 1 by the electronic equipment, wherein the information quantity of the second type of to-be-processed image 2 is determined to be larger than the information quantity of the second type of to-be-processed image 1 through comparison. Further, the electronic device judges whether the information amount of the second-class to-be-processed image 2 is smaller than a first threshold value, and determines that the information amount of the second-class to-be-processed image 2 is larger than the first threshold value through judgment, and determines that the second-class to-be-processed image 2 can be used as a reference image, and replaces the second-class to-be-processed image 1 with the second-class to-be-processed image 2, as shown in (2) in fig. 7. If the information content of the second type of image 2 to be processed is smaller than or equal to the first threshold value, which indicates that the second type of image 2 to be processed cannot be used as the reference image, the electronic device may also temporarily hold the second type of image 2 to be processed, and after determining the reference image, replace the second type of image 2 to be processed with the reference image, which is not illustrated by the drawings.
The second type of to-be-processed image 3 is input, the electronic device can compare the information amount of the second type of to-be-processed image 2 with the information amount of the second type of to-be-processed image 3, and the information amount of the second type of to-be-processed image 2 is smaller than the information amount of the second type of to-be-processed image 3 through comparison, the second type of to-be-processed image 3 is used as a reference image, the second type of to-be-processed image 2 is not used as the reference image any more, and the second type of to-be-processed image 1 is replaced by the second type of to-be-processed image 2. Since the information amount of the second-type to-be-processed image 2 is larger than the first threshold value, the information amount of the second-type to-be-processed image 2 is smaller than the information amount of the second-type to-be-processed image 3, so the second-type to-be-processed image 3 is retained, as shown in (3) in fig. 7.
Inputting a second type of to-be-processed image 4, comparing the information amount of the second type of to-be-processed image 4 with the information amount of the second type of to-be-processed image 3 by the electronic equipment, determining that the information amount of the second type of to-be-processed image 4 is larger than the information amount of the second type of to-be-processed image 3 through comparison, and determining the second type of to-be-processed image 4 as a reference image, wherein the second type of to-be-processed image 3 is not used as the reference image any more. The second type of the image to be processed 4 remains because the amount of information of the second type of the image to be processed 4 is larger than the amount of information of the second type of the image to be processed 3, and the amount of information of the second type of the image to be processed 3 is larger than the first threshold.
And inputting the second-class to-be-processed image 5, comparing the information quantity of the second-class to-be-processed image 5 with the information quantity of the second-class to-be-processed image 4 by the electronic equipment, and determining that the information quantity of the second-class to-be-processed image 5 is smaller than the information quantity of the second-class to-be-processed image 4 through comparison, wherein the reference image is still the second-class to-be-processed image 4.
The electronic device determines whether the information amount of the second-type to-be-processed image 5 is smaller than the first threshold, determines that the information amount of the second-type to-be-processed image 5 is smaller than the first threshold by the determination, and replaces the second-type to-be-processed image 5 as the second-type to-be-processed image 4, as shown in (4) in fig. 7.
After processing in the manner shown in fig. 7, the comparison results before and after processing of all the second type of images to be processed are shown in table 3:
TABLE 3 comparison results before and after processing of all second class of pending images
Fig. 8 shows another processing flow of the second processing manner, which is different from the second processing manner shown in fig. 7 in that, after determining that the reference image is changed, the electronic device replaces the second type of to-be-processed image input before the reference image and having an information amount smaller than the first threshold value with the changed reference image.
As shown in fig. 8, after it is determined that the reference image is changed from the second-type to-be-processed image 2, the second-type to-be-processed image which is input before the second-type to-be-processed image 3 and whose information amount is smaller than the first threshold value includes only the second-type to-be-processed image 1, whereby the second-type to-be-processed image 1 will be replaced with the second-type to-be-processed image 3 as shown in (3) in fig. 8. After the reference image is changed from the second-type to-be-processed image 3 to the second-type to-be-processed image 4, the replacement relationship of the second-type to-be-processed image 1 is continuously modified, and the second-type to-be-processed image 1 is replaced with the second-type to-be-processed image 4, as shown in (4) in fig. 8.
After processing in the manner shown in fig. 8, the comparison results before and after processing of all the second type of images to be processed are shown in table 4:
TABLE 4 comparison results before and after processing of all second class pending images
Fig. 9 shows a procedure corresponding to the third processing mode in a scene where the reference image is unknown, the procedure being as follows:
the second class of pending images 1 is entered because the reference image is unknown and the electronic device does not trigger the reselection of the reference image. The electronic device may determine whether the information amount of the second type of to-be-processed image 1 is smaller than the first threshold, and determine that the information amount of the second type of to-be-processed image 1 is smaller than the first threshold after the determination, but the reference image is unknown, and the electronic device may only temporarily retain the second type of to-be-processed image 1, as shown in (1) in fig. 9. After the reference image is determined, the second type of image to be processed 1 is replaced with the reference image.
The second class of pending images 2 is entered because the reference image is unknown and the electronic device does not trigger the reselection of the reference image. The electronic device determines whether the information amount of the second-class to-be-processed image 2 is smaller than the first threshold, determines that the information amount of the second-class to-be-processed image 2 is larger than the first threshold through the determination, and retains the second-class to-be-processed image 2, as shown in (1) in fig. 9.
The second type of to-be-processed image 3 is input, the second type of to-be-processed image 3 is a reference image, the electronic equipment can compare the information amount of the second type of to-be-processed image 1, the information amount of the second type of to-be-processed image 2 with the information amount of the second type of to-be-processed image 3, the information amount of the second type of to-be-processed image 1 and the information amount of the second type of to-be-processed image 2 are determined to be smaller than the information amount of the second type of to-be-processed image 3 through comparison, the second type of to-be-processed image 3 is continuously used as the reference image, and the second type of to-be-processed image 1 is replaced by the second type of to-be-processed image 3. Since the information amount of the second-type to-be-processed image 2 is larger than the first threshold value, the information amount of the second-type to-be-processed image 2 is smaller than the information amount of the second-type to-be-processed image 3, so the second-type to-be-processed image 3 is retained, as shown in (2) in fig. 9.
Inputting a second type of to-be-processed image 4, comparing the information amount of the second type of to-be-processed image 4 with the information amount of the second type of to-be-processed image 3 by the electronic equipment, determining that the information amount of the second type of to-be-processed image 4 is larger than the information amount of the second type of to-be-processed image 3 through comparison, and determining the second type of to-be-processed image 4 as a reference image, wherein the second type of to-be-processed image 3 is not used as the reference image any more. The second type of the image to be processed 4 remains because the amount of information of the second type of the image to be processed 4 is larger than the amount of information of the second type of the image to be processed 3, and the amount of information of the second type of the image to be processed 3 is larger than the first threshold.
And inputting the second-class to-be-processed image 5, comparing the information quantity of the second-class to-be-processed image 5 with the information quantity of the second-class to-be-processed image 4 by the electronic equipment, and determining that the information quantity of the second-class to-be-processed image 5 is smaller than the information quantity of the second-class to-be-processed image 4 through comparison, wherein the reference image is still the second-class to-be-processed image 4.
The electronic device determines whether the information amount of the second-type to-be-processed image 5 is smaller than the first threshold, determines that the information amount of the second-type to-be-processed image 5 is smaller than the first threshold by the determination, and replaces the second-type to-be-processed image 5 as the second-type to-be-processed image 4, as shown in (3) in fig. 9.
Through the fifth processing mode, the comparison results before and after processing all the second type of images to be processed are shown in table 5:
TABLE 5 comparison results before and after processing of all second class of pending images
In the third processing manner shown in fig. 9, after the reference image is determined to be changed to the second type of to-be-processed image 4, the second type of to-be-processed image 4 with the amount of the replacement information smaller than the first threshold may be utilized, which is not described herein.
The sixth processing mode is that after the electronic equipment acquires all the second-class to-be-processed images, the information quantity of each second-class to-be-processed image is calculated, and the second-class to-be-processed image with the largest information quantity is selected from all the second-class to-be-processed images to be used as a reference image; then judging whether the information quantity of the second type of to-be-processed images is smaller than a first threshold value, and if the information quantity of the second type of to-be-processed images is smaller than or equal to the first threshold value, replacing the second type of to-be-processed images by using the reference images; and if the information quantity of the second type of to-be-processed images is larger than the first threshold value, reserving the second type of to-be-processed images. The first threshold may be an average or median of the information amounts of all the second type of images to be processed, the information amount of the reference image being the largest of all the second type of images to be processed, and thus the information amount of the reference image being greater than the first threshold.
For example, all the second-class to-be-processed images include second-class to-be-processed images 1 to 5, the electronic device calculates information amount of each of the second-class to-be-processed images 1 to 5, compares information amounts of the 5 second-class to-be-processed images, determines that information amount of the second-class to-be-processed image 4 is maximum, and determines the second-class to-be-processed image 4 as a reference image. Then the electronic equipment judges whether the information quantity of each second type of image to be processed in the 4 second type of images to be processed is larger than a first threshold value or not for the second type of images to be processed 1, the second type of images to be processed 2, the second type of images to be processed 3 and the second type of images to be processed 5 respectively, and if the information quantity of each second type of images to be processed in the 4 second type of images to be processed is larger than the first threshold value, the second type of images to be processed are reserved; and if the information amount of the second type of to-be-processed image is smaller than or equal to the first threshold value, replacing the second type of to-be-processed image by using the reference image.
By the above-described fig. 5 to 9, the electronic apparatus indirectly judges the sharpness of each image by the information amount of each image, thereby being able to reselect the reference image by the sharpness between the images, and perform the operation of image replacement or image retention by threshold judgment for the second type of to-be-processed images other than the reference image, thereby realizing that the sharpness of the reference image is optimal (may also become the sharpness maximum), and the blurred image is replaced, wherein the second type of to-be-processed image having the information amount less than or equal to the first threshold may be regarded as the blurred image.
The following is a schematic description of the effects. Fig. 10 (1) shows that the user opens the camera application, and the electronic device displays a preview interface of the camera application. Currently, an electronic device is in a dark light environment, and a darker area and a brighter area exist in an image displayed in a preview interface, so that a shooting object under the preview interface is not particularly clear. And clicking a shooting control in the preview interface by the user, and calling a camera by the electronic equipment to shoot the shooting object. The electronic device can call the camera to shoot images under different exposure amounts, and the electronic device calls the image processing method shown in the figures 3 to 9 to process the images under different exposure amounts, so that the electronic device can select a reference image with optimal definition, and the operations such as discarding or replacing the blurred image are completed. The electronic device may then generate an image of the subject using the retained image, and a thumbnail of the image of the subject may be displayed in a thumbnail frame of the preview interface, as shown in (2) of fig. 10, where the thumbnail frame is an entry where the electronic device displays the currently captured image and the thumbnail frame can be linked to a gallery application. After the electronic device displays the currently shot image, if the user slides the image left, the electronic device can switch the image. As in some examples, the electronic device is responsive to a left-hand slide operation, the electronic device displaying images ordered prior to the image in the gallery application.
The user clicks the thumbnail frame, and the image of the shooting object is displayed in the electronic equipment, so that compared with the image under the preview interface, the definition of the image of the shooting object regenerated by the electronic equipment by using the image processing method provided by the application is obviously improved. The image of the shooting object regenerated by the electronic equipment is stored in a gallery application, the gallery application can display a thumbnail of the image of the shooting object under the camera album, and after a user clicks the thumbnail of the image of the shooting object under the camera album, the electronic equipment can display the regenerated image of the shooting object.
The shooting time of the images with different exposure amounts may be different, and the shooting time of the images with different exposure amounts may be shorter, so that the difference between the images with different exposure amounts is smaller, and the difference is mainly represented by the change of the position of the moving object, so that if the position of the moving object in the reference image is different from the position of the moving object in the replaced image, the position of the moving object in the image regenerated by the electronic device can be changed slightly relative to the position of the moving object shot by the camera. For example, the automobile model in a moving state shown in fig. 10 (1) and fig. 10 (3), the position of the automobile model in fig. 10 (3) changes little with respect to the position thereof in fig. 10 (1). In some examples, the position of the photographic subject in motion in the preview interface is the same as the position of the photographic subject in the captured image; in some examples, the pose of a photographic subject in motion in the preview interface may be different or the same as the pose of the photographic subject in the captured image; in some examples, the position of the photographic subject in the still state in the preview interface is the same as the position of the photographic subject in the captured image, and/or the pose of the photographic subject in the still state in the preview interface is the same as the pose of the photographic subject in the captured image, i.e., the presentation of the photographic subject in the still state in the preview interface is the same as the presentation of the photographic subject in the captured image.
Fig. 11 shows an effect comparison diagram of a building in a stationary state, a user clicks a photographing control in the preview interface shown in (1) in fig. 11, and an electronic device photographs the building. After the photographing is completed, a thumbnail of an image of the building is displayed in a thumbnail frame of the preview interface, as shown in (2) in fig. 11. The user clicks on the thumbnail frame of the preview interface, and the image shown in (3) in fig. 11 is displayed with a definition significantly better than that of the image shown in (1) in fig. 11. After the camera shoots the images, the electronic device processes the images in the background, and the image is subjected to a link of replacing the reference image (i.e. reselecting the reference image) and discarding or replacing the blurred image, as shown in (3) in fig. 11, so that the definition of the image is obviously improved.

Claims (15)

1. An image processing method, characterized by being applied to an electronic device, wherein the electronic device comprises a camera application and a gallery application, and the method comprises:
in response to an opening operation of the camera application, displaying a first image of a photographic subject in a preview interface of the camera application, the first image having a first sharpness;
After shooting of the shooting object is completed, a second image of the shooting object is displayed in response to clicking operation of a thumbnail of the shooting object, the second image has second definition, the second definition is larger than the first definition, and the second image is stored in the gallery application.
2. The method according to claim 1, wherein the method further comprises:
and after shooting of the shooting object is completed, displaying the thumbnail of the second image in a preview interface of the camera application.
3. The method according to claim 1 or 2, wherein the photographic subject comprises a first subject, the first subject being in motion; the presentation of the first object in the first image is different from the presentation of the first object in the second image.
4. A method according to claim 3, wherein the position of the first object in the first image is different from the position of the first object in the second image;
and/or the number of the groups of groups,
the pose of the first object in the first image is different from the pose of the first object in the second image.
5. The method according to any one of claims 1 to 4, wherein the second image is generated from at least two images to be processed of the photographic subject, the at least two images to be processed being photographed by a camera in response to one click operation of a photographing control in the preview interface, exposure amounts of the at least two images to be processed being different.
6. The method of claim 5, wherein the at least two images to be processed comprise: the image processing device comprises at least one first type of image to be processed, at least two second types of images to be processed and at least one third type of image to be processed, wherein the exposure of the first type of image to be processed is larger than that of the second type of image to be processed, the exposure of the second type of image to be processed is larger than that of the third type of image to be processed, and one second type of image to be processed in the at least two second types of images to be processed is a reference image of the shooting object;
the second image is generated according to at least two images to be processed of the shooting object, and the second image comprises the following steps:
reselecting a reference image of the shooting object from at least part of the first class of images to be processed, the second class of images to be processed and the third class of images to be processed;
Screening at least part of the first type of images to be processed, the second type of images to be processed and the third type of images to be processed by using a preset screening rule, wherein the preset screening rule is used for removing images affecting definition;
and generating the second image by using the reserved first-class to-be-processed image, the reserved second-class to-be-processed image and the reserved third-class to-be-processed image.
7. The method of claim 6, wherein the re-selecting the reference image of the photographic subject from at least some of the first, second, and third types of images comprises:
and determining the definition of each second type of to-be-processed image, and selecting the second type of to-be-processed image with the definition meeting the preset condition as the reference image of the shooting object.
8. The method according to claim 6 or 7, wherein the reference image of the photographic subject is the second-type to-be-processed image having the greatest sharpness among all the second-type to-be-processed images.
9. The method of claim 6, wherein filtering at least some of the first, second, and third types of images using preset filtering rules comprises:
Replacing the second type of image to be processed with the reference image of the shooting object;
and/or the number of the groups of groups,
discarding the first type of image to be processed with the definition being smaller than or equal to a preset second definition, wherein the first type of image to be processed with the definition being smaller than or equal to the preset second definition is the first type of image to be processed with the information content being smaller than or equal to a second threshold value.
10. The method of claim 9, wherein the replacing the second type of image to be processed with the reference image of the subject comprises:
and replacing the second-class to-be-processed image with the definition smaller than or equal to a preset first definition by using the reference image of the shooting object, wherein the second-class to-be-processed image with the definition smaller than or equal to the preset first definition is the second-class to-be-processed image with the information content smaller than or equal to a first threshold value.
11. The method according to claim 9 or 10, wherein filtering at least part of the first, second and third types of images using a preset filtering rule further comprises:
discarding the third class of to-be-processed images with the definition smaller than or equal to a preset third definition, wherein the third class of to-be-processed images with the definition smaller than or equal to the preset third definition are the third class of to-be-processed images with the information content smaller than or equal to a third threshold value.
12. The method of claim 6, wherein the re-selecting the reference image of the photographic subject from at least some of the first, second, and third types of images to be processed, and the filtering at least some of the first, second, and third types of images using a preset filtering rule comprises:
after the second class of to-be-processed images are acquired for the nth time, selecting the second class of to-be-processed images with definition meeting the preset condition from all the acquired second class of to-be-processed images as the reference image of the shooting object;
and replacing a second type of to-be-processed image with the definition smaller than or equal to a preset first definition in a first image set by using the reference image of the shooting object, wherein the second type of to-be-processed image with the definition smaller than or equal to the preset first definition is the second type of to-be-processed image with the information content smaller than or equal to a first threshold value, the first image set comprises all acquired second type of to-be-processed images, or the first image set comprises the second type of to-be-processed image acquired for the nth time and the second type of to-be-processed image acquired between the nth time and the N-M time, N is a natural number larger than 1, and M is a natural number larger than or equal to 1.
13. The method according to claim 7 or 8, wherein the sharpness is determined by an amount of information, wherein the amount of information is a sum of image gradients or the amount of information is a total number of pixels of a preset type in a binary image.
14. An electronic device, the electronic device comprising:
one or more processors and memory;
the memory is for storing computer program code comprising computer instructions which, when executed by the one or more processors, cause the electronic device to perform the image processing method of any of claims 1 to 13.
15. A computer-readable storage medium, characterized in that the computer-readable storage medium is for storing a computer program which, when executed, implements the image processing method according to any one of claims 1 to 13.
CN202310183258.9A 2023-02-20 2023-02-20 Image processing method and device Pending CN117119318A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310183258.9A CN117119318A (en) 2023-02-20 2023-02-20 Image processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310183258.9A CN117119318A (en) 2023-02-20 2023-02-20 Image processing method and device

Publications (1)

Publication Number Publication Date
CN117119318A true CN117119318A (en) 2023-11-24

Family

ID=88807983

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310183258.9A Pending CN117119318A (en) 2023-02-20 2023-02-20 Image processing method and device

Country Status (1)

Country Link
CN (1) CN117119318A (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108777765A (en) * 2018-08-07 2018-11-09 成都西纬科技有限公司 Obtain the method, apparatus and electronic equipment of full clear image
CN108900782A (en) * 2018-08-22 2018-11-27 Oppo广东移动通信有限公司 Exposal control method, device and electronic equipment
CN110401766A (en) * 2019-05-22 2019-11-01 华为技术有限公司 A kind of image pickup method and terminal
CN110881104A (en) * 2019-10-17 2020-03-13 宇龙计算机通信科技(深圳)有限公司 Photographing method, photographing device, storage medium and terminal
CN111800580A (en) * 2019-04-08 2020-10-20 福州瑞芯微电子股份有限公司 High dynamic image synthesis method and storage medium
CN115604572A (en) * 2022-09-02 2023-01-13 荣耀终端有限公司(Cn) Image acquisition method and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108777765A (en) * 2018-08-07 2018-11-09 成都西纬科技有限公司 Obtain the method, apparatus and electronic equipment of full clear image
CN108900782A (en) * 2018-08-22 2018-11-27 Oppo广东移动通信有限公司 Exposal control method, device and electronic equipment
CN111800580A (en) * 2019-04-08 2020-10-20 福州瑞芯微电子股份有限公司 High dynamic image synthesis method and storage medium
CN110401766A (en) * 2019-05-22 2019-11-01 华为技术有限公司 A kind of image pickup method and terminal
CN110881104A (en) * 2019-10-17 2020-03-13 宇龙计算机通信科技(深圳)有限公司 Photographing method, photographing device, storage medium and terminal
CN115604572A (en) * 2022-09-02 2023-01-13 荣耀终端有限公司(Cn) Image acquisition method and device

Similar Documents

Publication Publication Date Title
US9451173B2 (en) Electronic device and control method of the same
US9407831B2 (en) Intelligent auto-exposure bracketing
JP7266672B2 (en) Image processing method, image processing apparatus, and device
WO2020192692A1 (en) Image processing method and related apparatus
CN110971841B (en) Image processing method, image processing device, storage medium and electronic equipment
CN115689963B (en) Image processing method and electronic equipment
US20210406532A1 (en) Method and apparatus for detecting finger occlusion image, and storage medium
CN113810588B (en) Image synthesis method, terminal and storage medium
CN113411498A (en) Image shooting method, mobile terminal and storage medium
CN112258380A (en) Image processing method, device, equipment and storage medium
CN117061861B (en) Shooting method, chip system and electronic equipment
CN116916151B (en) Shooting method, electronic device and storage medium
CN112419218A (en) Image processing method and device and electronic equipment
CN116723383B (en) Shooting method and related equipment
US20230014272A1 (en) Image processing method and apparatus
CN117119318A (en) Image processing method and device
CN115460343A (en) Image processing method, apparatus and storage medium
CN116363017B (en) Image processing method and device
CN115601842B (en) Automatic snapshot method, electronic equipment and storage medium
CN113870300A (en) Image processing method and device, electronic equipment and readable storage medium
CN117097993B (en) Image processing method and related device
US20240005521A1 (en) Photographing method and apparatus, medium and chip
CN116668836B (en) Photographing processing method and electronic equipment
CN114245011B (en) Image processing method, user interface and electronic equipment
CN117409184A (en) Image processing method, device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination