WO2021164162A1 - 拍摄图像的方法、装置及设备 - Google Patents

拍摄图像的方法、装置及设备 Download PDF

Info

Publication number
WO2021164162A1
WO2021164162A1 PCT/CN2020/097476 CN2020097476W WO2021164162A1 WO 2021164162 A1 WO2021164162 A1 WO 2021164162A1 CN 2020097476 W CN2020097476 W CN 2020097476W WO 2021164162 A1 WO2021164162 A1 WO 2021164162A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
face image
face
preset
electronic device
Prior art date
Application number
PCT/CN2020/097476
Other languages
English (en)
French (fr)
Inventor
冯启哲
Original Assignee
深圳传音控股股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳传音控股股份有限公司 filed Critical 深圳传音控股股份有限公司
Publication of WO2021164162A1 publication Critical patent/WO2021164162A1/zh

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/80Camera processing pipelines; Components thereof

Definitions

  • the embodiments of the present application relate to the field of image capturing technologies, and in particular, to a method, device, and equipment for capturing images.
  • electronic devices such as mobile phones have the function of image shooting.
  • the user can use the front camera of the electronic device to take a selfie.
  • the existing front camera devices In order to improve the quality of image shooting, the existing front camera devices generally provide the function of beautiful pictures, such as beautification or filters, which can allow users to adjust the color and contrast of the taken photos to make the photos more beautiful. In line with the public's aesthetics.
  • the above method of making pictures only optimizes the color, whitening, microdermabrasion, etc., and improves the quality of the image to a limited extent.
  • the general user does not have professional photography knowledge, and the composition of the image taken by the user is often not reasonable enough, resulting in the image The shooting quality is poor.
  • the embodiments of the present application provide a method, device, and equipment for shooting images, which improve the quality of image shooting.
  • an embodiment of the present application provides a method for capturing an image, which is applied to an electronic device, and the electronic device is provided with a camera device, and the method includes:
  • the camera device After the camera device is started, acquiring a first image collected by the camera device, where the first image includes a human face image;
  • the second image is output.
  • determining the position of the face image in the first image in the first image includes:
  • the position of the rectangular frame in the first image is determined as the position of the face image in the first image.
  • processing the first image to obtain the second image according to the position of the face image in the first image includes:
  • processing the first image to obtain a second image According to the position of the face image in the first image and the first preset position, processing the first image to obtain a second image.
  • determining a first preset position among a plurality of preset positions according to the first area includes:
  • the first preset position is determined among the plurality of preset positions according to the first area and the preset correspondence, and the preset correspondence is the correspondence between the area and the preset location.
  • processing the first image to obtain the second image includes:
  • the method further includes:
  • the second image is determined to be a shooting image.
  • the method further includes:
  • the ratio is greater than or equal to the first threshold, generating and displaying first prompt information, where the first prompt information is used to prompt the user to stay away from the electronic device;
  • second prompt information is generated and displayed, and the second prompt information is used to prompt the user to approach the electronic device.
  • the method further includes:
  • an embodiment of the present application provides a device for capturing images, which is applied to an electronic device, and the electronic device is provided with a camera device, and the device includes:
  • An obtaining module configured to obtain a first image collected by the camera device after the camera device is started, the first image including a face image;
  • a determining module configured to determine the position of the face image in the first image in the first image
  • a processing module configured to process the first image to obtain a second image, and the face image is located at a first preset position in the second image
  • the output module is used to output the second image.
  • the determining module is specifically configured to:
  • the position of the rectangular frame in the first image is determined as the position of the face image in the first image.
  • the processing module is specifically configured to:
  • processing the first image to obtain a second image According to the position of the face image in the first image and the first preset position, processing the first image to obtain a second image.
  • the determining module is specifically configured to:
  • the first preset position is determined among the plurality of preset positions according to the first area and the preset correspondence, and the preset correspondence is the correspondence between the area and the preset location.
  • the processing module is specifically configured to:
  • the device further includes a receiving module:
  • the receiving module is configured to receive a shooting instruction input by a user
  • the determining module is further configured to determine the second image as a captured image according to the shooting instruction.
  • the determining module is further configured to:
  • the ratio is greater than or equal to the first threshold, generating and displaying first prompt information, where the first prompt information is used to prompt the user to stay away from the electronic device;
  • second prompt information is generated and displayed, and the second prompt information is used to prompt the user to approach the electronic device.
  • the device further includes a judgment module:
  • the judgment module is used to judge whether the face image is complete
  • an embodiment of the present application provides an image capturing apparatus, including: at least one processor and a memory;
  • the memory is used to store computer program instructions
  • the at least one processor is configured to execute computer program instructions stored in the memory, so that the at least one processor executes the method for capturing an image according to any one of the first aspect.
  • an embodiment of the present application provides a computer-readable storage medium having computer program instructions stored in the computer-readable storage medium, and when a processor executes the computer program instructions, any item as in the first aspect is implemented The described method of taking images.
  • the user when the user needs to shoot an image with a reasonable composition through the electronic device, the user can start the camera device in the electronic device, and the electronic device acquires the camera device during the shooting and framing process.
  • the first image is collected, the first image includes a face image; the position of the face image in the first image is determined in the first image; the first image is processed according to the position of the face image in the first image
  • the second image the face image is located at the first preset position in the second image; the second image is output on the display screen of the electronic device, so that the user can obtain a reasonable composition image during the shooting and framing, which improves the image shooting the quality of.
  • FIG. 1 is a schematic diagram of an application scenario of a method for photographing an image provided by an embodiment of the application
  • FIG. 2 is a schematic flowchart of a method for capturing an image provided by an embodiment of the application
  • FIG. 3 is a schematic diagram of determining the position of a face image in a first image according to an embodiment of the application
  • Figure 4 is a schematic diagram of the golden composition rule provided by an embodiment of the application.
  • FIG. 5 is a schematic diagram of an image capturing process provided by an embodiment of the application.
  • FIG. 6 is a schematic flowchart of another method for photographing an image provided by an embodiment of the application.
  • FIG. 7 is a schematic diagram of determining the ratio between the size of a face image and the size of a first image provided by an embodiment of the application;
  • FIG. 8 is a schematic diagram of a process of judging whether a face image is complete according to an embodiment of the application.
  • FIG. 9 is a schematic structural diagram of an image capturing apparatus provided by an embodiment of the application.
  • FIG. 10 is a schematic structural diagram of another image capturing apparatus provided by an embodiment of the application.
  • FIG. 11 is a schematic structural diagram of yet another image capturing apparatus provided by an embodiment of the application.
  • FIG. 12 is a schematic diagram of the hardware structure of an image capturing apparatus provided by an embodiment of the application.
  • FIG. 1 is a schematic diagram of an application scenario of a method for capturing an image provided by an embodiment of the application.
  • the electronic device 101 may be an electronic device with an image capturing function.
  • the electronic device 101 may include, but is not limited to, electronic devices such as smart phones, tablet computers, cameras, and personal digital assistants.
  • An imaging device 103 is provided in the electronic device 101.
  • the camera 103 may include a front camera and a rear camera.
  • the number of the camera 103 can be one or more.
  • the camera 103 can have multiple types.
  • the camera 103 can include a wide-angle camera and a macro camera. Device, telephoto camera, etc.
  • the user 102 can collect an image through the camera 103.
  • the electronic device 101 can collect the image through the camera 103, and process the facial image in the image by using the beauty function such as beautification or filters to obtain Higher quality image.
  • the beauty function such as beautification or filters
  • this process only optimizes the color, whitening, microdermabrasion, etc., and does not consider the rationality of the composition of the image taken by the user.
  • this application improves the processing process of the image optimization.
  • the user when the user needs to take high-quality images through the electronic device 101, the user can start the camera device in the electronic device 101.
  • the electronic device In the process of shooting and framing, the electronic device can obtain the image including the face image through the camera device.
  • the first image is processed according to the position of the face image in the first image to obtain a second image with a reasonable frame composition, so that the electronic device 101 can output the second image with a reasonable composition on its screen.
  • the electronic device 101 can process the image according to the position of the face image in the image, so as to obtain an image with a reasonable composition, so that the quality of the image taken by the user is higher.
  • FIG. 2 is a schematic flowchart of a method for capturing an image provided by an embodiment of the application. See Figure 2.
  • the method can include:
  • the execution subject of the embodiments of the present application may be an electronic device, or may be an image capturing device provided in the electronic device.
  • the electronic device may be an electronic device with an image capturing function.
  • the electronic device may include, but is not limited to, electronic devices such as smart phones, tablet computers, cameras, and personal digital assistants.
  • the electronic equipment is provided with a camera device.
  • the camera device can include a front camera device and a rear camera device.
  • the number of camera devices can be one or more.
  • the camera device can include a wide-angle camera device. , Macro camera device, telephoto camera device, etc., this embodiment of the present application does not specifically limit it.
  • the first image may be an image obtained by an electronic device through a camera device.
  • the image may include a face image.
  • the number of face images may be one.
  • the user when the user needs to obtain an image with a reasonable composition through the electronic device, the user can turn on the camera device of the electronic device.
  • the user can switch the front camera device or the rear camera device according to actual needs.
  • the user After the camera device is started, the user can adjust the angle and position of the camera device to obtain the image to be collected in real time.
  • the electronic device can be provided with a display screen, and the image collected by the camera device can be output on the display screen of the electronic device in real time.
  • an option of a composition optimization function can be set in the electronic device. Before acquiring the first image, the user can choose whether to optimize the composition according to his own preferences.
  • S202 Determine the position of the face image in the first image in the first image.
  • the position of the face image in the first image can be determined in the first image through the following feasible implementations: perform face recognition on the first image to obtain the face image; determine the rectangular frame where the face image is located ; Determine the position of the rectangular frame in the first image as the position of the face image in the first image.
  • Fig. 3 is a schematic diagram of determining the position of a face image in a first image provided by an embodiment of the application. Please refer to Figure 3, including page 3A and page 3B.
  • page 3B After obtaining the face image, determine the rectangular frame where the face image is located, and determine the position of the rectangular frame in the first image as the position of the face image in the first image. Specifically, as shown in page 3B As shown, the position of the rectangular frame in the first image can be represented by the distance between the four sides of the rectangular frame and the four frames of the image.
  • S203 According to the position of the face image in the first image, process the first image to obtain a second image, and the face image is located at a first preset position in the second image.
  • the second image may be an image obtained after processing the first image according to a composition rule.
  • the first preset position may be a position of a face image with a reasonable composition obtained according to the composition rule.
  • the composition rule may include but is not limited to the golden composition rule, the frame composition rule, the cross-line rule, and the like. Among them, the golden composition rule may also be referred to as the nine-square lattice composition rule, and the embodiment of the present application takes the golden composition rule as an example for specific description. Below, in conjunction with Figure 4, the specific implementation process of the golden composition rule will be described.
  • Fig. 4 is a schematic diagram of a golden composition rule provided by an embodiment of the application.
  • the golden section rule approximately divides the image into three equal parts. Specifically, the image is divided into three equal parts from the horizontal and vertical directions to form a nine-square grid. The four points obtained by crossing can be used as gold. The dividing point, these four lines can be used as the golden section line.
  • the position of the subject and the ratio of the division to the remaining space will be more coordinated, which can create a sense of balance in the picture, enhance visual comfort, and reflect the sense of beauty.
  • the first image can be processed to obtain the second image according to the position of the face image in the first image through the following feasible implementation methods: according to the position of the face image in the first image, it is determined that the face image is The first area in the first image; according to the first area, the first preset position is determined among a plurality of preset positions; according to the position of the face image in the first image and the first preset position, the first image The second image is obtained by processing.
  • the first area may be an area where the rectangular frame in the first image is located.
  • the preset position can be the golden section point determined according to the composition rule.
  • the number of preset positions can be multiple.
  • the preset positions can include: upper left third, upper right third, lower left third, and right Next three points.
  • the first preset position may be a preset position closest to the first area, and the second image may be an image with a reasonable composition after processing the first image.
  • the first preset position may be determined in a plurality of preset positions according to the first area through the following feasible implementation manners: the first preset position may be determined in the plurality of preset positions according to the corresponding relationship between the first area and the preset. Preset location.
  • the preset correspondence relationship is the correspondence relationship between the area and the preset location.
  • the first preset correspondence relationship may be the correspondence relationship between the preset location closest to the first area among the plurality of preset locations and the first area.
  • the first preset correspondence may be The first area corresponds to the upper right third point.
  • the first image can be processed to obtain the second image according to the position of the face image in the first image and the first preset position through the following feasible implementation modes: according to the position of the face image in the first image And the first preset position, determining the cropping location and cropping size in the first image; processing the first image according to the cropping location and cropping size to obtain a second image.
  • the first image is enlarged according to the ratio of the original image according to the trimming position and the trimming size, so that the processed second image has the same size as the first image.
  • the position of the rectangular frame is also at the upper left corner of the first image. Therefore, it can be determined that the face image is at the upper left corner of the first image.
  • the first area in the first image is the upper left corner area.
  • the first preset position can be determined as the upper left third point from a plurality of preset positions. Move the first image so that the position of the face image in the first image coincides with the first preset position. Specifically, the center of the rectangular frame coincides with the first preset position, and at the same time, perform the operation on the moved first image.
  • Enlargement so that the enlarged first image can include all the original first image, and according to the size of the original first image, the trimming position and trimming size of the moved first image are determined.
  • the first image after the movement is processed according to the trimming position and the trimming size to obtain a second image with the same size as the first image.
  • the electronic device outputs the processed second image on its display screen.
  • the second image may further include: receiving a photographing instruction input by the user; and determining the second image as a photographed image according to the photographing instruction.
  • the user can see the second image with a reasonable composition through the display screen of the electronic device in real time during the shooting and framing process, and click the shooting button of the electronic device when he sees the second image that he is satisfied with.
  • the second image is determined as the photographed image and saved in the electronic device.
  • FIG. 5 is a schematic diagram of an image capturing process provided by an embodiment of the application.
  • the camera is a front camera as an example. See Figure 5, including page 5A-page 5F.
  • page 5A When the user needs to take an image with a reasonable composition through the electronic device, the user can turn on the camera device of the electronic device. And output the first image in real time on the display screen of the electronic device.
  • the electronic device can perform face recognition on the first image to obtain a face image, determine the size of the rectangular frame according to the size of the face image, and combine the person
  • the face image is placed in the rectangular frame, so that the face image fits within the rectangular frame.
  • the position of the rectangular frame in the first image is determined as the position of the face image in the first image.
  • the center point of the rectangular frame is determined as the position of the face image in the first image.
  • the image is divided into three equal parts from the horizontal and vertical directions to form a nine-square grid.
  • Multiple preset positions are the golden section points obtained by crossing, respectively: the upper left third Point, upper right third, lower left third, lower right third.
  • the position of the face image in the first image it can be determined that the first area of the face image in the first image is the upper right corner, and according to the position of the first area, it can be determined that the first preset is among multiple preset positions
  • the position is the upper right third point.
  • page 5D move the first image, and align the center point of the rectangular frame where the face image in the first image is located with the upper right third point. At this time, a blank area will appear in the upper part of the first image.
  • the image is enlarged. Specifically, it is enlarged according to the ratio of the original first image, so that the blank area formed by the movement of the first image can be just removed.
  • the trimming location and trimming size are determined in the first image, so that the trimmed second image has the same size as the first image.
  • page 5E Please refer to page 5E to crop the first image so that the second image can be completely output on the display screen of the electronic device.
  • the user can see the second image with optimized composition through the display screen in real time.
  • the electronic device After the electronic device outputs the second image, the user can shoot according to his own needs. After the electronic device receives the shooting instruction input by the user, the second image is determined as a captured image and saved in In electronic equipment, as shown on page 5F.
  • the user when the user needs to shoot an image with a reasonable composition through the electronic device, the user can start the camera device in the electronic device, and the electronic device acquires the camera device during the shooting and framing process.
  • the first image is collected, the first image includes a face image; the position of the face image in the first image is determined in the first image; the first image is processed according to the position of the face image in the first image.
  • the second image the face image is located at the first preset position in the second image; the second image is output on the display screen of the electronic device, so that a reasonable composition image can be obtained during the shooting and framing process, which improves the image shooting quality.
  • FIG. 6 is a schematic flowchart of another method for capturing an image provided by an embodiment of the application. Referring to Figure 6, the method may include:
  • S602 Determine the position of the face image in the first image in the first image.
  • S603 Determine the ratio between the size of the face image and the size of the first image.
  • first prompt information is generated and displayed.
  • the first prompt information is used to prompt the user to stay away from the electronic device.
  • the first prompt information may be displayed on the display screen of the electronic device.
  • the first prompt information may include but is not limited to: "Please stay away Camera”.
  • a second prompt message is generated and displayed.
  • the second prompt message is used to prompt the user to approach the electronic device.
  • the second prompt information may be displayed on the display screen of the electronic device.
  • the second prompt information may include but is not limited to: "please approach the camera”.
  • the electronic device can perform a measurement on the first image displayed in this range Composition optimization processing.
  • FIG. 7 is a schematic diagram of determining the ratio between the size of the face image and the size of the first image provided by an embodiment of the application. See Figure 7, including page 7A-page 7D.
  • the display screen of the electronic device can The first prompt message "please stay away from the camera" is displayed, and the user can move away from the camera device according to the prompt message.
  • the display screen of the electronic device can The second prompt message "Please approach the camera" is displayed. The user can approach the camera device according to the prompt information.
  • the ratio between the size of the face image and the size of the first image is greater than the second threshold and less than the first threshold, that is, the ratio between the size of the face image and the size of the first image is in the normal shooting range When it is within, it can be further judged whether the face image is complete.
  • the following feasible implementations can be used to determine whether the face image is complete: when the face is at any one of the four frame positions of the first image, or when the face is at the four corners of the first image, the face If it cannot be displayed completely on the screen, it can be judged that the face image is incomplete.
  • the electronic device If not, the electronic device generates and displays the third prompt message, which is used to prompt the user to stay away from the frame of the electronic device.
  • the third prompt message may include but is not limited to: "Please stay away from the frame or adjust the camera position" .
  • FIG. 8 is a schematic diagram of a process of judging whether a face image is complete according to an embodiment of the application. See Figure 8, including page 8A-page 8B.
  • page 8A-page 8B Please refer to page 8A-page 8B.
  • the electronic device may generate and display the third prompt message "Please stay away from the frame or adjust the position of the camera".
  • S605. Process the first image according to the position of the face image in the first image to obtain a second image, where the face image is located at a first preset position in the second image.
  • the user when a user needs to take an image with a reasonable composition through an electronic device, the user can start the camera device in the electronic device, and the electronic device acquires the camera device during the shooting and framing process.
  • the first image acquired, the first image includes a face image; the position of the face image in the first image is determined in the first image; the first image is processed according to the position of the face image in the first image.
  • the second image, the face image is located at the first preset position in the second image; the second image is output on the display screen of the electronic device, so that a reasonable composition image can be obtained during the shooting and framing process, which improves the image shooting quality.
  • FIG. 9 is a schematic structural diagram of an image capturing apparatus provided by an embodiment of the application.
  • the device 10 includes:
  • the acquiring module 11 is configured to acquire a first image collected by the camera device after the camera device is started, and the first image includes a face image;
  • the determining module 12 is configured to determine the position of the face image in the first image in the first image
  • the processing module 13 is configured to process the first image according to the position of the face image in the first image to obtain a second image, and the face image is located in the first preset of the second image.
  • the output module 14 is used to output the second image.
  • An image capturing apparatus provided in an embodiment of the present application can execute the technical solutions shown in the foregoing method embodiments, and its implementation principles and beneficial effects are similar, and details are not described herein again.
  • the determining module is specifically configured to:
  • the position of the rectangular frame in the first image is determined as the position of the face image in the first image.
  • processing module 13 is specifically configured to:
  • processing the first image to obtain a second image According to the position of the face image in the first image and the first preset position, processing the first image to obtain a second image.
  • the determining module 12 is specifically configured to:
  • the first preset position is determined among the plurality of preset positions according to the first area and the preset correspondence, and the preset correspondence is the correspondence between the area and the preset location.
  • processing module 13 is specifically configured to:
  • FIG. 10 is a schematic structural diagram of another image capturing apparatus provided by an embodiment of the application. Based on the embodiment shown in FIG. 7, referring to FIG. 10, the device 10 further includes a receiving module 15:
  • the receiving module 15 is configured to receive a shooting instruction input by a user
  • the determining module 12 is further configured to determine the second image as a captured image according to the shooting instruction.
  • the determining module 12 is further configured to:
  • the ratio is greater than or equal to the first threshold, generating and displaying first prompt information, where the first prompt information is used to prompt the user to stay away from the electronic device;
  • second prompt information is generated and displayed, and the second prompt information is used to prompt the user to approach the electronic device.
  • FIG. 11 is a schematic structural diagram of another image capturing apparatus provided by an embodiment of the application. Based on the embodiment shown in FIG. 10, referring to FIG. 11, the device 10 further includes a judgment module 16:
  • the judgment module 16 is used to judge whether the face image is complete
  • the image capturing apparatus provided in the embodiments of the present application can execute the technical solutions shown in the foregoing method embodiments, and the implementation principles and beneficial effects are similar, and details are not described herein again.
  • FIG. 12 is a schematic diagram of the hardware structure of an image capturing apparatus provided by an embodiment of the application.
  • the image capturing apparatus 20 includes: at least one processor 21 and a memory 22. Among them, the processor 21 and the memory 22 are connected by a bus 23.
  • At least one processor 21 executes the computer-executable instructions stored in the memory 22, so that the at least one processor 21 executes the above method for capturing images.
  • the processor may be a central processing unit (English: Central Processing Unit, abbreviated as: CPU), and may also be other general-purpose processors or digital signal processors (English: Digital Signal Processor). Processor, referred to as DSP), application specific integrated circuit (English: Application Specific Integrated Circuit, referred to as ASIC), etc.
  • the general-purpose processor may be a microprocessor or the processor may also be any conventional processor or the like. The steps of the method disclosed in combination with the invention can be directly embodied as executed and completed by a hardware processor, or executed and completed by a combination of hardware and software modules in the processor.
  • the memory may include a high-speed RAM memory, and may also include a non-volatile storage NVM, such as at least one disk memory.
  • NVM non-volatile storage
  • the bus can be an Industry Standard Architecture (ISA) bus, Peripheral Component (PCI) bus, or Extended Industry Standard Architecture (EISA) bus, etc.
  • ISA Industry Standard Architecture
  • PCI Peripheral Component
  • EISA Extended Industry Standard Architecture
  • the bus can be divided into address bus, data bus, control bus and so on.
  • the buses in the drawings of this application are not limited to only one bus or one type of bus.
  • the present application also provides a computer-readable storage medium in which computer-executable instructions are stored.
  • the processor executes the computer-executable instructions, the method for capturing images as described above is implemented.
  • the above-mentioned computer-readable storage medium may be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable and removable Programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
  • SRAM static random access memory
  • EEPROM electrically erasable and removable Programmable read-only memory
  • EPROM erasable programmable read-only memory
  • PROM programmable read-only memory
  • ROM read-only memory
  • magnetic memory flash memory
  • flash memory magnetic disk or optical disk.
  • a readable storage medium may be any available medium that can be accessed by a general purpose or special purpose computer.
  • An exemplary readable storage medium is coupled to the processor, so that the processor can read information from the readable storage medium and can write information to the readable storage medium.
  • the readable storage medium may also be an integral part of the processor.
  • the processor and the readable storage medium may be located in Application Specific Integrated Circuits (ASIC for short).
  • ASIC Application Specific Integrated Circuits
  • the processor and the readable storage medium may also exist in the device as discrete components.
  • the division of the units is only a logical function division, and there may be other divisions in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not implemented.
  • the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
  • the functional units in the various embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
  • the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium.
  • the technical solution of the present application essentially or the part that contributes to the existing technology or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including Several instructions are used to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the methods described in the various embodiments of the present application.
  • the aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disks or optical disks and other media that can store program codes. .
  • a person of ordinary skill in the art can understand that all or part of the steps in the foregoing method embodiments can be implemented by a program instructing relevant hardware.
  • the aforementioned program can be stored in a computer readable storage medium. When the program is executed, it executes the steps including the foregoing method embodiments; and the foregoing storage medium includes: ROM, RAM, magnetic disk, or optical disk and other media that can store program codes.

Landscapes

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

Abstract

本申请实施例提供一种拍摄图像的方法、装置及设备,应用于电子设备,所述电子设备中设置有摄像装置,所述方法包括:在摄像装置启动后,获取摄像装置采集得到的第一图像,第一图像包括人脸图像;在第一图像中确定人脸图像在第一图像中的位置;根据人脸图像在第一图像中的位置,对第一图像处理得到第二图像,人脸图像位于第二图像中的第一预设位置;输出第二图像。提高了拍摄图像的质量。

Description

拍摄图像的方法、装置及设备
本申请要求于2020年02月17日提交中国专利局、申请号为2020100962064、申请名称为“拍摄图像的方法、装置及设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请实施例涉及拍摄图像技术领域,尤其涉及一种拍摄图像的方法、装置及设备。
背景技术
目前,诸如手机之类的电子设备都具有图像拍摄的功能。用户可以使用电子设备的前置摄像装置进行自拍。
为了提高图像拍摄的质量,现有的前置摄像装置一般都提供了美图的功能,例如美颜或者滤镜,能够让用户对拍摄后的照片进行色彩、对比度等方面的调整,使照片更符合大众的审美。但是上述的美图的方法只是对色彩、美白、磨皮等做出优化,对图像的质量提升程度有限,此外,一般用户不具备专业摄影知识,用户拍摄的图像画面构图往往不够合理,导致图像拍摄质量较差。
发明内容
本申请实施例提供一种拍摄图像的方法、装置及设备,提高了图像拍摄的质量。
第一方面,本申请实施例提供一种拍摄图像的方法,应用于电子设备,所述电子设备中设置有摄像装置,所述方法包括:
在所述摄像装置启动后,获取所述摄像装置采集得到的第一图像,所述第一图像包括人脸图像;
在所述第一图像中确定所述人脸图像在所述第一图像中的位置;
根据所述人脸图像在所述第一图像中的位置,对所述第一图像处理得到第二图像,所述人脸图像位于所述第二图像中的第一预设位置;
输出所述第二图像。
在一种可能的实施方式中,在所述第一图像中确定所述人脸图像在所述第一图像中的位置,包括:
对所述第一图像进行人脸识别,得到所述人脸图像;
确定所述人脸图像所在的矩形框;
将所述矩形框在所述第一图像中的位置确定为所述人脸图像在所述第一图像中的位置。
在一种可能的实施方式中,根据所述人脸图像在所述第一图像中的位置,对所述第一图像处理得到第二图像,包括:
根据所述人脸图像在所述第一图像中的位置,确定所述人脸图像在所述第一图像中的第一区域;
根据所述第一区域,在多个预设位置中确定第一预设位置;
根据所述人脸图像在所述第一图像中的位置和所述第一预设位置,对所述第一图像处理得到第二图像。
在一种可能的实施方式中,根据所述第一区域,在多个预设位置中确定第一预设位置,包括:
根据所述第一区域和预设对应关系,在所述多个预设位置中确定所述第一预设位置,所述预设对应关系为区域与预设位置之间的对应关系。
在一种可能的实施方式中,根据所述人脸图像在所述第一图像中的位置和所述第一预设位置,对所述第一图像处理得到第二图像包括:
根据所述人脸图像在所述第一图像中的位置和所述第一预设位置,在所述第一图像中确定剪裁部位和剪裁尺寸;
根据所述剪裁部位和所述剪裁尺寸对所述第一图像处理得到第二图像。
在一种可能的实施方式中,输出所述第二图像之后,还包括:
接收用户输入的拍摄指令;
根据所述拍摄指令,将所述第二图像确定为拍摄图像。
在一种可能的实施方式中,所述方法还包括:
确定所述人脸图像的尺寸与所述第一图像的尺寸之间的比值;
若所述比值大于或等于第一阈值,则生成并显示第一提示信息,所述 第一提示信息用于提示用户远离所述电子设备;
若所述比值小于或等于第二阈值,则生成并显示第二提示信息,所述第二提示信息用于提示用户靠近所述电子设备。
在一种可能的实施方式中,所述方法还包括:
判断所述人脸图像是否完整;
若否,则生成并显示第三提示信息,所述第三提示信息用于提示用户远离所述电子设备的边框。
第二方面,本申请实施例提供一种拍摄图像的装置,应用于电子设备,所述电子设备中设置有摄像装置,所述装置包括:
获取模块,用于在所述摄像装置启动后,获取所述摄像装置采集得到的第一图像,所述第一图像包括人脸图像;
确定模块,用于在所述第一图像中确定所述人脸图像在所述第一图像中的位置;
处理模块,用于对所述第一图像处理得到第二图像,所述人脸图像位于所述第二图像中的第一预设位置;
输出模块,用于输出所述第二图像。
在一种可能的实施方式中,所述确定模块具体用于:
对所述第一图像进行人脸识别,得到所述人脸图像;
确定所述人脸图像所在的矩形框;
将所述矩形框在所述第一图像中的位置确定为所述人脸图像在所述第一图像中的位置。
在一种可能的实施方式中,所述处理模块具体用于:
根据所述人脸图像在所述第一图像中的位置,确定所述人脸图像在所述第一图像中的第一区域;
根据所述第一区域,在多个预设位置中确定第一预设位置;
根据所述人脸图像在所述第一图像中的位置和所述第一预设位置,对所述第一图像处理得到第二图像。
在一种可能的实施方式中,所述确定模块具体用于:
根据所述第一区域和预设对应关系,在所述多个预设位置中确定所述第一预设位置,所述预设对应关系为区域与预设位置之间的对应关系。
在一种可能的实施方式中,所述处理模块具体用于:
根据所述人脸图像在所述第一图像中的位置和所述第一预设位置,在所述第一图像中确定剪裁部位和剪裁尺寸;
根据所述剪裁部位和所述剪裁尺寸对所述第一图像处理得到第二图像。
在一种可能的实施方式中,所述装置还包括接收模块:
所述接收模块用于,接收用户输入的拍摄指令;
所述确定模块还用于,根据所述拍摄指令,将所述第二图像确定为拍摄图像。
在一种可能的实施方式中,所述确定模块还用于:
确定所述人脸图像的尺寸与所述第一图像的尺寸之间的比值;
若所述比值大于或等于第一阈值,则生成并显示第一提示信息,所述第一提示信息用于提示用户远离所述电子设备;
若所述比值小于或等于第二阈值,则生成并显示第二提示信息,所述第二提示信息用于提示用户靠近所述电子设备。
在一种可能的实施方式中,所述装置还包括判断模块:
所述判断模块用于,判断所述人脸图像是否完整;
若否,则生成并显示第三提示信息,所述第三提示信息用于提示用户远离所述电子设备的边框。
第三方面,本申请实施例提供一种拍摄图像的装置,包括:至少一个处理器和存储器;
所述存储器用于存储计算机程序指令;
所述至少一个处理器用于执行所述存储器存储的计算机程序指令,使得所述至少一个处理器执行如第一方面任一项所述的拍摄图像的方法。
第四方面,本申请实施例提供一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机程序指令,当处理器执行所述计算机程序指令时,实现如第一方面任一项所述的拍摄图像的方法。
本申请实施例提供的拍摄图像的方法、设备及装置,当用户需要通过电子设备拍摄构图合理的图像时,用户可以在电子设备中启动摄像装置,在拍摄取景的过程中,电子设备获取摄像装置采集得到的第一图像,第一图像包括人脸图像;在第一图像中确定人脸图像在第一图像中的位置;根据人脸图像在第一图像中的位置,对第一图像处理得到第二图像,人脸图像位于第二图像中的第一预设位置;在电子设备的显示屏上输出第二图像, 从而可以在用户拍摄取景过程中得到构图合理的图像画面,提高了图像拍摄的质量。
附图说明
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作一简单地介绍,显而易见地,下面描述中的附图是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为本申请实施例提供的拍摄图像的方法的应用场景示意图;
图2为本申请实施例提供的一种拍摄图像的方法的流程示意图;
图3为本申请实施例提供的确定人脸图像在第一图像中的位置的示意图;
图4为本申请实施例提供的黄金构图法则示意图;
图5为本申请实施例提供的拍摄图像过程的示意图;
图6为本申请实施例提供的另一种拍摄图像的方法的流程示意图;
图7为本申请实施例提供的确定人脸图像的尺寸与第一图像的尺寸之间的比值的示意图;
图8为本申请实施例提供的判断人脸图像是否完整的过程示意图;
图9为本申请实施例提供的一种拍摄图像的装置的结构示意图;
图10为本申请实施例提供的另一种拍摄图像的装置的结构示意图;
图11为本申请实施例提供的又一种拍摄图像的装置的结构示意图;
图12为本申请实施例提供的拍摄图像的装置的硬件结构示意图。
具体实施方式
为使本申请实施例的目的、技术方案和优点更加清楚,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
图1为本申请实施例提供的拍摄图像的方法的应用场景示意图。请参 见图1,包括电子设备101和用户102。电子设备101可以为具有图像拍摄功能的电子设备,例如,电子设备101可以包括但不限于智能手机、平板电脑、相机、个人数字助理等电子设备。电子设备101中设置有摄像装置103。摄像装置103可以包括前置摄像装置和后置摄像装置,摄像装置103的数量可以为一个或者多个,摄像装置103可以有多种类型,例如,摄像装置103可以包括广角摄像装置、微距摄像装置、长焦摄像装置等。用户102可以通过摄像装置103采集图像,在现有技术中,电子设备101可以通过摄像装置103采集得到图像,利用美颜或者滤镜等美颜功能对图像中的人脸图像进行处理,从而得到质量较高的图像。但是该过程只是对色彩、美白、磨皮等做出优化,没有考虑到用户拍摄的图像画面构图的合理性,对此,本申请对图像画面优化的处理过程进行了改进。
在本申请中,当用户需要通过电子设备101拍摄高质量的图像时,用户可以启动电子设备101中的摄像装置,在拍摄取景的过程中,电子设备可以通过摄像装置获取得到包括人脸图像的第一图像,根据人脸图像在第一图像中的位置,对该第一图像处理后得到图像画面构图合理的第二图像,从而电子设备101可以在其屏幕上输出构图合理的第二图像。在上述过程中,电子设备101可以根据图像中的人脸图像的位置对该图像处理,从而得到构图合理的图像,使得用户拍摄图像的质量较高。
下面,通过具体实施例对本申请所示的技术方案进行详细说明。需要说明的是,下面几个具体实施例可以相互结合,对于相同或相似的内容,在不同的实施例中不再进行重复说明。
图2为本申请实施例提供的一种拍摄图像的方法的流程示意图。请参见图2,该方法可以包括:
S201、在摄像装置启动后,获取摄像装置采集得到的第一图像。
本申请实施例的执行主体可以为电子设备,也可以为设置在电子设备中的拍摄图像装置。可选的,电子设备可以为具有图像拍摄功能的电子设备,例如,电子设备可以包括但不限于智能手机、平板电脑、相机、个人数字助理等电子设备。电子设备上设置有摄像装置,摄像装置可以包括前置摄像装置和后置摄像装置,摄像装置的数量可以为一个或者多个,摄像装置可以有多种类型,例如,摄像装置可以包括广角摄像装置、微距摄像装置、长焦摄像装置等,对此,本申请实施例不做具体限定。
第一图像可以为电子设备通过摄像装置获取得到的图像,在本申请实施例中,该图像中可以包括人脸图像,具体的,人脸图像的数量可以为1。
在实际应用过程中,当用户需要通过电子设备获取得到构图合理的图像时,用户可以打开电子设备的摄像装置,可选的,用户可以根据实际需要切换前置摄像装置或者后置摄像装置。在摄像装置启动后,用户可以调节摄像装置的角度及位置,实时获取需要采集的图像,电子设备可以设置有显示屏,摄像装置采集得到的图像可以实时地在电子设备的显示屏上输出。
可选的,电子设备中可以设置构图优化功能的选项,在获取第一图像之前,用户可以根据自己的喜好选择是否进行构图优化。
S202、在第一图像中确定人脸图像在第一图像中的位置。
可选的,可以通过如下可行的实现方式在第一图像中确定人脸图像在第一图像中的位置:对第一图像进行人脸识别,得到人脸图像;确定人脸图像所在的矩形框;将矩形框在第一图像中的位置确定为人脸图像在第一图像中的位置。
下面,结合图3,通过具体实施例,对上述确定人脸图像在第一图像中的位置的过程进行详细说明。
图3为本申请实施例提供的确定人脸图像在第一图像中的位置的示意图。请参见图3,包括页面3A、页面3B。
请参见页面3A,当摄像装置采集得到第一图像之后,对第一图像进行人脸识别,得到人脸图像。对第一图像进行人脸识别的过程可以参考现有技术,在此本申请实施例不再赘述。
请参见页面3B,当得到人脸图像之后,确定人脸图像所在的矩形框,将矩形框在第一图像中的位置确定为人脸图像在第一图像中的位置,具体的,如页面3B所示,可以通过矩形框的四条边分别与图像的四条边框的距离来表示矩形框在第一图像中的位置。
S203、根据人脸图像在第一图像中的位置,对第一图像处理得到第二图像,人脸图像位于第二图像中的第一预设位置。
第二图像可以为根据构图法则对第一图像处理后得到的图像。第一预设位置可以为根据构图法则得到的构图合理的人脸图像的位置。构图法则可以包括但不限于黄金构图法则、框架式构图法则、交叉线法则等。其中, 黄金构图法则也可以称为九宫格构图法则,本申请实施例以黄金构图法则为例具体说明。下面,结合图4,对黄金构图法则的具体实现过程进行说明。
图4为本申请实施例提供的黄金构图法则示意图。请参见图4,黄金分割法则近似将图像画面进行三等分分割,具体的,将图像画面分别从水平方向和垂直方向平均分为三等分,形成九宫格,交叉得到的四个点可以作为黄金分割点,这四条线可以作为黄金分割线。当拍摄对象刚好放置于黄金分割点或线上时,拍摄对象的位置以及和剩余空间的分割比值会比较协调,能够营造画面的平衡感,提升视觉舒适感,体现出美感。
可选的,可以通过如下可行的实现方式根据人脸图像在第一图像中的位置,对第一图像处理得到第二图像:根据人脸图像在第一图像中的位置,确定人脸图像在第一图像中的第一区域;根据第一区域,在多个预设位置中确定第一预设位置;根据人脸图像在第一图像中的位置和第一预设位置,对第一图像处理得到第二图像。
其中,第一区域可以为第一图像中矩形框所在的区域。预设位置可以为根据构图法则确定出来的黄金分割点,预设位置的数量可以为多个,具体的,预设位置可以包括:左上三分点、右上三分点、左下三分点、右下三分点。第一预设位置可以为与第一区域距离最近的预设位置,第二图像可以为对第一图像处理后的构图合理的图像。
可选的,可以通过如下可行的实现方式根据第一区域,在多个预设位置中确定第一预设位置:根据第一区域和预设对应关系,在多个预设位置中确定第一预设位置。
其中,预设对应关系为区域与预设位置之间的对应关系。第一预设对应关系可以为多个预设位置中离第一区域最近的预设位置与第一区域的对应关系,例如,当第一区域为右上角区域时,第一预设对应关系可以为第一区域与右上三分点相对应。需要说明的是,上述只是以示例的形式示意区域与预设位置之间的对应关系,当然,还可以有其他形式表示区域与预设位置之间的对应关系。
可选的,可以通过如下可行的实现方式根据人脸图像在第一图像中的位置和第一预设位置,对第一图像处理得到第二图像:根据人脸图像在第一图像中的位置和第一预设位置,在第一图像中确定剪裁部位和剪裁尺寸; 根据剪裁部位和剪裁尺寸对第一图像处理得到第二图像。需要注意的是,在对第一图像处理之前,根据剪裁部位和剪裁尺寸将第一图像按照原图像比值进行放大,以使处理后得到的第二图像与第一图像尺寸相同。
在实际应用过程中,例如,当人脸图像在第一图像中的偏左上角位置时,相应的,矩形框所在位置也处于第一图像中的偏左上角位置,因此可以确定人脸图像在第一图像中的第一区域为左上角区域。根据第一区域和预设对应关系,可以从多个预设位置中确定第一预设位置为左上三分点。移动第一图像,使得人脸图像在第一图像中的位置与第一预设位置重合,具体的,使得矩形框的中心与第一预设位置重合,同时,对移动后的第一图像进行放大,使得放大后的第一图像可以将原第一图像全部包含在内,根据原第一图像的尺寸,确定移动后的第一图像的剪裁部位以及剪裁尺寸。根据剪裁部位以及剪裁尺寸对移动后的第一图像处理得到与第一图像尺寸相同的第二图像。
S204、输出第二图像。
电子设备在其显示屏上输出处理后的第二图像。
可选的,在输出第二图像之后,还可以包括:接收用户输入的拍摄指令;根据拍摄指令,将第二图像确定为拍摄图像。
在实际应用过程中,用户可以在拍摄取景过程中,通过电子设备的显示屏实时看到构图合理的第二图像的画面,当看到自己满意的第二图像时,会点击电子设备的拍摄按钮,电子设备接收到用户输入的拍摄指令后,将该第二图像确定为拍摄图像并保存在电子设备中。
在上述实施例的基础上,下面,结合图5,通过具体示例,对本申请实施例所示的拍摄图像的过程进行详细说明。
图5为本申请实施例提供的拍摄图像过程的示意图。本示例以摄像装置为前置摄像装置为例进行说明。请参见图5,包括页面5A-页面5F。
请参见页面5A,当用户需要通过电子设备拍摄构图合理的图像时,用户可以打开电子设备的摄像装置,在摄像装置开启之后,用户通过调节摄像装置的角度及位置,实时获取需要采集的第一图像,并在电子设备的显示屏上实时输出第一图像。
请参见页面5B,拍摄取景过程中,当获取到第一图像之后,电子设备可以对第一图像进行人脸识别,得到人脸图像,根据人脸图像的尺寸确定 矩形框的尺寸,并将人脸图像放置于矩形框内,使得人脸图像恰好处于矩形框内。将矩形框在第一图像中的位置确定为人脸图像在第一图像中的位置,具体的,将矩形框的中心点确定为人脸图像在第一图像中的位置。
请参见页面5C,根据上述构图法则将图像的画面分别从水平方向和垂直方向平均分为三等分,形成九宫格,多个预设位置即为交叉得到的黄金分割点,分别为:左上三分点、右上三分点、左下三分点、右下三分点。根据人脸图像在第一图像中的位置,可以确定人脸图像在第一图像中的第一区域为右上角,根据第一区域的位置,可以确定在多个预设位置中第一预设位置为右上三分点。
请参见页面5D,移动第一图像,将第一图像中的人脸图像所在的矩形框的中心点与右上三分点重合,此时,第一图像的上部会出现空白区域,需要将第一图像进行放大,具体的,按照原第一图像的比值进行放大,以便可以刚好去掉第一图像由于移动形成的空白区域。对第一图像进行放大之后,在第一图像中确定剪裁部位和剪裁尺寸(页面5D中以灰色部位示出),以使剪裁后得到的第二图像与第一图像尺寸相同。
请参见页面5E,对第一图像进行剪裁,使得刚好可以在电子设备的显示屏中完整输出第二图像。在拍摄取景过程中,用户可以通过显示屏实时看到构图优化后的第二图像。
请参见页面5F,可选的,在电子设备输出第二图像之后,用户可以根据自己的需要进行拍摄,电子设备接收到用户输入的拍摄指令后,将该第二图像确定为拍摄图像并保存在电子设备中,如页面5F所示。
本申请实施例提供的拍摄图像的方法、设备及装置,当用户需要通过电子设备拍摄构图合理的图像时,用户可以在电子设备中启动摄像装置,在拍摄取景的过程中,电子设备获取摄像装置采集得到的第一图像,第一图像包括人脸图像;在第一图像中确定人脸图像在第一图像中的位置;根据人脸图像在第一图像中的位置,对第一图像处理得到第二图像,人脸图像位于第二图像中的第一预设位置;在电子设备的显示屏上输出第二图像,从而可以在拍摄取景过程中得到构图合理的图像画面,提高了图像拍摄的质量。
在上述实施例的基础上,下面,通过图6所示的实施例,对上述拍摄图像的方法进行进一步详细说明。
图6为本申请实施例提供的另一种拍摄图像的方法的流程示意图。请参见图6,该方法可以包括:
S601、在摄像装置启动后,获取摄像装置采集得到的第一图像。
需要说明的是,S601的执行过程可以参见S201的执行过程,此处不再进行赘述。
S602、在第一图像中确定人脸图像在第一图像中的位置。
需要说明的是,S602的执行过程可以参见S202的执行过程,此处不再进行赘述。
S603、确定人脸图像的尺寸与第一图像的尺寸之间的比值。
可选的,若比值大于或等于第一阈值,则生成并显示第一提示信息,第一提示信息用于提示用户远离电子设备,例如,当第一图像中人脸图像较大,具体的,人脸图像的尺寸与第一图像的尺寸的比值大于或等于第一阈值时,电子设备的显示屏上可以显示第一提示信息,例如,第一提示信息可以包括但不限于:“请您远离摄像头”。
若比值小于或等于第二阈值,则生成并显示第二提示信息,第二提示信息用于提示用户靠近电子设备,例如,当第一图像中人脸图像较小,具体的,人脸图像的尺寸与第一图像的尺寸的比值小于或等于第二阈值时,电子设备的显示屏上可以显示第二提示信息,例如,第二提示信息可以包括但不限于:“请您靠近摄像头”。
若比值大于第二阈值且小于第一阈值,则表明人脸图像的尺寸与第一图像的尺寸之间的比值处于正常拍摄范围之内,电子设备可以对在该范围内显示的第一图像进行构图优化处理。
下面,结合图7,通过具体示例,对本申请实施例所示的确定人脸图像的尺寸与第一图像的尺寸之间的比值的过程进行详细说明。
图7为本申请实施例提供的确定人脸图像的尺寸与第一图像的尺寸之间的比值的示意图。请参见图7,包括页面7A-页面7D。
请参见页面7A以及页面7B,当第一图像中人脸图像较大,具体的,人脸图像的尺寸与第一图像的尺寸的比值大于或等于第一阈值时,电子设备的显示屏上可以显示第一提示信息“请您远离摄像头”,用户可以根据该提示信息远离摄像装置。
请参见页面7C以及页面7D,当第一图像中人脸图像较小,具体的, 人脸图像的尺寸与第一图像的尺寸的比值小于或等于第二阈值时,电子设备的显示屏上可以显示第二提示信息“请您靠近摄像头”。用户可以根据该提示信息靠近摄像装置。
S604、判断人脸图像是否完整。
可选的,若人脸图像的尺寸与第一图像的尺寸之间的比值大于第二阈值且小于第一阈值,即人脸图像的尺寸与第一图像的尺寸之间的比值处于正常拍摄范围之内时,可以进一步判断人脸图像是否完整。
可选的,可以通过如下可行的实现方式判断人脸图像是否完整:当人脸处于第一图像的四条边框位置中的任意一条时,或者人脸处于第一图像的四个角时,人脸在显示屏上无法完整显示,即可判断人脸图像不完整。
若否,电子设备则生成并显示第三提示信息,第三提示信息用于提示用户远离电子设备的边框,例如,第三提示信息可以包括但不限于:“请您远离边框或者调整摄像头位置”。
下面,结合图8,通过具体示例,对本申请实施例所示的判断人脸图像是否完整的过程进行详细说明。
图8为本申请实施例提供的判断人脸图像是否完整的过程示意图。请参见图8,包括页面8A-页面8B。
请参见页面8A-页面8B,例如,当人脸处于第一图像的四条边框位置中的任意一条时,人脸在显示屏上无法完整显示,即可判断人脸图像不完整。此时,电子设备可以生成并显示第三提示信息“请您远离边框或者调整摄像头位置”。
S605、根据人脸图像在第一图像中的位置,对第一图像处理得到第二图像,人脸图像位于第二图像中的第一预设位置。
需要说明的是,S605的执行过程可以参见S203的执行过程,此处不再进行赘述。
S606、输出第二图像。
需要说明的是,S606的执行过程可以参见S204的执行过程,此处不再进行赘述。
本申请实施例提供的拍摄图像的方法、设备及装置,当用户需要通过电子设备拍摄构图合理的图像时,用户可以在电子设备中启动摄像装置,在拍摄取景的过程中,电子设备获取摄像装置采集得到的第一图像,第一 图像包括人脸图像;在第一图像中确定人脸图像在第一图像中的位置;根据人脸图像在第一图像中的位置,对第一图像处理得到第二图像,人脸图像位于第二图像中的第一预设位置;在电子设备的显示屏上输出第二图像,从而可以在拍摄取景过程中得到构图合理的图像画面,提高了图像拍摄的质量。
图9为本申请实施例提供的一种拍摄图像的装置的结构示意图。请参见图9,该装置10包括:
获取模块11,用于在所述摄像装置启动后,获取所述摄像装置采集得到的第一图像,所述第一图像包括人脸图像;
确定模块12,用于在所述第一图像中确定所述人脸图像在所述第一图像中的位置;
处理模块13,用于根据所述人脸图像在所述第一图像中的位置,对所述第一图像处理得到第二图像,所述人脸图像位于所述第二图像中的第一预设位置;
输出模块14,用于输出所述第二图像。
本申请实施例提供的一种拍摄图像的装置可以执行上述方法实施例所示的技术方案,其实现原理以及有益效果类似,此处不再进行赘述。
在另一种可能的实施方式中,所述确定模块具体用于:
对所述第一图像进行人脸识别,得到所述人脸图像;
确定所述人脸图像所在的矩形框;
将所述矩形框在所述第一图像中的位置确定为所述人脸图像在所述第一图像中的位置。
在另一种可能的实施方式中,所述处理模块13具体用于:
根据所述人脸图像在所述第一图像中的位置,确定所述人脸图像在所述第一图像中的第一区域;
根据所述第一区域,在多个预设位置中确定第一预设位置;
根据所述人脸图像在所述第一图像中的位置和所述第一预设位置,对所述第一图像处理得到第二图像。
在另一种可能的实施方式中,所述确定模块12具体用于:
根据所述第一区域和预设对应关系,在所述多个预设位置中确定所述第一预设位置,所述预设对应关系为区域与预设位置之间的对应关系。
在另一种可能的实施方式中,所述处理模块13具体用于:
根据所述人脸图像在所述第一图像中的位置和所述第一预设位置,在所述第一图像中确定剪裁部位和剪裁尺寸;
根据所述剪裁部位和所述剪裁尺寸对所述第一图像处理得到第二图像。
图10为本申请实施例提供的另一种拍摄图像的装置的结构示意图。在图7所示实施例的基础上,请参见图10,所述装置10还包括接收模块15:
所述接收模块15用于,接收用户输入的拍摄指令;
所述确定模块12还用于,根据所述拍摄指令,将所述第二图像确定为拍摄图像。
在另一种可能的实施方式中,所述确定模块12还用于:
确定所述人脸图像的尺寸与所述第一图像的尺寸之间的比值;
若所述比值大于或等于第一阈值,则生成并显示第一提示信息,所述第一提示信息用于提示用户远离所述电子设备;
若所述比值小于或等于第二阈值,则生成并显示第二提示信息,所述第二提示信息用于提示用户靠近所述电子设备。
图11为本申请实施例提供的又一种拍摄图像的装置的结构示意图。在图10所示实施例的基础上,请参见图11,所述装置10还包括判断模块16:
所述判断模块16用于,判断所述人脸图像是否完整;
若否,则生成并显示第三提示信息,所述第三提示信息用于提示用户远离所述电子设备的边框。
本申请实施例提供的拍摄图像的装置可以执行上述方法实施例所示的技术方案,其实现原理以及有益效果类似,此处不再进行赘述。
图12为本申请实施例提供的拍摄图像的装置的硬件结构示意图,如图12所示,该拍摄图像的装置20包括:至少一个处理器21和存储器22。其中,处理器21和存储器22通过总线23连接。
在具体实现过程中,至少一个处理器21执行所述存储器22存储的计算机执行指令,使得至少一个处理器21执行如上的拍摄图像的方法。
处理器21的具体实现过程可参见上述方法实施例,其实现原理和技术效果类似,本实施例此处不再赘述。
在上述图12所示的实施例中,应理解,处理器可以是中央处理单元(英文:Central Processing Unit,简称:CPU),还可以是其他通用处理器、 数字信号处理器(英文:Digital Signal Processor,简称:DSP)、专用集成电路(英文:Application Specific Integrated Circuit,简称:ASIC)等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合发明所公开的方法的步骤可以直接体现为硬件处理器执行完成,或者用处理器中的硬件及软件模块组合执行完成。
存储器可能包含高速RAM存储器,也可能还包括非易失性存储NVM,例如至少一个磁盘存储器。
总线可以是工业标准体系结构(Industry Standard Architecture,ISA)总线、外部设备互连(Peripheral Component,PCI)总线或扩展工业标准体系结构(Extended Industry Standard Architecture,EISA)总线等。总线可以分为地址总线、数据总线、控制总线等。为便于表示,本申请附图中的总线并不限定仅有一根总线或一种类型的总线。
本申请还提供一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机执行指令,当处理器执行所述计算机执行指令时,实现如上所述的拍摄图像的方法。
上述的计算机可读存储介质,上述可读存储介质可以是由任何类型的易失性或非易失性存储设备或者它们的组合实现,如静态随机存取存储器(SRAM),电可擦除可编程只读存储器(EEPROM),可擦除可编程只读存储器(EPROM),可编程只读存储器(PROM),只读存储器(ROM),磁存储器,快闪存储器,磁盘或光盘。可读存储介质可以是通用或专用计算机能够存取的任何可用介质。
一种示例性的可读存储介质耦合至处理器,从而使处理器能够从该可读存储介质读取信息,且可向该可读存储介质写入信息。当然,可读存储介质也可以是处理器的组成部分。处理器和可读存储介质可以位于专用集成电路(Application Specific Integrated Circuits,简称:ASIC)中。当然,处理器和可读存储介质也可以作为分立组件存在于设备中。
所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个***,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。
本领域普通技术人员可以理解:实现上述各方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成。前述的程序可以存储于一计算机可读取存储介质中。该程序在执行时,执行包括上述各方法实施例的步骤;而前述的存储介质包括:ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。
最后应说明的是:以上各实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述各实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分或者全部技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的范围。

Claims (11)

  1. 一种拍摄图像的方法,其中,应用于电子设备,所述电子设备中设置有摄像装置,所述方法包括:
    在所述摄像装置启动后,获取所述摄像装置采集得到的第一图像,所述第一图像包括人脸图像;
    在所述第一图像中确定所述人脸图像在所述第一图像中的位置;
    根据所述人脸图像在所述第一图像中的位置,对所述第一图像处理得到第二图像,所述人脸图像位于所述第二图像中的第一预设位置;
    输出所述第二图像。
  2. 根据权利要求1所述的方法,其中,在所述第一图像中确定所述人脸图像在所述第一图像中的位置,包括:
    对所述第一图像进行人脸识别,得到所述人脸图像;
    确定所述人脸图像所在的矩形框;
    将所述矩形框在所述第一图像中的位置确定为所述人脸图像在所述第一图像中的位置。
  3. 根据权利要求1所述的方法,其中,根据所述人脸图像在所述第一图像中的位置,对所述第一图像处理得到第二图像,包括:
    根据所述人脸图像在所述第一图像中的位置,确定所述人脸图像在所述第一图像中的第一区域;
    根据所述第一区域,在多个预设位置中确定第一预设位置;
    根据所述人脸图像在所述第一图像中的位置和所述第一预设位置,对所述第一图像处理得到第二图像。
  4. 根据权利要求3所述的方法,其中,根据所述第一区域,在多个预设位置中确定第一预设位置,包括:
    根据所述第一区域和预设对应关系,在所述多个预设位置中确定所述第一预设位置,所述预设对应关系为区域与预设位置之间的对应关系。
  5. 根据权利要求3所述的方法,其中,根据所述人脸图像在所述第一图像中的位置和所述第一预设位置,对所述第一图像处理得到第二图像包括:
    根据所述人脸图像在所述第一图像中的位置和所述第一预设位置,在 所述第一图像中确定剪裁部位和剪裁尺寸;
    根据所述剪裁部位和所述剪裁尺寸对所述第一图像得到第二图像。
  6. 根据权利要求1所述的方法,其中,输出所述第二图像之后,还包括:
    接收用户输入的拍摄指令;
    根据所述拍摄指令,将所述第二图像确定为拍摄图像。
  7. 根据权利要求1所述的方法,其中,所述方法还包括:
    确定所述人脸图像的尺寸与所述第一图像的尺寸之间的比值;
    若所述比值大于或等于第一阈值,则生成并显示第一提示信息,所述第一提示信息用于提示用户远离所述电子设备;
    若所述比值小于第二阈值,则生成并显示第二提示信息,所述第二提示信息用于提示用户靠近所述电子设备。
  8. 根据权利要求1所述的方法,其中,所述方法还包括:
    判断所述人脸图像是否完整;
    若否,则生成并显示第三提示信息,所述第三提示信息用于提示用户远离所述电子设备的边框。
  9. 一种拍摄图像的装置,其中,所述装置包括:
    获取模块,获取包括人脸图像的第一图像;
    确定模块,确定所述人脸图像在所述第一图像中的位置;
    处理模块,用于对所述第一图像处理得到第二图像,所述人脸图像位于所述第二图像中的第一预设位置。
  10. 根据权利要求9所述的装置,其中,所述确定模块还用于:
    确定所述人脸图像的尺寸与所述第一图像的尺寸之间的比值;
    若所述比值大于或等于第一阈值,则生成并显示第一提示信息,所述第一提示信息用于提示用户远离所述电子设备;
    若所述比值小于或等于第二阈值,则生成并显示第二提示信息,所述第二提示信息用于提示用户靠近所述电子设备。
  11. 一种计算机可读存储介质,其中,所述计算机可读存储介质中存储有计算机程序指令,当处理器执行所述计算机程序指令时,实现如权利要求1至8任一项所述的拍摄图像的方法。
PCT/CN2020/097476 2020-02-17 2020-06-22 拍摄图像的方法、装置及设备 WO2021164162A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010096206.4A CN111263063A (zh) 2020-02-17 2020-02-17 拍摄图像的方法、装置及设备
CN202010096206.4 2020-02-17

Publications (1)

Publication Number Publication Date
WO2021164162A1 true WO2021164162A1 (zh) 2021-08-26

Family

ID=70951118

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/097476 WO2021164162A1 (zh) 2020-02-17 2020-06-22 拍摄图像的方法、装置及设备

Country Status (2)

Country Link
CN (1) CN111263063A (zh)
WO (1) WO2021164162A1 (zh)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111263063A (zh) * 2020-02-17 2020-06-09 深圳传音控股股份有限公司 拍摄图像的方法、装置及设备
CN113796064A (zh) * 2020-06-28 2021-12-14 深圳市大疆创新科技有限公司 拍摄控制方法和装置、云台、拍摄***
CN115812308A (zh) * 2020-07-14 2023-03-17 深圳传音控股股份有限公司 拍摄控制方法、装置、智能设备及计算机可读存储介质
CN114827445B (zh) * 2021-01-29 2023-09-01 华为技术有限公司 图像处理方法及相关装置
CN113301252B (zh) * 2021-05-20 2024-03-22 努比亚技术有限公司 图像拍摄方法、移动终端及计算机可读存储介质
CN115529417A (zh) * 2022-10-05 2022-12-27 湖南科技大学 一种后摄自拍成像方法、人脸验证方法、手机、存储介质

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003348389A (ja) * 2002-05-28 2003-12-05 Konica Minolta Holdings Inc 写真撮影装置
US20090087097A1 (en) * 2007-09-27 2009-04-02 Masako Suehiro Image display device, image display method and storage medium storing image display program
US20100110266A1 (en) * 2008-10-31 2010-05-06 Samsung Electronics Co., Ltd. Image photography apparatus and method for proposing composition based person
CN102413282A (zh) * 2011-10-26 2012-04-11 惠州Tcl移动通信有限公司 一种自拍引导方法和设备
CN102867179A (zh) * 2012-08-29 2013-01-09 广东铂亚信息技术股份有限公司 一种数字证件照片采集质量检测的方法
CN103391361A (zh) * 2013-07-05 2013-11-13 中科创达软件股份有限公司 一种智能终端自拍构图自动提醒方法及装置
JP2014236304A (ja) * 2013-05-31 2014-12-15 株式会社ニコン 撮像装置
CN105100625A (zh) * 2015-08-27 2015-11-25 华南理工大学 一种基于图像美学的人物图像辅助拍摄方法和***
CN105681627A (zh) * 2016-03-03 2016-06-15 联想(北京)有限公司 拍摄图像方法及电子设备
CN107257438A (zh) * 2017-07-10 2017-10-17 广东欧珀移动通信有限公司 拍照提醒方法、装置、终端和计算机存储介质
CN110377204A (zh) * 2019-06-30 2019-10-25 华为技术有限公司 一种生成用户头像的方法及电子设备
CN111263063A (zh) * 2020-02-17 2020-06-09 深圳传音控股股份有限公司 拍摄图像的方法、装置及设备

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7454707B2 (en) * 2002-09-30 2008-11-18 Canon Kabushiki Kaisha Image editing method, image editing apparatus, program for implementing image editing method, and recording medium recording program
JP4508257B2 (ja) * 2008-03-19 2010-07-21 ソニー株式会社 構図判定装置、構図判定方法、プログラム
CN103945129B (zh) * 2014-04-30 2018-07-10 努比亚技术有限公司 基于移动终端的拍照预览构图指导方法及***
CN105357436B (zh) * 2015-11-03 2018-07-03 广东欧珀移动通信有限公司 用于图像拍摄中的图像裁剪方法和***
CN106131418A (zh) * 2016-07-19 2016-11-16 腾讯科技(深圳)有限公司 一种构图控制方法、装置及拍照设备
CN107909030A (zh) * 2017-11-14 2018-04-13 深圳市金立通信设备有限公司 人像照片的处理方法、终端及计算机可读存储介质
CN108833784B (zh) * 2018-06-26 2021-01-29 Oppo(重庆)智能科技有限公司 一种自适应构图方法、移动终端及计算机可读存储介质

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003348389A (ja) * 2002-05-28 2003-12-05 Konica Minolta Holdings Inc 写真撮影装置
US20090087097A1 (en) * 2007-09-27 2009-04-02 Masako Suehiro Image display device, image display method and storage medium storing image display program
US20100110266A1 (en) * 2008-10-31 2010-05-06 Samsung Electronics Co., Ltd. Image photography apparatus and method for proposing composition based person
CN102413282A (zh) * 2011-10-26 2012-04-11 惠州Tcl移动通信有限公司 一种自拍引导方法和设备
CN102867179A (zh) * 2012-08-29 2013-01-09 广东铂亚信息技术股份有限公司 一种数字证件照片采集质量检测的方法
JP2014236304A (ja) * 2013-05-31 2014-12-15 株式会社ニコン 撮像装置
CN103391361A (zh) * 2013-07-05 2013-11-13 中科创达软件股份有限公司 一种智能终端自拍构图自动提醒方法及装置
CN105100625A (zh) * 2015-08-27 2015-11-25 华南理工大学 一种基于图像美学的人物图像辅助拍摄方法和***
CN105681627A (zh) * 2016-03-03 2016-06-15 联想(北京)有限公司 拍摄图像方法及电子设备
CN107257438A (zh) * 2017-07-10 2017-10-17 广东欧珀移动通信有限公司 拍照提醒方法、装置、终端和计算机存储介质
CN110377204A (zh) * 2019-06-30 2019-10-25 华为技术有限公司 一种生成用户头像的方法及电子设备
CN111263063A (zh) * 2020-02-17 2020-06-09 深圳传音控股股份有限公司 拍摄图像的方法、装置及设备

Also Published As

Publication number Publication date
CN111263063A (zh) 2020-06-09

Similar Documents

Publication Publication Date Title
WO2021164162A1 (zh) 拍摄图像的方法、装置及设备
EP3326360B1 (en) Image capturing apparatus and method of operating the same
CN112565589B (zh) 一种拍照预览方法、装置、存储介质和电子设备
EP3346329A1 (en) Image processing method and apparatus
US20210306559A1 (en) Photographing methods and devices
WO2022028184A1 (zh) 一种拍摄控制方法、装置、电子设备及存储介质
JP2016528772A (ja) 画像処理方法および画像処理装置、ならびに端末
WO2020103604A1 (zh) 拍照方法、装置、终端及计算机可读存储介质
WO2018076460A1 (zh) 一种终端的拍照方法和终端
JP2006311574A (ja) 合成デジタル画像効果を作成する方法及び装置
CN109040596B (zh) 一种调整摄像头的方法、移动终端及存储介质
US20100118175A1 (en) Imaging Apparatus For Image Integration
WO2018166069A1 (zh) 拍照预览方法、图形用户界面及终端
CN110798627B (zh) 一种拍摄方法、装置、存储介质及终端
CN111064893A (zh) 一种扫码拍照兼容方法及电子终端
CN108495041B (zh) 一种用于电子终端的图像处理和显示方法、装置
US11770603B2 (en) Image display method having visual effect of increasing size of target image, mobile terminal, and computer-readable storage medium
TWI520604B (zh) 攝像裝置及其影像預覽系統及影像預覽方法
CN111290659A (zh) 书写板信息记录方法、***和书写板
CN107155000B (zh) 一种拍照行为分析方法、装置及移动终端
KR20170011876A (ko) 영상 처리 장치 및 그 동작 방법
JP2009088710A (ja) 撮影装置、撮影方法及び撮影プログラム
CN113037990B (zh) 辅助拍摄方法、终端设备及计算机可读存储介质
KR102022559B1 (ko) 듀얼 카메라를 이용한 무배경 이미지 촬영과 이를 이용한 합성사진 촬영 방법 및 컴퓨터 프로그램
CN112351204A (zh) 一种拍照方法、装置、移动终端及计算机可读存储介质

Legal Events

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

Ref document number: 20920272

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 25/01/2023)

122 Ep: pct application non-entry in european phase

Ref document number: 20920272

Country of ref document: EP

Kind code of ref document: A1