WO2021135945A1 - Image processing method and apparatus, storage medium, and electronic device - Google Patents

Image processing method and apparatus, storage medium, and electronic device Download PDF

Info

Publication number
WO2021135945A1
WO2021135945A1 PCT/CN2020/136777 CN2020136777W WO2021135945A1 WO 2021135945 A1 WO2021135945 A1 WO 2021135945A1 CN 2020136777 W CN2020136777 W CN 2020136777W WO 2021135945 A1 WO2021135945 A1 WO 2021135945A1
Authority
WO
WIPO (PCT)
Prior art keywords
central area
area
preview image
camera
central
Prior art date
Application number
PCT/CN2020/136777
Other languages
French (fr)
Chinese (zh)
Inventor
金越
Original Assignee
Oppo广东移动通信有限公司
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 Oppo广东移动通信有限公司 filed Critical Oppo广东移动通信有限公司
Publication of WO2021135945A1 publication Critical patent/WO2021135945A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/62Control of parameters via user interfaces
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N17/00Diagnosis, testing or measuring for television systems or their details
    • 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

Definitions

  • This application relates to the field of image processing technology, and in particular to an image processing method, device, storage medium, and electronic equipment.
  • the hardware technology level of the shooting component of the smart terminal is getting higher and higher, the pixels of the camera are also getting higher and higher, and the focusing function is getting more and more powerful. the part that can not be lost.
  • the embodiments of the present application provide an image processing method, device, storage medium, and electronic equipment, which can accurately compose photographs and improve the quality of photographs.
  • an image processing method including:
  • the target area is determined according to the multiple evaluation results, and the target area is taken as the central area for shooting.
  • an image processing device including:
  • a dividing unit configured to divide the preview image into regions to obtain multiple regions of the preview image
  • An evaluation unit configured to evaluate the image quality of the multiple regions to obtain multiple evaluation results
  • the determining unit determines a target area according to the multiple evaluation results, and takes the target area as a central area for shooting.
  • the storage medium provided by the embodiment of the present application has a computer program stored thereon, and when the computer program runs on a computer, the computer is caused to execute the image processing method provided in any embodiment of the present application.
  • the electronic device provided by an embodiment of the present application includes a processor and a memory, the memory has a computer program, and the processor is used to execute the image provided by any embodiment of the present application by invoking the computer program. Approach.
  • Fig. 1 is a schematic flowchart of an image processing method provided by an embodiment of the present application.
  • FIG. 2 is a schematic diagram of a scene of an image processing method provided by an embodiment of the application.
  • FIG. 3 is a schematic diagram of another scene of the image processing method provided by an embodiment of the application.
  • FIG. 4 is a schematic diagram of another flow of an image processing method provided by an embodiment of the application.
  • FIG. 5 is a schematic diagram of modules of an image processing device provided by an embodiment of the application.
  • FIG. 6 is a schematic structural diagram of an electronic device provided by an embodiment of the application.
  • FIG. 7 is a schematic diagram of another structure of an electronic device provided by an embodiment of the application.
  • module used in this article can be regarded as a software object executed on the computing system.
  • the different components, modules, engines and services mentioned in this article can be regarded as the implementation objects on the computing system.
  • the device and method described herein are preferably implemented in the form of software, of course, they can also be implemented on hardware, and they all fall within the protection scope of the present application.
  • An embodiment of the application provides an image processing method, including:
  • the target area is determined according to the multiple evaluation results, and the target area is taken as the central area for shooting.
  • the region division of the preview image to obtain multiple regions of the preview image may include:
  • the preview image is divided based on the pixel value of the preview image and the preset ratio to obtain multiple regions.
  • the obtaining multiple regions may include:
  • a central area and a non-central area in the plurality of areas are determined based on the area marking result.
  • the determining the target area according to the multiple evaluation results and taking the target area as the central area for shooting may include:
  • the central area is taken as the target area, and the preview image is taken as the target shooting image;
  • the shooting angle of the camera is adjusted according to the positional relationship between the non-central area and the central area with the largest evaluation result.
  • the adjusting the shooting angle of the camera according to the positional relationship between the non-central area and the central area with the largest evaluation result may include:
  • the adjusting the shooting angle of the camera to the diagonal position of the preview image corresponding to the non-central area with the largest evaluation result may include:
  • the shooting angle of the camera is adjusted.
  • the adjusting the shooting angle of the camera according to the positional relationship between the common edge of the non-central area and the central area of the two largest evaluation results may include:
  • the shooting angle of the camera is adjusted.
  • the adjusting the shooting angle of the camera in response to the adjusting angle may include:
  • evaluating the image quality of the multiple regions to obtain multiple evaluation results may include:
  • Image quality scores are performed on the multiple regions based on the image quality assessment algorithm, and corresponding multiple assessment results are obtained.
  • the embodiment of the application provides an image processing method.
  • the execution subject of the image processing method may be the image processing device provided in the embodiment of the application, or an electronic device integrated with the image processing device, wherein the image processing device may use hardware or Realized by software.
  • the electronic device may be a smart phone, a tablet computer, a PDA (Personal Digital Assistant), etc.
  • FIG. 1 is a schematic flowchart of the image processing method provided by the embodiment of the application.
  • the image processing method may include the following steps:
  • the preview image refers to the image displayed in real time on the display of the electronic device after starting the camera.
  • the electronic device can shoot in real time by calling the camera component, collect the current preview image, and display it on the display of the electronic device.
  • the shooting angle of the camera component can be adjusted, for example, the camera component can be controlled The shooting angle of the camera is adjusted upward, downward, left or right. After the shooting angle of the camera assembly is adjusted, the correspondingly captured preview image will also change with the adjustment of the shooting angle.
  • the camera assembly includes a front camera and a rear camera, and the user can determine whether to use the front camera or the rear camera as needed.
  • dividing the preview image refers to dividing the real-time image screen displayed by the current electronic device into different areas according to certain rules.
  • the divided areas can be disjoint pictures or overlapping pictures.
  • the preview image is divided into 5 areas according to the same ratio, namely upper left, upper right, lower right, lower left, and five areas in the center. There are overlapping pictures in the five areas.
  • the step of dividing the preview image into regions to obtain multiple regions of the preview image may include:
  • the pixel value refers to the value assigned by the computer when the original image is digitized. It represents the average brightness information of a small square of the original, or the average reflection (transmission) density information of the small square.
  • the dot area ratio (dot percentage) has a direct relationship with the pixel value (gray value) of the digital image, that is, the size of the dot represents the average brightness information of a small square of the original manuscript. .
  • the preset ratio refers to the ratio artificially set in the actual situation, for example, the preset ratio can be 1:0.8, that is, the ratio of 80% of the preview image can be taken according to the pixel value, and multiple images can be divided by this ratio area.
  • the image may be zoomed according to the center, upper left, upper right, lower left, and lower right directions to obtain multiple regions.
  • the step of obtaining multiple regions may include:
  • the area marking refers to marking the divided area through the location words. For example, referring to FIG. 2, these five areas can be marked as 1 (upper left), 2 (upper right), 3 (lower right), 4 (lower left), and 5 (center).
  • the image quality of the multiple regions may be evaluated by an image quality evaluation algorithm, and the multiple regions may be scored respectively based on the image quality evaluation algorithm to obtain corresponding multiple evaluation results.
  • the image quality evaluation algorithm refers to the evaluation of the quality of the image by analyzing the characteristics of the image, and outputting a score for the current image quality.
  • the characteristics include image composition, color matching, brightness, distortion, noise, etc. The higher the evaluation result obtained by the image quality evaluation algorithm, the better the image quality.
  • the image quality evaluation algorithm can be divided into subjective evaluation with reference and objective evaluation without reference in method.
  • Subjective reference evaluation is to evaluate the quality of the image from the subjective perception of the person, and give the original reference image.
  • the original reference image is the picture with the best image quality, and other pictures are scored based on this picture.
  • the average subjective score (Mean Opinion Score, MOS) or the average subjective score difference (Differential Mean Opinion Score, DMOS) is used to express.
  • the objective non-reference evaluation refers to the lack of the best reference picture, the mathematical model is trained, and the mathematical model is used to give the quantified value.
  • the image score is 1-10 points; 1 point represents poor image quality, and 10 points represent the image good quality.
  • the score can be a discrete value or a continuous value.
  • objective non-reference evaluation can include two implementation methods, one is to use multiple models to evaluate the image quality; the other is to use one model to evaluate the quality.
  • the method of using multiple models to evaluate image quality is to train multiple models, and each model is only responsible for evaluating one characteristic, such as composition, color matching, brightness, distortion, and noise. Take the weighted average of the scores output by each model to get the quality evaluation score of the whole picture.
  • the method of using a single model to evaluate the quality of an image is to train only one model, be responsible for evaluating various factors at the same time, and directly output the quality score of the image, that is, the evaluation result.
  • an image quality assessment model may be trained according to a deep learning algorithm such as CNN (Convolutional Neural Network), and the image quality assessment model may be performed according to the image quality assessment model.
  • the image quality evaluation model generally includes an input layer, a hidden layer, and an output layer; the input layer is used to receive the input of the image; the hidden layer is used to process the received image; the output layer is used to output the final result of the image processing.
  • the image quality evaluation scores are discrete, such as 1, 2, 3, ..., 10, a classification model can be used, and the output result is the confidence level of 10 classifications. The classification with the highest confidence can be used as the quality evaluation score of the image.
  • the image quality evaluation scores are continuous, such as 1, 1.1, 1.3,..., 9.5, 10, a regression model can be used, and the output result is a fraction with decimals. This result is the score of the image quality evaluation.
  • the method of constructing training samples for image quality evaluation is as follows: multiple people score each image, and the average of these scores is taken as the quality evaluation label score of the current image. Because everyone has different scoring standards for pictures, for example, some people tend to score most images with an intermediate value of 5 or 6, and some people tend to expand the scoring distribution of images, and they think it is not good to score 1, 2 points. Score 8 or 9 points for images that you think are good. In order to eliminate the difference in scoring between people, you can count the distribution of each person's scoring on all images, and get the average and variance of each person's scoring; in this way, the score of each image can be adjusted.
  • the evaluation results of all regions can be sorted, and then the evaluation results of the central region and the non-central region can be compared according to the ranking results, or the evaluation results of the central region and the non-central region can be directly compared. The judgment result is obtained according to the comparison result. After comparison, the area with the highest evaluation result is the target area.
  • the location of the area can be distinguished by area marks, such as the aforementioned marks: 1 (upper left), 2 (upper right), 3 (lower right), 4 (lower left), 5 (center).
  • area marks such as the aforementioned marks: 1 (upper left), 2 (upper right), 3 (lower right), 4 (lower left), 5 (center).
  • the non-central area is: 1, 2, 3, 4, and the central area is 5.
  • the preview image can be directly used as the target captured image.
  • the target area is a non-central area, for example, the target area is area 1 in the image 100
  • the diagonal line is the diagonal line formed by the line connecting the upper left end point and the lower right end point of area 1 in the image 100.
  • the common The edge is the edge formed by connecting the upper left end point and the upper right end point of the image 100. It should be noted that adjusting the direction of the camera is the direction with a higher evaluation result.
  • the step of determining the target area according to the multiple evaluation results and taking the target area as the central area for shooting may include:
  • the shooting angle of the camera is adjusted according to the position relationship between the non-central area and the central area with the largest evaluation result.
  • the shooting angle includes shooting height, shooting direction and shooting distance.
  • the shooting height is divided into three types: horizontal shooting, overhead shooting and upward shooting.
  • the shooting direction is divided into front angle, side angle, oblique angle, back angle, etc.
  • the shooting distance is one of the elements that determines the scene.
  • the step of adjusting the shooting angle of the camera according to the positional relationship between the non-central area and the central area with the largest evaluation result may include:
  • the angle adjustment can be performed in a corresponding manner according to different division rules.
  • the step of adjusting the shooting angle of the camera to the diagonal position of the non-central area with the largest evaluation result may include:
  • the evaluation difference refers to the difference between the evaluation result between the non-central area and the central area with the largest evaluation result. According to the evaluation difference, the parameter value of the adjustment angle can be determined, and the shooting angle of the camera can be adjusted correspondingly according to the parameter value.
  • the step of adjusting the shooting angle of the camera according to the position relationship between the central area and the common edges of the two non-central areas with the largest evaluation results may include:
  • the step of adjusting the shooting angle of the camera according to the response to the adjustment angle may include:
  • prompt information may be generated according to the adjusted angle to guide the user.
  • the prompt message can be: "Please move the phone horizontally upwards”.
  • the camera the camera's shooting angle is monitored at the same time.
  • the prompt message can be: "The current image quality is good and you can shoot, please click the shutter”. Among them, specific adjusted parameters can also be added to the prompt information.
  • the embodiment of the present application obtains a preview image collected by a camera; divides the preview image into regions to obtain multiple regions of the preview image; evaluates the image quality of the multiple regions to obtain multiple evaluation results;
  • the target area is determined according to the multiple evaluation results, and the target area is taken as the central area for shooting.
  • FIG. 4 is a schematic flowchart of another image processing method provided by an embodiment of the application.
  • the method includes:
  • the electronic device can shoot in real time by calling the camera component, collect the current preview image, and display it on the display of the electronic device.
  • the shooting angle of the camera component can be adjusted, for example, the camera component can be controlled.
  • the shooting angle of the camera assembly is adjusted up, down, left or right. After the shooting angle of the camera assembly is adjusted, the correspondingly captured preview image will also change with the adjustment of the shooting angle.
  • the camera component may include a front camera and a rear camera, and the user can determine whether to use the front camera or the rear camera as needed.
  • the pixel value refers to the value assigned by the computer when the original image is digitized, and it represents the average brightness information of a small square of the original.
  • the average brightness information of the preview image may be calculated to facilitate subsequent division of the preview image based on the brightness information.
  • the image can be zoomed according to the upper left, upper right, lower right, lower left, and center directions, and the corresponding average brightness information is taken to obtain multiple regions.
  • the preview image can be divided with a preset ratio of 1:0.8, and the preview image can be divided into five areas, namely, the upper left area, the upper right area, the lower right area, the lower left area, and the center area. There are overlapping screens in each area. Each divided area is a rectangle with the same width and height ratio as the original image, and the size is 80% of the original image, which ensures that the result of the image quality evaluation is comparable to the result of the original image.
  • these five areas can be denoted as: 1 (top left), 2 (top right), 3 (bottom right), 4 (bottom left), and 5 (center). Each mark indicates the location of each area.
  • the non-central area is: 1, 2, 3, 4, and the central area is 5.
  • the image quality evaluation algorithm can be used to evaluate the quality of the five regions of the current frame, and output five scores.
  • step 209 when the evaluation result of the central area is less than the evaluation result of the non-central area, step 209 is executed; when the evaluation result of the central area is not less than the evaluation result of the non-central area, step 208 is executed.
  • the evaluation results of all regions can be sorted, and then the evaluation results of the central region and the non-central region can be compared according to the ranking results, or the evaluation results of the central region and the non-central region can be directly compared. According to the comparison result, the judgment result of step 207 is obtained.
  • the image 100 can be referred to, that is, the score of the area 5 is not less than the score of any other four areas, and the preview image is taken as the target image.
  • the area with the highest evaluation result is the target area.
  • step 210 when the non-central area with the largest evaluation result is single, step 210 is executed; when the non-central area with the largest evaluation result is not single, step 211 is executed.
  • the evaluation difference between the non-central area with the largest evaluation result and the evaluation result of the central area can be calculated, and then the diagonal direction of the non-central area with the largest evaluation result can be determined according to the evaluation difference.
  • the adjustment angle In response to the adjustment angle, the electronic device adjusts the shooting angle of the camera.
  • the evaluation result of area 1 when one of the evaluation results of the four regions 1, 2, 3, and 4 is greater than the other three, it moves to the diagonal direction of the preview image corresponding to the region with the largest evaluation result. For example, if the evaluation result of area 1 is the largest, it moves along the diagonal line formed by the line connecting the upper left end point and the lower right end point of area 1 in the image 100, and the moving direction is the direction where area 1 is located, that is, the upper left direction.
  • step 210 If the judgment result of step 210 is "Yes”, then directly jump to step 212; if the judgment result of step 210 is "No", return to step 201 and restart image detection.
  • areas 1 and 4 have the highest scores, and they do not have a common edge, they do not move, and wait for the next frame of detection, that is, re-detect the next frame of preview image. All in all, adjust the camera angle in the direction where the evaluation value is larger.
  • the shooting angle of the camera is adjusted according to the positional relationship between the common side of the two non-central regions with the largest evaluation result and the central region.
  • the positional relationship between the non-central area and the central area can be determined by setting a position reference standard.
  • the diagonal line and each side of the preview image represented by the image 100 can be used as the position reference standard.
  • the evaluation difference between the two non-central areas with the largest evaluation results and the central area can be calculated, and then the adjustment angles in the common side direction of the two non-central areas with the largest evaluation results can be determined according to the evaluation differences.
  • the electronic device adjusts the shooting angle of the camera.
  • the direction of the most frequent occurrence in the area mark can be used as a reference to determine the direction of the camera movement, and the direction of the most frequent occurrence represents the direction of the camera adjustment. For example, with reference to image 100, if the highest score is 1, 2, and the direction with the most occurrences is "up", that is, the common side with the upper common side moves upward. All in all, adjust the camera angle in the direction where the evaluation value is larger.
  • the adjustment of the shooting angle of the camera may be to automatically adjust the focus direction of the camera, or to generate prompt information by adjusting the angle, and then guide the photographer to adjust the shooting angle of the camera according to the prompt information.
  • the target shooting image can be determined and the shooting can be carried out.
  • the shooting behavior may be triggered by the user by pressing the physical shutter button on the electronic device, or by the user touching the virtual shutter control on the display interface of the electronic device, or the electronic device may detect the preview image. It was taken automatically when the image was taken for the target.
  • the embodiment of the present application obtains a preview image collected by a camera; divides the preview image into regions to obtain multiple regions of the preview image; evaluates the image quality of the multiple regions to obtain multiple evaluation results;
  • the target area is determined according to the multiple evaluation results, and the target area is taken as the central area for shooting.
  • the embodiment of the present application also provides an image processing apparatus based on the foregoing.
  • the meaning of the nouns is the same as in the above image processing method, and the specific implementation details can refer to the description in the method embodiment.
  • FIG. 5 is a schematic diagram of modules of an image processing apparatus provided by an embodiment of the application.
  • the image processing device 300 includes: an acquisition unit 31, a division unit 32, an evaluation unit 33, and a determination unit 34.
  • the acquiring unit 31 is configured to acquire a preview image collected by the camera.
  • the preview image refers to the image displayed in real time on the display of the electronic device after starting the camera.
  • the electronic device can shoot in real time by calling the camera component, and the acquisition unit 31 collects the current preview image and displays it on the display of the electronic device.
  • the dividing unit 32 is configured to divide the preview image into regions to obtain multiple regions of the preview image.
  • the dividing unit 32 is configured to determine the pixel value of the preview image, and then divide the preview image based on the pixel value of the preview image and a preset ratio to obtain multiple regions.
  • it is also used to determine the pixel value of the preview image, and then divide the preview image based on the pixel value of the preview image and a preset ratio to obtain multiple regions. Mark the multiple areas separately, the area mark is used to indicate the position of each area in the multiple areas; the central area and the non-central area in the multiple areas are determined based on the result of the area marking.
  • the evaluation unit 33 is used to evaluate the image quality of the multiple regions to obtain multiple evaluation results.
  • the evaluation unit 33 may be specifically configured to score the image quality of multiple regions based on an image quality evaluation algorithm to obtain corresponding multiple evaluation results.
  • the determining unit 34 is configured to determine a target area according to the multiple evaluation results, and take the target area as a central area for shooting.
  • the determining unit 34 is configured to, when the evaluation result of the central area is not less than the evaluation result of the non-central area, take the central area as the target area and use the preview image as the target captured image; when the evaluation result of the central area is When the evaluation result is smaller than the non-central area, the shooting angle of the camera is adjusted according to the position relationship between the non-central area with the largest evaluation result and the central area.
  • the determining unit 34 is further configured to, when the evaluation result of the central area is not less than the evaluation result of the non-central area, use the central area as the target area and the preview image as the target captured image; when the evaluation result of the central area is When the result is less than the evaluation result of the non-central area, and when the number of non-central areas with the largest evaluation result is single, adjust the shooting angle of the camera to the diagonal position of the preview image corresponding to the non-central area with the largest evaluation result; The electronic device calculates the evaluation difference between the non-central area with the largest evaluation result and the central area, and then, according to the evaluation difference, determines the diagonal adjustment angle of the preview image corresponding to the non-central area with the largest evaluation result .
  • the electronic device adjusts the shooting angle of the camera.
  • the evaluation result of the central area is less than the evaluation result of the non-central area and when the number of non-central areas with the largest evaluation result is two, judge whether the two non-central areas with the largest evaluation results have a common edge, when there is a common edge , Adjust the shooting angle of the camera according to the positional relationship between the common edge of the non-central area and the central area of the two largest evaluation results.
  • the electronic device calculates the evaluation difference between the two non-central areas with the largest evaluation results and the central area, and then determines the adjustment angle in the common side direction of the two non-central areas with the largest evaluation results based on the evaluation difference.
  • the electronic device adjusts the shooting angle of the camera.
  • an embodiment of the present application provides an image processing device 300, which acquires a preview image collected by a camera through an acquisition unit 31; a division unit 32 divides the preview image into regions to obtain multiple regions of the preview image; an evaluation unit 33 evaluates the image quality of the multiple areas to obtain multiple evaluation results; the determining unit 34 determines the target area according to the multiple evaluation results, and takes the target area as the central area for shooting.
  • an image processing device 300 which acquires a preview image collected by a camera through an acquisition unit 31; a division unit 32 divides the preview image into regions to obtain multiple regions of the preview image; an evaluation unit 33 evaluates the image quality of the multiple areas to obtain multiple evaluation results; the determining unit 34 determines the target area according to the multiple evaluation results, and takes the target area as the central area for shooting.
  • the embodiment of the present application also provides an electronic device.
  • the electronic device 500 includes a processor 501 and a memory 502. Wherein, the processor 501 and the memory 502 are electrically connected.
  • the processor 500 is the control center of the electronic device 500. It uses various interfaces and lines to connect various parts of the entire electronic device. It executes by running or loading a computer program stored in the memory 502, and calling data stored in the memory 502. Various functions of the electronic device 500 and data are processed, so as to monitor the electronic device 500 as a whole.
  • the memory 502 may be used to store software programs and modules.
  • the processor 501 executes various functional applications and data processing by running the computer programs and modules stored in the memory 502.
  • the memory 502 may mainly include a storage program area and a storage data area.
  • the storage program area may store an operating system, a computer program required by at least one function (such as a sound playback function, an image playback function, etc.), etc.; Data created by the use of electronic equipment, etc.
  • the memory 502 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other volatile solid-state storage devices.
  • the memory 502 may further include a memory controller to provide the processor 501 with access to the memory 502.
  • the processor 501 in the electronic device 500 will load the instructions corresponding to the process of one or more computer programs into the memory 502 according to the following steps, and run the instructions by the processor 501 and store them in the memory 502.
  • the processor 501 in the electronic device 500 will load the instructions corresponding to the process of one or more computer programs into the memory 502 according to the following steps, and run the instructions by the processor 501 and store them in the memory 502.
  • the target area is determined according to the multiple evaluation results, and the target area is taken as the central area for shooting.
  • the processor 501 may specifically execute the following steps:
  • the central area is taken as the target area, and the preview image is taken as the target captured image;
  • the shooting angle of the camera is adjusted according to the positional relationship between the non-central area and the central area with the largest evaluation result.
  • the processor 501 may specifically perform the following steps:
  • the processor 501 may specifically perform the following steps when adjusting the shooting angle of the camera according to the positional relationship between the common edge of the non-central area and the central area of the two largest evaluation results:
  • the shooting angle of the camera is adjusted.
  • the processor 501 may specifically perform the following steps:
  • the shooting angle of the camera is adjusted according to the positional relationship between the central area and the common edges of the two non-central areas with the largest evaluation results.
  • the processor 501 may specifically perform the following steps:
  • the preview image is divided based on the pixel value of the preview image and the preset ratio to obtain multiple regions.
  • the central area and the non-central area of the plurality of areas are determined.
  • the processor 501 may specifically execute the following steps:
  • Image quality scores are performed on the multiple regions based on the image quality evaluation algorithm, and multiple corresponding evaluation results are obtained.
  • the embodiment of the present application obtains a preview image collected by a camera; divides the preview image into regions to obtain multiple regions of the preview image; evaluates the image quality of the multiple regions to obtain multiple evaluation results;
  • the target area is determined according to the multiple evaluation results, and the target area is taken as the central area for shooting.
  • the electronic device 500 may further include a display 503, a radio frequency circuit 504, an audio circuit 505, and a power supply 506.
  • the display 503, the radio frequency circuit 504, the audio circuit 505, and the power supply 506 are electrically connected to the processor 501, respectively.
  • the display 503 may be used to display information input by the user or information provided to the user, and various graphical user interfaces. These graphical user interfaces may be composed of graphics, text, icons, videos, and any combination thereof.
  • the display 503 may include a display panel.
  • the display panel may be configured in the form of a liquid crystal display (LCD) or an organic light-emitting diode (OLED).
  • LCD liquid crystal display
  • OLED organic light-emitting diode
  • the radio frequency circuit 504 can be used to transmit and receive radio frequency signals to establish wireless communication with network equipment or other electronic equipment through wireless communication, and to transmit and receive signals with the network equipment or other electronic equipment.
  • the audio circuit 505 can be used to provide an audio interface between the user and the electronic device through a speaker or a microphone.
  • the power supply 506 can be used to supply power to various components of the electronic device 500.
  • the power supply 506 may be logically connected to the processor 501 through a power management system, so that functions such as charging, discharging, and power consumption management can be managed through the power management system.
  • the electronic device 500 may also include a camera, a Bluetooth module, etc., which will not be repeated here.
  • the embodiments of the present application also provide a storage medium that stores a computer program, and when the computer program is run on a computer, the computer is caused to execute the image processing method in any of the above embodiments, such as: acquiring data collected by a camera. Preview image; divide the preview image to obtain multiple areas of the preview image; evaluate the image quality of the multiple areas to obtain multiple evaluation results; determine the target area according to the multiple evaluation results, and use the The target area is taken as the center area for shooting.
  • the storage medium may be a magnetic disk, an optical disk, a read only memory (Read Only Memory, ROM), or a random access memory (Random Access Memory, RAM), etc.
  • the computer program can be stored in a computer readable storage medium, such as stored in the memory of an electronic device, and executed by at least one processor in the electronic device, and the execution process can include, for example, the implementation of an image processing method Example process.
  • the storage medium can be a magnetic disk, an optical disk, a read-only memory, a random access memory, and the like.
  • its functional modules may be integrated into one processing chip, or each module may exist alone physically, or two or more modules may be integrated into one module.
  • the above-mentioned integrated modules can be implemented in the form of hardware or software functional modules. If the integrated module is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer readable storage medium, such as a read-only memory, a magnetic disk, or an optical disk.

Abstract

Embodiments of the present application disclose an image processing method and apparatus, a storage medium, and an electronic device. The method in the embodiments of the present application comprises: obtaining a preview image acquired by a camera; performing region division on the preview image, so as to obtain multiple regions of the preview image; evaluating the image quality of the multiple regions, so as to obtain multiple evaluation results; and determining a target region according to the multiple evaluation results, and performing photography using the target region as a central region.

Description

图像处理方法、装置、存储介质以及电子设备Image processing method, device, storage medium and electronic equipment
本申请要求于2019年12月31日提交中国专利局、申请号为201911421569.4、申请名称为“图像处理方法、装置、存储介质以及电子设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of a Chinese patent application filed with the Chinese Patent Office, the application number is 201911421569.4, and the application name is "Image processing methods, devices, storage media and electronic equipment" on December 31, 2019, the entire contents of which are incorporated by reference In this application.
技术领域Technical field
本申请涉及图像处理技术领域,具体涉及一种图像处理方法、装置、存储介质以及电子设备。This application relates to the field of image processing technology, and in particular to an image processing method, device, storage medium, and electronic equipment.
背景技术Background technique
随着智能终端拍照功能的不断发展,智能终端的拍摄组件的硬件技术水平越来越高,摄像头的像素也越来越高、对焦功能越来越强大,使得利用智能终端进行拍照成为人们生活中不可缺少的一部分。With the continuous development of the camera function of the smart terminal, the hardware technology level of the shooting component of the smart terminal is getting higher and higher, the pixels of the camera are also getting higher and higher, and the focusing function is getting more and more powerful. the part that can not be lost.
人们通过智能终端如手机进行拍照,并将获得的照片通过互联网分享上传至社交网络,拉近了人与人之间的交流。并且,随着在社交平台上秀照片风潮的兴起,用户越来越希望能用手机拍出更漂亮更专业的照片。People take pictures through smart terminals, such as mobile phones, and share and upload the obtained photos to social networks via the Internet, which brings closer communication between people. Moreover, with the rise of the trend of showing photos on social platforms, users increasingly hope to take more beautiful and professional photos with their mobile phones.
发明内容Summary of the invention
本申请实施例提供一种图像处理方法、装置、存储介质以及电子设备,可以准确的进行拍照构图,提升拍照质量。The embodiments of the present application provide an image processing method, device, storage medium, and electronic equipment, which can accurately compose photographs and improve the quality of photographs.
第一方面,本申请实施例提供了一种图像处理方法,包括:In the first aspect, an embodiment of the present application provides an image processing method, including:
获取摄像头采集的预览图像;Obtain the preview image collected by the camera;
对所述预览图像进行区域划分,得到所述预览图像的多个区域;Performing area division on the preview image to obtain multiple areas of the preview image;
对所述多个区域的图像质量进行评估,得到多个评估结果;Evaluating the image quality of the multiple regions to obtain multiple evaluation results;
根据所述多个评估结果确定目标区域,并以所述目标区域作为中心区域进行拍摄。The target area is determined according to the multiple evaluation results, and the target area is taken as the central area for shooting.
第二方面,本申请实施例提供了一种图像处理装置,包括:In the second aspect, an embodiment of the present application provides an image processing device, including:
获取单元,用于获取摄像头采集的预览图像;An acquiring unit for acquiring the preview image collected by the camera;
划分单元,用于对所述预览图像进行区域划分,得到所述预览图像的多个区域;A dividing unit, configured to divide the preview image into regions to obtain multiple regions of the preview image;
评估单元,用于对所述多个区域的图像质量进行评估,得到多个评估结果;An evaluation unit, configured to evaluate the image quality of the multiple regions to obtain multiple evaluation results;
确定单元,根据所述多个评估结果确定目标区域,并以所述目标区域作为中心区域进行拍摄。The determining unit determines a target area according to the multiple evaluation results, and takes the target area as a central area for shooting.
第三方面,本申请实施例提供的存储介质,其上存储有计算机程序,当所述计算机程序在计算机上运行时,使得所述计算机执行如本申请任一实施例提供的图像处理方法。In the third aspect, the storage medium provided by the embodiment of the present application has a computer program stored thereon, and when the computer program runs on a computer, the computer is caused to execute the image processing method provided in any embodiment of the present application.
第四方面,本申请实施例提供的电子设备,包括处理器和存储器,所述存储器有计算机程序,所述处理器通过调用所述计算机程序,用于执行如本申请任一实施例提供的图像处理方法。In a fourth aspect, the electronic device provided by an embodiment of the present application includes a processor and a memory, the memory has a computer program, and the processor is used to execute the image provided by any embodiment of the present application by invoking the computer program. Approach.
附图说明Description of the drawings
下面结合附图,通过对本申请的具体实施方式详细描述,将使本申请的技术方案及其它有益效果显而易见。The following detailed description of specific implementations of the present application in conjunction with the accompanying drawings will make the technical solutions and other beneficial effects of the present application obvious.
图1是本申请实施例提供的图像处理方法的流程示意图。Fig. 1 is a schematic flowchart of an image processing method provided by an embodiment of the present application.
图2为本申请实施例提供的图像处理方法的场景示意图。FIG. 2 is a schematic diagram of a scene of an image processing method provided by an embodiment of the application.
图3为本申请实施例提供的图像处理方法的另一场景示意图。FIG. 3 is a schematic diagram of another scene of the image processing method provided by an embodiment of the application.
图4为本申请实施例提供的图像处理方法的另一流程示意图。FIG. 4 is a schematic diagram of another flow of an image processing method provided by an embodiment of the application.
图5为本申请实施例提供的图像处理装置的模块示意图。FIG. 5 is a schematic diagram of modules of an image processing device provided by an embodiment of the application.
图6为本申请实施例提供的电子设备的结构示意图。FIG. 6 is a schematic structural diagram of an electronic device provided by an embodiment of the application.
图7为本申请实施例提供的电子设备的另一结构示意图。FIG. 7 is a schematic diagram of another structure of an electronic device provided by an embodiment of the application.
具体实施方式Detailed ways
请参照图式,其中相同的组件符号代表相同的组件,本申请的原理是以实施在一适当的运算环境中来举例说明。以下的说明是基于所例示的本申请具体实施例,其不应被视为限制本申请未在此详述的其它具体实施例。Please refer to the drawings, where the same component symbols represent the same components, and the principle of the present application is implemented in an appropriate computing environment for illustration. The following description is based on the exemplified specific embodiments of the application, which should not be regarded as limiting other specific embodiments of the application that are not described in detail herein.
本文所使用的术语「模块」可看做为在该运算系统上执行的软件对象。本文该的不同组件、模块、引擎及服务可看做为在该运算系统上的实施对象。而本文该的装置及方法优选的以软件的方式进行实施,当然也可在硬件上进行实施,均在本申请保护范围之内。The term "module" used in this article can be regarded as a software object executed on the computing system. The different components, modules, engines and services mentioned in this article can be regarded as the implementation objects on the computing system. The device and method described herein are preferably implemented in the form of software, of course, they can also be implemented on hardware, and they all fall within the protection scope of the present application.
本申请实施例提供一种图像处理方法,包括:An embodiment of the application provides an image processing method, including:
获取摄像头采集的预览图像;Obtain the preview image collected by the camera;
对所述预览图像进行区域划分,得到所述预览图像的多个区域;Performing area division on the preview image to obtain multiple areas of the preview image;
对所述多个区域的图像质量进行评估,得到多个评估结果;Evaluating the image quality of the multiple regions to obtain multiple evaluation results;
根据所述多个评估结果确定目标区域,并以所述目标区域作为中心区域进行拍摄。The target area is determined according to the multiple evaluation results, and the target area is taken as the central area for shooting.
在一种实施方式中,所述对所述预览图像进行区域划分,得到所述预览图像的多个区域,可以包括:In an implementation manner, the region division of the preview image to obtain multiple regions of the preview image may include:
确定所述预览图像的像素值;Determining the pixel value of the preview image;
基于所述预览图像的像素值和预设比例对所述预览图像进行划分,得到多个区域。The preview image is divided based on the pixel value of the preview image and the preset ratio to obtain multiple regions.
在一种实施方式中,所述得到多个区域,可以包括:In an embodiment, the obtaining multiple regions may include:
对所述多个区域分别进行区域标记,所述区域标记用于指示所述多个区域中每一区域的位置;Performing area marks on the multiple areas respectively, where the area marks are used to indicate the position of each area in the multiple areas;
基于所述区域标记结果确定所述多个区域中的中心区域以及非中心区域。A central area and a non-central area in the plurality of areas are determined based on the area marking result.
在一种实施方式中,所述根据所述多个评估结果确定目标区域,并以所述目标区域作为中心区域进行拍摄,可以包括:In an embodiment, the determining the target area according to the multiple evaluation results and taking the target area as the central area for shooting may include:
当中心区域的评估结果不小于非中心区域的评估结果时,将中心区域作为目标区域,并将预览图像作为目标拍摄图像;When the evaluation result of the central area is not less than the evaluation result of the non-central area, the central area is taken as the target area, and the preview image is taken as the target shooting image;
当中心区域的评估结果小于非中心区域的评估结果时,根据评估结果最大的非中心区域与中心区域之间的位置关系调整摄像头的拍摄角度。When the evaluation result of the central area is smaller than the evaluation result of the non-central area, the shooting angle of the camera is adjusted according to the positional relationship between the non-central area and the central area with the largest evaluation result.
在一种实施方式中,所述根据评估结果最大的非中心区域与中心区域之间的位置关系调整摄像头的拍摄角度,可以包括:In an embodiment, the adjusting the shooting angle of the camera according to the positional relationship between the non-central area and the central area with the largest evaluation result may include:
当所述评估结果最大的非中心区域的数量为单个时,向所述评估结果最大的非中心区域对应的预览图像的对角线位置调整摄像头的拍摄角度;When the number of non-central regions with the largest evaluation result is single, adjust the shooting angle of the camera to the diagonal position of the preview image corresponding to the non-central region with the largest evaluation result;
当所述评估结果最大的非中心区域的数量为两个时,判断两个评估结果最大的非中心区域是否存在公共边;When the number of non-central regions with the largest evaluation result is two, determine whether the two non-central regions with the largest evaluation result have a common edge;
当存在公共边时,根据两个评估结果最大的非中心区域的公共边与中心区域之间的位置关系调整摄像头的拍摄角度。When there is a common edge, adjust the shooting angle of the camera according to the positional relationship between the common edge of the non-central area and the central area of the two largest evaluation results.
在一种实施方式中,所述向所述评估结果最大的非中心区域对应的预览图像的对角线位置调整摄像头的拍摄角度,可以包括:In an embodiment, the adjusting the shooting angle of the camera to the diagonal position of the preview image corresponding to the non-central area with the largest evaluation result may include:
计算所述评估结果最大的非中心区域与中心区域之间的评估差值;Calculating the evaluation difference between the non-central area and the central area with the largest evaluation result;
根据所述评估差值确定评估结果最大的非中心区域对应的预览图像的对角线方向上的调整角度;Determining, according to the evaluation difference, an adjustment angle in the diagonal direction of the preview image corresponding to the non-central area with the largest evaluation result;
响应所述调整角度,对所述摄像头的拍摄角度进行调整。In response to the adjustment angle, the shooting angle of the camera is adjusted.
在一种实施方式中,所述根据两个评估结果最大的非中心区域的公共边与中心区域之间的位置关系调整摄像头的拍摄角度,可以包括:In an implementation manner, the adjusting the shooting angle of the camera according to the positional relationship between the common edge of the non-central area and the central area of the two largest evaluation results may include:
计算两个评估结果最大的非中心区域与中心区域之间的评估差值;Calculate the evaluation difference between the two non-central areas with the largest evaluation results and the central area;
根据所述评估差值确定评估结果最大的两个非中心区域的公共边方向上的调整角度;Determining the adjustment angles in the common side direction of the two non-central regions with the largest evaluation result according to the evaluation difference;
响应所述调整角度,对所述摄像头的拍摄角度进行调整。In response to the adjustment angle, the shooting angle of the camera is adjusted.
在一种实施方式中,所述响应所述调整角度,对所述摄像头的拍摄角度进行调整,可以包括:In an embodiment, the adjusting the shooting angle of the camera in response to the adjusting angle may include:
根据所述调整角度生成提示信息;Generating prompt information according to the adjustment angle;
基于提示信息指导用户对所述摄像头的拍摄角度进行调整。Guide the user to adjust the shooting angle of the camera based on the prompt information.
在一种实施方式中,对所述多个区域的图像质量进行评估,得到多个评估结果,可以包括:In an implementation manner, evaluating the image quality of the multiple regions to obtain multiple evaluation results may include:
基于图像质量评估算法分别对所述多个区域进行图像质量评分,得到相应的多个评估结果。Image quality scores are performed on the multiple regions based on the image quality assessment algorithm, and corresponding multiple assessment results are obtained.
本申请实施例提供一种图像处理方法,该图像处理方法的执行主体可以是本申请实施例提供的图像处理装置,或者集成了该图像处理装置的电子设备,其中该图像处理装置可以采用硬件或者软件的方式实现。其中,电子设备可以是智能手机、平板电脑、掌上电脑(PDA,Personal Digital Assistant)等。The embodiment of the application provides an image processing method. The execution subject of the image processing method may be the image processing device provided in the embodiment of the application, or an electronic device integrated with the image processing device, wherein the image processing device may use hardware or Realized by software. Among them, the electronic device may be a smart phone, a tablet computer, a PDA (Personal Digital Assistant), etc.
以下进行具体分析说明。The following is a specific analysis and description.
本申请实施例提供一种图像处理方法,如图1所示,图1为本申请实施例提供的图像处理方法的流程示意图,该图像处理方法可以包括以下步骤:An embodiment of the application provides an image processing method. As shown in FIG. 1, FIG. 1 is a schematic flowchart of the image processing method provided by the embodiment of the application. The image processing method may include the following steps:
101、获取摄像头采集的预览图像。101. Obtain a preview image collected by the camera.
其中,该预览图像指的是电子设备启动摄像头后其显示器中实时显示的图像。电子设备可以通过调用摄像头组件实时进行拍摄,采集当前的预览图像,并显示在该电子设备的显示器上,在一实施方式中,该摄像头组件的拍摄角度可以进行调节,比如,可以控制该摄像头组件的拍摄角度向上、向下、向左或者向右调节,在该摄像头组件的拍摄角度调节之后,相应拍摄到的预览图像也会随着拍摄角度调节变化而改变。Wherein, the preview image refers to the image displayed in real time on the display of the electronic device after starting the camera. The electronic device can shoot in real time by calling the camera component, collect the current preview image, and display it on the display of the electronic device. In one embodiment, the shooting angle of the camera component can be adjusted, for example, the camera component can be controlled The shooting angle of the camera is adjusted upward, downward, left or right. After the shooting angle of the camera assembly is adjusted, the correspondingly captured preview image will also change with the adjustment of the shooting angle.
在一实施方式中,该摄像头组件包括前置摄像头以及后置摄像头,用户可以根据需要确定使用前置摄像头或者后置摄像头。In one embodiment, the camera assembly includes a front camera and a rear camera, and the user can determine whether to use the front camera or the rear camera as needed.
102、对预览图像进行区域划分,得到预览图像的多个区域。102. Perform area division on the preview image to obtain multiple areas of the preview image.
其中,对预览图像进行划分指的是对当前电子设备显示的实时图像画面按照一定的规则划分为不同的区域。所划分的区域可以是互不相交的画面也可以是重叠的画面,例如,将预览图像按照相同的比例从划分为5个区域,即左上、右上、右下,左下,中心五个区域,该五个区域存在重叠的画面。Among them, dividing the preview image refers to dividing the real-time image screen displayed by the current electronic device into different areas according to certain rules. The divided areas can be disjoint pictures or overlapping pictures. For example, the preview image is divided into 5 areas according to the same ratio, namely upper left, upper right, lower right, lower left, and five areas in the center. There are overlapping pictures in the five areas.
在一实施方式中,对该预览图像进行区域划分,得到该预览图像的多个区域的步骤,可以包括:In an embodiment, the step of dividing the preview image into regions to obtain multiple regions of the preview image may include:
(1)确定该预览图像的像素值;(1) Determine the pixel value of the preview image;
(2)基于该预览图像的像素值和预设比例对该预览图像进行划分,得到多个区域。(2) Divide the preview image based on the pixel value of the preview image and the preset ratio to obtain multiple regions.
其中,像素值指的是原稿图像被数字化时由计算机赋予的值,它代表了原稿某一小方块的平均亮度信息,或者说是该小方块的平均反射(透射)密度信息。在将数字图像转化为网目调图像时,网点面积率(网点百分比)与数字图像的像素值(灰度值)有直接的关系,即网点以其大小表示原稿某一小方块的平均亮度信息。Among them, the pixel value refers to the value assigned by the computer when the original image is digitized. It represents the average brightness information of a small square of the original, or the average reflection (transmission) density information of the small square. When converting a digital image into a halftone image, the dot area ratio (dot percentage) has a direct relationship with the pixel value (gray value) of the digital image, that is, the size of the dot represents the average brightness information of a small square of the original manuscript. .
其中,预设比例指的是人为地在实际情况中设置的比例,例如该预设比例可以是1:0.8,即可以根据像素值取预览图像的80%的比例,通过该比例划分多个图像区域。例如,参考图2所示图像100,可以按照中心、左上、右上、左下、右下这几个方位进行图像的缩放得到多个区域。Among them, the preset ratio refers to the ratio artificially set in the actual situation, for example, the preset ratio can be 1:0.8, that is, the ratio of 80% of the preview image can be taken according to the pixel value, and multiple images can be divided by this ratio area. For example, referring to the image 100 shown in FIG. 2, the image may be zoomed according to the center, upper left, upper right, lower left, and lower right directions to obtain multiple regions.
在一实施方式中,该得到多个区域的步骤,可以包括:In an embodiment, the step of obtaining multiple regions may include:
(1)对该多个区域分别进行区域标记,该区域标记用于指示该多个区域中每一区域的位置;(1) Perform area marks on the multiple areas respectively, and the area marks are used to indicate the position of each area in the multiple areas;
(2)基于该位置确定该多个区域中的中心区域以及非中心区域。(2) Determine the central area and the non-central area of the plurality of areas based on the position.
其中,区域标记指的是对划分出的区域通过方位词进行标记。例如,参考图2所示,可以将这五个区域分别标记为、1(左上)、2(右上)、3(右下)、4(左下)、5(中心)。Among them, the area marking refers to marking the divided area through the location words. For example, referring to FIG. 2, these five areas can be marked as 1 (upper left), 2 (upper right), 3 (lower right), 4 (lower left), and 5 (center).
103、对多个区域的图像质量进行评估,得到多个评估结果。103. Evaluate the image quality of multiple regions to obtain multiple evaluation results.
在一实施方式中,可以通过图像质量评估算法对该多个区域的图像质量进行评估,基于图像质量评估算法分别对该多个区域进行图像质量评分,得到相应的多个评估结果。In one embodiment, the image quality of the multiple regions may be evaluated by an image quality evaluation algorithm, and the multiple regions may be scored respectively based on the image quality evaluation algorithm to obtain corresponding multiple evaluation results.
其中,图像质量评估算法指的是通过对图像进行特性分析研究,评估出图像质量的优劣,输出对当前图像质量的打分。其中,特性包括图像的构图情况、色彩搭配、明暗度、失真度、噪点等。通过图像质量评估算法得到的评估结果越高则代表图像质量越好。Among them, the image quality evaluation algorithm refers to the evaluation of the quality of the image by analyzing the characteristics of the image, and outputting a score for the current image quality. Among them, the characteristics include image composition, color matching, brightness, distortion, noise, etc. The higher the evaluation result obtained by the image quality evaluation algorithm, the better the image quality.
其中,图像质量评估算法从方法上可分为主观有参考评估和客观无参考评估。主观有参考评估就是从人的主观感知来评价图像的质量,给出原始参考图像,该原始参考图片是图像质量最好的图片,其他图片依据这张图片进行评分。一般采用平均主观得分(Mean Opinion Score,MOS)或平均主观得分差异(Differential Mean Opinion Score,DMOS)表示。客观无参考评估指的是没有最佳参考图片,训练数学模型,使用数学模型给出量化值,一般来说,图像的评分为1~10分;1分代表图像质量很差,10分代表图像质量很好。评分可以是离散值,也可以是连续值。Among them, the image quality evaluation algorithm can be divided into subjective evaluation with reference and objective evaluation without reference in method. Subjective reference evaluation is to evaluate the quality of the image from the subjective perception of the person, and give the original reference image. The original reference image is the picture with the best image quality, and other pictures are scored based on this picture. Generally, the average subjective score (Mean Opinion Score, MOS) or the average subjective score difference (Differential Mean Opinion Score, DMOS) is used to express. The objective non-reference evaluation refers to the lack of the best reference picture, the mathematical model is trained, and the mathematical model is used to give the quantified value. Generally speaking, the image score is 1-10 points; 1 point represents poor image quality, and 10 points represent the image good quality. The score can be a discrete value or a continuous value.
其中,客观无参考评估可以包括2种实现方式,一种是使用多个模型对图像进行质量评估;另一种是使用一个模型进行质量评估。使用多个模型对图像进行质量评估的方法是:训练多个模型,每一个模型只负责评估一个特性,如构图、色彩搭配、明暗度、失真度、 噪点等。将每个模型输出的分数做加权平均得到整张图片的质量评估分数。使用单个模型对图像进行质量评估的方法是:只训练一个模型,同时负责评估各种因素,直接输出该图像的质量分数即评估结果。Among them, objective non-reference evaluation can include two implementation methods, one is to use multiple models to evaluate the image quality; the other is to use one model to evaluate the quality. The method of using multiple models to evaluate image quality is to train multiple models, and each model is only responsible for evaluating one characteristic, such as composition, color matching, brightness, distortion, and noise. Take the weighted average of the scores output by each model to get the quality evaluation score of the whole picture. The method of using a single model to evaluate the quality of an image is to train only one model, be responsible for evaluating various factors at the same time, and directly output the quality score of the image, that is, the evaluation result.
在一些实施例中,对图像进行质量评估,可以根据CNN(Convolutional Neural Network,卷积神经网络)等深度学习算法训练图像质量评估模型,根据图像质量评估模型对图像进行质量评估。其中,图像质量评估模型一般包括输入层、隐层和输出层;输入层用于接收图像的输入;隐层用于对接收到的图像进行处理;输出层用于输出对图像处理的最终结果即输出图像的质量评估分数。当图像质量评估的分数是离散的,如1,2,3,……,10,则可以使用分类模型,输出的结果为10个分类的置信度。取置信度最高的那个分类即可作为该图像的质量评估分数。当图像质量评估的分数是连续的,如1,1.1,1.3,……,9.5,10,则可以使用回归模型,输出的结果为带有小数的分数。此结果即为图像质量评估的分数。In some embodiments, to perform quality assessment on an image, an image quality assessment model may be trained according to a deep learning algorithm such as CNN (Convolutional Neural Network), and the image quality assessment model may be performed according to the image quality assessment model. Among them, the image quality evaluation model generally includes an input layer, a hidden layer, and an output layer; the input layer is used to receive the input of the image; the hidden layer is used to process the received image; the output layer is used to output the final result of the image processing. The quality evaluation score of the output image. When the image quality evaluation scores are discrete, such as 1, 2, 3, ..., 10, a classification model can be used, and the output result is the confidence level of 10 classifications. The classification with the highest confidence can be used as the quality evaluation score of the image. When the image quality evaluation scores are continuous, such as 1, 1.1, 1.3,..., 9.5, 10, a regression model can be used, and the output result is a fraction with decimals. This result is the score of the image quality evaluation.
在一些实施例中,图像质量评估的训练样本构造方式如下:多个人对每张图像进行打分,取这些分数的平均值作为当前图像的质量评估标注分数。由于每个人对于图片打分的标准不同,例如有些人倾向于将大多数图像都打中间值5、6分,有些人倾向于将图像的打分分布拉大,觉得不好的打1、2分,觉得好的图像打8、9分。为了排除人与人之间打分的差异,可以统计每个人对所有图像的打分分布情况,得出每个人的打分均值与方差;这样可以对每张图像的分数进行调整。In some embodiments, the method of constructing training samples for image quality evaluation is as follows: multiple people score each image, and the average of these scores is taken as the quality evaluation label score of the current image. Because everyone has different scoring standards for pictures, for example, some people tend to score most images with an intermediate value of 5 or 6, and some people tend to expand the scoring distribution of images, and they think it is not good to score 1, 2 points. Score 8 or 9 points for images that you think are good. In order to eliminate the difference in scoring between people, you can count the distribution of each person's scoring on all images, and get the average and variance of each person's scoring; in this way, the score of each image can be adjusted.
104、根据多个评估结果确定目标区域,并以目标区域作为中心区域进行拍摄。104. Determine the target area according to multiple evaluation results, and take the target area as the central area for shooting.
在一实施方式中,可以对所有区域的评估结果进行排序,然后根据排序结果,比较中心区域以及非中心区域评估结果的大小,也可以直接比较中心区域以及非中心区域评估结果的大小。根据比较结果得到判断结果。经过比较之后,评估结果最高的区域即为目标区域。In one embodiment, the evaluation results of all regions can be sorted, and then the evaluation results of the central region and the non-central region can be compared according to the ranking results, or the evaluation results of the central region and the non-central region can be directly compared. The judgment result is obtained according to the comparison result. After comparison, the area with the highest evaluation result is the target area.
在一实施方式中,可以通过区域标记分辨区域的位置,例如上述提到的标记:1(左上)、2(右上)、3(右下)、4(左下)、5(中心)。例如,非中心区域即为:1、2、3、4,中心区域为5。In one embodiment, the location of the area can be distinguished by area marks, such as the aforementioned marks: 1 (upper left), 2 (upper right), 3 (lower right), 4 (lower left), 5 (center). For example, the non-central area is: 1, 2, 3, 4, and the central area is 5.
比如,当目标区域为一个的时候,且目标区域为中心区域,例如图像100中的5区域,则可直接将预览图像作为目标拍摄图像。又例如,当目标区域为为非中心区域,例如,该目标区域为图像100中的区域1,则向该区域1对应的预览图像的对角线的位置调整摄像头的拍摄角度,此时,该对角线为图像100中区域1左上端点与右下端点的连线形成的对角线。当目标区域为两个的时候,例如,目标区域为图像100中的区域1和区域2时,则 向区域1和区域2的公共边方向,即向上调整摄像头的拍摄角度,此时,该公共边即为图像100的左上端点与右上端点连接形成的边。需要说明的是,调整摄像头的方向为评估结果较高的方向。For example, when the target area is one, and the target area is the central area, such as the 5 areas in the image 100, the preview image can be directly used as the target captured image. For another example, when the target area is a non-central area, for example, the target area is area 1 in the image 100, adjust the camera's shooting angle to the diagonal position of the preview image corresponding to the area 1. The diagonal line is the diagonal line formed by the line connecting the upper left end point and the lower right end point of area 1 in the image 100. When there are two target areas, for example, when the target areas are area 1 and area 2 in the image 100, then adjust the camera's shooting angle upward in the direction of the common side of area 1 and area 2. At this time, the common The edge is the edge formed by connecting the upper left end point and the upper right end point of the image 100. It should be noted that adjusting the direction of the camera is the direction with a higher evaluation result.
在一实施方式中,该根据该多个评估结果确定目标区域,并以该目标区域作为中心区域进行拍摄的步骤,可以包括:In an embodiment, the step of determining the target area according to the multiple evaluation results and taking the target area as the central area for shooting may include:
(1)当中心区域的评估结果大于等于非中心区域的评估结果时,将中心区域作为目标区域,并将预览图像作为目标拍摄图像;(1) When the evaluation result of the central area is greater than or equal to the evaluation result of the non-central area, the central area is taken as the target area, and the preview image is taken as the target captured image;
(2)当中心区域的评估结果小于非中心区域的评估结果时,根据评估结果最大的非中心区域与中心区域之间的位置关系调整摄像头的拍摄角度。(2) When the evaluation result of the central area is smaller than the evaluation result of the non-central area, the shooting angle of the camera is adjusted according to the position relationship between the non-central area and the central area with the largest evaluation result.
其中,拍摄角度包括拍摄高度、拍摄方向和拍摄距离。拍摄高度分为平拍、俯拍和仰拍三种。拍摄方向分为正面角度、侧面角度、斜侧角度、背面角度等。拍摄距离是决定景别的元素之一。Among them, the shooting angle includes shooting height, shooting direction and shooting distance. The shooting height is divided into three types: horizontal shooting, overhead shooting and upward shooting. The shooting direction is divided into front angle, side angle, oblique angle, back angle, etc. The shooting distance is one of the elements that determines the scene.
在一实施方式中,该根据评估结果最大的非中心区域与中心区域之间的位置关系调整摄像头的拍摄角度的步骤,可以包括:In an embodiment, the step of adjusting the shooting angle of the camera according to the positional relationship between the non-central area and the central area with the largest evaluation result may include:
(1)当该评估结果最大的非中心区域的数量为单个时,向该评估结果最大的非中心区域对应的对角线位置调整摄像头的拍摄角度;(1) When the number of non-central areas with the largest evaluation result is single, adjust the shooting angle of the camera to the diagonal position corresponding to the non-central area with the largest evaluation result;
(2)当该评估结果最大的非中心区域的数量为两个时,判断两个评估结果最大的非中心区域是否存在公共边,当存在公共边时,根据两个评估结果最大的非中心区域的公共边与中心区域之间的位置关系调整摄像头的拍摄角度。(2) When the number of non-central areas with the largest evaluation result is two, judge whether the two non-central areas with the largest evaluation results have a common edge. When there is a common edge, according to the two non-central areas with the largest evaluation results The positional relationship between the common edge and the central area of the camera adjusts the shooting angle of the camera.
需要说明的是,该多个区域得到的评估结果存在很多种情况,实际调整摄像头角度的过程中,根据划分规则的不同可以进行对应方式的角度调整。It should be noted that there are many situations in which the evaluation results obtained from the multiple regions exist. In the actual adjustment of the camera angle, the angle adjustment can be performed in a corresponding manner according to different division rules.
在一实施方式中,向评估结果最大的非中心区域的对角线位置调整摄像头的拍摄角度的步骤,可以包括:In an embodiment, the step of adjusting the shooting angle of the camera to the diagonal position of the non-central area with the largest evaluation result may include:
(1)计算该评估结果最大的非中心区域与中心区域之间的评估差值;(1) Calculate the evaluation difference between the non-central area with the largest evaluation result and the central area;
(2)根据该评估差值确定评估结果最大的非中心区域对应的对角线方向上的调整角度;(2) Determine the adjustment angle in the diagonal direction corresponding to the non-central area with the largest evaluation result according to the evaluation difference;
(3)响应该调整角度,对该摄像头的拍摄角度进行调整。(3) In response to the adjustment angle, the shooting angle of the camera is adjusted.
其中,评估差值指的是评估结果最大的非中心区域与中心区域之间的评估结果的差值。根据评估差值可以确定调整角度的参数值,并根据该参数值对应调整摄像头的拍摄角度。Among them, the evaluation difference refers to the difference between the evaluation result between the non-central area and the central area with the largest evaluation result. According to the evaluation difference, the parameter value of the adjustment angle can be determined, and the shooting angle of the camera can be adjusted correspondingly according to the parameter value.
在一实施方式中,根据中心区域与两个评估结果最大的非中心区域的公共边之间的位 置关系调整摄像头的拍摄角度的步骤,可以包括:In an embodiment, the step of adjusting the shooting angle of the camera according to the position relationship between the central area and the common edges of the two non-central areas with the largest evaluation results may include:
(4)计算两个评估结果最大的非中心区域与中心区域之间的评估差值;(4) Calculate the evaluation difference between the two non-central areas with the largest evaluation results and the central area;
(5)根据该评估差值确定评估结果最大的两个非中心区域的公共边方向上的调整角度;(5) Determine the adjustment angle in the direction of the common side of the two non-central regions with the largest evaluation result according to the evaluation difference;
(6)响应该调整角度,对该摄像头的拍摄角度进行调整。(6) In response to the adjustment angle, the shooting angle of the camera is adjusted.
在一实施方式中,根据响应该调整角度,对该摄像头的拍摄角度进行调整的步骤,可以包括:In an embodiment, the step of adjusting the shooting angle of the camera according to the response to the adjustment angle may include:
(1)根据调整角度生成提示信息;(1) Generate prompt information according to the adjustment angle;
(2)基于提示信息指导用户对摄像头的拍摄角度进行调整。(2) Guide the user to adjust the shooting angle of the camera based on the prompt information.
例如,当用户使用手机拍摄如图3所示的被拍摄人物时,在手机确定所要调整的拍摄角度后,可以根据该调整角度生成提示信息以指导用户。当确定好要移动的方向时,如图3所示,提示信息可以为:“请将手机向上方水平移动”,在用户对摄像头进行移动的过程中同时监控摄像头拍摄角度的变化,当用户的调整角度合适时提示信息可以为:“当前图像质量佳,可以进行拍摄,请点击快门”。其中,也可在提示信息中加入具体调整的参数。For example, when a user uses a mobile phone to shoot a photographed person as shown in FIG. 3, after the mobile phone determines the shooting angle to be adjusted, prompt information may be generated according to the adjusted angle to guide the user. When the direction to move is determined, as shown in Figure 3, the prompt message can be: "Please move the phone horizontally upwards". When the user moves the camera, the camera's shooting angle is monitored at the same time. When the user's When the angle is adjusted properly, the prompt message can be: "The current image quality is good and you can shoot, please click the shutter". Among them, specific adjusted parameters can also be added to the prompt information.
由上述可知,本申请实施例通过获取摄像头采集的预览图像;对该预览图像进行区域划分,得到该预览图像的多个区域;对该多个区域的图像质量进行评估,得到多个评估结果;根据该多个评估结果确定目标区域,并以该目标区域作为中心区域进行拍摄。以此,通过对预览图像划分后的多个区域进行质量评估,得到多个评估结果,并根据评估结果确定出最适合拍照的目标区域,并以该目标区域作为中心区域进行拍摄,实现更为准确的拍摄构图,提升拍摄质量。It can be seen from the above that the embodiment of the present application obtains a preview image collected by a camera; divides the preview image into regions to obtain multiple regions of the preview image; evaluates the image quality of the multiple regions to obtain multiple evaluation results; The target area is determined according to the multiple evaluation results, and the target area is taken as the central area for shooting. In this way, through the quality evaluation of multiple regions after the preview image is divided, multiple evaluation results are obtained, and the most suitable target area for photographing is determined according to the evaluation results, and the target area is taken as the central area for shooting to achieve more Accurate shooting composition, improve shooting quality.
根据上述实施例所描述的方法,以下将举例作进一步详细说明。According to the method described in the foregoing embodiment, an example will be given below for further detailed description.
请参阅图4,图4为本申请实施例提供的图像处理方法的另一流程示意图。Please refer to FIG. 4, which is a schematic flowchart of another image processing method provided by an embodiment of the application.
具体而言,该方法包括:Specifically, the method includes:
201、获取摄像头采集的预览图像。201. Obtain a preview image collected by a camera.
例如,电子设备可以通过调用摄像头组件实时进行拍摄,采集当前的预览图像,并显示在该电子设备的显示器上,在一实施方式中,该摄像头组件的拍摄角度可以进行调节,比如,可以控制该摄像头组件的拍摄角度向上、向下、向左或者向右调节,在该摄像头组件的拍摄角度调节之后,相应拍摄到的预览图像也会随着拍摄角度调节变化而改变。其中,该摄像头组件可以包括前置摄像头以及后置摄像头,用户可以根据需要确定使用前置摄像 头或者后置摄像头。For example, the electronic device can shoot in real time by calling the camera component, collect the current preview image, and display it on the display of the electronic device. In one embodiment, the shooting angle of the camera component can be adjusted, for example, the camera component can be controlled. The shooting angle of the camera assembly is adjusted up, down, left or right. After the shooting angle of the camera assembly is adjusted, the correspondingly captured preview image will also change with the adjustment of the shooting angle. Among them, the camera component may include a front camera and a rear camera, and the user can determine whether to use the front camera or the rear camera as needed.
202、确定预览图像的像素值。202. Determine the pixel value of the preview image.
其中,像素值指的是原稿图像被数字化时由计算机赋予的值,它代表了原稿某一小方块的平均亮度信息。在一实施方式中,可以根据计算预览图像的平均亮度信息,方便后续基于该亮度信息对预览图像进行区域的划分。Among them, the pixel value refers to the value assigned by the computer when the original image is digitized, and it represents the average brightness information of a small square of the original. In one embodiment, the average brightness information of the preview image may be calculated to facilitate subsequent division of the preview image based on the brightness information.
203、基于预览图像的像素值和预设比例对预览图像进行划分得到多个区域。203. Divide the preview image based on the pixel value of the preview image and the preset ratio to obtain multiple regions.
例如,参考图2所示图像100,可以按照左上方、右上方、右下方,左下方,中心这几个方位进行图像的缩放,并取相应的平均亮度信息,从而划分得到多个区域。进一步地,可以取预设比例为1:0.8对该预览图像进行划分,将预览图像划分成五个区域,即左上区域、右上区域、右下区域,左下区域,中心区域五个区域,该五个区域存在重叠的画面。其中每个划分后的区域都是一个与原图像相同宽高比例的矩形,大小为原图像的80%,保证了图像质量评估的结果和原图的结果具有可比性。并且取原图80%的可以保证划分区域之后的图像不会丢失太多的全局信息,同时划分区域后的图像之间具有明显的差异。取左上、右上、左下、右下四个区域可以模拟将相机移动到这四个位置时,取景框中心的图像质量。For example, referring to the image 100 shown in FIG. 2, the image can be zoomed according to the upper left, upper right, lower right, lower left, and center directions, and the corresponding average brightness information is taken to obtain multiple regions. Further, the preview image can be divided with a preset ratio of 1:0.8, and the preview image can be divided into five areas, namely, the upper left area, the upper right area, the lower right area, the lower left area, and the center area. There are overlapping screens in each area. Each divided area is a rectangle with the same width and height ratio as the original image, and the size is 80% of the original image, which ensures that the result of the image quality evaluation is comparable to the result of the original image. And taking 80% of the original image can ensure that the image after the division does not lose too much global information, and there are obvious differences between the images after the division. Take the upper left, upper right, lower left, and lower right areas to simulate the image quality at the center of the viewfinder frame when the camera is moved to these four positions.
204、对多个区域分别进行区域标记,区域标记用于指示所述多个区域中每一区域的位置。204. Perform area marks on the multiple areas respectively, where the area marks are used to indicate the position of each area in the multiple areas.
例如,可以将这五个区域分别记为:1(左上)、2(右上)、3(右下)、4(左下)、5(中心)。每一个标记指示每一区域的位置。For example, these five areas can be denoted as: 1 (top left), 2 (top right), 3 (bottom right), 4 (bottom left), and 5 (center). Each mark indicates the location of each area.
205、基于区域标记结果确定多个区域中的中心区域以及非中心区域。205. Determine a central area and a non-central area in the multiple areas based on the area marking result.
例如,非中心区域即为:1、2、3、4,中心区域为5。For example, the non-central area is: 1, 2, 3, 4, and the central area is 5.
206、基于图像质量评估算法对多个区域的图像进行评估,得到多个评估结果。206. Evaluate images in multiple regions based on an image quality evaluation algorithm to obtain multiple evaluation results.
例如,如图2所示,可以利用图像质量评估算法对当前帧的这五个区域分别进行质量评估,输出五个分数。For example, as shown in Figure 2, the image quality evaluation algorithm can be used to evaluate the quality of the five regions of the current frame, and output five scores.
207、判断中心区域的评估结果是否小于非中心区域的评估结果。207. Determine whether the evaluation result of the central area is less than the evaluation result of the non-central area.
其中,当中心区域的评估结果小于非中心区域的评估结果时,则执行步骤209;当中心区域的评估结果不小于非中心区域的评估结果时,则执行步骤208。Wherein, when the evaluation result of the central area is less than the evaluation result of the non-central area, step 209 is executed; when the evaluation result of the central area is not less than the evaluation result of the non-central area, step 208 is executed.
在一实施方式中,可以对所有区域的评估结果进行排序,然后根据排序结果,比较中心区域以及非中心区域评估结果的大小,也可以直接比较中心区域以及非中心区域评估结果的大小。根据比较结果得到步骤207的判断结果。In one embodiment, the evaluation results of all regions can be sorted, and then the evaluation results of the central region and the non-central region can be compared according to the ranking results, or the evaluation results of the central region and the non-central region can be directly compared. According to the comparison result, the judgment result of step 207 is obtained.
208、将中心区域作为目标区域并将预览图像作为目标拍摄图像。208. Use the central area as the target area and use the preview image as the target captured image.
例如,可以参考图像100,即区域5的分数不小于其他任何四个区域的分数,则将预览图像作为目标拍摄图像。For example, the image 100 can be referred to, that is, the score of the area 5 is not less than the score of any other four areas, and the preview image is taken as the target image.
其中,经过比较各个区域的评估结果之后,评估结果最高的区域即为目标区域。Among them, after comparing the evaluation results of each area, the area with the highest evaluation result is the target area.
209、判断评估结果最大的非中心区域是否为单个。209. Determine whether the non-central area with the largest evaluation result is single.
其中,当评估结果最大的非中心区域为单个时,则执行步骤210;当评估结果最大的非中心区域不为单个时,则执行步骤211。Wherein, when the non-central area with the largest evaluation result is single, step 210 is executed; when the non-central area with the largest evaluation result is not single, step 211 is executed.
210、向评估结果最大的非中心区域对应的对角线位置调整摄像头的拍摄角度。210. Adjust the shooting angle of the camera to the diagonal position corresponding to the non-central area with the largest evaluation result.
在一实施方式中,可以通过计算该评估结果最大的非中心区域与中心区域评估结果之间的评估差值,然后,根据该评估差值确定评估结果最大的非中心区域的对角线方向上的调整角度。电子设备响应该调整角度,对该摄像头的拍摄角度进行调整。In one embodiment, the evaluation difference between the non-central area with the largest evaluation result and the evaluation result of the central area can be calculated, and then the diagonal direction of the non-central area with the largest evaluation result can be determined according to the evaluation difference. The adjustment angle. In response to the adjustment angle, the electronic device adjusts the shooting angle of the camera.
例如,参考图像100,当,1、2、3、4这四个区域的评估结果中有一个均大于其他三个,则向评估结果最大的区域对应的预览图像的对角线的方向移动。例如区域1的评估结果最大,则沿着图像100中区域1左上端点与右下端点的连线形成的对角线移动,且移动方向为区域1所在的方向即左上方向。For example, in the reference image 100, when one of the evaluation results of the four regions 1, 2, 3, and 4 is greater than the other three, it moves to the diagonal direction of the preview image corresponding to the region with the largest evaluation result. For example, if the evaluation result of area 1 is the largest, it moves along the diagonal line formed by the line connecting the upper left end point and the lower right end point of area 1 in the image 100, and the moving direction is the direction where area 1 is located, that is, the upper left direction.
211、判断非中心区域之间是否存在公共边。211. Determine whether there is a common edge between non-central areas.
若步骤210的判断结果为“是”则直接跳转到步骤212;若步骤210的判断结果为“否”返回步骤201,重新开始图像检测。If the judgment result of step 210 is "Yes", then directly jump to step 212; if the judgment result of step 210 is "No", return to step 201 and restart image detection.
例如,若分数最高的是区域1和区域4,它们不存在公共边,则不进行移动,等待下一帧检测,即对下一帧预览图像重新进行图像检测。总而言之,向评估值大的方向调整摄像头角度。For example, if areas 1 and 4 have the highest scores, and they do not have a common edge, they do not move, and wait for the next frame of detection, that is, re-detect the next frame of preview image. All in all, adjust the camera angle in the direction where the evaluation value is larger.
212、根据评估结果最大的非中心区域之间的公共边与中心区域之间的位置关系调整摄像头的拍摄角度。212. Adjust the shooting angle of the camera according to the positional relationship between the common edge between the non-central area and the central area with the largest evaluation result.
例如,该评估结果最大的非中心区域的数量为两个时,根据两个评估结果最大的非中心区域的公共边与中心区域之间的位置关系调整摄像头的拍摄角度。For example, when the number of non-central regions with the largest evaluation result is two, the shooting angle of the camera is adjusted according to the positional relationship between the common side of the two non-central regions with the largest evaluation result and the central region.
其中,非中心区域与中心区域之间的位置关系可以通过设置位置参照标准来认定,例如,图像100表示的预览图像的对角线以及各边可以作为位置参照标准。比如,可以通过计算两个评估结果最大的非中心区域与中心区域之间的评估差值,然后根据该评估差值确定评估结果最大的两个非中心区域的公共边方向上的调整角度。电子设备响应该调整角度,对该摄像头的拍摄角度进行调整。Wherein, the positional relationship between the non-central area and the central area can be determined by setting a position reference standard. For example, the diagonal line and each side of the preview image represented by the image 100 can be used as the position reference standard. For example, the evaluation difference between the two non-central areas with the largest evaluation results and the central area can be calculated, and then the adjustment angles in the common side direction of the two non-central areas with the largest evaluation results can be determined according to the evaluation differences. In response to the adjustment angle, the electronic device adjusts the shooting angle of the camera.
在一些实施例中,还可以通过区域标记中出现次数最多的方向为参考,判断摄像头移 动方向,出现次数最多的方向则代表摄像头调整的方向。例如,参考图像100,若分数最高的是1、2,出现次数最多的方向是“上”,即公共边为上方的公共边则向上方移动。总而言之,即向评估值大的方向调整摄像头角度。In some embodiments, the direction of the most frequent occurrence in the area mark can be used as a reference to determine the direction of the camera movement, and the direction of the most frequent occurrence represents the direction of the camera adjustment. For example, with reference to image 100, if the highest score is 1, 2, and the direction with the most occurrences is "up", that is, the common side with the upper common side moves upward. All in all, adjust the camera angle in the direction where the evaluation value is larger.
其中,对该摄像头的拍摄角度进行调整可以是自动调整摄像头的对焦方向,也可以是通过调整角度生成提示信息,然后根据提示信息指导拍摄者进行摄像头拍摄角度的调整。The adjustment of the shooting angle of the camera may be to automatically adjust the focus direction of the camera, or to generate prompt information by adjusting the angle, and then guide the photographer to adjust the shooting angle of the camera according to the prompt information.
213、进行拍摄。213. Take pictures.
即经过上述调整摄像头的拍摄角度之后就可以确定目标拍摄图像,从而进行拍摄。在一实施方式中,拍摄行为可以用户通过按压电子设备上的物理快门键所触发的,或用户通过触摸电子设备显示界面上的虚拟快门控件所触发的,也可以是电子设备在检测到预览图像为目标拍摄图像时自动拍摄的。That is, after the above-mentioned adjustment of the shooting angle of the camera, the target shooting image can be determined and the shooting can be carried out. In one embodiment, the shooting behavior may be triggered by the user by pressing the physical shutter button on the electronic device, or by the user touching the virtual shutter control on the display interface of the electronic device, or the electronic device may detect the preview image. It was taken automatically when the image was taken for the target.
由上述可知,本申请实施例通过获取摄像头采集的预览图像;对该预览图像进行区域划分,得到该预览图像的多个区域;对该多个区域的图像质量进行评估,得到多个评估结果;根据该多个评估结果确定目标区域,并以该目标区域作为中心区域进行拍摄。以此,通过对预览图像划分后的多个区域进行质量评估,得到多个评估结果,并根据评估结果确定出最适合拍照的目标区域,并以该目标区域作为中心区域进行拍摄,实现更为准确的拍摄构图,提升拍摄质量。It can be seen from the above that the embodiment of the present application obtains a preview image collected by a camera; divides the preview image into regions to obtain multiple regions of the preview image; evaluates the image quality of the multiple regions to obtain multiple evaluation results; The target area is determined according to the multiple evaluation results, and the target area is taken as the central area for shooting. In this way, through the quality evaluation of multiple regions after the preview image is divided, multiple evaluation results are obtained, and the most suitable target area for photographing is determined according to the evaluation results, and the target area is taken as the central area for shooting to achieve more Accurate shooting composition, improve shooting quality.
为便于更好的实施本申请实施例提供的图像处理方法,本申请实施例还提供一种基于上述图像处理装置。其中名词的含义与上述图像处理方法中相同,具体实现细节可以参考方法实施例中的说明。In order to facilitate better implementation of the image processing method provided in the embodiment of the present application, the embodiment of the present application also provides an image processing apparatus based on the foregoing. The meaning of the nouns is the same as in the above image processing method, and the specific implementation details can refer to the description in the method embodiment.
请参阅图5,图5为本申请实施例提供的图像处理装置的模块示意图。具体而言,该图像处理装置300,包括:获取单元31、划分单元32、评估单元33以及确定单元34。Please refer to FIG. 5. FIG. 5 is a schematic diagram of modules of an image processing apparatus provided by an embodiment of the application. Specifically, the image processing device 300 includes: an acquisition unit 31, a division unit 32, an evaluation unit 33, and a determination unit 34.
获取单元31,用于获取摄像头采集的预览图像。The acquiring unit 31 is configured to acquire a preview image collected by the camera.
其中,该预览图像指的是电子设备启动摄像头后其显示器中实时显示的图像。电子设备可以通过调用摄像头组件实时进行拍摄,获取单元31采集当前的预览图像,并显示在该电子设备的显示器上。Wherein, the preview image refers to the image displayed in real time on the display of the electronic device after starting the camera. The electronic device can shoot in real time by calling the camera component, and the acquisition unit 31 collects the current preview image and displays it on the display of the electronic device.
划分单元32,用于对该预览图像进行区域划分,得到该预览图像的多个区域。The dividing unit 32 is configured to divide the preview image into regions to obtain multiple regions of the preview image.
在一实施方式中,该划分单元32,用于确定预览图像的像素值,然后基于预览图像的像素值和预设比例对预览图像进行划分,得到多个区域。In one embodiment, the dividing unit 32 is configured to determine the pixel value of the preview image, and then divide the preview image based on the pixel value of the preview image and a preset ratio to obtain multiple regions.
在一实施方式中,还用于确定预览图像的像素值,然后基于预览图像的像素值和预设比例对预览图像进行划分,得到多个区域。对多个区域分别进行区域标记,区域标记用于 指示多个区域中每一区域的位置;基于区域标记结果确定多个区域中的中心区域以及非中心区域。In one embodiment, it is also used to determine the pixel value of the preview image, and then divide the preview image based on the pixel value of the preview image and a preset ratio to obtain multiple regions. Mark the multiple areas separately, the area mark is used to indicate the position of each area in the multiple areas; the central area and the non-central area in the multiple areas are determined based on the result of the area marking.
评估单元33,用于对该多个区域的图像质量进行评估,得到多个评估结果。The evaluation unit 33 is used to evaluate the image quality of the multiple regions to obtain multiple evaluation results.
在一实施方式中,该评估单元33,具体可以用于基于图像质量评估算法分别对多个区域进行图像质量评分,得到相应的多个评估结果。In one embodiment, the evaluation unit 33 may be specifically configured to score the image quality of multiple regions based on an image quality evaluation algorithm to obtain corresponding multiple evaluation results.
确定单元34,用于根据该多个评估结果确定目标区域,并以该目标区域作为中心区域进行拍摄。The determining unit 34 is configured to determine a target area according to the multiple evaluation results, and take the target area as a central area for shooting.
在一实施方式中,该确定单元34用于当中心区域的评估结果不小于非中心区域的评估结果时,将中心区域作为目标区域,并将预览图像作为目标拍摄图像;当中心区域的评估结果小于非中心区域的评估结果时,根据评估结果最大的非中心区域与中心区域之间的位置关系调整摄像头的拍摄角度。In one embodiment, the determining unit 34 is configured to, when the evaluation result of the central area is not less than the evaluation result of the non-central area, take the central area as the target area and use the preview image as the target captured image; when the evaluation result of the central area is When the evaluation result is smaller than the non-central area, the shooting angle of the camera is adjusted according to the position relationship between the non-central area with the largest evaluation result and the central area.
在一实施方式中,该确定单元34还用于当中心区域的评估结果不小于非中心区域的评估结果时,将中心区域作为目标区域,并将预览图像作为目标拍摄图像;当中心区域的评估结果小于非中心区域的评估结果时,且当该评估结果最大的非中心区域的数量为单个时,向该评估结果最大的非中心区域对应的预览图像的对角线位置调整摄像头的拍摄角度;电子设备通过计算该评估结果最大的非中心区域与中心区域之间的评估差值,然后,根据该评估差值确定评估结果最大的非中心区域对应的预览图像的对角线方向上的调整角度。电子设备响应该调整角度,对该摄像头的拍摄角度进行调整。当中心区域的评估结果小于非中心区域的评估结果且当该评估结果最大的非中心区域的数量为两个时,判断两个评估结果最大的非中心区域是否存在公共边,当存在公共边时,根据两个评估结果最大的非中心区域的公共边与中心区域之间的位置关系调整摄像头的拍摄角度。电子设备通过计算两个评估结果最大的非中心区域与中心区域之间的评估差值,然后根据该评估差值确定评估结果最大的两个非中心区域的公共边方向上的调整角度。电子设备响应该调整角度,对该摄像头的拍摄角度进行调整。In one embodiment, the determining unit 34 is further configured to, when the evaluation result of the central area is not less than the evaluation result of the non-central area, use the central area as the target area and the preview image as the target captured image; when the evaluation result of the central area is When the result is less than the evaluation result of the non-central area, and when the number of non-central areas with the largest evaluation result is single, adjust the shooting angle of the camera to the diagonal position of the preview image corresponding to the non-central area with the largest evaluation result; The electronic device calculates the evaluation difference between the non-central area with the largest evaluation result and the central area, and then, according to the evaluation difference, determines the diagonal adjustment angle of the preview image corresponding to the non-central area with the largest evaluation result . In response to the adjustment angle, the electronic device adjusts the shooting angle of the camera. When the evaluation result of the central area is less than the evaluation result of the non-central area and when the number of non-central areas with the largest evaluation result is two, judge whether the two non-central areas with the largest evaluation results have a common edge, when there is a common edge , Adjust the shooting angle of the camera according to the positional relationship between the common edge of the non-central area and the central area of the two largest evaluation results. The electronic device calculates the evaluation difference between the two non-central areas with the largest evaluation results and the central area, and then determines the adjustment angle in the common side direction of the two non-central areas with the largest evaluation results based on the evaluation difference. In response to the adjustment angle, the electronic device adjusts the shooting angle of the camera.
由上述可知,本申请实施例提供了一种图像处理装置300,通过获取单元31获取摄像头采集的预览图像;划分单元32对该预览图像进行区域划分,得到该预览图像的多个区域;评估单元33对该多个区域的图像质量进行评估,得到多个评估结果;确定单元34根据该多个评估结果确定目标区域,并以该目标区域作为中心区域进行拍摄。以此,通过对预览图像划分后的多个区域进行质量评估,得到多个评估结果,并根据评估结果确定出最适合拍照的目标区域,并以该目标区域作为中心区域进行拍摄,实现更为准确的拍摄构图,提 升拍摄质量。It can be seen from the foregoing that an embodiment of the present application provides an image processing device 300, which acquires a preview image collected by a camera through an acquisition unit 31; a division unit 32 divides the preview image into regions to obtain multiple regions of the preview image; an evaluation unit 33 evaluates the image quality of the multiple areas to obtain multiple evaluation results; the determining unit 34 determines the target area according to the multiple evaluation results, and takes the target area as the central area for shooting. In this way, through the quality evaluation of multiple regions after the preview image is divided, multiple evaluation results are obtained, and the most suitable target area for photographing is determined according to the evaluation results, and the target area is taken as the central area for shooting to achieve more Accurate shooting composition, improve shooting quality.
本申请实施例还提供一种电子设备。请参阅图6,电子设备500包括处理器501以及存储器502。其中,处理器501与存储器502电性连接。The embodiment of the present application also provides an electronic device. Please refer to FIG. 6, the electronic device 500 includes a processor 501 and a memory 502. Wherein, the processor 501 and the memory 502 are electrically connected.
该处理器500是电子设备500的控制中心,利用各种接口和线路连接整个电子设备的各个部分,通过运行或加载存储在存储器502内的计算机程序,以及调用存储在存储器502内的数据,执行电子设备500的各种功能并处理数据,从而对电子设备500进行整体监控。The processor 500 is the control center of the electronic device 500. It uses various interfaces and lines to connect various parts of the entire electronic device. It executes by running or loading a computer program stored in the memory 502, and calling data stored in the memory 502. Various functions of the electronic device 500 and data are processed, so as to monitor the electronic device 500 as a whole.
该存储器502可用于存储软件程序以及模块,处理器501通过运行存储在存储器502的计算机程序以及模块,从而执行各种功能应用以及数据处理。存储器502可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的计算机程序(比如声音播放功能、图像播放功能等)等;存储数据区可存储根据电子设备的使用所创建的数据等。此外,存储器502可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。相应地,存储器502还可以包括存储器控制器,以提供处理器501对存储器502的访问。The memory 502 may be used to store software programs and modules. The processor 501 executes various functional applications and data processing by running the computer programs and modules stored in the memory 502. The memory 502 may mainly include a storage program area and a storage data area. The storage program area may store an operating system, a computer program required by at least one function (such as a sound playback function, an image playback function, etc.), etc.; Data created by the use of electronic equipment, etc. In addition, the memory 502 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other volatile solid-state storage devices. Correspondingly, the memory 502 may further include a memory controller to provide the processor 501 with access to the memory 502.
在本申请实施例中,电子设备500中的处理器501会按照如下的步骤,将一个或一个以上的计算机程序的进程对应的指令加载到存储器502中,并由处理器501运行存储在存储器502中的计算机程序,从而实现各种功能,如下:In the embodiment of the present application, the processor 501 in the electronic device 500 will load the instructions corresponding to the process of one or more computer programs into the memory 502 according to the following steps, and run the instructions by the processor 501 and store them in the memory 502. In order to realize various functions in the computer program, as follows:
获取摄像头采集的预览图像;Obtain the preview image collected by the camera;
对该预览图像进行区域划分,得到该预览图像的多个区域;Performing area division on the preview image to obtain multiple areas of the preview image;
对该多个区域的图像质量进行评估,得到多个评估结果;Evaluate the image quality of the multiple regions to obtain multiple evaluation results;
根据该多个评估结果确定目标区域,并以该目标区域作为中心区域进行拍摄。The target area is determined according to the multiple evaluation results, and the target area is taken as the central area for shooting.
在某些实施方式中,在根据该多个评估结果确定目标区域,并以该目标区域作为中心区域进行拍摄时,处理器501可以具体执行以下步骤:In some embodiments, when the target area is determined according to the multiple evaluation results, and the target area is taken as the central area for shooting, the processor 501 may specifically execute the following steps:
当中心区域的评估结果不小于等于非中心区域的评估结果时,将中心区域作为目标区域,并将预览图像作为目标拍摄图像;When the evaluation result of the central area is not less than or equal to the evaluation result of the non-central area, the central area is taken as the target area, and the preview image is taken as the target captured image;
当中心区域的评估结果小于非中心区域的评估结果时,根据评估结果最大的非中心区域与中心区域之间的位置关系调整摄像头的拍摄角度。When the evaluation result of the central area is smaller than the evaluation result of the non-central area, the shooting angle of the camera is adjusted according to the positional relationship between the non-central area and the central area with the largest evaluation result.
在某些实施方式中,在根据评估结果最大的非中心区域与中心区域之间的位置关系调整摄像头的拍摄角度时,处理器501可以具体执行以下步骤:In some embodiments, when adjusting the shooting angle of the camera according to the positional relationship between the non-central area and the central area with the largest evaluation result, the processor 501 may specifically perform the following steps:
当该评估结果最大的非中心区域的数量为单个时,向该评估结果最大的非中心区域对应的预览图像的对角线位置调整摄像头的拍摄角度;When the number of non-central areas with the largest evaluation result is single, adjust the shooting angle of the camera to the diagonal position of the preview image corresponding to the non-central area with the largest evaluation result;
当该评估结果最大的非中心区域的数量为两个时,判断两个评估结果最大的非中心区域是否存在公共边,When the number of non-central regions with the largest evaluation result is two, judge whether the two non-central regions with the largest evaluation results have a common edge,
当存在公共边时,根据两个评估结果最大的非中心区域的公共边与中心区域之间的位置关系调整摄像头的拍摄角度。When there is a common edge, adjust the shooting angle of the camera according to the positional relationship between the common edge of the non-central area and the central area of the two largest evaluation results.
在某些实施方式中,在根据两个评估结果最大的非中心区域的公共边与中心区域之间的位置关系调整摄像头的拍摄角度时,处理器501可以具体执行以下步骤:In some embodiments, the processor 501 may specifically perform the following steps when adjusting the shooting angle of the camera according to the positional relationship between the common edge of the non-central area and the central area of the two largest evaluation results:
计算该评估结果最大的非中心区域与中心区域之间的评估差值;Calculate the evaluation difference between the non-central area with the largest evaluation result and the central area;
根据该评估差值确定评估结果最大的非中心区域对应的预览图像的对角线方向上的调整角度;Determine the diagonal adjustment angle of the preview image corresponding to the non-central area with the largest evaluation result according to the evaluation difference;
响应该调整角度,对该摄像头的拍摄角度进行调整。In response to the adjustment angle, the shooting angle of the camera is adjusted.
在某些实施方式中,在根据中心区域与两个评估结果最大的非中心区域的公共边之间的位置关系调整摄像头的拍摄角度时,处理器501可以具体执行以下步骤:In some embodiments, when adjusting the shooting angle of the camera according to the positional relationship between the central area and the common edge of the two non-central areas with the largest evaluation results, the processor 501 may specifically perform the following steps:
根据中心区域与两个评估结果最大的非中心区域的公共边之间的位置关系调整摄像头的拍摄角度。The shooting angle of the camera is adjusted according to the positional relationship between the central area and the common edges of the two non-central areas with the largest evaluation results.
在某些实施方式中,在对该预览图像进行区域划分,得到该预览图像的多个区域时,处理器501可以具体执行以下步骤:In some implementation manners, when the preview image is divided into regions to obtain multiple regions of the preview image, the processor 501 may specifically perform the following steps:
确定该预览图像的像素值;Determine the pixel value of the preview image;
基于该预览图像的像素值和预设比例对该预览图像进行划分,得到多个区域。The preview image is divided based on the pixel value of the preview image and the preset ratio to obtain multiple regions.
在某些实施方式中,在得到多个区域时,可以包括以下步骤:In some embodiments, when multiple regions are obtained, the following steps may be included:
对该多个区域分别进行区域标记,该区域标记用于指示该多个区域中每一区域的位置;Performing area marks on the multiple areas respectively, where the area marks are used to indicate the position of each area in the multiple areas;
基于该位置确定该多个区域中的中心区域以及非中心区域。Based on the position, the central area and the non-central area of the plurality of areas are determined.
在某些实施方式中,在对该多个区域的图像质量进行评估,得到多个评估结果时,处理器501可以具体执行以下步骤:In some embodiments, when the image quality of the multiple regions is evaluated and multiple evaluation results are obtained, the processor 501 may specifically execute the following steps:
基于图像质量评估算法分别对该多个区域进行图像质量评分,得到相应的多个评估结果。Image quality scores are performed on the multiple regions based on the image quality evaluation algorithm, and multiple corresponding evaluation results are obtained.
由上述可知,本申请实施例通过获取摄像头采集的预览图像;对该预览图像进行区域划分,得到该预览图像的多个区域;对该多个区域的图像质量进行评估,得到多个评估结果;根据该多个评估结果确定目标区域,并以该目标区域作为中心区域进行拍摄。以此,通过对预览图像划分后的多个区域进行质量评估,得到多个评估结果,并根据评估结果确定出最适合拍照的目标区域,并以该目标区域作为中心区域进行拍摄,实现更为准确的拍 摄构图,提升拍摄质量。It can be seen from the above that the embodiment of the present application obtains a preview image collected by a camera; divides the preview image into regions to obtain multiple regions of the preview image; evaluates the image quality of the multiple regions to obtain multiple evaluation results; The target area is determined according to the multiple evaluation results, and the target area is taken as the central area for shooting. In this way, through the quality evaluation of multiple regions after the preview image is divided, multiple evaluation results are obtained, and the most suitable target area for photographing is determined according to the evaluation results, and the target area is taken as the central area for shooting to achieve more Accurate shooting composition, improve shooting quality.
请一并参阅图7,在某些实施方式中,电子设备500还可以包括:显示器503、射频电路504、音频电路505以及电源506。其中,其中,显示器503、射频电路504、音频电路505以及电源506分别与处理器501电性连接。Please also refer to FIG. 7. In some embodiments, the electronic device 500 may further include a display 503, a radio frequency circuit 504, an audio circuit 505, and a power supply 506. Among them, the display 503, the radio frequency circuit 504, the audio circuit 505, and the power supply 506 are electrically connected to the processor 501, respectively.
该显示器503可以用于显示由用户输入的信息或提供给用户的信息以及各种图形用户接口,这些图形用户接口可以由图形、文本、图标、视频和其任意组合来构成。显示器503可以包括显示面板,在某些实施方式中,可以采用液晶显示器(Liquid Crystal Display,LCD)、或者有机发光二极管(Organic Light-Emitting Diode,OLED)等形式来配置显示面板。The display 503 may be used to display information input by the user or information provided to the user, and various graphical user interfaces. These graphical user interfaces may be composed of graphics, text, icons, videos, and any combination thereof. The display 503 may include a display panel. In some embodiments, the display panel may be configured in the form of a liquid crystal display (LCD) or an organic light-emitting diode (OLED).
该射频电路504可以用于收发射频信号,以通过无线通信与网络设备或其他电子设备建立无线通讯,与网络设备或其他电子设备之间收发信号。The radio frequency circuit 504 can be used to transmit and receive radio frequency signals to establish wireless communication with network equipment or other electronic equipment through wireless communication, and to transmit and receive signals with the network equipment or other electronic equipment.
该音频电路505可以用于通过扬声器、传声器提供用户与电子设备之间的音频接口。The audio circuit 505 can be used to provide an audio interface between the user and the electronic device through a speaker or a microphone.
该电源506可以用于给电子设备500的各个部件供电。在一些实施例中,电源506可以通过电源管理系统与处理器501逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。The power supply 506 can be used to supply power to various components of the electronic device 500. In some embodiments, the power supply 506 may be logically connected to the processor 501 through a power management system, so that functions such as charging, discharging, and power consumption management can be managed through the power management system.
尽管图7中未示出,电子设备500还可以包括摄像头、蓝牙模块等,在此不再赘述。Although not shown in FIG. 7, the electronic device 500 may also include a camera, a Bluetooth module, etc., which will not be repeated here.
本申请实施例还提供一种存储介质,该存储介质存储有计算机程序,当该计算机程序在计算机上运行时,使得该计算机执行上述任一实施例中的图像处理方法,比如:获取摄像头采集的预览图像;对该预览图像进行区域划分,得到该预览图像的多个区域;对该多个区域的图像质量进行评估,得到多个评估结果;根据该多个评估结果确定目标区域,并以该目标区域作为中心区域进行拍摄。The embodiments of the present application also provide a storage medium that stores a computer program, and when the computer program is run on a computer, the computer is caused to execute the image processing method in any of the above embodiments, such as: acquiring data collected by a camera. Preview image; divide the preview image to obtain multiple areas of the preview image; evaluate the image quality of the multiple areas to obtain multiple evaluation results; determine the target area according to the multiple evaluation results, and use the The target area is taken as the center area for shooting.
在本申请实施例中,存储介质可以是磁碟、光盘、只读存储器(Read Only Memory,ROM)、或者随机存取记忆体(Random Access Memory,RAM)等。In the embodiment of the present application, the storage medium may be a magnetic disk, an optical disk, a read only memory (Read Only Memory, ROM), or a random access memory (Random Access Memory, RAM), etc.
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。In the above-mentioned embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in an embodiment, reference may be made to related descriptions of other embodiments.
需要说明的是,对本申请实施例的图像处理方法而言,本领域普通测试人员可以理解实现本申请实施例的图像处理方法的全部或部分流程,是可以通过计算机程序来控制相关的硬件来完成,该计算机程序可存储于一计算机可读取存储介质中,如存储在电子设备的存储器中,并被该电子设备内的至少一个处理器执行,在执行过程中可包括如图像处理方法的实施例的流程。其中,该的存储介质可为磁碟、光盘、只读存储器、随机存取记忆体 等。It should be noted that for the image processing method of the embodiment of the present application, ordinary testers in the field can understand that all or part of the process of implementing the image processing method of the embodiment of the present application can be completed by controlling the relevant hardware through a computer program. The computer program can be stored in a computer readable storage medium, such as stored in the memory of an electronic device, and executed by at least one processor in the electronic device, and the execution process can include, for example, the implementation of an image processing method Example process. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only memory, a random access memory, and the like.
对本申请实施例的图像处理装置而言,其各功能模块可以集成在一个处理芯片中,也可以是各个模块单独物理存在,也可以两个或两个以上模块集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。该集成的模块如果以软件功能模块的形式实现并作为独立的产品销售或使用时,也可以存储在一个计算机可读取存储介质中,该存储介质譬如为只读存储器,磁盘或光盘等。For the image processing apparatus of the embodiment of the present application, its functional modules may be integrated into one processing chip, or each module may exist alone physically, or two or more modules may be integrated into one module. The above-mentioned integrated modules can be implemented in the form of hardware or software functional modules. If the integrated module is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer readable storage medium, such as a read-only memory, a magnetic disk, or an optical disk.
以上对本申请实施例所提供的一种图像处理方法、装置、存储介质及电子设备进行了详细介绍,本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想;同时,对于本领域的技术人员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本申请的限制。The above describes in detail an image processing method, device, storage medium, and electronic equipment provided by the embodiments of the present application. Specific examples are used in this article to illustrate the principles and implementation of the present application. The description of the above embodiments is only It is used to help understand the method and core idea of this application; at the same time, for those skilled in the art, according to the idea of this application, there will be changes in the specific implementation and the scope of application. In summary, this specification The content should not be construed as a limitation on this application.

Claims (20)

  1. 一种图像处理方法,其中,包括:An image processing method, which includes:
    获取摄像头采集的预览图像;Obtain the preview image collected by the camera;
    对所述预览图像进行区域划分,得到所述预览图像的多个区域;Performing area division on the preview image to obtain multiple areas of the preview image;
    对所述多个区域的图像质量进行评估,得到多个评估结果;Evaluating the image quality of the multiple regions to obtain multiple evaluation results;
    根据所述多个评估结果确定目标区域,并以所述目标区域作为中心区域进行拍摄。The target area is determined according to the multiple evaluation results, and the target area is taken as the central area for shooting.
  2. 根据权利要求1所述的方法,其中,所述对所述预览图像进行区域划分,得到所述预览图像的多个区域,包括:The method according to claim 1, wherein said dividing the preview image into regions to obtain multiple regions of the preview image comprises:
    确定所述预览图像的像素值;Determining the pixel value of the preview image;
    基于所述预览图像的像素值和预设比例对所述预览图像进行划分,得到多个区域。The preview image is divided based on the pixel value of the preview image and the preset ratio to obtain multiple regions.
  3. 根据权利要求2所述的方法,其中,所述得到多个区域,包括:The method according to claim 2, wherein said obtaining a plurality of regions comprises:
    对所述多个区域分别进行区域标记,所述区域标记用于指示所述多个区域中每一区域的位置;Performing area marks on the multiple areas respectively, where the area marks are used to indicate the position of each area in the multiple areas;
    基于所述区域标记结果确定所述多个区域中的中心区域以及非中心区域。A central area and a non-central area in the plurality of areas are determined based on the area marking result.
  4. 根据权利要求1所述的方法,其中,所述根据所述多个评估结果确定目标区域,并以所述目标区域作为中心区域进行拍摄,包括:The method according to claim 1, wherein the determining a target area according to the multiple evaluation results and taking the target area as a central area for shooting comprises:
    当中心区域的评估结果不小于非中心区域的评估结果时,将中心区域作为目标区域,并将预览图像作为目标拍摄图像;When the evaluation result of the central area is not less than the evaluation result of the non-central area, the central area is taken as the target area, and the preview image is taken as the target shooting image;
    当中心区域的评估结果小于非中心区域的评估结果时,根据评估结果最大的非中心区域与中心区域之间的位置关系调整摄像头的拍摄角度。When the evaluation result of the central area is smaller than the evaluation result of the non-central area, the shooting angle of the camera is adjusted according to the positional relationship between the non-central area and the central area with the largest evaluation result.
  5. 根据权利要求4所述的方法,其中,所述根据评估结果最大的非中心区域与中心区域之间的位置关系调整摄像头的拍摄角度,包括:The method according to claim 4, wherein the adjusting the shooting angle of the camera according to the positional relationship between the non-central area and the central area with the largest evaluation result comprises:
    当所述评估结果最大的非中心区域的数量为单个时,向所述评估结果最大的非中心区域对应的预览图像的对角线位置调整摄像头的拍摄角度;When the number of non-central regions with the largest evaluation result is single, adjust the shooting angle of the camera to the diagonal position of the preview image corresponding to the non-central region with the largest evaluation result;
    当所述评估结果最大的非中心区域的数量为两个时,判断两个评估结果最大的非中心区域是否存在公共边;When the number of non-central regions with the largest evaluation result is two, determine whether the two non-central regions with the largest evaluation result have a common edge;
    当存在公共边时,根据两个评估结果最大的非中心区域的公共边与中心区域之间的位置关系调整摄像头的拍摄角度。When there is a common edge, adjust the shooting angle of the camera according to the positional relationship between the common edge of the non-central area and the central area of the two largest evaluation results.
  6. 根据权利要求5所述的方法,其中,所述向所述评估结果最大的非中心区域对应的 预览图像的对角线位置调整摄像头的拍摄角度,包括:The method according to claim 5, wherein the adjusting the shooting angle of the camera to the diagonal position of the preview image corresponding to the non-central area with the largest evaluation result comprises:
    计算所述评估结果最大的非中心区域与中心区域之间的评估差值;Calculating the evaluation difference between the non-central area and the central area with the largest evaluation result;
    根据所述评估差值确定评估结果最大的非中心区域对应的预览图像的对角线方向上的调整角度;Determining, according to the evaluation difference, an adjustment angle in the diagonal direction of the preview image corresponding to the non-central area with the largest evaluation result;
    响应所述调整角度,对所述摄像头的拍摄角度进行调整。In response to the adjustment angle, the shooting angle of the camera is adjusted.
  7. 根据权利要求5所述的方法,其中,所述根据两个评估结果最大的非中心区域的公共边与中心区域之间的位置关系调整摄像头的拍摄角度,包括:The method according to claim 5, wherein the adjusting the shooting angle of the camera according to the positional relationship between the common side of the non-central area and the central area of the two largest evaluation results comprises:
    计算两个评估结果最大的非中心区域与中心区域之间的评估差值;Calculate the evaluation difference between the two non-central areas with the largest evaluation results and the central area;
    根据所述评估差值确定评估结果最大的两个非中心区域的公共边方向上的调整角度;Determining the adjustment angles in the common side direction of the two non-central regions with the largest evaluation result according to the evaluation difference;
    响应所述调整角度,对所述摄像头的拍摄角度进行调整。In response to the adjustment angle, the shooting angle of the camera is adjusted.
  8. 根据权利要求6所述的方法,其中,所述响应所述调整角度,对所述摄像头的拍摄角度进行调整,包括:The method according to claim 6, wherein the adjusting the shooting angle of the camera in response to the adjusting angle comprises:
    根据所述调整角度生成提示信息;Generating prompt information according to the adjustment angle;
    基于提示信息指导用户对所述摄像头的拍摄角度进行调整。Guide the user to adjust the shooting angle of the camera based on the prompt information.
  9. 根据权利要求1所述的方法,其中,对所述多个区域的图像质量进行评估,得到多个评估结果,包括:The method according to claim 1, wherein evaluating the image quality of the plurality of regions to obtain a plurality of evaluation results comprises:
    基于图像质量评估算法分别对所述多个区域进行图像质量评分,得到相应的多个评估结果。Image quality scores are performed on the multiple regions based on the image quality assessment algorithm, and corresponding multiple assessment results are obtained.
  10. 一种图像处理装置,其中,包括:An image processing device, which includes:
    获取单元,用于获取摄像头采集的预览图像;An acquiring unit for acquiring the preview image collected by the camera;
    划分单元,用于对所述预览图像进行区域划分,得到所述预览图像的多个区域;A dividing unit, configured to divide the preview image into regions to obtain multiple regions of the preview image;
    评估单元,用于对所述多个区域的图像质量进行评估,得到多个评估结果;An evaluation unit, configured to evaluate the image quality of the multiple regions to obtain multiple evaluation results;
    确定单元,根据所述多个评估结果确定目标区域,并以所述目标区域作为中心区域进行拍摄。The determining unit determines a target area according to the multiple evaluation results, and takes the target area as a central area for shooting.
  11. 一种计算机可读存储介质,其中,所述存储介质存储有多条指令,所述指令适于处理器进行加载,以执行权利要求以执行权利要求1所述的一种图像处理方法中的步骤。A computer-readable storage medium, wherein the storage medium stores a plurality of instructions, and the instructions are suitable for loading by a processor to execute the claims to perform the steps in the image processing method of claim 1 .
  12. 一种电子设备,包括处理器和存储器,所述存储器有计算机程序,其中,所述处理器通过调用所述计算机程序,用于执行:An electronic device including a processor and a memory, the memory having a computer program, wherein the processor is configured to execute:
    获取摄像头采集的预览图像;Obtain the preview image collected by the camera;
    对所述预览图像进行区域划分,得到所述预览图像的多个区域;Performing area division on the preview image to obtain multiple areas of the preview image;
    对所述多个区域的图像质量进行评估,得到多个评估结果;Evaluating the image quality of the multiple regions to obtain multiple evaluation results;
    根据所述多个评估结果确定目标区域,并以所述目标区域作为中心区域进行拍摄。The target area is determined according to the multiple evaluation results, and the target area is taken as the central area for shooting.
  13. 根据权利要求12所述的电子设备,其中,所述处理器用于执行:The electronic device according to claim 12, wherein the processor is configured to execute:
    确定所述预览图像的像素值;Determining the pixel value of the preview image;
    基于所述预览图像的像素值和预设比例对所述预览图像进行划分,得到多个区域。The preview image is divided based on the pixel value of the preview image and the preset ratio to obtain multiple regions.
  14. 根据权利要求13所述的电子设备,其中,所述处理器用于执行:The electronic device according to claim 13, wherein the processor is configured to execute:
    对所述多个区域分别进行区域标记,所述区域标记用于指示所述多个区域中每一区域的位置;Performing area marks on the multiple areas respectively, where the area marks are used to indicate the position of each area in the multiple areas;
    基于所述区域标记结果确定所述多个区域中的中心区域以及非中心区域。A central area and a non-central area in the plurality of areas are determined based on the area marking result.
  15. 根据权利要求12所述的电子设备,其中,所述处理器用于执行:The electronic device according to claim 12, wherein the processor is configured to execute:
    当中心区域的评估结果不小于非中心区域的评估结果时,将中心区域作为目标区域,并将预览图像作为目标拍摄图像;When the evaluation result of the central area is not less than the evaluation result of the non-central area, the central area is taken as the target area, and the preview image is taken as the target shooting image;
    当中心区域的评估结果小于非中心区域的评估结果时,根据评估结果最大的非中心区域与中心区域之间的位置关系调整摄像头的拍摄角度。When the evaluation result of the central area is smaller than the evaluation result of the non-central area, the shooting angle of the camera is adjusted according to the positional relationship between the non-central area and the central area with the largest evaluation result.
  16. 根据权利要求15所述的电子设备,其中,所述处理器用于执行:The electronic device according to claim 15, wherein the processor is configured to execute:
    当所述评估结果最大的非中心区域的数量为单个时,向所述评估结果最大的非中心区域对应的预览图像的对角线位置调整摄像头的拍摄角度;When the number of non-central regions with the largest evaluation result is single, adjust the shooting angle of the camera to the diagonal position of the preview image corresponding to the non-central region with the largest evaluation result;
    当所述评估结果最大的非中心区域的数量为两个时,判断两个评估结果最大的非中心区域是否存在公共边;When the number of non-central regions with the largest evaluation result is two, determine whether the two non-central regions with the largest evaluation result have a common edge;
    当存在公共边时,根据两个评估结果最大的非中心区域的公共边与中心区域之间的位置关系调整摄像头的拍摄角度。When there is a common edge, adjust the shooting angle of the camera according to the positional relationship between the common edge of the non-central area and the central area of the two largest evaluation results.
  17. 根据权利要求16所述的电子设备,其中,所述处理器用于执行:The electronic device according to claim 16, wherein the processor is configured to execute:
    计算所述评估结果最大的非中心区域与中心区域之间的评估差值;Calculating the evaluation difference between the non-central area and the central area with the largest evaluation result;
    根据所述评估差值确定评估结果最大的非中心区域对应的预览图像的对角线方向上的调整角度;Determining, according to the evaluation difference, an adjustment angle in the diagonal direction of the preview image corresponding to the non-central area with the largest evaluation result;
    响应所述调整角度,对所述摄像头的拍摄角度进行调整。In response to the adjustment angle, the shooting angle of the camera is adjusted.
  18. 根据权利要求16所述的电子设备,其中,所述处理器用于执行:The electronic device according to claim 16, wherein the processor is configured to execute:
    计算两个评估结果最大的非中心区域与中心区域之间的评估差值;Calculate the evaluation difference between the two non-central areas with the largest evaluation results and the central area;
    根据所述评估差值确定评估结果最大的两个非中心区域的公共边方向上的调整角度;Determining the adjustment angles in the common side direction of the two non-central regions with the largest evaluation result according to the evaluation difference;
    响应所述调整角度,对所述摄像头的拍摄角度进行调整。In response to the adjustment angle, the shooting angle of the camera is adjusted.
  19. 根据权利要求17所述的电子设备,其中,所述处理器用于执行:The electronic device according to claim 17, wherein the processor is configured to execute:
    根据所述调整角度生成提示信息;Generating prompt information according to the adjustment angle;
    基于提示信息指导用户对所述摄像头的拍摄角度进行调整。Guide the user to adjust the shooting angle of the camera based on the prompt information.
  20. 根据权利要求12所述的电子设备,其中,所述处理器用于执行:The electronic device according to claim 12, wherein the processor is configured to execute:
    基于图像质量评估算法分别对所述多个区域进行图像质量评分,得到相应的多个评估结果。Image quality scores are performed on the multiple regions based on the image quality assessment algorithm, and corresponding multiple assessment results are obtained.
PCT/CN2020/136777 2019-12-31 2020-12-16 Image processing method and apparatus, storage medium, and electronic device WO2021135945A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201911421569.4A CN111182212B (en) 2019-12-31 2019-12-31 Image processing method, image processing apparatus, storage medium, and electronic device
CN201911421569.4 2019-12-31

Publications (1)

Publication Number Publication Date
WO2021135945A1 true WO2021135945A1 (en) 2021-07-08

Family

ID=70655968

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/136777 WO2021135945A1 (en) 2019-12-31 2020-12-16 Image processing method and apparatus, storage medium, and electronic device

Country Status (2)

Country Link
CN (1) CN111182212B (en)
WO (1) WO2021135945A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114710655A (en) * 2022-03-17 2022-07-05 苏州万店掌网络科技有限公司 Camera definition detection method, device, equipment and medium

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111182212B (en) * 2019-12-31 2021-08-24 Oppo广东移动通信有限公司 Image processing method, image processing apparatus, storage medium, and electronic device
CN111464795B (en) * 2020-05-22 2022-07-26 联想(北京)有限公司 Method and device for realizing configuration of monitoring equipment and electronic equipment
CN113938671B (en) * 2020-07-14 2023-05-23 北京灵汐科技有限公司 Image content analysis method, image content analysis device, electronic equipment and storage medium
CN112019739A (en) * 2020-08-03 2020-12-01 RealMe重庆移动通信有限公司 Shooting control method and device, electronic equipment and storage medium
CN111970455B (en) * 2020-09-14 2022-01-11 Oppo广东移动通信有限公司 Information prompting method and device, electronic equipment and storage medium

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1691740A (en) * 2004-04-23 2005-11-02 欧姆龙株式会社 Magnified display apparatus and magnified image control apparatus
CN101494737A (en) * 2009-03-09 2009-07-29 杭州海康威视数字技术股份有限公司 Integrated camera device and self-adapting automatic focus method
US20140085451A1 (en) * 2012-09-24 2014-03-27 Fujitsu Limited Gaze detection apparatus, gaze detection computer program, and display apparatus
CN106464755A (en) * 2015-02-28 2017-02-22 华为技术有限公司 Method for automatically adjusting camera and electronic device
CN108093174A (en) * 2017-12-15 2018-05-29 北京臻迪科技股份有限公司 Patterning process, device and the photographing device of photographing device
CN108174185A (en) * 2016-12-07 2018-06-15 中兴通讯股份有限公司 A kind of photographic method, device and terminal
CN108989666A (en) * 2018-06-26 2018-12-11 Oppo(重庆)智能科技有限公司 Image pickup method, device, mobile terminal and computer-readable storage medium
CN109996051A (en) * 2017-12-31 2019-07-09 广景视睿科技(深圳)有限公司 A kind of trend projecting method that view field is adaptive, apparatus and system
CN111182212A (en) * 2019-12-31 2020-05-19 Oppo广东移动通信有限公司 Image processing method, image processing apparatus, storage medium, and electronic device

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010134309A (en) * 2008-12-08 2010-06-17 Renesas Electronics Corp Autofocus device, autofocus method and imaging apparatus
US9449248B1 (en) * 2015-03-12 2016-09-20 Adobe Systems Incorporated Generation of salient contours using live video
CN105007410B (en) * 2015-06-30 2018-01-23 广东欧珀移动通信有限公司 A kind of big visual angle camera control method and user terminal
CN107635095A (en) * 2017-09-20 2018-01-26 广东欧珀移动通信有限公司 Shoot method, apparatus, storage medium and the capture apparatus of photo
CN108668086B (en) * 2018-08-16 2021-05-04 Oppo广东移动通信有限公司 Automatic focusing method and device, storage medium and terminal
CN109978884B (en) * 2019-04-30 2020-06-30 恒睿(重庆)人工智能技术研究院有限公司 Multi-person image scoring method, system, equipment and medium based on face analysis

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1691740A (en) * 2004-04-23 2005-11-02 欧姆龙株式会社 Magnified display apparatus and magnified image control apparatus
CN101494737A (en) * 2009-03-09 2009-07-29 杭州海康威视数字技术股份有限公司 Integrated camera device and self-adapting automatic focus method
US20140085451A1 (en) * 2012-09-24 2014-03-27 Fujitsu Limited Gaze detection apparatus, gaze detection computer program, and display apparatus
CN106464755A (en) * 2015-02-28 2017-02-22 华为技术有限公司 Method for automatically adjusting camera and electronic device
CN108174185A (en) * 2016-12-07 2018-06-15 中兴通讯股份有限公司 A kind of photographic method, device and terminal
CN108093174A (en) * 2017-12-15 2018-05-29 北京臻迪科技股份有限公司 Patterning process, device and the photographing device of photographing device
CN109996051A (en) * 2017-12-31 2019-07-09 广景视睿科技(深圳)有限公司 A kind of trend projecting method that view field is adaptive, apparatus and system
CN108989666A (en) * 2018-06-26 2018-12-11 Oppo(重庆)智能科技有限公司 Image pickup method, device, mobile terminal and computer-readable storage medium
CN111182212A (en) * 2019-12-31 2020-05-19 Oppo广东移动通信有限公司 Image processing method, image processing apparatus, storage medium, and electronic device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114710655A (en) * 2022-03-17 2022-07-05 苏州万店掌网络科技有限公司 Camera definition detection method, device, equipment and medium

Also Published As

Publication number Publication date
CN111182212B (en) 2021-08-24
CN111182212A (en) 2020-05-19

Similar Documents

Publication Publication Date Title
WO2021135945A1 (en) Image processing method and apparatus, storage medium, and electronic device
WO2019109801A1 (en) Method and device for adjusting photographing parameter, storage medium, and mobile terminal
US10565696B2 (en) Systems and methods for producing image feedback
JP6357589B2 (en) Image display method, apparatus, program, and recording medium
KR101643975B1 (en) System and method for dynamic adaption of media based on implicit user input and behavior
US20210306559A1 (en) Photographing methods and devices
US11158057B2 (en) Device, method, and graphical user interface for processing document
WO2020082902A1 (en) Sound effect processing method for video, and related products
WO2022028184A1 (en) Photography control method and apparatus, electronic device, and storage medium
US10847073B2 (en) Image display optimization method and apparatus
WO2019134502A1 (en) Photographing method and device, storage medium, and electronic apparatus
WO2017092289A1 (en) Image processing method and device
US10586308B2 (en) Digital media environment for removal of obstructions in a digital image scene
CN110619350B (en) Image detection method, device and storage medium
WO2022183902A1 (en) Image definition determination method and apparatus, and device and storage medium
US9953220B2 (en) Cutout object merge
US20150213609A1 (en) Image Cropping Suggestion
US10706512B2 (en) Preserving color in image brightness adjustment for exposure fusion
WO2017032035A1 (en) Method and device for adjusting, and terminal
KR20160078929A (en) Automatic processing of images
US11792351B2 (en) Image processing method, electronic device, and computer-readable storage medium
WO2019120025A1 (en) Photograph adjustment method and apparatus, storage medium and electronic device
WO2020114097A1 (en) Boundary box determining method and apparatus, electronic device, and storage medium
US11222208B2 (en) Portrait image evaluation based on aesthetics
WO2021136035A1 (en) Photographing method and apparatus, storage medium, and electronic device

Legal Events

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

Ref document number: 20908514

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20908514

Country of ref document: EP

Kind code of ref document: A1