CN111263066A - Composition guiding method, composition guiding device, electronic equipment and storage medium - Google Patents

Composition guiding method, composition guiding device, electronic equipment and storage medium Download PDF

Info

Publication number
CN111263066A
CN111263066A CN202010100113.4A CN202010100113A CN111263066A CN 111263066 A CN111263066 A CN 111263066A CN 202010100113 A CN202010100113 A CN 202010100113A CN 111263066 A CN111263066 A CN 111263066A
Authority
CN
China
Prior art keywords
human body
preview image
ratio
scene
height
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202010100113.4A
Other languages
Chinese (zh)
Other versions
CN111263066B (en
Inventor
薛致远
李亚乾
蒋燚
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN202010100113.4A priority Critical patent/CN111263066B/en
Publication of CN111263066A publication Critical patent/CN111263066A/en
Application granted granted Critical
Publication of CN111263066B publication Critical patent/CN111263066B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/61Control of cameras or camera modules based on recognised objects
    • H04N23/611Control of cameras or camera modules based on recognised objects where the recognised objects include parts of the human body
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/63Control of cameras or camera modules by using electronic viewfinders
    • H04N23/631Graphical user interfaces [GUI] specially adapted for controlling image capture or setting capture parameters
    • H04N23/632Graphical user interfaces [GUI] specially adapted for controlling image capture or setting capture parameters for displaying or modifying preview images prior to image capturing, e.g. variety of image resolutions or capturing parameters
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/63Control of cameras or camera modules by using electronic viewfinders
    • H04N23/633Control of cameras or camera modules by using electronic viewfinders for displaying additional information relating to control or operation of the camera
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/64Computer-aided capture of images, e.g. transfer from script file into camera, check of taken image quality, advice or proposal for image composition or decision on when to take image
    • 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/67Focus control based on electronic image sensor signals

Abstract

The embodiment of the application discloses a composition guiding method, a composition guiding device, electronic equipment and a storage medium, wherein the composition guiding method comprises the following steps: acquiring a preview image of a scene to be shot; acquiring the area ratio of the human face of a human body in a scene to be shot in a preview image; when the area ratio is larger than a first preset ratio, outputting first prompt information for adjusting the shooting focal length of the electronic equipment according to the area ratio; and when the area ratio is smaller than or equal to a first preset ratio, acquiring the height and the width of the human body in the preview image, and outputting second prompt information for adjusting the shooting focal length of the electronic equipment according to the height and the width of the human body in the preview image. According to the embodiment of the application, the user is prompted to adjust the shooting focal length of the electronic equipment according to the different area ratios of the faces in the preview image or the height and the width of the human body respectively, so that the user is guided to reasonably compose the picture during shooting, and a high-quality picture is shot.

Description

Composition guiding method, composition guiding device, electronic equipment and storage medium
Technical Field
The present application relates to the field of electronic technologies, and in particular, to a composition guidance method and apparatus, an electronic device, and a storage medium.
Background
With the continuous development of science and technology, the pixels of cameras on electronic devices such as smart phones are higher and higher, so that more and more users tend to take pictures by using the electronic devices such as smart phones. In order to meet the photographing requirements of users, electronic equipment manufacturers continuously update and upgrade electronic equipment hardware so as to improve photographing pixels of the electronic equipment. However, to take a high-quality picture, the camera of the electronic device is required to have a high resolution, and the user himself/herself should have a certain professional shooting skill, such as reasonably using composition. However, most users do not have professional shooting skills, cannot reasonably use composition, and cannot take high-quality photographs.
Disclosure of Invention
The embodiment of the application provides a composition guidance method, a composition guidance device, electronic equipment and a storage medium, which can guide a user to reasonably compose a composition during shooting.
The embodiment of the application provides a composition guiding method, which is applied to electronic equipment, wherein the composition guiding method comprises the following steps:
acquiring a preview image of a scene to be shot;
acquiring the area ratio of the human face of the human body in the scene to be shot in the preview image;
when the area ratio is larger than a first preset ratio, outputting first prompt information for adjusting the shooting focal length of the electronic equipment according to the area ratio;
and when the area ratio is smaller than or equal to the first preset ratio, acquiring the height and the width of the human body in the preview image, and outputting second prompt information for adjusting the shooting focal length of the electronic equipment according to the height and the width of the human body in the preview image.
The embodiment of the present application further provides a composition guiding apparatus, which is applied to an electronic device, wherein the composition guiding apparatus includes:
the first acquisition module is used for acquiring a preview image of a scene to be shot;
the second acquisition module is used for acquiring the area ratio of the human face of the human body in the scene to be shot in the preview image;
the first prompting module is used for outputting first prompting information for adjusting the shooting focal length of the electronic equipment according to the area ratio when the area ratio is larger than a first preset ratio;
and the second prompting module is used for acquiring the height and the width of the human body in the preview image when the area ratio is smaller than or equal to the first preset ratio, and outputting second prompting information for adjusting the shooting focal length of the electronic equipment according to the height and the width of the human body in the preview image.
The embodiment of the present application further provides an electronic device, where the electronic device includes a processor and a memory, the memory stores a computer program, and the processor calls the computer program stored in the memory to execute any step in the composition guidance method provided in the embodiment of the present invention.
The embodiment of the present invention further provides a storage medium, where the storage medium stores a computer program, and when the computer program runs on a computer, the computer program causes the computer to execute any of the steps in the composition guidance method provided by the embodiment of the present invention.
In the embodiment of the application, the electronic equipment acquires a preview image of a scene to be shot; acquiring the area ratio of the human face of a human body in a scene to be shot in a preview image; when the area ratio is larger than a first preset ratio, outputting first prompt information for adjusting the shooting focal length of the electronic equipment according to the area ratio; and when the area ratio is smaller than or equal to a first preset ratio, acquiring the height and the width of the human body in the preview image, and outputting second prompt information for adjusting the shooting focal length of the electronic equipment according to the height and the width of the human body in the preview image. According to the embodiment of the application, the user is prompted to adjust the shooting focal length of the electronic equipment according to the different area ratios of the faces in the preview image or the height and the width of the human body respectively, so that the user is guided to reasonably compose the picture during shooting, and a high-quality picture is shot.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings used in the description of the embodiments will be briefly introduced below. It is obvious that the drawings in the following description are only some embodiments of the application, and that for a person skilled in the art, other drawings can be derived from them without inventive effort.
Fig. 1 is a first flowchart of a composition guidance method provided in an embodiment of the present application.
Fig. 2 is a schematic diagram of a human body frame according to an embodiment of the present application.
Fig. 3 is a schematic diagram of a human body image provided in an embodiment of the present application.
Fig. 4 is a schematic diagram of human body key points provided in the present application.
Fig. 5 is a second flowchart of a composition guidance method provided in an embodiment of the present application.
FIG. 6 is a schematic diagram of a first structure of a composition guiding apparatus according to an embodiment of the present application.
FIG. 7 is a schematic diagram of a second structure of a patterning guidance device according to an embodiment of the present application.
FIG. 8 is a schematic diagram of a third structure of a patterning guidance device according to an embodiment of the present application.
FIG. 9 is a schematic diagram of a fourth structure of a patterning guidance device according to an embodiment of the present application.
Fig. 10 is a schematic structural diagram of a first electronic device according to an embodiment of the present application.
Fig. 11 is a second structural schematic diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. It is to be understood that the embodiments described are only a few embodiments of the present application and not all embodiments. All embodiments obtained by a person skilled in the art based on the embodiments in the present application without any inventive step are within the scope of the present invention.
The terms "first," "second," "third," and the like in the description and in the claims, as well as in the drawings, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the objects so described are interchangeable under appropriate circumstances. Furthermore, the terms "comprising" and "having," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, or apparatus, terminal, system comprising a list of steps is not necessarily limited to those steps or modules or elements expressly listed, and may include other steps or modules or elements not expressly listed, or inherent to such process, method, apparatus, terminal, or system.
The embodiment of the application firstly provides a composition guiding method, and the composition guiding method is applied to electronic equipment. The execution main body of the composition guiding method may be the composition guiding device provided in the embodiment of the present application, or an electronic device integrated with the composition guiding device, where the composition guiding device may be implemented in a hardware or software manner, and the electronic device may be a device with processing capability and configured with a processor, such as a smart phone, a tablet computer, a palmtop computer, a notebook computer, or a desktop computer.
Referring to fig. 1, fig. 1 is a schematic flow chart of a composition guidance method according to an embodiment of the present application. The composition guidance method is applied to the electronic device provided by the embodiment of the application, and the composition guidance method provided by the embodiment of the application can comprise the following steps:
101, acquiring a preview image of a scene to be shot.
The electronic equipment can comprise one or more cameras, and previews the scene to be shot through the cameras to obtain a preview image of the scene to be shot. After the electronic device starts a shooting application program (for example, a system application "camera" of the electronic device) according to a user operation, a scene aimed at by a camera of the electronic device is a scene to be shot. For example, after a user clicks an icon of a "camera" application on the electronic device through a finger to start the "camera application", if the user uses a camera of the electronic device to aim at a certain scene, the scene is the scene to be shot. From the above description, it will be understood by those skilled in the art that the scene to be shot is not specific to a particular scene, but is aligned in real time following the orientation of the camera.
The electronic equipment can also comprise a view frame, and a picture previewing a scene to be shot by the camera can be displayed in the view frame. When the electronic equipment realizes the shooting or previewing function, a picture previewed by the camera can be displayed on the display screen. At this time, the display screen of the electronic device serves as a finder frame.
In one embodiment, the preview image of the scene to be photographed may be an infrared thermography image. The electronic equipment detects the infrared radiation energy of each object in the scene to be shot, and converts the infrared radiation energy of each object in the scene to be shot into an infrared thermal imaging graph of the scene to be shot through means of photoelectric conversion, signal processing and the like. The surface temperature of different objects is different, the infrared radiation condition is different, and the imaging condition on the infrared thermal imaging graph is different, so that different temperature distribution of the surface of each object can be reflected by different colors on the infrared thermal imaging graph. There are various methods for representing different temperature distributions on the surfaces of the objects on the infrared thermal imaging graph, and optionally, a gray scale graph can be used for representing, and the higher the temperature of the surface of the object is, the brighter the color of the object to be analyzed on the infrared thermal imaging graph is. By analyzing the color distribution on the infrared thermographic image, each object in the scene to be photographed can be identified. The infrared thermal imaging technology is used for converting the thermal radiation emitted by the object into the image of visible light, so that the object in the scene to be shot can be accurately identified even in dark night without being influenced by the brightness of the external environment.
The preview image of the scene to be shot can be displayed on the shooting preview interface, and a user can observe the scene to be shot in real time through the preview image displayed on the shooting preview interface, so that the shooting posture of the camera is adjusted, and a better shooting effect is obtained. Alternatively, the preview image of the scene to be photographed may not be displayed, but may be processed directly in the background. The preview image of the scene to be photographed includes, but is not limited to, the form of the infrared thermal imaging graph exemplified above.
102, acquiring the area ratio of the human face of the human body in the scene to be shot in the preview image.
In one embodiment, a preview image of a scene to be photographed is input into a human body detection algorithm trained in advance, and when a human body exists in the preview image, the human body detection algorithm outputs a human body frame of the human body. The human body rectangular frame of the human body is selected as a frame and is represented by two coordinate points of the upper left and the lower right of the human body rectangular frame.
For example, the human detection algorithm may include Histogram of Oriented Gradients (HOG) and Support Vector Machine (SVM). The human body detection algorithm firstly divides an input preview image into a plurality of small connected regions (cell units), then collects the direction histograms of the gradients or edges of all pixel points in each region, combines the histograms, and extracts the direction gradient histogram characteristics of the regions.
And pre-training an SVM model for human body detection by using the feature map obtained by the images in the training set and the labeled human body position, wherein the SVM model can receive the HOG feature map of the images as input and output human body coordinates in the HOG feature map. And inputting the extracted directional gradient histogram features into a pre-trained SVM model for human body detection to obtain one or more human body frames. Referring to fig. 2, fig. 2 is a schematic diagram of a human body frame according to an embodiment of the present application. Wherein, the human body frame is rectangular shape, contains the human body wherein, the human body frame can be represented by two coordinates: vertex coordinates of upper left corner (x)1,y1) And the coordinates of the vertex of the lower right corner (x)2,y2). The vertex coordinates of the lower left corner and the upper right corner, the width and the height of the human body frame, the relative position of the human body frame relative to the whole preview image and the like can all pass through (x)1,y1) And (x)2,y2) And (4) calculating. The number of the human body frames is determined according to the number of human bodies in the preview image.
Referring to fig. 3, fig. 3 is a schematic diagram of a human body image according to an embodiment of the present application. The human body image is intercepted from the preview image according to the obtained human body frame coordinates, the human body image is input into a key detection algorithm for human body key point detection, and 17 key point coordinates of the human body are obtained, wherein the key point detection algorithm can be an OpenPose algorithm, an AEPose algorithm, a CPM algorithm, a Hourglass algorithm, an AlphaPose algorithm and the like.
Taking the openpos algorithm as an example, the algorithm is a key point detection algorithm based on a Convolutional Neural Network (CNN), and can detect key points and an integral skeleton of a human body in an image from bottom to top, wherein an input image of the algorithm can be a single-person image or a multi-person image, and the output of the algorithm is 17 key point coordinates of all detectable human bodies in the image. For example, if there are two human bodies in the input human body image and the two human bodies are detected without any occlusion between them, the keypoint detection algorithm outputs 34 keypoint coordinates of the 2 detectable human bodies.
The OpenPose algorithm adopts a two-branch neural network structure, wherein one branch is responsible for extracting part of the confidence map, and the other branch is responsible for extracting part of the relationship field, so that the joint point connection of all parts of the body of an independent individual in the image is realized. The algorithm adopts a basic network as an image feature extractor, such as VGG, MobileNet and the like, as the input of two branches and a plurality of subsequent stages. The two-branch network of the algorithm is further divided into a plurality of stages, wherein starting from the second stage, each stage takes as input the first branch, the second branch and the base feature of the previous stage and the output is supplied to the next stage. And in the last stage, the results of the first branch and the second branch are spliced according to channels to be used as a final output characteristic diagram. The structure of the two branches is completely the same except that the number of the characteristic diagram channels output by the last layer is different.
The OpenPose algorithm outputs 17 human body key points, including: left eye, right eye, left ear, right ear, nose, left shoulder, right shoulder, left elbow, right elbow, left wrist, right wrist, left hip, right hip, left knee, right knee, left ankle, right ankle. Each keypoint is represented by a pair of (x, y) coordinates. In addition, the average values of x and y can be calculated from the left shoulder and right shoulder keypoint coordinates, respectively, as the x and y values of the approximate neck keypoint coordinates. Thus, the key point of the neck is the 18 th key point of the human body.
Referring to fig. 4, fig. 4 is a schematic diagram of human body key points provided in the present application, including a neck key point, where there are 18 key points, and adjacent key points may be drawn with colored lines as connections. The method comprises the steps of obtaining face key points such as a left eye, a right eye, a left ear, a right ear, a nose and a neck among the human body key points, obtaining a face frame according to the face key points, and calculating the area ratio of a human face of a human body in a scene to be shot in a preview image according to the face frame.
Referring to fig. 4, in an embodiment, the height of the face frame is extracted according to the positions of the highest point of the body frame and the key point of the neck, the width of the face frame is extracted according to the positions of the key points of the left ear and the right ear, and the coordinates (x) at the upper left corner of the body frame are extracted from the coordinates (x) of the body frame1,y1) And the coordinates of the lower right corner (x)2,y2) And coordinates (x) of key points of neck in 18 key points obtained by key point detectionneck,yneck) And left ear keypoint coordinates (x)left_ear,yleft_ear) And right ear keypoint coordinates (x)right_ear,yright_ear) The face area is calculated as follows: (height of highest point of human body frame-height of neck key point) × (width of right ear key point-width of left ear key point), namely: (y)1-yneck)*(xright_ear-xleft_ear). The result obtained by calculation is the face area Sface. The face area can be represented by the number of pixels contained in a face frame in the preview image, and the face area does not need to be a specific area value.
And acquiring the area of the preview image, and calculating the area ratio of the face area in the area of the preview image to obtain the area ratio. The area of the preview image can be represented by the number of pixels contained in the preview image, and may not be a specific area value, that is, the area ratio of the human face in the preview image can be the ratio of the number of pixels occupied by the human face frame in the preview image.
103, judging whether the area ratio is larger than a first preset ratio, if so, turning to a step 104, otherwise, turning to a step 105.
And 104, outputting first prompt information for adjusting the shooting focal length of the electronic equipment according to the area ratio.
And when the area ratio is larger than a first preset ratio, outputting first prompt information for adjusting the shooting focal length of the electronic equipment according to the area ratio, wherein the first prompt information is used for prompting to reduce the area ratio of the human face in the preview image.
In an embodiment, when a human body exists in the object to be shot, the human body in the scene to be shot can be identified, and whether the scene to be shot is a global shot or a face close-up is judged by judging whether the area ratio of the human face of the human body in the scene to be shot in the preview image is larger than a first preset ratio, wherein the global shot is a shot scene taking the human body or other objects as a shooting subject, and the face close-up is a shot scene specially aiming at the human face, for example, a 'big head shot'.
When the area ratio of the human face in the preview image in the scene to be shot is larger than a first preset ratio, the scene to be shot can be judged to be a face close-up scene. When the area ratio of the human face in the preview image in the scene to be shot is smaller than or equal to a first preset ratio, the scene to be shot can be judged to be a global shooting scene.
In the face close-up scene, first prompt information for adjusting the shooting focal length of the electronic equipment is output according to the area proportion of the human face of the human body in the preview image. When the area proportion of the human face in the preview image is too large, first prompt information can be output to prompt a user to adjust the shooting focal length of the electronic equipment, so that the composition of the human face in the preview image is as beautiful as possible. That is, in an embodiment, outputting the first prompt information for adjusting the shooting focal length of the electronic device according to the area ratio may include: and when the area ratio is larger than a second preset ratio, outputting first prompt information for adjusting the shooting focal length of the electronic equipment.
Wherein the second predetermined ratio is greater than the first predetermined ratio. And on the basis that the area ratio is greater than the first preset ratio, further judging whether the area ratio is greater than a second preset ratio. If the area ratio is larger than the first preset ratio and larger than the second preset ratio, outputting first prompt information for adjusting the shooting focal length of the electronic equipment so as to reduce the area ratio of the human face in the preview image; and if the area ratio is greater than the first preset ratio but not greater than the second preset ratio, no prompt is given.
105, the height and width of the human body in the preview image are acquired.
And 106, outputting second prompt information for adjusting the shooting focal length of the electronic equipment according to the height and the width of the human body in the preview image.
And when the area ratio is smaller than or equal to a first preset ratio, acquiring the height and the width of the human body in the preview image, and outputting second prompt information for adjusting the shooting focal length of the electronic equipment according to the height and the width of the human body in the preview image, wherein the second prompt information is used for prompting the increase of the height ratio and the width ratio of the height and the width of the human body in the preview image.
When the area ratio of the human face in the preview image in the scene to be shot is smaller than or equal to the first preset ratio, the scene to be shot can be judged to be a global shooting scene, and the shooting at the moment can be shooting for the whole human body instead of just shooting the human face.
In the global shooting scene, the height and the width of the human body in the preview image are obtained, and second prompt information for adjusting the shooting focal length of the electronic equipment is output according to the height and the width of the human body in the preview image. When the height ratio and the width ratio of the human body in the preview image are both too small, second prompt information can be output to prompt a user to adjust the shooting focal length of the electronic equipment, so that the composition of the human face in the preview image is as beautiful as possible. That is, in an embodiment, outputting the second prompt information for adjusting the shooting focus of the electronic device according to the height and width of the human body in the preview image may include: acquiring the height and width of a preview image; calculating the ratio of the height of the human body frame to the height of the preview image to obtain the height ratio; calculating the ratio of the width of the human body frame to the width of the preview image to obtain the width ratio; and when the height ratio and the width ratio are both smaller than a third preset ratio, outputting second prompt information for adjusting the shooting focal length of the electronic equipment.
In an embodiment, after outputting first prompt information and second prompt information for adjusting a shooting focal length of the electronic device, receiving a focusing operation of a user, acquiring a focused preview image, repeating the above steps, and if the condition for outputting the first prompt information or the second prompt information is still met, continuing prompting by the electronic device until the focused preview image does not meet the condition for outputting the first prompt information or the second prompt information. Or, after the electronic device outputs the first prompt information or the second prompt information suggestion for focusing, the user may also reject the focusing suggestion of the device, reserve the current focal length, and shoot the scene to be shot at the current focal length.
The composition guidance method provided by the embodiment of the application can guide the user to reasonably compose the composition during shooting, but does not limit the composition of the user, and the user can still select the favorite composition mode, so that the composition flexibility is reserved while guidance is provided for the user.
Referring to fig. 5, fig. 5 is a second flowchart of a composition guidance method according to an embodiment of the present application. The text display method is applied to the electronic equipment provided by the embodiment of the application, and the composition guidance method can comprise the following steps:
201. and acquiring a preview image of a scene to be shot.
The electronic equipment can comprise one or more cameras, and previews the scene to be shot through the cameras to obtain a preview image of the scene to be shot. After the electronic device starts a shooting application program (for example, a system application "camera" of the electronic device) according to a user operation, a scene aimed at by a camera of the electronic device is a scene to be shot. For example, after a user clicks an icon of a "camera" application on the electronic device through a finger to start the "camera application", if the user uses a camera of the electronic device to aim at a certain scene, the scene is the scene to be shot. From the above description, it will be understood by those skilled in the art that the scene to be shot is not specific to a particular scene, but is aligned in real time following the orientation of the camera.
The electronic equipment can also comprise a view frame, and a picture previewing a scene to be shot by the camera can be displayed in the view frame. When the electronic equipment realizes the shooting or previewing function, a picture previewed by the camera can be displayed on the display screen. At this time, the display screen of the electronic device serves as a finder frame.
In one embodiment, the preview image of the scene to be photographed may be an infrared thermography image. The electronic equipment detects the infrared radiation energy of each object in the scene to be shot, and converts the infrared radiation energy of each object in the scene to be shot into an infrared thermal imaging graph of the scene to be shot through means of photoelectric conversion, signal processing and the like. The surface temperature of different objects is different, the infrared radiation condition is different, and the imaging condition on the infrared thermal imaging graph is different, so that different temperature distribution of the surface of each object can be reflected by different colors on the infrared thermal imaging graph. There are various methods for representing different temperature distributions on the surfaces of the objects on the infrared thermal imaging graph, and optionally, a gray scale graph can be used for representing, and the higher the temperature of the surface of the object is, the brighter the color of the object to be analyzed on the infrared thermal imaging graph is. By analyzing the color distribution on the infrared thermographic image, each object in the scene to be photographed can be identified. The infrared thermal imaging technology is used for converting the thermal radiation emitted by the object into the image of visible light, so that the object in the scene to be shot can be accurately identified even in dark night without being influenced by the brightness of the external environment.
The preview image of the scene to be shot can be displayed on the shooting preview interface, and a user can observe the scene to be shot in real time through the preview image displayed on the shooting preview interface, so that the shooting posture of the camera is adjusted, and a better shooting effect is obtained. Alternatively, the preview image of the scene to be photographed may not be displayed, but may be processed directly in the background. The preview image of the scene to be photographed includes, but is not limited to, the form of the infrared thermal imaging graph exemplified above.
202. And carrying out human body detection on the preview image to obtain a human body frame.
In one embodiment, a preview image of a scene to be photographed is input into a human body detection algorithm trained in advance, and when a human body exists in the preview image, the human body detection algorithm outputs a human body frame of the human body. The human body rectangular frame of the human body is selected as a frame and is represented by two coordinate points of the upper left and the lower right of the human body rectangular frame.
For example, the human detection algorithm may include Histogram of Oriented Gradients (HOG) and Support Vector Machine (SVM). The human body detection algorithm firstly divides an input preview image into a plurality of small connected regions (cell units), then collects the direction histograms of the gradients or edges of all pixel points in each region, combines the histograms, and extracts the direction gradient histogram characteristics of the regions.
And pre-training an SVM model for human body detection by using the feature map obtained by the images in the training set and the labeled human body position, wherein the SVM model can receive the HOG feature map of the images as input and output human body coordinates in the HOG feature map. And inputting the extracted directional gradient histogram features into a pre-trained SVM model for human body detection to obtain one or more human body frames. Referring to fig. 2, fig. 2 is a schematic diagram of a human body frame according to an embodiment of the present application. Wherein, the human body frame is rectangular shape, contains the human body wherein, the human body frame can be represented by two coordinates: vertex coordinates of upper left corner (x)1,y1) And the coordinates of the vertex of the lower right corner (x)2,y2). The vertex coordinates of the lower left corner and the upper right corner, the width and the height of the human body frame, the relative position of the human body frame relative to the whole preview image and the like can all pass through (x)1,y1) And (x)2,y2) And (4) calculating. The number of the human body frames is determined according to the number of human bodies in the preview image.
203. And intercepting the human body image in the preview image according to the human body frame, and detecting human body key points of the human body image to obtain the human body key points.
Referring to fig. 3, fig. 3 is a schematic diagram of a human body image according to an embodiment of the present application. The human body image is intercepted from the preview image according to the obtained human body frame coordinates, the human body image is input into a key detection algorithm for human body key point detection, and 17 key point coordinates of the human body are obtained, wherein the key point detection algorithm can be an OpenPose algorithm, an AEPose algorithm, a CPM algorithm, a Hourglass algorithm, an AlphaPose algorithm and the like.
Taking the openpos algorithm as an example, the algorithm is a key point detection algorithm based on a Convolutional Neural Network (CNN), and can detect key points and an integral skeleton of a human body in an image from bottom to top, wherein an input image of the algorithm can be a single-person image or a multi-person image, and the output of the algorithm is 17 key point coordinates of all detectable human bodies in the image. For example, if there are two human bodies in the input human body image and the two human bodies are detected without any occlusion between them, the keypoint detection algorithm outputs 34 keypoint coordinates of the 2 detectable human bodies.
The OpenPose algorithm adopts a two-branch neural network structure, wherein one branch is responsible for extracting part of the confidence map, and the other branch is responsible for extracting part of the relationship field, so that the joint point connection of all parts of the body of an independent individual in the image is realized. The algorithm adopts a basic network as an image feature extractor, such as VGG, MobileNet and the like, as the input of two branches and a plurality of subsequent stages. The two-branch network of the algorithm is further divided into a plurality of stages, wherein starting from the second stage, each stage takes as input the first branch, the second branch and the base feature of the previous stage and the output is supplied to the next stage. And in the last stage, the results of the first branch and the second branch are spliced according to channels to be used as a final output characteristic diagram. The structure of the two branches is completely the same except that the number of the characteristic diagram channels output by the last layer is different.
The OpenPose algorithm outputs 17 human body key points, including: left eye, right eye, left ear, right ear, nose, left shoulder, right shoulder, left elbow, right elbow, left wrist, right wrist, left hip, right hip, left knee, right knee, left ankle, right ankle. Each keypoint is represented by a pair of (x, y) coordinates. In addition, the average values of x and y can be calculated from the left shoulder and right shoulder keypoint coordinates, respectively, as the x and y values of the approximate neck keypoint coordinates. Thus, the key point of the neck is the 18 th key point of the human body.
204. And acquiring a face frame according to the face key points.
205. And calculating the area ratio of the human face of the human body in the scene to be shot in the preview image according to the human face frame.
Referring to fig. 4, fig. 4 is a schematic diagram of human body key points provided in the present application, including a neck key point, where there are 18 key points, and adjacent key points may be drawn with colored lines as connections. The method comprises the steps of obtaining face key points such as a left eye, a right eye, a left ear, a right ear, a nose and a neck among the human body key points, obtaining a face frame according to the face key points, and calculating the area ratio of a human face of a human body in a scene to be shot in a preview image according to the face frame.
Referring to fig. 4, in an embodiment, the height of the face frame is extracted according to the positions of the highest point of the body frame and the key point of the neck, the width of the face frame is extracted according to the positions of the key points of the left ear and the right ear, and the coordinates (x) at the upper left corner of the body frame are extracted from the coordinates (x) of the body frame1,y1) And the coordinates of the lower right corner (x)2,y2) And coordinates (x) of key points of neck in 18 key points obtained by key point detectionneck,yneck) And left ear keypoint coordinates (x)left_ear,yleft_ear) And right ear keypoint coordinates (x)right_ear,yright_ear) The face area is calculated as follows: (height of highest point of human body frame-height of neck key point) × (width of right ear key point-width of left ear key point), namely: (y)1-yneck)*(xright_ear-xleft_ear). The result obtained by calculation is the face area Sface. The face area can be represented by the number of pixels contained in a face frame in the preview image, and the face area does not need to be a specific area value.
And acquiring the area of the preview image, and calculating the area ratio of the face area in the area of the preview image to obtain the area ratio. The area of the preview image can be represented by the number of pixels contained in the preview image, and may not be a specific area value, that is, the area ratio of the human face in the preview image can be the ratio of the number of pixels occupied by the human face frame in the preview image.
206. And judging whether the area ratio is larger than a first preset ratio or not. If yes, go to step 207, otherwise go to step 210.
207. And judging whether the area ratio is larger than a second preset ratio or not. If yes, go to step 208, otherwise go to step 217.
208. And calculating a first focusing multiple corresponding to a scene to be shot.
209. And outputting first prompt information for adjusting the shooting focal length of the electronic equipment according to the first focusing multiple.
And when the area ratio is larger than a first preset ratio, outputting first prompt information for adjusting the shooting focal length of the electronic equipment according to the area ratio, wherein the first prompt information is used for prompting to reduce the area ratio of the human face in the preview image.
In an embodiment, when a human body exists in the object to be shot, the human body in the scene to be shot can be identified, and whether the scene to be shot is a global shot or a face close-up is judged by judging whether the area ratio of the human face of the human body in the scene to be shot in the preview image is larger than a first preset ratio, wherein the global shot is a shot scene taking the human body or other objects as a shooting subject, and the face close-up is a shot scene specially aiming at the human face, for example, a 'big head shot'.
When the area ratio of the human face in the preview image in the scene to be shot is larger than a first preset ratio, the scene to be shot can be judged to be a face close-up scene. When the area ratio of the human face in the preview image in the scene to be shot is smaller than or equal to a first preset ratio, the scene to be shot can be judged to be a global shooting scene.
In the face close-up scene, first prompt information for adjusting the shooting focal length of the electronic equipment is output according to the area proportion of the human face of the human body in the preview image. When the area proportion of the human face in the preview image is too large, first prompt information can be output to prompt a user to adjust the shooting focal length of the electronic equipment, so that the composition of the human face in the preview image is as beautiful as possible. That is, in an embodiment, outputting the first prompt information for adjusting the shooting focal length of the electronic device according to the area ratio may include: and when the area ratio is larger than a second preset ratio, outputting first prompt information for adjusting the shooting focal length of the electronic equipment.
Wherein the second predetermined ratio is greater than the first predetermined ratio. And on the basis that the area ratio is greater than the first preset ratio, further judging whether the area ratio is greater than a second preset ratio. If the area ratio is larger than the first preset ratio and larger than the second preset ratio, outputting first prompt information for adjusting the shooting focal length of the electronic equipment so as to reduce the area ratio of the human face in the preview image; and if the area ratio is greater than the first preset ratio but not greater than the second preset ratio, no prompt is given.
In an embodiment, according to
Figure BDA0002386650100000131
And calculating a first focusing multiple corresponding to a scene to be shot, and outputting first prompt information for adjusting the shooting focal length of the electronic equipment according to the first focusing multiple. Wherein k is1Is a first focusing multiple, r1The ratio of the face area is T _ max, which is a second predetermined ratio.
It will be appreciated that at r1When the value is more than T _ max, the calculated zoom multiple k1Less than 1, prompting the user to adjust the focal length to k1And thus zoom the lens farther.
210. And acquiring the height and the width of the human body frame in the preview image.
211. The height and width of the preview image are acquired.
212. And calculating the ratio of the height of the human body frame to the height of the preview image to obtain the height ratio.
213. And calculating the ratio of the width of the human body frame to the width of the preview image to obtain the width ratio.
214. And judging whether the height ratio and the width ratio are both smaller than a third preset ratio. If yes, go to step 215, otherwise go to step 217.
215. And calculating a second focusing multiple corresponding to the scene to be shot.
216. And outputting second prompt information for adjusting the shooting focal length of the electronic equipment according to the second focusing multiple.
And when the area ratio is smaller than or equal to a first preset ratio, acquiring the height and the width of the human body in the preview image, and outputting second prompt information for adjusting the shooting focal length of the electronic equipment according to the height and the width of the human body in the preview image, wherein the second prompt information is used for prompting the increase of the height ratio and the width ratio of the height and the width of the human body in the preview image.
When the area ratio of the human face in the preview image in the scene to be shot is smaller than or equal to the first preset ratio, the scene to be shot can be judged to be a global shooting scene, and the shooting at the moment can be shooting for the whole human body instead of just shooting the human face.
In the global shooting scene, the height and the width of the human body in the preview image are obtained, and second prompt information for adjusting the shooting focal length of the electronic equipment is output according to the height and the width of the human body in the preview image. When the height ratio and the width ratio of the human body in the preview image are both too small, second prompt information can be output to prompt a user to adjust the shooting focal length of the electronic equipment, so that the composition of the human face in the preview image is as beautiful as possible. That is, in an embodiment, outputting the second prompt information for adjusting the shooting focus of the electronic device according to the height and width of the human body in the preview image may include: acquiring the height and width of a preview image; calculating the ratio of the height of the human body frame to the height of the preview image to obtain the height ratio; calculating the ratio of the width of the human body frame to the width of the preview image to obtain the width ratio; and when the height ratio and the width ratio are both smaller than a third preset ratio, outputting second prompt information for adjusting the shooting focal length of the electronic equipment.
In an embodiment, after outputting first prompt information and second prompt information for adjusting a shooting focal length of the electronic device, receiving a focusing operation of a user, acquiring a focused preview image, repeating the above steps, and if the condition for outputting the first prompt information or the second prompt information is still met, continuing prompting by the electronic device until the focused preview image does not meet the condition for outputting the first prompt information or the second prompt information. Or, after the electronic device outputs the first prompt information or the second prompt information suggestion for focusing, the user may also reject the focusing suggestion of the device, reserve the current focal length, and shoot the scene to be shot at the current focal length.
In an embodiment, according to
Figure BDA0002386650100000141
Calculating a second focus corresponding to a scene to be photographedAnd multiplying and outputting second prompt information for adjusting the shooting focal length of the electronic equipment according to the second focusing multiple. Wherein k is2Is a second focusing multiple, r2The larger one of the height ratio and the width ratio, T _ min is a third preset ratio.
It will be appreciated that at r2When the zoom factor is more than T _ min, the calculated zoom factor k2Greater than 1, prompting the user to adjust the focal length to k2And thus the lens is pulled closer.
217. No zoom cues are output.
When the area ratio of the human face in the preview image is larger than a first preset ratio and larger than a second preset ratio, not outputting a zooming prompt; and when the area ratio of the human face in the preview image is larger than the first preset ratio and the height ratio and the width ratio of the human frame in the preview image are both smaller than the third preset ratio, not outputting the zooming prompt.
As can be seen from the above, in the composition guidance method provided in the embodiment of the present application, a preview image of a scene to be photographed is first obtained; then, acquiring the area ratio of the human face of the human body in the scene to be shot in the preview image; when the area ratio is larger than a first preset ratio, outputting first prompt information for adjusting the shooting focal length of the electronic equipment according to the area ratio; and when the area ratio is smaller than or equal to a first preset ratio, acquiring the height and the width of the human body in the preview image, and outputting second prompt information for adjusting the shooting focal length of the electronic equipment according to the height and the width of the human body in the preview image. According to the embodiment of the application, the user is prompted to adjust the shooting focal length of the electronic equipment according to the different area ratios of the faces in the preview image or the height and the width of the human body respectively, so that the user is guided to reasonably compose the picture during shooting, and a high-quality picture is shot.
The embodiment of the application also provides a composition guiding device. Referring to fig. 6, fig. 6 is a schematic view of a first structure of a composition guiding apparatus according to an embodiment of the present application. The composition guiding apparatus 300 is applied to an electronic device, and includes a first obtaining module 301, a second obtaining module 302, a first prompting module 303, and a second prompting module 304, as follows:
a first obtaining module 301, configured to obtain a preview image of a scene to be photographed;
a second obtaining module 302, configured to obtain an area ratio of a human face in a scene to be photographed in a preview image;
the first prompting module 303 is configured to output first prompting information for adjusting a shooting focal length of the electronic device according to the area ratio when the area ratio is greater than a first preset ratio;
and the second prompt module 304 is configured to, when the area ratio is smaller than or equal to the first preset ratio, acquire the height and width of the human body in the preview image, and output second prompt information for adjusting the shooting focal length of the electronic device according to the height and width of the human body in the preview image.
Referring to fig. 7, fig. 7 is a schematic diagram illustrating a second structure of a composition guiding device 300 according to an embodiment of the present application. In an embodiment, the second acquiring module 302 includes a first detecting unit 3021, a second detecting unit 3022, and a first acquiring unit 3023:
a first detecting unit 3021, configured to perform human body detection on the preview image to obtain a human body frame;
the second detecting unit 3022 is configured to intercept a human body image from the preview image according to the human body frame, and perform human body key point detection on the human body image to obtain a human body key point;
a first obtaining unit 3023, configured to obtain, according to the face key points in the human key points, an area ratio of a human face of a human body in a scene to be photographed in the preview image.
In an embodiment, the first obtaining unit 3023 is configured to:
acquiring a face frame according to the face key points;
and calculating the area ratio of the human face of the human body in the scene to be shot in the preview image according to the human face frame.
Referring to fig. 8, fig. 8 is a schematic diagram illustrating a third structure of a composition guiding device 300 according to an embodiment of the present application. In one embodiment, the first hinting module 303 includes a first computing unit 3031 and a first hinting unit 3032:
a first calculating unit 3031 for calculating the area ratio according to the first predetermined ratio when the area ratio is greater than the second predetermined ratio
Figure BDA0002386650100000161
Calculating a first focusing multiple corresponding to a scene to be shot;
and the first prompt unit 3032 is configured to output first prompt information for adjusting a shooting focal length of the electronic device according to the first focusing multiple.
Wherein k is1Is a first focusing multiple, r1The ratio of the face area is T _ max, which is a second predetermined ratio.
Referring to fig. 9, fig. 9 is a schematic diagram illustrating a fourth structure of a composition guiding device 300 according to an embodiment of the present application. In an embodiment, the second prompting module 304 includes a second obtaining unit 3041, a third obtaining unit 3042, a second calculating unit 3043, a third calculating unit 3044, a second calculating unit 3045, and a second prompting unit 3046:
a second acquiring unit 3041 for acquiring the height and width of the human body frame in the preview image;
a third acquiring unit 3042 for acquiring the height and width of the preview image;
a second calculating unit 3043, configured to calculate a ratio of the height of the human body frame to the height of the preview image, so as to obtain a height ratio;
a third calculating unit 3044, configured to calculate a ratio of the width of the human body frame to the width of the preview image, so as to obtain a width ratio;
a fourth calculating unit 3045 for calculating a height ratio and a width ratio according to when both are less than a third preset ratio
Figure BDA0002386650100000162
Calculating a second focusing multiple corresponding to a scene to be shot;
and a second prompting unit 3046 configured to output second prompting information for adjusting the shooting focal length of the electronic device according to the second focusing multiple.
As can be seen from the above, in the composition guidance method provided in the embodiment of the present application, first, the first obtaining module 301 obtains a preview image of a scene to be photographed; then, the second obtaining module 302 obtains the area ratio of the human face in the preview image in the scene to be shot; when the area ratio is greater than a first preset ratio, the first prompting unit 303 outputs first prompting information for adjusting the shooting focal length of the electronic device according to the area ratio; when the area ratio is smaller than or equal to the first preset ratio, the second prompting unit 304 acquires the height and the width of the human body in the preview image, and outputs second prompting information for adjusting the shooting focal length of the electronic device according to the height and the width of the human body in the preview image. According to the embodiment of the application, the user is prompted to adjust the shooting focal length of the electronic equipment according to the different area ratios of the faces in the preview image or the height and the width of the human body respectively, so that the user is guided to reasonably compose the picture during shooting, and a high-quality picture is shot.
The embodiment of the application also provides the electronic equipment. The electronic device may be a smartphone, a tablet computer, a gaming device, an AR (Augmented Reality) device, an automobile, a vehicle peripheral obstacle detection apparatus, an audio playback apparatus, a video playback apparatus, a notebook, a desktop computing device, a wearable device such as a watch, glasses, a helmet, an electronic bracelet, an electronic necklace, an electronic garment, or the like.
Referring to fig. 10, fig. 10 is a schematic view of a first structure of an electronic device 400 according to an embodiment of the present disclosure. The electronic device 400 comprises, among other things, a processor 401 and a memory 402. The processor 401 is electrically connected to the memory 402.
The processor 401 is a control center of the electronic device 400, connects various parts of the entire electronic device using various interfaces and lines, and performs various functions of the electronic device and processes data by running or calling a computer program stored in the memory 402 and calling data stored in the memory 402, thereby performing overall monitoring of the electronic device.
In this embodiment, the processor 401 in the electronic device 400 may load instructions corresponding to one or more computer program processes into the memory 402 according to the steps in the composition guiding method, and the processor 401 executes the computer program stored in the memory 402, so as to implement the steps in the composition guiding method, such as:
acquiring a preview image of a scene to be shot;
acquiring the area ratio of the human face of a human body in a scene to be shot in a preview image;
when the area ratio is larger than a first preset ratio, outputting first prompt information for adjusting the shooting focal length of the electronic equipment according to the area ratio;
and when the area ratio is smaller than or equal to a first preset ratio, acquiring the height and the width of the human body in the preview image, and outputting second prompt information for adjusting the shooting focal length of the electronic equipment according to the height and the width of the human body in the preview image.
In some cases, when obtaining the area ratio of the human face of the human body in the scene to be photographed in the preview image, the processor 401 performs the following steps:
detecting a human body of the preview image to obtain a human body frame;
intercepting a human body image in the preview image according to the human body frame, and detecting human body key points of the human body image to obtain human body key points;
and acquiring the area ratio of the human face of the human body in the scene to be shot in the preview image according to the human face key points in the human body key points.
In some cases, when the area ratio of the human face of the human body in the scene to be photographed in the preview image is obtained according to the human face key points in the human body key points, the processor 401 performs the following steps:
acquiring a face frame according to the face key points;
and calculating the area ratio of the human face of the human body in the scene to be shot in the preview image according to the human face frame.
In some cases, when outputting the first prompt to adjust the focal length of the electronic device according to the area ratio, the processor 401 performs the following steps:
and when the area ratio is larger than a second preset ratio, outputting first prompt information for adjusting the shooting focal length of the electronic equipment.
In some cases, before outputting the first prompt to adjust the shooting focus of the electronic device, the processor 401 further performs the following steps:
according to
Figure BDA0002386650100000181
Calculating a first focusing multiple corresponding to a scene to be shot, wherein k is1Is a first focusing multiple;
and outputting first prompt information for adjusting the shooting focal length of the electronic equipment according to the first focusing multiple.
Wherein k is1Is a first focusing multiple, r1Is the face area ratio, and T _ max is a second preset ratio
In some cases, when the height and the width of the human body in the preview image are acquired, and the second prompt information for adjusting the shooting focal length of the electronic device is output according to the height and the width of the human body in the preview image, the processor 401 performs the following steps:
acquiring the height and width of the human body frame in the preview image;
acquiring the height and width of a preview image;
calculating the ratio of the height of the human body frame to the height of the preview image to obtain the height ratio;
calculating the ratio of the width of the human body frame to the width of the preview image to obtain the width ratio;
and when the height ratio and the width ratio are both smaller than a third preset ratio, outputting second prompt information for adjusting the shooting focal length of the electronic equipment.
In some cases, before outputting the second prompt to adjust the shooting focus of the electronic device, the processor 401 further performs the following steps:
according to
Figure BDA0002386650100000191
Calculating a second focusing multiple corresponding to the scene to be shot, wherein k is2Is a second focusing multiple;
and outputting second prompt information for adjusting the shooting focal length of the electronic equipment according to the second focusing multiple.
Wherein,k2Is a second focusing multiple, r2The larger one of the height ratio and the width ratio, T _ min is a third preset ratio.
Referring to fig. 11, fig. 11 is a schematic view of a second structure of an electronic device 400 according to an embodiment of the present disclosure. Wherein the electronic device 400 further comprises: a display 403, a control circuit 404, an input unit 405, a sensor 406, and a power supply 407. The processor 401 is electrically connected to the display 403, the control circuit 404, the input unit 405, the sensor 406, and the power source 407.
The display screen 403 may be used to display information entered by or provided to the user as well as various graphical user interfaces of the electronic device, which may be comprised of images, text, icons, video, and any combination thereof.
The control circuit 404 is electrically connected to the display 403, and is configured to control the display 403 to display information.
The input unit 405 may be used to receive input numbers, character information, or user characteristic information (e.g., fingerprint), and generate keyboard, mouse, joystick, optical, or trackball signal inputs related to user settings and function control. Wherein, the input unit 405 may include a fingerprint recognition module.
The sensor 406 is used to collect information of the electronic device itself or information of the user or external environment information. For example, the sensor 406 may include a plurality of sensors such as a distance sensor, a magnetic field sensor, a light sensor, an acceleration sensor, a fingerprint sensor, a hall sensor, a position sensor, a gyroscope, an inertial sensor, an attitude sensor, a barometer, a heart rate sensor, and the like.
The power supply 407 is used to power the various components of the electronic device 400. In some embodiments, the power supply 407 may be logically coupled to the processor 401 via a power management system, such that the power management system may perform functions of managing charging, discharging, and power consumption.
Although not shown in fig. 8 and 9, the electronic device 400 may further include a camera, a bluetooth module, and the like, which are not described herein again.
In the foregoing embodiments, descriptions of the various embodiments have respective emphasis, and parts that are not described in detail in a certain embodiment may refer to the above detailed description of the processing method for the service wind control system, and are not described herein again.
As can be seen from the above, an embodiment of the present application provides an electronic device, where a processor in the electronic device performs the following steps: acquiring a preview image of a scene to be shot; acquiring the area ratio of the human face of a human body in a scene to be shot in a preview image; when the area ratio is larger than a first preset ratio, outputting first prompt information for adjusting the shooting focal length of the electronic equipment according to the area ratio; and when the area ratio is smaller than or equal to a first preset ratio, acquiring the height and the width of the human body in the preview image, and outputting second prompt information for adjusting the shooting focal length of the electronic equipment according to the height and the width of the human body in the preview image. According to the embodiment of the application, the user is prompted to adjust the shooting focal length of the electronic equipment according to the different area ratios of the faces in the preview image or the height and the width of the human body respectively, so that the user is guided to reasonably compose the picture during shooting, and a high-quality picture is shot.
The embodiment of the application also provides a storage medium, wherein a computer program is stored in the storage medium, and when the computer program runs on a computer, the computer executes the composition guiding method of any one of the embodiments.
For example, in some embodiments, when the computer program is run on a computer, the computer performs the steps of:
acquiring a preview image of a scene to be shot; acquiring the area ratio of the human face of a human body in a scene to be shot in a preview image; when the area ratio is larger than a first preset ratio, outputting first prompt information for adjusting the shooting focal length of the electronic equipment according to the area ratio; and when the area ratio is smaller than or equal to a first preset ratio, acquiring the height and the width of the human body in the preview image, and outputting second prompt information for adjusting the shooting focal length of the electronic equipment according to the height and the width of the human body in the preview image.
The above operations can be implemented in the foregoing embodiments, and are not described in detail herein.
It should be noted that, those skilled in the art can understand that all or part of the steps in the methods of the above embodiments can be implemented by the relevant hardware instructed by the computer program, and the computer program can be stored in the computer readable storage medium, which can include but is not limited to: read Only Memory (ROM), Random Access Memory (RAM), magnetic or optical disks, and the like.
The composition guidance method, apparatus, electronic device, and storage medium provided by the embodiments of the present application are described in detail above. The principle and the implementation of the present application are explained herein by applying specific examples, and the above description of the embodiments is only used to help understand the method and the core idea of the present application; meanwhile, for those skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

Claims (10)

1. A composition guidance method applied to an electronic device, comprising:
acquiring a preview image of a scene to be shot;
acquiring the area ratio of the human face of the human body in the scene to be shot in the preview image;
when the area ratio is larger than a first preset ratio, outputting first prompt information for adjusting the shooting focal length of the electronic equipment according to the area ratio;
and when the area ratio is smaller than or equal to the first preset ratio, acquiring the height and the width of the human body in the preview image, and outputting second prompt information for adjusting the shooting focal length of the electronic equipment according to the height and the width of the human body in the preview image.
2. The composition guidance method according to claim 1, wherein the obtaining of the area ratio of the human face in the preview image of the human body in the scene to be photographed comprises:
carrying out human body detection on the preview image to obtain a human body frame;
intercepting a human body image in the preview image according to the human body frame, and carrying out human body key point detection on the human body image to obtain human body key points;
and acquiring the area ratio of the human face of the human body in the scene to be shot in the preview image according to the human face key points in the human body key points.
3. The composition guidance method according to claim 2, wherein the obtaining the area ratio of the human face in the scene to be photographed in the preview image according to the human face key points comprises:
acquiring a face frame according to the face key points;
and calculating the area ratio of the human face of the human body in the scene to be shot in the preview image according to the human face frame.
4. The composition guidance method according to any one of claims 1 to 3, wherein outputting first prompt information for adjusting the shooting focal length of the electronic device according to the area ratio includes:
and when the area ratio is larger than a second preset ratio, outputting first prompt information for adjusting the shooting focal length of the electronic equipment.
5. The composition guidance method according to claim 4, wherein before outputting the first prompt information for adjusting the shooting focal length of the electronic device, the method further comprises:
according to
Figure FDA0002386650090000021
Calculating a first focusing multiple corresponding to the scene to be shot, wherein k is1Is the first focusing multiple, r1The face area ratio is set, and T _ max is the second preset ratio;
the outputting of the first prompt information for adjusting the shooting focal length of the electronic device includes:
and outputting first prompt information for adjusting the shooting focal length of the electronic equipment according to the first focusing multiple.
6. The composition guidance method according to claim 2, wherein the obtaining of the height and width of the human body in the preview image, and the outputting of the second prompt information for adjusting the shooting focal length of the electronic device according to the height and width of the human body in the preview image comprises:
acquiring the height and width of the human body in the preview image;
acquiring the height and width of the preview image;
calculating the ratio of the height of the human body frame to the height of the preview image to obtain the height ratio;
calculating the ratio of the width of the human body frame to the width of the preview image to obtain the width ratio;
and when the height ratio and the width ratio are both smaller than a third preset ratio, outputting second prompt information for adjusting the shooting focal length of the electronic equipment.
7. The composition guidance method according to claim 6, wherein before outputting the second prompt information for adjusting the shooting focal length of the electronic device, the method further comprises:
according to
Figure FDA0002386650090000022
Calculating a second focusing multiple corresponding to the scene to be shot, wherein k is2Is the second focusing multiple, r2The ratio of the height to the width is larger than the ratio of the width to the height, and T _ min is the third preset ratio;
the outputting of the second prompt information for adjusting the shooting focal length of the electronic device includes:
and outputting second prompt information for adjusting the shooting focal length of the electronic equipment according to the second focusing multiple.
8. A composition guide apparatus applied to an electronic device, comprising:
the first acquisition module is used for acquiring a preview image of a scene to be shot;
the second acquisition module is used for acquiring the area ratio of the human face of the human body in the scene to be shot in the preview image;
the first prompting module is used for outputting first prompting information for adjusting the shooting focal length of the electronic equipment according to the area ratio when the area ratio is larger than a first preset ratio;
and the second prompting module is used for acquiring the height and the width of the human body in the preview image when the area ratio is smaller than or equal to the first preset ratio, and outputting second prompting information for adjusting the shooting focal length of the electronic equipment according to the height and the width of the human body in the preview image.
9. An electronic device, wherein the electronic device comprises a processor and a memory, the memory having stored therein a computer program, the processor executing the steps in the composition guide method according to any one of claims 1 to 7 by calling the computer program stored in the memory.
10. A storage medium having stored therein a computer program for causing a computer to perform the steps of the composition guidance method according to any one of claims 1 to 7 when the computer program runs on the computer.
CN202010100113.4A 2020-02-18 2020-02-18 Composition guiding method, composition guiding device, electronic equipment and storage medium Active CN111263066B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010100113.4A CN111263066B (en) 2020-02-18 2020-02-18 Composition guiding method, composition guiding device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010100113.4A CN111263066B (en) 2020-02-18 2020-02-18 Composition guiding method, composition guiding device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111263066A true CN111263066A (en) 2020-06-09
CN111263066B CN111263066B (en) 2021-07-20

Family

ID=70951119

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010100113.4A Active CN111263066B (en) 2020-02-18 2020-02-18 Composition guiding method, composition guiding device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111263066B (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112017231A (en) * 2020-08-27 2020-12-01 中国平安财产保险股份有限公司 Human body weight identification method and device based on monocular camera and storage medium
CN112333395A (en) * 2020-12-01 2021-02-05 维沃移动通信有限公司 Focusing control method and device and electronic equipment
CN112367468A (en) * 2020-10-30 2021-02-12 维沃移动通信有限公司 Image processing method and device and electronic equipment
CN112653841A (en) * 2020-12-23 2021-04-13 维沃移动通信有限公司 Shooting method and device and electronic equipment
CN113055593A (en) * 2021-03-11 2021-06-29 百度在线网络技术(北京)有限公司 Image processing method and device
WO2022011534A1 (en) * 2020-07-14 2022-01-20 深圳传音控股股份有限公司 Photographing control method and apparatus, and intelligent device and computer-readable storage medium
CN114842426A (en) * 2022-07-06 2022-08-02 广东电网有限责任公司肇庆供电局 Transformer substation equipment state monitoring method and system based on accurate alignment camera shooting
WO2023029992A1 (en) * 2021-09-03 2023-03-09 北京字跳网络技术有限公司 Photographing method and apparatus, and electronic device and storage medium

Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080068487A1 (en) * 2006-09-14 2008-03-20 Canon Kabushiki Kaisha Image display apparatus, image capturing apparatus, and image display method
CN101452181A (en) * 2007-12-03 2009-06-10 鸿富锦精密工业(深圳)有限公司 Automatic focusing system and method OF electronic device
CN102117413A (en) * 2011-03-01 2011-07-06 金华就约我吧网络科技有限公司 Method for automatically filtering defective image based on multilayer feature
CN103024165A (en) * 2012-12-04 2013-04-03 华为终端有限公司 Method and device for automatically setting shooting mode
CN106295468A (en) * 2015-05-19 2017-01-04 小米科技有限责任公司 Face identification method and device
CN107370946A (en) * 2017-07-27 2017-11-21 高域(北京)智能科技研究院有限公司 The flight filming apparatus and method of adjust automatically picture-taking position
CN107911616A (en) * 2017-12-26 2018-04-13 Tcl移动通信科技(宁波)有限公司 A kind of camera automatic focusing method, storage device and mobile terminal
CN108156380A (en) * 2017-12-28 2018-06-12 广东欧珀移动通信有限公司 Image acquiring method, device, storage medium and electronic equipment
CN108259752A (en) * 2018-02-27 2018-07-06 北京智启科技有限公司 A kind of image pickup method and system
CN109561249A (en) * 2017-09-26 2019-04-02 北京小米移动软件有限公司 Adjust the method and device of focal length
CN109660719A (en) * 2018-12-11 2019-04-19 维沃移动通信有限公司 A kind of information cuing method and mobile terminal
CN110472611A (en) * 2019-08-21 2019-11-19 图谱未来(南京)人工智能研究院有限公司 Method, apparatus, electronic equipment and the readable storage medium storing program for executing of character attribute identification
US20200053288A1 (en) * 2018-08-08 2020-02-13 Samsung Electronics Co., Ltd. Electronic device and method for providing notification related to image displayed through display and image stored in memory based on image analysis
CN110827371A (en) * 2019-11-05 2020-02-21 厦门美图之家科技有限公司 Certificate photo generation method and device, electronic equipment and storage medium

Patent Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080068487A1 (en) * 2006-09-14 2008-03-20 Canon Kabushiki Kaisha Image display apparatus, image capturing apparatus, and image display method
CN101452181A (en) * 2007-12-03 2009-06-10 鸿富锦精密工业(深圳)有限公司 Automatic focusing system and method OF electronic device
CN102117413A (en) * 2011-03-01 2011-07-06 金华就约我吧网络科技有限公司 Method for automatically filtering defective image based on multilayer feature
CN103024165A (en) * 2012-12-04 2013-04-03 华为终端有限公司 Method and device for automatically setting shooting mode
CN106295468A (en) * 2015-05-19 2017-01-04 小米科技有限责任公司 Face identification method and device
CN107370946A (en) * 2017-07-27 2017-11-21 高域(北京)智能科技研究院有限公司 The flight filming apparatus and method of adjust automatically picture-taking position
CN109561249A (en) * 2017-09-26 2019-04-02 北京小米移动软件有限公司 Adjust the method and device of focal length
CN107911616A (en) * 2017-12-26 2018-04-13 Tcl移动通信科技(宁波)有限公司 A kind of camera automatic focusing method, storage device and mobile terminal
CN108156380A (en) * 2017-12-28 2018-06-12 广东欧珀移动通信有限公司 Image acquiring method, device, storage medium and electronic equipment
CN108259752A (en) * 2018-02-27 2018-07-06 北京智启科技有限公司 A kind of image pickup method and system
US20200053288A1 (en) * 2018-08-08 2020-02-13 Samsung Electronics Co., Ltd. Electronic device and method for providing notification related to image displayed through display and image stored in memory based on image analysis
CN109660719A (en) * 2018-12-11 2019-04-19 维沃移动通信有限公司 A kind of information cuing method and mobile terminal
CN110472611A (en) * 2019-08-21 2019-11-19 图谱未来(南京)人工智能研究院有限公司 Method, apparatus, electronic equipment and the readable storage medium storing program for executing of character attribute identification
CN110827371A (en) * 2019-11-05 2020-02-21 厦门美图之家科技有限公司 Certificate photo generation method and device, electronic equipment and storage medium

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115812308A (en) * 2020-07-14 2023-03-17 深圳传音控股股份有限公司 Shooting control method and device, intelligent equipment and computer readable storage medium
WO2022011534A1 (en) * 2020-07-14 2022-01-20 深圳传音控股股份有限公司 Photographing control method and apparatus, and intelligent device and computer-readable storage medium
CN112017231A (en) * 2020-08-27 2020-12-01 中国平安财产保险股份有限公司 Human body weight identification method and device based on monocular camera and storage medium
CN112017231B (en) * 2020-08-27 2024-04-05 中国平安财产保险股份有限公司 Monocular camera-based human body weight identification method, monocular camera-based human body weight identification device and storage medium
CN112367468A (en) * 2020-10-30 2021-02-12 维沃移动通信有限公司 Image processing method and device and electronic equipment
CN112367468B (en) * 2020-10-30 2022-02-01 维沃移动通信有限公司 Image processing method and device and electronic equipment
CN112333395A (en) * 2020-12-01 2021-02-05 维沃移动通信有限公司 Focusing control method and device and electronic equipment
CN112333395B (en) * 2020-12-01 2022-05-06 维沃移动通信(杭州)有限公司 Focusing control method and device and electronic equipment
CN112653841A (en) * 2020-12-23 2021-04-13 维沃移动通信有限公司 Shooting method and device and electronic equipment
CN112653841B (en) * 2020-12-23 2023-01-24 维沃移动通信有限公司 Shooting method and device and electronic equipment
CN113055593B (en) * 2021-03-11 2022-08-16 百度在线网络技术(北京)有限公司 Image processing method and device
CN113055593A (en) * 2021-03-11 2021-06-29 百度在线网络技术(北京)有限公司 Image processing method and device
WO2023029992A1 (en) * 2021-09-03 2023-03-09 北京字跳网络技术有限公司 Photographing method and apparatus, and electronic device and storage medium
CN114842426B (en) * 2022-07-06 2022-10-04 广东电网有限责任公司肇庆供电局 Transformer substation equipment state monitoring method and system based on accurate alignment camera shooting
CN114842426A (en) * 2022-07-06 2022-08-02 广东电网有限责任公司肇庆供电局 Transformer substation equipment state monitoring method and system based on accurate alignment camera shooting

Also Published As

Publication number Publication date
CN111263066B (en) 2021-07-20

Similar Documents

Publication Publication Date Title
CN111263066B (en) Composition guiding method, composition guiding device, electronic equipment and storage medium
CN110647865B (en) Face gesture recognition method, device, equipment and storage medium
CN111091576B (en) Image segmentation method, device, equipment and storage medium
CN110210571B (en) Image recognition method and device, computer equipment and computer readable storage medium
CN111327829B (en) Composition guiding method, composition guiding device, electronic equipment and storage medium
KR101679290B1 (en) Image processing method and apparatus
CN113205568B (en) Image processing method, device, electronic equipment and storage medium
CA3122315A1 (en) Eye tracking method and system
CN113630545B (en) Shooting method and equipment
CN112287852B (en) Face image processing method, face image display method, face image processing device and face image display equipment
CN111831119A (en) Eyeball tracking method and device, storage medium and head-mounted display equipment
CN111327828A (en) Photographing method and device, electronic equipment and storage medium
CN108200351A (en) Image pickup method, terminal and computer-readable medium
WO2024021742A1 (en) Fixation point estimation method and related device
US20220329729A1 (en) Photographing method, storage medium and electronic device
CN113570614A (en) Image processing method, device, equipment and storage medium
CN112511743B (en) Video shooting method and device
CN115967823A (en) Video cover generation method and device, electronic equipment and readable medium
CN112399078B (en) Shooting method and device and electronic equipment
CN112183200B (en) Eye movement tracking method and system based on video image
CN113778233B (en) Method and device for controlling display equipment and readable medium
CN114697530B (en) Photographing method and device for intelligent view finding recommendation
CN115623313A (en) Image processing method, image processing apparatus, electronic device, and storage medium
CN110956576B (en) Image processing method, device, equipment and storage medium
CN112907702A (en) Image processing method, image processing device, computer equipment and storage medium

Legal Events

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