WO2021218926A1 - Image display method and apparatus, and computer device - Google Patents

Image display method and apparatus, and computer device Download PDF

Info

Publication number
WO2021218926A1
WO2021218926A1 PCT/CN2021/089984 CN2021089984W WO2021218926A1 WO 2021218926 A1 WO2021218926 A1 WO 2021218926A1 CN 2021089984 W CN2021089984 W CN 2021089984W WO 2021218926 A1 WO2021218926 A1 WO 2021218926A1
Authority
WO
WIPO (PCT)
Prior art keywords
area
image
target
face
display
Prior art date
Application number
PCT/CN2021/089984
Other languages
French (fr)
Chinese (zh)
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 WO2021218926A1 publication Critical patent/WO2021218926A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • GPHYSICS
    • G07CHECKING-DEVICES
    • G07CTIME OR ATTENDANCE REGISTERS; REGISTERING OR INDICATING THE WORKING OF MACHINES; GENERATING RANDOM NUMBERS; VOTING OR LOTTERY APPARATUS; ARRANGEMENTS, SYSTEMS OR APPARATUS FOR CHECKING NOT PROVIDED FOR ELSEWHERE
    • G07C9/00Individual registration on entry or exit
    • G07C9/30Individual registration on entry or exit not involving the use of a pass
    • G07C9/32Individual registration on entry or exit not involving the use of a pass in combination with an identity check
    • G07C9/37Individual registration on entry or exit not involving the use of a pass in combination with an identity check using biometric data, e.g. fingerprints, iris scans or voice recognition
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10016Video; Image sequence

Definitions

  • the embodiments of the present application relate to the field of image processing technology, and in particular to an image display method, device, and computer equipment.
  • biometric access control systems based on artificial intelligence and deep learning have developed rapidly.
  • face recognition access control is more and more widely used in access control systems due to its fast speed, convenient traffic and good user experience.
  • the face recognition access control system is limited by the appearance of the device, and its preview interface for users to watch their face is often displayed as a fixed scene, that is, the image at a fixed position in the capture range of the camera is displayed in the preview. Interface.
  • the user must stand at the fixed position to see his face on the preview interface, which limits the display position of the face to a small range, which brings inconvenience to the user.
  • the embodiments of the present application provide an image display method, device, computer equipment, and storage medium, which can expand the position where the human face can be displayed.
  • an image display method includes:
  • the target image is displayed on the display interface.
  • the determining the face area in the image includes:
  • the area indicated by the largest detection frame in one or more detection frames in the image is taken as the face area in the image.
  • the determining the target area in the image according to the face area in the image includes:
  • a target area in the image is determined.
  • the determining the target area in the image according to the first area and the second area includes:
  • the distance between the position of the first area and the position of the second area is less than or equal to a preset distance, using the first area as the target area in the image;
  • the position of the second area is moved to the direction of the position of the first area by the preset distance .
  • the method further includes:
  • a target area in the image is determined.
  • an image display device includes:
  • the processor is configured to determine the face area in the acquired image; determine the target area in the image according to the face area in the image, and the size of the target area is the same as the size of the display interface; Describe the target area in the image to obtain the target image;
  • the display is used to display the target image on the display interface.
  • the processor is used to:
  • the area indicated by the largest detection frame in one or more detection frames in the image is taken as the face area in the image.
  • the processor is used to:
  • a target area in the image is determined.
  • the processor is used to:
  • the distance between the position of the first area and the position of the second area is less than or equal to a preset distance, using the first area as the target area in the image;
  • the position of the second area is moved to the direction of the position of the first area by the preset distance .
  • the processor is further configured to:
  • a target area in the image is determined.
  • the device further includes:
  • the image acquisition module is used to acquire images.
  • an image display device includes:
  • Image acquisition module for acquiring images
  • the first determining module is used to determine the face area in the image
  • the second determining module is configured to determine a target area in the image according to the face area in the image, and the size of the target area is the same as the size of the display interface;
  • the cropping module is used to crop out the target area in the image to obtain the target image
  • the display module is used to display the target image on the display interface.
  • the first determining module is used to:
  • the area indicated by the largest detection frame in one or more detection frames in the image is taken as the face area in the image.
  • the second determining module is used to:
  • a target area in the image is determined.
  • the second determining module is used to:
  • the distance between the position of the first area and the position of the second area is less than or equal to a preset distance, using the first area as the target area in the image;
  • the position of the second area is moved to the direction of the position of the first area by the preset distance .
  • the device further includes:
  • the third determining module is configured to, if there is no face area in the image, use an area in the image with the same size as the size of the display interface and the same center point as the center point of the image as the first area ;
  • a fourth determining module configured to use the target area in the last frame of image acquired before the image is acquired as the second area
  • the fifth determining module is configured to determine a target area in the image according to the first area and the second area.
  • a computer device in one aspect, includes a processor and a memory, the memory is used to store a computer program, and the processor is used to execute the program stored in the memory to realize the above-mentioned image display Method steps.
  • a computer-readable storage medium is provided, and a computer program is stored in the storage medium, and when the computer program is executed by a processor, the steps of the above-mentioned image display method are realized.
  • a computer program product containing instructions which when run on a computer, causes the computer to execute the steps of the above-mentioned image display method.
  • the embodiment of the present application expands the position range that can realize the face display, improves the flexibility of the face display, and can greatly improve the user. Experience.
  • FIG. 1 is a flowchart of an image display method provided by an embodiment of the present application
  • FIG. 2 is a flowchart of another image display method provided by an embodiment of the present application.
  • FIG. 3 is a schematic diagram of a face area and a first area provided by an embodiment of the present application
  • FIG. 4 is a schematic diagram of a first area, a second area, and a target area provided by an embodiment of the present application;
  • FIG. 5 is a flowchart of another image display method provided by an embodiment of the present application.
  • FIG. 6 is a schematic structural diagram of an image display device provided by an embodiment of the present application.
  • FIG. 7 is a schematic structural diagram of another image display device provided by an embodiment of the present application.
  • FIG. 8 is a schematic structural diagram of a terminal provided by an embodiment of the present application.
  • Fig. 9 is a schematic structural diagram of a server provided by an embodiment of the present application.
  • Fig. 1 is a flowchart of an image display method provided by an embodiment of the present application. Referring to Figure 1, the method includes the following steps:
  • Step 101 Obtain an image, and determine the face area in the image.
  • Step 102 Determine a target area in the image according to the face area in the image, and the size of the target area is the same as the size of the display interface.
  • Step 103 Cut out the target area in the image to obtain the target image.
  • Step 104 Display the target image on the display interface.
  • the face area in the image is determined.
  • the target area in the image is determined according to the face area in the image, and then the target area in the image is cut out to obtain the target image.
  • the target image is displayed on the display interface.
  • the embodiment of the present application expands the position range that can realize the face display, improves the flexibility of the face display, and can greatly improve the user. Experience.
  • determining the face area in the image includes:
  • the area indicated by the largest detection frame in one or more detection frames in the image is taken as the face area in the image.
  • determining the target area in the image according to the face area in the image includes:
  • the target area in the image is determined.
  • determining the target area in the image according to the first area and the second area includes:
  • the first area is taken as the target area in the image
  • the position of the second area is moved to the direction of the position of the first area by the preset distance to obtain the target position;
  • the area with the same position as the target position is regarded as the target area in the image.
  • the method further includes:
  • the target area in the image is determined.
  • Fig. 2 is a flowchart of an image display method provided by an embodiment of the present application. Referring to Figure 2, the method includes the following steps.
  • Step 201 Obtain an image, and determine a target area in the image.
  • one frame of image can be acquired every time the camera acquires a frame of image during the image acquisition process.
  • the camera can collect images in real time.
  • the camera may be a camera used in an access control device.
  • the image collected by the camera can be used for face recognition.
  • the access control device can open the door when the face recognition is successful, and maintain the door when the face recognition fails.
  • the image collected by the camera can be previewed by the user, that is, can be used for display on the display screen of the access control device, and can be specifically displayed according to the image display method provided in the embodiment of the present application.
  • the image display method provided in the embodiments of the present application can be applied not only to access control devices, but also to other devices with image display requirements, such as payment devices, which are not limited in the embodiments of the present application.
  • the size of the target area is the same as the size of the display interface. In other words, the width and height of the target area are consistent with the screen display resolution. In this way, the image of the target area can be directly displayed on the display interface.
  • the target area in the image can be determined, so that the subsequent image preview in the display interface can be realized accordingly. That is, the embodiment of the present application can realize real-time preview of the image collected by the camera during the image collection process.
  • the target area in the image when determining the target area in the image, if there is a face area in the image, the target area in the image can be determined according to the following first possible way; if there is no face area in the image, you can Determine the target area in the image according to the second possible way as follows.
  • the first possible way determine the face area in the image; determine the target area in the image according to the face area in the image.
  • the face area in the image is an area where a face exists in the image.
  • one or more detection frames in the image can be determined, and the area indicated by the largest detection frame in the one or more detection frames in the image is taken as the area in the image Of the face area.
  • the detection frame contains a human face, and the detection frame is used to indicate an area where the human face exists.
  • the area can usually be a rectangular area, so the size of the detection frame can usually include the width and height of the detection frame.
  • the face contained in the largest detection frame in one or more detection frames in the image is most likely to be the face of the person currently using the camera, so one or more of the The area indicated by the largest detection frame in the detection frame is taken as the face area in the image.
  • the area indicated by the widest or highest detection frame in one or more detection frames in the image can be used as the face area in the image.
  • the image can be input to a face detection model, and the face detection model outputs the position of each detection frame in the image.
  • the position of the detection frame may include the size and position of the detection frame (such as the upper left corner point). , The lower left corner point, the upper right corner point, the lower right corner point or the center point) coordinates.
  • one or more detection frames in the image can also be determined in other ways, which is not limited in the embodiment of the present application.
  • the face detection model may be a pre-trained model that can determine the detection frame where the face appears in the image.
  • the face detection model may be CNN (Convolutional Neural Network, convolutional neural network).
  • the coordinates of the position point included in the position of the detection frame are not the coordinates of the center point
  • the area indicated by the largest detection frame in one or more detection frames in the image is regarded as the person in the image.
  • the coordinates of the center point of the face area can also be determined according to the size of the face area and the coordinates of the location point.
  • the operation of determining the target area in the image may be: the size in the image is the same as the size of the display interface, and the center point is the same as the center point of the face area in the image As the target area in the image.
  • the area in the image whose size is the same as the size of the display interface and the center point is the same as the center point of the face area is regarded as the first area; the target area in the last frame of the image captured before the image is captured As the second area; according to the first area and the second area, determine the target area in the image.
  • the boundary of the first area in the image is obtained by expanding or shrinking the boundary of the face area in the image in the image. That is to say, when the size of the face area in the image is smaller than the size of the display interface, the boundary of the first area in the image is expanded by the boundary of the face area in the image. Obtained; when the size of the face area in the image is greater than the size of the display interface, the boundary of the first area in the image is obtained by shrinking the boundary of the face area in the image in the image.
  • the face area in the image can be directly used as the first area.
  • the size of the face area in the image is smaller than the size of the display interface, and the center point of the face area in the image is point M, the width of the display interface is a, and the height is b. Then you can take the center point of the face area in the image (ie M point) as the starting point, and expand the area boundary to one-half of the width of the display interface (ie 1/2 of a) in the width direction , In the height direction, expand the area boundary to one-half of the height of the display interface (that is, 1/2 of b), and the area enclosed by the expanded area boundary is the first area. At this time, the size of the first area in the image is the same as the size of the display interface, and the center point is the same as the center point of the face area in the image.
  • the boundary adjustment of the first region may be performed.
  • the boundary of the first area may be moved in the width direction and/or the height direction into the image until the boundary of the first area is exactly in the image.
  • the image is the image currently collected by the camera.
  • the image of the target area in the last frame of the image collected by the camera before the image is collected is the image currently displayed on the display interface. That is, the image of the second area is the image being displayed on the display interface when the camera collects the image.
  • the first area and the second area may be combined, that is, the area where the face is located in the current image and the area where the image being displayed on the display interface is located in the previous frame of the image. Determine the area in the current image where the image to be displayed on the display interface is located in the current image. In this way, it helps to achieve a smooth display of the image.
  • the operation of determining the target area in the image may be: if the distance between the position of the first area and the position of the second area is less than or equal to the preset distance, then the first area The area is used as the target area in the image. If the distance between the position of the first area and the position of the second area is greater than the preset distance, the position of the second area is moved to the direction of the position of the first area by the preset distance to obtain the target position; The same area as the target position is taken as the target area in the image.
  • the preset distance can be set according to actual usage requirements, and the preset distance can be set to be smaller.
  • the position of the first area and the position of the second area can both be indicated by corresponding position points. That is, the distance between the position of the first area and the position of the second area can be measured by the corresponding position point in the first area and the second area, and the position point may be a corner point or a center point.
  • the distance between the upper left corner point of the first area and the upper left corner point of the second area can be taken as the distance between the position of the first area and the position of the second area; or, the lower left corner of the first area can be The distance between the point and the lower left corner point of the second area is taken as the distance between the position of the first area and the position of the second area; alternatively, the upper right corner point of the first area and the upper right corner point of the second area The distance between the first area and the second area is the distance between the position of the first area and the position of the second area; alternatively, the distance between the lower right corner point of the first area and the lower right corner point of the second area can be taken as the distance between the position of the first area and the position of the second area.
  • the distance between the positions of the second area; or, the distance between the center point of the first area and the center point of the second area may be taken as the distance between the position of the first area and the position of the second area.
  • the image display of the second area is switched to The image display of the first area is relatively smooth, so the first area can be directly used as the target area in the image, so that the area where the human face is located in the current image can be directly displayed subsequently.
  • the distance between the position of the first area and the position of the second area is greater than the preset distance, it means that the position of the first area is farther away from the position of the second area.
  • the image display of the second area is switched to the first area.
  • the image display of the area is likely to show fluctuations in the display screen, so at this time, the first area is not used as the target area in the image, but the position of the second area is moved in the direction of the position of the first area.
  • Distance to get the location of the target area in the image That is to say, in this case, the position of the image being displayed on the display interface is approached to the position of the human face in the current image by a fixed step (ie, a preset distance), so that a smooth transition of the displayed image can be realized.
  • the operation of moving the position of the second area toward the position of the first area by a preset distance to obtain the target position can be realized by adjusting the position of the second area.
  • the position of the first area and the position of the second area are both indicated by the upper left corner point.
  • the coordinates of the upper left corner of the first area are (X 1 , Y 1 )
  • the coordinates of the upper left corner of the second area are (X 2 , Y 2 )
  • the preset distance is v
  • the difference between Y 1 and Y 2 is also greater than v.
  • the target position includes the size and the coordinates of the upper left corner point. This size is the size of the first area.
  • the upper left corner point coordinates are obtained by adjusting the coordinates of the upper left corner point of the second area, that is, the The coordinates of the upper left corner point are adjusted (X 2 , Y 2 ).
  • the abscissa X 2 of the upper left corner point included in the target position is X 2 +v; if X 2 -X 1 >v, then the abscissa of the upper left corner point included in the target position X 2 is X 2 -v. If Y 1 -Y 2 >v, the ordinate Y 2 of the upper left corner point included in the target position is Y 2 +v; if Y 2 -Y 1 >v, then the ordinate Y 2 of the upper left corner point included in the target position Y 2 is Y 2 -v.
  • the coordinates of the upper left corner of the first area are (X 1 , Y 1 ), the coordinates of the upper left corner of the second area are (X 2 , Y 2 ), and the preset distance is v.
  • the second area can be moved to the right by v, and the second area can be moved down by v, and the position of the moved second area is the position of the target area.
  • the second possible way if there is no face area in the image, then the area in the image with the same size as the size of the display interface and the same center point as the center point of the image is taken as the first area; The target area in the last frame of image collected before the image is taken as the second area; the target area in the image is determined according to the first area and the second area.
  • the first area in the image is the central area of the image
  • the central point of the central area of the image is the central point of the image
  • the central area of the image is the central point of the image
  • the size of is the size of the display interface.
  • the image is the image currently collected by the camera.
  • the image of the target area in the last frame of the image collected by the camera before the image is collected is the image currently displayed on the display interface. That is, the image of the second area is the image being displayed on the display interface when the camera collects the image.
  • the first area and the second area may be combined, that is, combined with the center area of the current image and the area where the image being displayed on the display interface is located in the previous frame of image, to determine the current image Is used for the area where the image displayed on the display interface is located in the current image. In this way, it helps to achieve a smooth display of the image.
  • the operation of determining the target area in the image may be: if the distance between the position of the first area and the position of the second area is less than or equal to the preset distance, then the first area The area is used as the target area in the image. If the distance between the position of the first area and the position of the second area is greater than the preset distance, the position of the second area is moved to the direction of the position of the first area by the preset distance to obtain the target position; The same area as the target position is taken as the target area in the image.
  • the preset distance can be set according to actual usage requirements, and the preset distance can be set to be smaller.
  • the position of the first area and the position of the second area can both be indicated by corresponding position points. That is, the distance between the position of the first area and the position of the second area can be measured by the corresponding position point in the first area and the second area, and the position point may be a corner point or a center point.
  • the image display of the second area is switched to The image display of the first area is relatively smooth, so the first area can be directly used as the target area in the image, so that the central area of the current image can be directly displayed subsequently.
  • the distance between the position of the first area and the position of the second area is greater than the preset distance, it means that the position of the first area is farther away from the position of the second area.
  • the image display of the second area is switched to the first area.
  • the image display of the area is likely to show fluctuations in the display screen, so at this time, the first area is not used as the target area in the image, but the position of the second area is moved in the direction of the position of the first area.
  • Distance to get the location of the target area in the image That is to say, in this case, the position of the image being displayed on the display interface is approached to the center position of the current image by a fixed step (ie, a preset distance), so that a smooth transition of the displayed image can be achieved.
  • Step 202 Cut out the target area in the image to obtain the target image.
  • the image located within the boundary of the target area in the image is the target image. Since the size of the target area is the same as the size of the display interface, the resolution of the target image is the same as the resolution of the display interface.
  • Step 203 Display the target image on the display interface.
  • the target image Since the resolution of the target image is the same as the resolution of the display interface, the target image can be displayed clearly and completely in the display interface, so that the preview image will not be distorted and the preview effect is better.
  • the face area in the image is determined.
  • the target area in the image is determined according to the face area in the image, and then the target area in the image is cut out to obtain the target image.
  • the target image is displayed on the display interface.
  • the embodiment of the present application expands the position range that can realize the face display, improves the flexibility of the face display, and can greatly improve the user. Experience.
  • the background and position range of the captured image are also fixed.
  • the face area can be detected first, and then the new preview area is gradually approached to the detected face area, so as to ensure that the previewed target image can contain the face as much as possible, and it can also generate A preview effect similar to tracking human faces, which can significantly improve the visual effect and user experience.
  • the image display method provided by the embodiment of the present application will be described with reference to FIG. 5 as an example.
  • the image display can be implemented according to the following steps.
  • Step 501 Detect whether there is a human face in the image. If there is a human face, continue to perform the following steps 502-504; if there is no human face, continue to perform the following steps 505-508.
  • Step 502 Determine the face area in the image.
  • Step 503 A region in the image with the same size as the size of the display interface and the same center point as the center point of the face region in the image is taken as the first region.
  • Step 504 If the distance between the position of the first area and the position of the second area is greater than the preset distance, move the position of the second area to the position of the first area by the preset distance to obtain the target in the image The location of the area.
  • the second area is the target area in the last frame of image collected by the camera before the image is collected.
  • Step 505 Determine whether the target area in the previous frame of image is its central area; if it is, proceed to step 506; if not, proceed to step 507 to step 508.
  • the center point of the center area is the same as the image center point, and the size of the center area is the same as the size of the display interface.
  • Step 506 Use the central area of the image as the target area in the image.
  • Step 507 Use the central area of the image as the first area.
  • Step 508 If the distance between the position of the first area and the position of the second area is greater than the preset distance, move the position of the second area to the position of the first area by the preset distance to obtain the target in the image The location of the area.
  • step 506 After the target area in the image is obtained through step 504, step 506, or step 508, the following steps 509 to 510 can be performed to realize image display.
  • Step 509 Cut out the target area in the image to obtain the target image.
  • Step 510 Display the target image on the display interface.
  • FIG. 6 is a schematic structural diagram of an image display device provided by an embodiment of the present application. Referring to Figure 6, the device includes:
  • the image acquisition module 601 is used to acquire an image
  • the first determining module 602 is configured to determine the face area in the image
  • the second determining module 603 is configured to determine a target area in the image according to the face area in the image, and the size of the target area is the same as the size of the display interface;
  • the cropping module 604 is used to crop out the target area in the image to obtain the target image
  • the display module 605 is used to display the target image on the display interface.
  • the first determining module 602 is used to:
  • the area indicated by the largest detection frame in one or more detection frames in the image is taken as the face area in the image.
  • the second determining module 603 is used to:
  • the target area in the image is determined.
  • the second determining module 603 is used to:
  • the first area is taken as the target area in the image
  • the position of the second area is moved to the direction of the position of the first area by the preset distance to obtain the target position;
  • the area with the same position as the target position is regarded as the target area in the image.
  • the device further includes:
  • the third determining module is configured to, if there is no face area in the image, use an area in the image with the same size as the size of the display interface and the same center point as the center point of the image as the first area;
  • the fourth determining module is configured to use the target area in the last frame of image acquired before the image is acquired as the second area;
  • the fifth determining module is used to determine the target area in the image according to the first area and the second area.
  • an image is acquired, and the face area in the image is determined. Then, the target area in the image is determined according to the face area in the image, and then the target area in the image is cut out to obtain the target image. Finally, the target image is displayed on the display interface. In this way, as long as the user is within the image acquisition range, the target image displayed on the display interface will contain the user's face as much as possible.
  • the embodiment of the present application expands the position range that can realize the face display, improves the flexibility of the face display, and can greatly improve the user. Experience.
  • FIG. 7 is a schematic structural diagram of an image display device provided by an embodiment of the present application. Referring to Figure 7, the device includes:
  • the processor 701 is configured to determine the face area in the acquired image; determine the target area in the image according to the face area in the image, and the size of the target area is the same as the size of the display interface; The target area, the target image is obtained;
  • the display 702 is used to display a target image on the display interface.
  • the processor 701 is configured to:
  • the area indicated by the largest detection frame in one or more detection frames in the image is taken as the face area in the image.
  • the processor 701 is configured to:
  • the target area in the image is determined.
  • the processor 701 is configured to:
  • the first area is taken as the target area in the image
  • the position of the second area is moved to the direction of the position of the first area by the preset distance to obtain the target position;
  • the same area as the target position is taken as the target area in the image.
  • the processor 701 is configured to:
  • the target area in the image is determined.
  • the device further includes:
  • the image acquisition module is used to acquire images.
  • the human face area is determined in the acquired image. Then, the target area in the image is determined according to the face area in the image, and then the target area in the image is cut out to obtain the target image. Finally, the target image is displayed on the display interface. In this way, as long as the user is within the image acquisition range, the target image displayed on the display interface will contain the user's face as much as possible.
  • the embodiment of the present application expands the position range that can realize the face display, improves the flexibility of the face display, and can greatly improve the user. Experience.
  • the image display device provided in the above embodiment displays images
  • only the division of the above functional modules is used as an example for illustration.
  • the above functions can be allocated by different functional modules as needed, i.e.
  • the internal structure of the device is divided into different functional modules to complete all or part of the functions described above.
  • the image display device provided in the foregoing embodiment and the image display method embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, and will not be repeated here.
  • FIG. 8 is a schematic structural diagram of a terminal 800 provided by an embodiment of the present application.
  • the terminal 800 can be: a smart phone, a tablet computer, an MP3 player (Moving Picture Experts Group Audio Layer III, a moving picture expert compresses standard audio layer 3), MP4 (Moving Picture Experts Group Audio Layer IV, a moving picture expert compresses a standard audio layer) 4) Player, laptop or desktop computer.
  • the terminal 800 may also be called user equipment, portable terminal, laptop terminal, desktop terminal and other names.
  • the terminal 800 includes a processor 801 and a memory 802.
  • the processor 801 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and so on.
  • the processor 801 may adopt at least one hardware form among DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array, Programmable Logic Array). accomplish.
  • the processor 801 may also include a main processor and a coprocessor.
  • the main processor is a processor used to process data in the wake state, also called a CPU (Central Processing Unit, central processing unit); the coprocessor is A low-power processor used to process data in the standby state.
  • the processor 801 may be integrated with a GPU (Graphics Processing Unit, image processor), and the GPU is used for rendering and drawing content that needs to be displayed on the display screen.
  • the processor 801 may further include an AI (Artificial Intelligence) processor, and the AI processor is used to process computing operations related to machine learning.
  • AI Artificial Intelligence
  • the memory 802 may include one or more computer-readable storage media, which may be non-transitory.
  • the memory 802 may also include high-speed random access memory and non-volatile memory, such as one or more magnetic disk storage devices and flash memory storage devices.
  • the non-transitory computer-readable storage medium in the memory 802 is used to store at least one instruction, and the at least one instruction is used to be executed by the processor 801 to implement the method provided in the embodiment of the present application. The operation performed in the image display method.
  • the terminal 800 may optionally further include: a peripheral device interface 803 and at least one peripheral device.
  • the processor 801, the memory 802, and the peripheral device interface 803 may be connected by a bus or a signal line.
  • Each peripheral device can be connected to the peripheral device interface 803 through a bus, a signal line, or a circuit board.
  • the peripheral device includes: at least one of a radio frequency circuit 804, a display screen 805, a camera component 806, an audio circuit 807, a positioning component 808, and a power supply 809.
  • the peripheral device interface 803 may be used to connect at least one peripheral device related to I/O (Input/Output) to the processor 801 and the memory 802.
  • the processor 801, the memory 802, and the peripheral device interface 803 are integrated on the same chip or circuit board; in some other embodiments, any one of the processor 801, the memory 802, and the peripheral device interface 803 or The two can be implemented on separate chips or circuit boards, which are not limited in the embodiment of the present application.
  • the radio frequency circuit 804 is used for receiving and transmitting RF (Radio Frequency, radio frequency) signals, also called electromagnetic signals.
  • the radio frequency circuit 804 communicates with a communication network and other communication devices through electromagnetic signals.
  • the radio frequency circuit 804 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals into electrical signals.
  • the radio frequency circuit 804 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, and the like.
  • the radio frequency circuit 804 can communicate with other terminals through at least one wireless communication protocol.
  • the wireless communication protocol includes, but is not limited to: metropolitan area networks, various generations of mobile communication networks (2G, 3G, 4G, and 5G), wireless local area networks, and/or WiFi (Wireless Fidelity, wireless fidelity) networks.
  • the radio frequency circuit 804 may also include a circuit related to NFC (Near Field Communication), which is not limited in the embodiment of the present application.
  • the display screen 805 is used to display UI (User Interface).
  • the UI can include graphics, text, icons, videos, and any combination thereof.
  • the display screen 805 also has the ability to collect touch signals on or above the surface of the display screen 805.
  • the touch signal can be input to the processor 801 as a control signal for processing.
  • the display screen 805 may also be used to provide virtual buttons and/or virtual keyboards, also called soft buttons and/or soft keyboards.
  • the display screen 805 there may be one display screen 805, which is arranged on the front panel of the terminal 800; in other embodiments, there may be at least two display screens 805, which are respectively arranged on different surfaces of the terminal 800 or in a folded design; In some other embodiments, the display screen 805 may be a flexible display screen, which is disposed on the curved surface or the folding surface of the terminal 800. Furthermore, the display screen 805 can also be set as a non-rectangular irregular pattern, that is, a special-shaped screen.
  • the display screen 805 may be made of materials such as LCD (Liquid Crystal Display) and OLED (Organic Light-Emitting Diode).
  • the camera assembly 806 is used to capture images or videos.
  • the camera assembly 806 includes a front camera and a rear camera.
  • the front camera is set on the front panel of the terminal, and the rear camera is set on the back of the terminal.
  • the camera assembly 806 may also include a flash.
  • the flash can be a single-color flash or a dual-color flash. Dual color temperature flash refers to a combination of warm light flash and cold light flash, which can be used for light compensation under different color temperatures.
  • the audio circuit 807 may include a microphone and a speaker.
  • the microphone is used to collect sound waves of the user and the environment, and convert the sound waves into electrical signals to be input to the processor 801 for processing, or input to the radio frequency circuit 804 to implement voice communication. For the purpose of stereo collection or noise reduction, there may be multiple microphones, which are respectively set in different parts of the terminal 800.
  • the microphone can also be an array microphone or an omnidirectional collection microphone.
  • the speaker is used to convert the electrical signal from the processor 801 or the radio frequency circuit 804 into sound waves.
  • the speaker can be a traditional thin-film speaker or a piezoelectric ceramic speaker.
  • the audio circuit 807 may also include a headphone jack.
  • the positioning component 808 is used to locate the current geographic location of the terminal 800 to implement navigation or LBS (Location Based Service, location-based service).
  • the positioning component 808 may be a positioning component based on the GPS (Global Positioning System, Global Positioning System) of the United States, the Beidou system of China, the Grenas system of Russia, or the Galileo system of the European Union.
  • the power supply 809 is used to supply power to various components in the terminal 800.
  • the power source 809 may be alternating current, direct current, disposable batteries, or rechargeable batteries.
  • the rechargeable battery may support wired charging or wireless charging.
  • the rechargeable battery can also be used to support fast charging technology.
  • the terminal 800 further includes one or more sensors 810.
  • the one or more sensors 810 include, but are not limited to: an acceleration sensor 811, a gyroscope sensor 812, a pressure sensor 813, a fingerprint sensor 814, an optical sensor 815, and a proximity sensor 816.
  • the acceleration sensor 811 can detect the magnitude of acceleration on the three coordinate axes of the coordinate system established by the terminal 800.
  • the acceleration sensor 811 can be used to detect the components of the gravitational acceleration on three coordinate axes.
  • the processor 801 may control the display screen 805 to display the user interface in a horizontal view or a vertical view according to the gravity acceleration signal collected by the acceleration sensor 811.
  • the acceleration sensor 811 may also be used for the collection of game or user motion data.
  • the gyroscope sensor 812 can detect the body direction and rotation angle of the terminal 800, and the gyroscope sensor 812 can cooperate with the acceleration sensor 811 to collect the user's 3D actions on the terminal 800.
  • the processor 801 can implement the following functions according to the data collected by the gyroscope sensor 812: motion sensing (such as changing the UI according to the user's tilt operation), image stabilization during shooting, game control, and inertial navigation.
  • the pressure sensor 813 may be disposed on the side frame of the terminal 800 and/or the lower layer of the display screen 805.
  • the processor 801 performs left and right hand recognition or quick operation according to the holding signal collected by the pressure sensor 813.
  • the processor 801 controls the operability controls on the UI interface according to the pressure operation of the user on the display screen 805.
  • the operability control includes at least one of a button control, a scroll bar control, an icon control, and a menu control.
  • the fingerprint sensor 814 is used to collect the user's fingerprint.
  • the processor 801 identifies the user's identity according to the fingerprint collected by the fingerprint sensor 814, or the fingerprint sensor 814 identifies the user's identity according to the collected fingerprint. When it is recognized that the user's identity is a trusted identity, the processor 801 authorizes the user to perform related sensitive operations, including unlocking the screen, viewing encrypted information, downloading software, paying, and changing settings.
  • the fingerprint sensor 814 may be provided on the front, back, or side of the terminal 800. When a physical button or a manufacturer logo is provided on the terminal 800, the fingerprint sensor 814 may be integrated with the physical button or the manufacturer logo.
  • the optical sensor 815 is used to collect the ambient light intensity.
  • the processor 801 may control the display brightness of the display screen 805 according to the ambient light intensity collected by the optical sensor 815. Specifically, when the ambient light intensity is high, the display brightness of the display screen 805 is increased; when the ambient light intensity is low, the display brightness of the display screen 805 is decreased.
  • the processor 801 may also dynamically adjust the shooting parameters of the camera assembly 806 according to the ambient light intensity collected by the optical sensor 815.
  • the proximity sensor 816 is also called a distance sensor, and is usually arranged on the front panel of the terminal 800.
  • the proximity sensor 816 is used to collect the distance between the user and the front of the terminal 800.
  • the processor 801 controls the display screen 805 to switch from the on-screen state to the off-screen state; when the proximity sensor 816 detects When the distance between the user and the front of the terminal 800 gradually increases, the processor 801 controls the display screen 805 to switch from the rest screen state to the bright screen state.
  • FIG. 8 does not constitute a limitation on the terminal 800, and may include more or fewer components than shown in the figure, or combine certain components, or adopt different component arrangements.
  • FIG. 9 is a schematic structural diagram of a server 900 provided by an embodiment of the present application.
  • the server 900 may be a server in a background server cluster. Specifically:
  • the server 900 includes a CPU (Central Processing Unit) 901, a system memory 904 including RAM (Random Access Memory) 902 and ROM (Read-Only Memory) 903, and a system memory connected to it 904 and the system bus 905 of the central processing unit 901.
  • the server 900 also includes a basic I/O (Input/Output) system 906 that helps transfer information between various devices in the computer, and a large-capacity storage system 913, application programs 914, and other program modules 915.
  • the basic input/output system 906 includes a display 908 for displaying information and an input device 909 such as a mouse and a keyboard for the user to input information.
  • the display 908 and the input device 909 are both connected to the central processing unit 901 through the input/output controller 910 connected to the system bus 905.
  • the basic input/output system 906 may also include an input/output controller 910 for receiving and processing input from multiple other devices such as a keyboard, a mouse, or an electronic stylus.
  • the input/output controller 910 also provides output to a display screen, a printer, or other types of output devices.
  • the mass storage device 907 is connected to the central processing unit 901 through a mass storage controller (not shown) connected to the system bus 905.
  • the mass storage device 907 and its associated computer-readable medium provide non-volatile storage for the server 900. That is, the mass storage device 907 may include a computer-readable medium (not shown) such as a hard disk or a CD-ROM (Compact Disc Read-Only Memory) drive.
  • Computer-readable media may include computer storage media and communication media.
  • Computer storage media includes volatile and nonvolatile, removable and non-removable media implemented by any method or technology for storing information such as computer readable instructions, data structures, program modules, or other data.
  • Computer storage media include RAM, ROM, EPROM (Electrically Erasable Programmable Read-Only Memory), EEPROM (Electrically Erasable Programmable Read-Only Memory), flash memory or other Solid-state storage technology, and includes CD-ROM, DVD (Digital Versatile Disc, Digital Versatile Disc) or other optical storage, tape cartridges, magnetic tape, magnetic disk storage or other magnetic storage devices.
  • the system memory 904 and the mass storage device 907 may be collectively referred to as memory.
  • the server 900 may also be connected to a remote computer on the network to run through a network such as the Internet. That is, the server 900 can be connected to the network 912 through the network interface unit 911 connected to the system bus 905, or in other words, the network interface unit 911 can also be used to connect to other types of networks or remote computer systems (not shown).
  • the foregoing memory also includes one or more programs, and one or more programs are stored in the memory and configured to be executed by the CPU.
  • the one or more programs include instructions for performing operations performed in the image display method provided by the method embodiment in the embodiment of the present application.
  • a computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the image display method provided in the embodiment of FIG. 2 are implemented.
  • the computer-readable storage medium may be ROM, RAM, CD-ROM, magnetic tape, floppy disk, optical data storage device, etc.
  • the computer-readable storage medium mentioned in the embodiment of the present application may be a non-volatile storage medium, in other words, it may be a non-transitory storage medium.
  • a computer program product containing instructions is also provided, which when running on a computer, causes the computer to execute the steps of the image display method provided in the embodiment of FIG. 2 above.

Abstract

Embodiments of the resent application relate to the technical field of image processing. Disclosed are an image display method and apparatus, and a computer device. The method comprises: obtaining an image, and determining a face area in the image; determining a target area in the image according to the face area in the image, the size of the target area being the same as the size of a display interface; cropping the target area in the image to obtain a target image; and displaying the target image in the display interface. In the embodiments of the present application, once a user is in an image acquisition range, the face of the user will be included as much as possible in the target image displayed in the display interface, thereby expanding the position range within which face display can be implemented, and improving the flexibility of face display, thus greatly improving user experience.

Description

图像显示方法、装置和计算机设备Image display method, device and computer equipment
本申请实施例要求于2020年4月30日提交的申请号为202010364395.9、发明名称为“图像显示方法、装置和计算机设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请实施例中。The embodiments of this application require the priority of the Chinese patent application filed on April 30, 2020, with the application number 202010364395.9 and the invention title "Image Display Method, Apparatus, and Computer Equipment", the entire content of which is incorporated into this application by reference. In the example.
技术领域Technical field
本申请实施例涉及图像处理技术领域,特别涉及一种图像显示方法、装置和计算机设备。The embodiments of the present application relate to the field of image processing technology, and in particular to an image display method, device, and computer equipment.
背景技术Background technique
随着图像处理技术的发展,以人工智能、深度学习为方向的生物识别门禁系统得到迅速发展。其中,人脸识别门禁由于快捷、通行方便、用户体验好而在门禁系统中得到越来越广泛的应用。With the development of image processing technology, biometric access control systems based on artificial intelligence and deep learning have developed rapidly. Among them, face recognition access control is more and more widely used in access control systems due to its fast speed, convenient traffic and good user experience.
目前,人脸识别门禁系统因受设备外观的限制,其用于供用户观看其人脸的预览界面往往显示为固定的场景,即是将摄像头的采集范围的固定位置处的图像显示在该预览界面上。这种情况下,用户必须站在该固定位置才能在预览界面上看到其人脸,这使得人脸显示位置被限制在一个很小的范围内,给用户带来不便。At present, the face recognition access control system is limited by the appearance of the device, and its preview interface for users to watch their face is often displayed as a fixed scene, that is, the image at a fixed position in the capture range of the camera is displayed in the preview. Interface. In this case, the user must stand at the fixed position to see his face on the preview interface, which limits the display position of the face to a small range, which brings inconvenience to the user.
发明内容Summary of the invention
本申请实施例提供了一种图像显示方法、装置、计算机设备和存储介质,可以扩大能够实现人脸显示的位置。The embodiments of the present application provide an image display method, device, computer equipment, and storage medium, which can expand the position where the human face can be displayed.
一方面,提供了一种图像显示方法,所述方法包括:In one aspect, an image display method is provided, and the method includes:
获取图像,确定所述图像中的人脸区域;Acquiring an image, and determining a face area in the image;
根据所述图像中的人脸区域,确定所述图像中的目标区域,所述目标区域的尺寸与显示界面的尺寸相同;Determining a target area in the image according to the face area in the image, where the size of the target area is the same as the size of the display interface;
裁剪出所述图像中的目标区域,得到目标图像;Crop out the target area in the image to obtain the target image;
在所述显示界面中显示所述目标图像。The target image is displayed on the display interface.
可选地,所述确定所述图像中的人脸区域,包括:Optionally, the determining the face area in the image includes:
确定所述图像中的一个或多个检测框,所述检测框内包含人脸;Determine one or more detection frames in the image, where the detection frames contain a human face;
将所述图像中的一个或多个检测框中尺寸最大的一个检测框指示的区域作为所述图像中的人脸区域。The area indicated by the largest detection frame in one or more detection frames in the image is taken as the face area in the image.
可选地,所述根据所述图像中的人脸区域,确定所述图像中的目标区域,包括:Optionally, the determining the target area in the image according to the face area in the image includes:
将所述图像中尺寸与所述显示界面的尺寸相同、中心点与所述图像中的人脸区域的中心点相同的区域作为第一区域;Taking an area in the image with the same size as the size of the display interface and the same center point as the center point of the face area in the image as the first area;
将在采集到所述图像之前采集的上一帧图像中的目标区域作为第二区域;Taking the target area in the last frame of image collected before the image is collected as the second area;
根据所述第一区域和所述第二区域,确定所述图像中的目标区域。According to the first area and the second area, a target area in the image is determined.
可选地,所述根据所述第一区域和所述第二区域,确定所述图像中的目标区域,包括:Optionally, the determining the target area in the image according to the first area and the second area includes:
若所述第一区域的位置与所述第二区域的位置之间的距离小于或等于预设距离,则将所述第一区域作为所述图像中的目标区域;If the distance between the position of the first area and the position of the second area is less than or equal to a preset distance, using the first area as the target area in the image;
若所述第一区域的位置与所述第二区域的位置之间的距离大于预设距离,则将所述第二区域的位置向所述第一区域的位置的方向移动所述预设距离,得到目标位置;将所述图像中位置与所述目标位置相同的区域作为所述图像中的目标区域。If the distance between the position of the first area and the position of the second area is greater than the preset distance, the position of the second area is moved to the direction of the position of the first area by the preset distance , Obtain the target position; take an area in the image with the same position as the target position as the target area in the image.
可选地,所述方法还包括:Optionally, the method further includes:
若所述图像中不存在人脸区域,则将所述图像中尺寸与所述显示界面的尺寸相同、中心点与所述图像的中心点相同的区域作为第一区域;If there is no face area in the image, use an area in the image with the same size as the size of the display interface and the same center point as the center point of the image as the first area;
将在采集到所述图像之前采集的上一帧图像中的目标区域作为第二区域;Taking the target area in the last frame of image collected before the image is collected as the second area;
根据所述第一区域和所述第二区域,确定所述图像中的目标区域。According to the first area and the second area, a target area in the image is determined.
一方面,提供了一种图像显示装置,所述装置包括:In one aspect, an image display device is provided, and the device includes:
处理器,用于在获取的图像中确定人脸区域;根据所述图像中的人脸区域,确定所述图像中的目标区域,所述目标区域的尺寸与显示界面的尺寸相同;裁剪出所述图像中的目标区域,得到目标图像;The processor is configured to determine the face area in the acquired image; determine the target area in the image according to the face area in the image, and the size of the target area is the same as the size of the display interface; Describe the target area in the image to obtain the target image;
显示器,用于在所述显示界面中显示所述目标图像。The display is used to display the target image on the display interface.
可选地,所述处理器用于:Optionally, the processor is used to:
确定所述图像中的一个或多个检测框,所述检测框内包含人脸;Determine one or more detection frames in the image, where the detection frames contain a human face;
将所述图像中的一个或多个检测框中尺寸最大的一个检测框指示的区域作为所述图像中的人脸区域。The area indicated by the largest detection frame in one or more detection frames in the image is taken as the face area in the image.
可选地,所述处理器用于:Optionally, the processor is used to:
将所述图像中尺寸与所述显示界面的尺寸相同、中心点与所述图像中的人脸区域的中心点相同的区域作为第一区域;Taking an area in the image with the same size as the size of the display interface and the same center point as the center point of the face area in the image as the first area;
将在采集到所述图像之前采集的上一帧图像中的目标区域作为第二区域;Taking the target area in the last frame of image collected before the image is collected as the second area;
根据所述第一区域和所述第二区域,确定所述图像中的目标区域。According to the first area and the second area, a target area in the image is determined.
可选地,所述处理器用于:Optionally, the processor is used to:
若所述第一区域的位置与所述第二区域的位置之间的距离小于或等于预设距离,则将所述第一区域作为所述图像中的目标区域;If the distance between the position of the first area and the position of the second area is less than or equal to a preset distance, using the first area as the target area in the image;
若所述第一区域的位置与所述第二区域的位置之间的距离大于预设距离,则将所述第二区域的位置向所述第一区域的位置的方向移动所述预设距离,得到目标位置;将所述图像中位置与所述目标位置相同的区域作为所述图像中的目标区域。If the distance between the position of the first area and the position of the second area is greater than the preset distance, the position of the second area is moved to the direction of the position of the first area by the preset distance , Obtain the target position; take an area in the image with the same position as the target position as the target area in the image.
可选地,所述处理器还用于:Optionally, the processor is further configured to:
若所述图像中不存在人脸区域,则将所述图像中尺寸与所述显示界面的尺寸相同、中心点与所述图像的中心点相同的区域作为第一区域;If there is no face area in the image, use an area in the image with the same size as the size of the display interface and the same center point as the center point of the image as the first area;
将在采集到所述图像之前采集的上一帧图像中的目标区域作为第二区域;Taking the target area in the last frame of image collected before the image is collected as the second area;
根据所述第一区域和所述第二区域,确定所述图像中的目标区域。According to the first area and the second area, a target area in the image is determined.
可选地,所述装置还包括:Optionally, the device further includes:
图像获取模块,用于获取图像。The image acquisition module is used to acquire images.
一方面,提供了一种图像显示装置,所述装置包括:In one aspect, an image display device is provided, and the device includes:
图像获取模块,用于获取图像;Image acquisition module for acquiring images;
第一确定模块,用于确定所述图像中的人脸区域;The first determining module is used to determine the face area in the image;
第二确定模块,用于根据所述图像中的人脸区域,确定所述图像中的目标区域,所述目标区域的尺寸与显示界面的尺寸相同;The second determining module is configured to determine a target area in the image according to the face area in the image, and the size of the target area is the same as the size of the display interface;
裁剪模块,用于裁剪出所述图像中的目标区域,得到目标图像;The cropping module is used to crop out the target area in the image to obtain the target image;
显示模块,用于在所述显示界面中显示所述目标图像。The display module is used to display the target image on the display interface.
可选地,所述第一确定模块用于:Optionally, the first determining module is used to:
确定所述图像中的一个或多个检测框,所述检测框内包含人脸;Determine one or more detection frames in the image, where the detection frames contain a human face;
将所述图像中的一个或多个检测框中尺寸最大的一个检测框指示的区域作为所述图像中的人脸区域。The area indicated by the largest detection frame in one or more detection frames in the image is taken as the face area in the image.
可选地,所述第二确定模块用于:Optionally, the second determining module is used to:
将所述图像中尺寸与所述显示界面的尺寸相同、中心点与所述图像中的人脸区域的中心点相同的区域作为第一区域;Taking an area in the image with the same size as the size of the display interface and the same center point as the center point of the face area in the image as the first area;
将在采集到所述图像之前采集的上一帧图像中的目标区域作为第二区域;Taking the target area in the last frame of image collected before the image is collected as the second area;
根据所述第一区域和所述第二区域,确定所述图像中的目标区域。According to the first area and the second area, a target area in the image is determined.
可选地,所述第二确定模块用于:Optionally, the second determining module is used to:
若所述第一区域的位置与所述第二区域的位置之间的距离小于或等于预设距离,则将所述第一区域作为所述图像中的目标区域;If the distance between the position of the first area and the position of the second area is less than or equal to a preset distance, using the first area as the target area in the image;
若所述第一区域的位置与所述第二区域的位置之间的距离大于预设距离,则将所述第二区域的位置向所述第一区域的位置的方向移动所述预设距离,得到目标位置;将所述图像中位置与所述目标位置相同的区域作为所述图像中的目标区域。If the distance between the position of the first area and the position of the second area is greater than the preset distance, the position of the second area is moved to the direction of the position of the first area by the preset distance , Obtain the target position; take an area in the image with the same position as the target position as the target area in the image.
可选地,所述装置还包括:Optionally, the device further includes:
第三确定模块,用于若所述图像中不存在人脸区域,则将所述图像中尺寸与所述显示界面的尺寸相同、中心点与所述图像的中心点相同的区域作为第一区域;The third determining module is configured to, if there is no face area in the image, use an area in the image with the same size as the size of the display interface and the same center point as the center point of the image as the first area ;
第四确定模块,用于将在采集到所述图像之前采集的上一帧图像中的目标区域作为第二区域;A fourth determining module, configured to use the target area in the last frame of image acquired before the image is acquired as the second area;
第五确定模块,用于根据所述第一区域和所述第二区域,确定所述图像中的目标区域。The fifth determining module is configured to determine a target area in the image according to the first area and the second area.
一方面,提供了一种计算机设备,所述计算机设备包括处理器和存储器,所述存储器用于存放计算机程序,所述处理器用于执行所述存储器上所存放的程序,以实现上述的图像显示方法的步骤。In one aspect, a computer device is provided. The computer device includes a processor and a memory, the memory is used to store a computer program, and the processor is used to execute the program stored in the memory to realize the above-mentioned image display Method steps.
一方面,提供了一种计算机可读存储介质,所述存储介质内存储有计算机程序,所述计算机程序被处理器执行时实现上述的图像显示方法的步骤。In one aspect, a computer-readable storage medium is provided, and a computer program is stored in the storage medium, and when the computer program is executed by a processor, the steps of the above-mentioned image display method are realized.
一方面,提供了一种包含指令的计算机程序产品,当其在计算机上运行时, 使得计算机执行上述的图像显示方法的步骤。On the one hand, a computer program product containing instructions is provided, which when run on a computer, causes the computer to execute the steps of the above-mentioned image display method.
本申请实施例提供的技术方案至少可以带来以下有益效果:The technical solutions provided by the embodiments of the present application can at least bring about the following beneficial effects:
获取图像后,确定该图像中的人脸区域。之后,根据该图像中的人脸区域确定该图像中的目标区域,然后裁剪出该图像中的目标区域,得到目标图像。最后,在该显示界面中显示目标图像。如此,只要用户处于图像采集范围内,该显示界面中显示的目标图像内就会尽可能的包含用户的人脸。相比于相关技术中需要用户站在固定位置才能实现人脸显示的方案,本申请实施例扩大了能够实现人脸显示的位置范围,提高了人脸显示的灵活性,可以极大的提高用户体验。After acquiring the image, determine the face area in the image. Then, the target area in the image is determined according to the face area in the image, and then the target area in the image is cut out to obtain the target image. Finally, the target image is displayed on the display interface. In this way, as long as the user is within the image acquisition range, the target image displayed on the display interface will contain the user's face as much as possible. Compared with the solution in the related art that requires the user to stand at a fixed position to realize the face display, the embodiment of the present application expands the position range that can realize the face display, improves the flexibility of the face display, and can greatly improve the user. Experience.
附图说明Description of the drawings
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly describe the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings that need to be used in the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work.
图1是本申请实施例提供的一种图像显示方法的流程图;FIG. 1 is a flowchart of an image display method provided by an embodiment of the present application;
图2是本申请实施例提供的另一种图像显示方法的流程图;FIG. 2 is a flowchart of another image display method provided by an embodiment of the present application;
图3是本申请实施例提供的一种人脸区域和第一区域的示意图;FIG. 3 is a schematic diagram of a face area and a first area provided by an embodiment of the present application;
图4是本申请实施例提供的一种第一区域、第二区域和目标区域的示意图;FIG. 4 is a schematic diagram of a first area, a second area, and a target area provided by an embodiment of the present application;
图5是本申请实施例提供的又一种图像显示方法的流程图;FIG. 5 is a flowchart of another image display method provided by an embodiment of the present application;
图6是本申请实施例提供的一种图像显示装置的结构示意图;FIG. 6 is a schematic structural diagram of an image display device provided by an embodiment of the present application;
图7是本申请实施例提供的另一种图像显示装置的结构示意图;FIG. 7 is a schematic structural diagram of another image display device provided by an embodiment of the present application;
图8是本申请实施例提供的一种终端的结构示意图;FIG. 8 is a schematic structural diagram of a terminal provided by an embodiment of the present application;
图9是本申请实施例提供的一种服务器的结构示意图。Fig. 9 is a schematic structural diagram of a server provided by an embodiment of the present application.
具体实施方式Detailed ways
为使本申请实施例的目的、技术方案和优点更加清楚,下面将结合附图对本申请实施方式作进一步地详细描述。In order to make the objectives, technical solutions, and advantages of the embodiments of the present application clearer, the following further describes the embodiments of the present application in detail with reference to the accompanying drawings.
应当理解的是,本申请实施例提及的“多个”是指两个或两个以上。在本申请实施例的描述中,除非另有说明,“/”表示或的意思,例如,A/B可以表示 A或B;本文中的“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,为了便于清楚描述本申请实施例的技术方案,采用了“第一”、“第二”等字样对功能和作用基本相同的相同项或相似项进行区分。本领域技术人员可以理解“第一”、“第二”等字样并不对数量和执行次序进行限定,并且“第一”、“第二”等字样也并不限定一定不同。It should be understood that the "plurality" mentioned in the embodiments of the present application refers to two or more. In the description of the embodiments of the present application, unless otherwise specified, "/" means or, for example, A/B can mean A or B; "and/or" in this document is only an association describing the associated object Relationship means that there can be three kinds of relationships. For example, A and/or B can mean that: A alone exists, A and B exist at the same time, and B exists alone. In addition, in order to clearly describe the technical solutions of the embodiments of the present application, words such as "first" and "second" are used to distinguish the same items or similar items that have substantially the same function and effect. Those skilled in the art can understand that words such as "first" and "second" do not limit the quantity and order of execution, and words such as "first" and "second" do not limit the difference.
图1是本申请实施例提供的一种图像显示方法的流程图。参见图1,该方法包括如下步骤:Fig. 1 is a flowchart of an image display method provided by an embodiment of the present application. Referring to Figure 1, the method includes the following steps:
步骤101:获取图像,确定该图像中的人脸区域。Step 101: Obtain an image, and determine the face area in the image.
步骤102:根据该图像中的人脸区域,确定该图像中的目标区域,目标区域的尺寸与显示界面的尺寸相同。Step 102: Determine a target area in the image according to the face area in the image, and the size of the target area is the same as the size of the display interface.
步骤103:裁剪出该图像中的目标区域,得到目标图像。Step 103: Cut out the target area in the image to obtain the target image.
步骤104:在该显示界面中显示目标图像。Step 104: Display the target image on the display interface.
在本申请实施例中,获取图像后,确定该图像中的人脸区域。之后,根据该图像中的人脸区域确定该图像中的目标区域,然后裁剪出该图像中的目标区域,得到目标图像。最后,在该显示界面中显示目标图像。如此,只要用户处于图像采集范围内,该显示界面中显示的目标图像内就会尽可能的包含用户的人脸。相比于相关技术中需要用户站在固定位置才能实现人脸显示的方案,本申请实施例扩大了能够实现人脸显示的位置范围,提高了人脸显示的灵活性,可以极大的提高用户体验。In the embodiment of the present application, after the image is acquired, the face area in the image is determined. Then, the target area in the image is determined according to the face area in the image, and then the target area in the image is cut out to obtain the target image. Finally, the target image is displayed on the display interface. In this way, as long as the user is within the image acquisition range, the target image displayed on the display interface will contain the user's face as much as possible. Compared with the solution in the related art that requires the user to stand at a fixed position to realize the face display, the embodiment of the present application expands the position range that can realize the face display, improves the flexibility of the face display, and can greatly improve the user. Experience.
可选地,确定该图像中的人脸区域,包括:Optionally, determining the face area in the image includes:
确定该图像中的一个或多个检测框,该检测框内包含人脸;Determine one or more detection frames in the image, where the detection frames contain human faces;
将该图像中的一个或多个检测框中尺寸最大的一个检测框指示的区域作为该图像中的人脸区域。The area indicated by the largest detection frame in one or more detection frames in the image is taken as the face area in the image.
可选地,根据该图像中的人脸区域,确定该图像中的目标区域,包括:Optionally, determining the target area in the image according to the face area in the image includes:
将该图像中尺寸与该显示界面的尺寸相同、中心点与该图像中的人脸区域的中心点相同的区域作为第一区域;Taking an area in the image that has the same size as the size of the display interface and the center point is the same as the center point of the face area in the image as the first area;
将在采集到该图像之前采集的上一帧图像中的目标区域作为第二区域;Taking the target area in the last frame of image collected before the image is collected as the second area;
根据第一区域和第二区域,确定该图像中的目标区域。According to the first area and the second area, the target area in the image is determined.
可选地,根据第一区域和第二区域,确定该图像中的目标区域,包括:Optionally, determining the target area in the image according to the first area and the second area includes:
若第一区域的位置与第二区域的位置之间的距离小于或等于预设距离,则将第一区域作为该图像中的目标区域;If the distance between the position of the first area and the position of the second area is less than or equal to the preset distance, the first area is taken as the target area in the image;
若第一区域的位置与第二区域的位置之间的距离大于预设距离,则将第二区域的位置向第一区域的位置的方向移动该预设距离,得到目标位置;将该图像中位置与目标位置相同的区域作为该图像中的目标区域。If the distance between the position of the first area and the position of the second area is greater than the preset distance, the position of the second area is moved to the direction of the position of the first area by the preset distance to obtain the target position; The area with the same position as the target position is regarded as the target area in the image.
可选地,该方法还包括:Optionally, the method further includes:
若该图像中不存在人脸区域,则将该图像中尺寸与该显示界面的尺寸相同、中心点与该图像的中心点相同的区域作为第一区域;If there is no face area in the image, then an area in the image with the same size as the size of the display interface and the same center point as the center point of the image is taken as the first area;
将在采集到该图像之前采集的上一帧图像中的目标区域作为第二区域;Taking the target area in the last frame of image collected before the image is collected as the second area;
根据第一区域和第二区域,确定该图像中的目标区域。According to the first area and the second area, the target area in the image is determined.
上述所有可选技术方案,均可按照任意结合形成本申请的可选实施例,本申请实施例对此不再一一赘述。All the above-mentioned optional technical solutions can be combined in any combination to form optional embodiments of the present application, and the embodiments of the present application will not repeat them one by one.
图2是本申请实施例提供的一种图像显示方法的流程图。参见图2,该方法包括如下步骤。Fig. 2 is a flowchart of an image display method provided by an embodiment of the present application. Referring to Figure 2, the method includes the following steps.
步骤201:获取图像,确定该图像中的目标区域。Step 201: Obtain an image, and determine a target area in the image.
其中,获取图像时,可以在图像采集过程中,在摄像机每采集到一帧图像时,获取这一帧图像。Among them, when acquiring an image, one frame of image can be acquired every time the camera acquires a frame of image during the image acquisition process.
摄像机可以实时采集图像。该摄像机可以是门禁设备中使用的摄像机。一方面,该摄像机采集的图像可以用于进行人脸识别,该门禁设备可以在人脸识别成功时打开门禁,在人脸识别失败时保持门禁。另一方面,该摄像机采集的图像可以供用户预览,即可以用于在该门禁设备中的显示屏上显示,具体可以按照本申请实施例提供的图像显示方法来进行显示。The camera can collect images in real time. The camera may be a camera used in an access control device. On the one hand, the image collected by the camera can be used for face recognition. The access control device can open the door when the face recognition is successful, and maintain the door when the face recognition fails. On the other hand, the image collected by the camera can be previewed by the user, that is, can be used for display on the display screen of the access control device, and can be specifically displayed according to the image display method provided in the embodiment of the present application.
当然,本申请实施例提供的图像显示方法不仅可以应用于门禁设备,也可以应用于其它有图像显示需求的设备中,如支付设备等,本申请实施例对此不作限定。Of course, the image display method provided in the embodiments of the present application can be applied not only to access control devices, but also to other devices with image display requirements, such as payment devices, which are not limited in the embodiments of the present application.
需要说明的是,目标区域的尺寸与显示界面的尺寸相同。也就是说,目标区域的宽高是与屏幕显示分辨率一致的。如此,目标区域的图像就可以直接在显示界面中显示。It should be noted that the size of the target area is the same as the size of the display interface. In other words, the width and height of the target area are consistent with the screen display resolution. In this way, the image of the target area can be directly displayed on the display interface.
值得注意的是,每当摄像机采集到一帧图像,就可以确定该图像中的目标区域,以便后续据此实现在显示界面中的图像预览。也即是,本申请实施例可以实现在图像采集过程中,对摄像机采集到的图像的实时预览。It is worth noting that every time the camera collects a frame of image, the target area in the image can be determined, so that the subsequent image preview in the display interface can be realized accordingly. That is, the embodiment of the present application can realize real-time preview of the image collected by the camera during the image collection process.
其中,确定该图像中的目标区域时,若该图像中存在人脸区域,则可以按照如下第一种可能的方式确定该图像中的目标区域;若该图像中不存在人脸区域,则可以按照如下第二种可能的方式确定该图像中的目标区域。Among them, when determining the target area in the image, if there is a face area in the image, the target area in the image can be determined according to the following first possible way; if there is no face area in the image, you can Determine the target area in the image according to the second possible way as follows.
第一种可能的方式:确定该图像中的人脸区域;根据该图像中的人脸区域,确定该图像中的目标区域。The first possible way: determine the face area in the image; determine the target area in the image according to the face area in the image.
需要说明的是,该图像中的人脸区域为该图像中存在人脸的区域。It should be noted that the face area in the image is an area where a face exists in the image.
其中,确定该图像中的人脸区域时,可以确定该图像中的一个或多个检测框,将该图像中的一个或多个检测框中尺寸最大的一个检测框指示的区域作为该图像中的人脸区域。Wherein, when determining the face area in the image, one or more detection frames in the image can be determined, and the area indicated by the largest detection frame in the one or more detection frames in the image is taken as the area in the image Of the face area.
需要说明的是,检测框内包含人脸,该检测框用于指示存在人脸的区域。该区域通常可以为矩形区域,因而该检测框的尺寸通常可以包括该检测框的宽和高。It should be noted that the detection frame contains a human face, and the detection frame is used to indicate an area where the human face exists. The area can usually be a rectangular area, so the size of the detection frame can usually include the width and height of the detection frame.
另外,该图像中的一个或多个检测框中尺寸最大的一个检测框内包含的人脸最有可能是当前正在使用该摄像头的人员的人脸,所以可以将该图像中的一个或多个检测框中尺寸最大的一个检测框指示的区域作为该图像中的人脸区域。比如,可以将该图像中的一个或多个检测框中最宽或最高的一个检测框指示的区域作为该图像中的人脸区域。In addition, the face contained in the largest detection frame in one or more detection frames in the image is most likely to be the face of the person currently using the camera, so one or more of the The area indicated by the largest detection frame in the detection frame is taken as the face area in the image. For example, the area indicated by the widest or highest detection frame in one or more detection frames in the image can be used as the face area in the image.
其中,确定该图像中的一个或多个检测框的方式可以有多种。比如,可以将该图像输入到人脸检测模型,由人脸检测模型输出该图像中的每个检测框的位置,该检测框的位置可以包括该检测框的尺寸、位置点(如左上角点、左下角点、右上角点、右下角点或中心点)的坐标。当然,也可以通过其它方式确定该图像中的一个或多个检测框,本申请实施例对此不作限定。There are many ways to determine one or more detection frames in the image. For example, the image can be input to a face detection model, and the face detection model outputs the position of each detection frame in the image. The position of the detection frame may include the size and position of the detection frame (such as the upper left corner point). , The lower left corner point, the upper right corner point, the lower right corner point or the center point) coordinates. Of course, one or more detection frames in the image can also be determined in other ways, which is not limited in the embodiment of the present application.
需要说明的是,人脸检测模型可以是预先训练好的能够确定图像中出现的人脸所在的检测框的模型,如人脸检测模型可以为CNN(Convolutional Neural Network,卷积神经网络)等。It should be noted that the face detection model may be a pre-trained model that can determine the detection frame where the face appears in the image. For example, the face detection model may be CNN (Convolutional Neural Network, convolutional neural network).
另外,若该检测框的位置中包括的位置点的坐标不是中心点的坐标,则在将该图像中的一个或多个检测框中尺寸最大的一个检测框指示的区域作为该图像中的人脸区域后,还可以根据该人脸区域的尺寸和位置点的坐标确定该人脸 区域的中心点的坐标。In addition, if the coordinates of the position point included in the position of the detection frame are not the coordinates of the center point, the area indicated by the largest detection frame in one or more detection frames in the image is regarded as the person in the image. After the face area, the coordinates of the center point of the face area can also be determined according to the size of the face area and the coordinates of the location point.
其中,根据该图像中的人脸区域,确定该图像中的目标区域的操作可以为:将该图像中尺寸与该显示界面的尺寸相同、中心点与该图像中的人脸区域的中心点相同的区域作为该图像中的目标区域。或者,将该图像中尺寸与该显示界面的尺寸相同、中心点与该人脸区域的中心点相同的区域作为第一区域;将在采集到该图像之前采集的上一帧图像中的目标区域作为第二区域;根据第一区域和第二区域,确定该图像中的目标区域。Wherein, according to the face area in the image, the operation of determining the target area in the image may be: the size in the image is the same as the size of the display interface, and the center point is the same as the center point of the face area in the image As the target area in the image. Or, the area in the image whose size is the same as the size of the display interface and the center point is the same as the center point of the face area is regarded as the first area; the target area in the last frame of the image captured before the image is captured As the second area; according to the first area and the second area, determine the target area in the image.
需要说明的是,当该图像中存在人脸区域时,该图像中的第一区域的边界是通过在该图像中对该图像中的人脸区域的边界进行外扩或内缩得到的。也就是说,当该图像中的人脸区域的尺寸小于该显示界面的尺寸时,该图像中的第一区域的边界是通过在该图像中对该图像中的人脸区域的边界进行外扩得到的;当该图像中的人脸区域的尺寸大于该显示界面的尺寸时,该图像中的第一区域的边界是通过在该图像中对该图像中的人脸区域的边界进行内缩得到的;当该图像中的人脸区域的尺寸等于该显示界面的尺寸时,可以直接将该图像中的人脸区域作为第一区域。It should be noted that when there is a face area in the image, the boundary of the first area in the image is obtained by expanding or shrinking the boundary of the face area in the image in the image. That is to say, when the size of the face area in the image is smaller than the size of the display interface, the boundary of the first area in the image is expanded by the boundary of the face area in the image. Obtained; when the size of the face area in the image is greater than the size of the display interface, the boundary of the first area in the image is obtained by shrinking the boundary of the face area in the image in the image When the size of the face area in the image is equal to the size of the display interface, the face area in the image can be directly used as the first area.
例如,如图3所示,假设该图像中的人脸区域的尺寸小于该显示界面的尺寸,且该图像中的人脸区域的中心点为M点,该显示界面的宽为a、高为b。则可以以该图像中的人脸区域的中心点(即M点)为起点,在宽度方向上将区域边界外扩到该显示界面的宽的二分之一(即1/2的a)处,在高度方向上将区域边界外扩到该显示界面的高的二分之一(即1/2的b)处,外扩后的区域边界围成的区域即为第一区域。此时该图像中的第一区域的尺寸与该显示界面的尺寸相同、中心点与该图像中的人脸区域的中心点相同。For example, as shown in Figure 3, suppose the size of the face area in the image is smaller than the size of the display interface, and the center point of the face area in the image is point M, the width of the display interface is a, and the height is b. Then you can take the center point of the face area in the image (ie M point) as the starting point, and expand the area boundary to one-half of the width of the display interface (ie 1/2 of a) in the width direction , In the height direction, expand the area boundary to one-half of the height of the display interface (that is, 1/2 of b), and the area enclosed by the expanded area boundary is the first area. At this time, the size of the first area in the image is the same as the size of the display interface, and the center point is the same as the center point of the face area in the image.
另外,若对该图像中的人脸区域的边界进行外扩后得到的第一区域的边界超出了该图像的边界,则可以对第一区域进行边界调整。例如,可以将第一区域的边界在宽度方向上和/或高度方向上向该图像内移动,直至第一区域的边界恰好处于该图像内。In addition, if the boundary of the first region obtained after the boundary of the face region in the image is expanded beyond the boundary of the image, the boundary adjustment of the first region may be performed. For example, the boundary of the first area may be moved in the width direction and/or the height direction into the image until the boundary of the first area is exactly in the image.
需要说明的是,该图像是该摄像机当前采集到的图像。该摄像机在采集到该图像之前采集的上一帧图像中的目标区域的图像是该显示界面上当前显示的图像。也即是,第二区域的图像是在该摄像机采集到该图像时该显示界面上正在显示的图像。It should be noted that the image is the image currently collected by the camera. The image of the target area in the last frame of the image collected by the camera before the image is collected is the image currently displayed on the display interface. That is, the image of the second area is the image being displayed on the display interface when the camera collects the image.
另外,本申请实施例中可以结合第一区域和第二区域,也即结合当前图像 中人脸所处的区域和该显示界面上正在显示的图像在上一帧图像中所处的区域,来确定当前图像中用于在该显示界面上显示的图像在当前图像中所处的区域。如此,有助于实现图像的平滑显示。In addition, in the embodiments of the present application, the first area and the second area may be combined, that is, the area where the face is located in the current image and the area where the image being displayed on the display interface is located in the previous frame of the image. Determine the area in the current image where the image to be displayed on the display interface is located in the current image. In this way, it helps to achieve a smooth display of the image.
其中,根据第一区域和第二区域,确定该图像中的目标区域的操作可以为:若第一区域的位置与第二区域的位置之间的距离小于或等于预设距离,则将第一区域作为该图像中的目标区域。若第一区域的位置与第二区域的位置之间的距离大于预设距离,则将第二区域的位置向第一区域的位置的方向移动预设距离,得到目标位置;将该图像中位置与目标位置相同的区域作为该图像中的目标区域。Wherein, according to the first area and the second area, the operation of determining the target area in the image may be: if the distance between the position of the first area and the position of the second area is less than or equal to the preset distance, then the first area The area is used as the target area in the image. If the distance between the position of the first area and the position of the second area is greater than the preset distance, the position of the second area is moved to the direction of the position of the first area by the preset distance to obtain the target position; The same area as the target position is taken as the target area in the image.
需要说明的是,预设距离可以根据实际使用需求进行设置,且预设距离可以设置的较小。It should be noted that the preset distance can be set according to actual usage requirements, and the preset distance can be set to be smaller.
另外,由于第一区域的尺寸和第二区域的尺寸相同,所以第一区域的位置和第二区域的位置均可以通过相对应的位置点来指示。也就是说,第一区域的位置与第二区域的位置之间的距离可以通过第一区域与第二区域中的对应位置点来衡量,该位置点可以是角点或中心点。In addition, since the size of the first area and the size of the second area are the same, the position of the first area and the position of the second area can both be indicated by corresponding position points. That is, the distance between the position of the first area and the position of the second area can be measured by the corresponding position point in the first area and the second area, and the position point may be a corner point or a center point.
例如,可以将第一区域的左上角点与第二区域的左上角点之间的距离作为第一区域的位置与第二区域的位置之间的距离;或者,可以将第一区域的左下角点与第二区域的左下角点之间的距离作为第一区域的位置与第二区域的位置之间的距离;或者,可以将第一区域的右上角点与第二区域的右上角点之间的距离作为第一区域的位置与第二区域的位置之间的距离;或者,可以将第一区域的右下角点与第二区域的右下角点之间的距离作为第一区域的位置与第二区域的位置之间的距离;或者,可以将第一区域的中心点与第二区域的中心点之间的距离作为第一区域的位置与第二区域的位置之间的距离。For example, the distance between the upper left corner point of the first area and the upper left corner point of the second area can be taken as the distance between the position of the first area and the position of the second area; or, the lower left corner of the first area can be The distance between the point and the lower left corner point of the second area is taken as the distance between the position of the first area and the position of the second area; alternatively, the upper right corner point of the first area and the upper right corner point of the second area The distance between the first area and the second area is the distance between the position of the first area and the position of the second area; alternatively, the distance between the lower right corner point of the first area and the lower right corner point of the second area can be taken as the distance between the position of the first area and the position of the second area. The distance between the positions of the second area; or, the distance between the center point of the first area and the center point of the second area may be taken as the distance between the position of the first area and the position of the second area.
若第一区域的位置与第二区域的位置之间的距离小于或等于预设距离,说明第一区域的位置与第二区域的位置相距比较近,此时从第二区域的图像显示转换到第一区域的图像显示是比较平滑的,因而可以直接将第一区域作为该图像中的目标区域,以便后续可以直接对当前图像中人脸所处的区域进行显示。If the distance between the position of the first area and the position of the second area is less than or equal to the preset distance, it means that the position of the first area is relatively close to the position of the second area. At this time, the image display of the second area is switched to The image display of the first area is relatively smooth, so the first area can be directly used as the target area in the image, so that the area where the human face is located in the current image can be directly displayed subsequently.
若第一区域的位置与第二区域的位置之间的距离大于预设距离,说明第一区域的位置与第二区域的位置相距比较远,此时从第二区域的图像显示转换到第一区域的图像显示很有可能会出现显示画面波动跳变,因而此时不将第一区域作为该图像中的目标区域,而是将第二区域的位置向第一区域的位置的方向 移动预设距离来得到该图像中的目标区域的位置。也就是说,这种情况下,是将该显示界面上正在显示的图像的位置以固定步长(即预设距离)向当前图像中人脸所在位置靠近,从而可以实现显示画面的平滑过渡。If the distance between the position of the first area and the position of the second area is greater than the preset distance, it means that the position of the first area is farther away from the position of the second area. At this time, the image display of the second area is switched to the first area. The image display of the area is likely to show fluctuations in the display screen, so at this time, the first area is not used as the target area in the image, but the position of the second area is moved in the direction of the position of the first area. Distance to get the location of the target area in the image. That is to say, in this case, the position of the image being displayed on the display interface is approached to the position of the human face in the current image by a fixed step (ie, a preset distance), so that a smooth transition of the displayed image can be realized.
其中,将第二区域的位置向第一区域的位置的方向移动预设距离,得到目标位置的操作可以通过对第二区域的位置的调整实现。Wherein, the operation of moving the position of the second area toward the position of the first area by a preset distance to obtain the target position can be realized by adjusting the position of the second area.
假设第一区域的位置和第二区域的位置均通过左上角点来指示。第一区域的左上角点的坐标为(X 1,Y 1),第二区域的左上角点的坐标为(X 2,Y 2),预设距离为v,则X 1与X 2之差大于v,Y 1与Y 2之差也大于v。这种情况下,目标位置中包括尺寸和左上角点的坐标,该尺寸就是第一区域的尺寸,该左上角点的坐标就是对第二区域的左上角点的坐标调整后得到的,即该左上角点的坐标就是调整后的(X 2,Y 2)。 It is assumed that the position of the first area and the position of the second area are both indicated by the upper left corner point. The coordinates of the upper left corner of the first area are (X 1 , Y 1 ), the coordinates of the upper left corner of the second area are (X 2 , Y 2 ), the preset distance is v, then the difference between X 1 and X 2 Greater than v, the difference between Y 1 and Y 2 is also greater than v. In this case, the target position includes the size and the coordinates of the upper left corner point. This size is the size of the first area. The upper left corner point coordinates are obtained by adjusting the coordinates of the upper left corner point of the second area, that is, the The coordinates of the upper left corner point are adjusted (X 2 , Y 2 ).
若是X 1-X 2>v,则目标位置中包括的左上角点的横坐标X 2为X 2+v;若是X 2-X 1>v,则目标位置中包括的左上角点的横坐标X 2为X 2-v。若是Y 1-Y 2>v,则目标位置中包括的左上角点的纵坐标Y 2为Y 2+v;若是Y 2-Y 1>v,则目标位置中包括的左上角点的纵坐标Y 2为Y 2-v。 If X 1 -X 2 >v, the abscissa X 2 of the upper left corner point included in the target position is X 2 +v; if X 2 -X 1 >v, then the abscissa of the upper left corner point included in the target position X 2 is X 2 -v. If Y 1 -Y 2 >v, the ordinate Y 2 of the upper left corner point included in the target position is Y 2 +v; if Y 2 -Y 1 >v, then the ordinate Y 2 of the upper left corner point included in the target position Y 2 is Y 2 -v.
例如,如图4所示,第一区域的左上角点的坐标为(X 1,Y 1),第二区域的左上角点的坐标为(X 2,Y 2),预设距离为v。并且,X 1-X 2>v,Y 1-Y 2>v。则可以将第二区域向右移动v,且将第二区域向下移动v,移动后的第二区域的位置就是目标区域的位置。 For example, as shown in FIG. 4, the coordinates of the upper left corner of the first area are (X 1 , Y 1 ), the coordinates of the upper left corner of the second area are (X 2 , Y 2 ), and the preset distance is v. In addition, X 1 -X 2 >v, and Y 1 -Y 2 >v. Then the second area can be moved to the right by v, and the second area can be moved down by v, and the position of the moved second area is the position of the target area.
第二种可能的方式:若该图像中不存在人脸区域,则将该图像中尺寸与该显示界面的尺寸相同、中心点与该图像的中心点相同的区域作为第一区域;将在采集到该图像之前采集的上一帧图像中的目标区域作为第二区域;根据第一区域和第二区域,确定该图像中的目标区域。The second possible way: if there is no face area in the image, then the area in the image with the same size as the size of the display interface and the same center point as the center point of the image is taken as the first area; The target area in the last frame of image collected before the image is taken as the second area; the target area in the image is determined according to the first area and the second area.
需要说明的是,当该图像中不存在人脸区域中,该图像中的第一区域就是该图像的中心区域,该图像的中心区域的中心点为该图像的中心点,该图像的中心区域的尺寸为该显示界面的尺寸。It should be noted that when there is no face area in the image, the first area in the image is the central area of the image, and the central point of the central area of the image is the central point of the image, and the central area of the image The size of is the size of the display interface.
另外,该图像是该摄像机当前采集到的图像。该摄像机在采集到该图像之前采集的上一帧图像中的目标区域的图像是该显示界面上当前显示的图像。也即是,第二区域的图像是在该摄像机采集到该图像时该显示界面上正在显示的图像。In addition, the image is the image currently collected by the camera. The image of the target area in the last frame of the image collected by the camera before the image is collected is the image currently displayed on the display interface. That is, the image of the second area is the image being displayed on the display interface when the camera collects the image.
再者,本申请实施例中可以结合第一区域和第二区域,也即结合当前图像 的中心区域和该显示界面上正在显示的图像在上一帧图像中所处的区域,来确定当前图像中用于在该显示界面上显示的图像在当前图像中所处的区域。如此,有助于实现图像的平滑显示。Furthermore, in the embodiments of the present application, the first area and the second area may be combined, that is, combined with the center area of the current image and the area where the image being displayed on the display interface is located in the previous frame of image, to determine the current image Is used for the area where the image displayed on the display interface is located in the current image. In this way, it helps to achieve a smooth display of the image.
其中,根据第一区域和第二区域,确定该图像中的目标区域的操作可以为:若第一区域的位置与第二区域的位置之间的距离小于或等于预设距离,则将第一区域作为该图像中的目标区域。若第一区域的位置与第二区域的位置之间的距离大于预设距离,则将第二区域的位置向第一区域的位置的方向移动预设距离,得到目标位置;将该图像中位置与目标位置相同的区域作为该图像中的目标区域。Wherein, according to the first area and the second area, the operation of determining the target area in the image may be: if the distance between the position of the first area and the position of the second area is less than or equal to the preset distance, then the first area The area is used as the target area in the image. If the distance between the position of the first area and the position of the second area is greater than the preset distance, the position of the second area is moved to the direction of the position of the first area by the preset distance to obtain the target position; The same area as the target position is taken as the target area in the image.
需要说明的是,预设距离可以根据实际使用需求进行设置,且预设距离可以设置的较小。It should be noted that the preset distance can be set according to actual usage requirements, and the preset distance can be set to be smaller.
另外,由于第一区域的尺寸和第二区域的尺寸相同,所以第一区域的位置和第二区域的位置均可以通过相对应的位置点来指示。也就是说,第一区域的位置与第二区域的位置之间的距离可以通过第一区域与第二区域中的对应位置点来衡量,该位置点可以是角点或中心点。In addition, since the size of the first area and the size of the second area are the same, the position of the first area and the position of the second area can both be indicated by corresponding position points. That is, the distance between the position of the first area and the position of the second area can be measured by the corresponding position point in the first area and the second area, and the position point may be a corner point or a center point.
若第一区域的位置与第二区域的位置之间的距离小于或等于预设距离,说明第一区域的位置与第二区域的位置相距比较近,此时从第二区域的图像显示转换到第一区域的图像显示是比较平滑的,因而可以直接将第一区域作为该图像中的目标区域,以便后续可以直接对当前图像的中心区域进行显示。If the distance between the position of the first area and the position of the second area is less than or equal to the preset distance, it means that the position of the first area is relatively close to the position of the second area. At this time, the image display of the second area is switched to The image display of the first area is relatively smooth, so the first area can be directly used as the target area in the image, so that the central area of the current image can be directly displayed subsequently.
若第一区域的位置与第二区域的位置之间的距离大于预设距离,说明第一区域的位置与第二区域的位置相距比较远,此时从第二区域的图像显示转换到第一区域的图像显示很有可能会出现显示画面波动跳变,因而此时不将第一区域作为该图像中的目标区域,而是将第二区域的位置向第一区域的位置的方向移动预设距离来得到该图像中的目标区域的位置。也就是说,这种情况下,是将该显示界面上正在显示的图像的位置以固定步长(即预设距离)向当前图像的中心位置靠近,从而可以实现显示画面的平滑过渡。If the distance between the position of the first area and the position of the second area is greater than the preset distance, it means that the position of the first area is farther away from the position of the second area. At this time, the image display of the second area is switched to the first area. The image display of the area is likely to show fluctuations in the display screen, so at this time, the first area is not used as the target area in the image, but the position of the second area is moved in the direction of the position of the first area. Distance to get the location of the target area in the image. That is to say, in this case, the position of the image being displayed on the display interface is approached to the center position of the current image by a fixed step (ie, a preset distance), so that a smooth transition of the displayed image can be achieved.
步骤202:裁剪出该图像中的目标区域,得到目标图像。Step 202: Cut out the target area in the image to obtain the target image.
该图像中位于目标区域的边界内的图像就是目标图像。由于目标区域的尺寸与该显示界面的尺寸相同,所以目标图像的分辨率与该显示界面的分辨率相同。The image located within the boundary of the target area in the image is the target image. Since the size of the target area is the same as the size of the display interface, the resolution of the target image is the same as the resolution of the display interface.
步骤203:在该显示界面中显示目标图像。Step 203: Display the target image on the display interface.
由于目标图像的分辨率与该显示界面的分辨率相同,所以在该显示界面中可以清楚完整地显示目标图像,如此预览画面不会失真,预览效果较好。Since the resolution of the target image is the same as the resolution of the display interface, the target image can be displayed clearly and completely in the display interface, so that the preview image will not be distorted and the preview effect is better.
在本申请实施例中,获取图像后,确定该图像中的人脸区域。之后,根据该图像中的人脸区域确定该图像中的目标区域,然后裁剪出该图像中的目标区域,得到目标图像。最后,在该显示界面中显示目标图像。如此,只要用户处于图像采集范围内,该显示界面中显示的目标图像内就会尽可能的包含用户的人脸。相比于相关技术中需要用户站在固定位置才能实现人脸显示的方案,本申请实施例扩大了能够实现人脸显示的位置范围,提高了人脸显示的灵活性,可以极大的提高用户体验。In the embodiment of the present application, after the image is acquired, the face area in the image is determined. Then, the target area in the image is determined according to the face area in the image, and then the target area in the image is cut out to obtain the target image. Finally, the target image is displayed on the display interface. In this way, as long as the user is within the image acquisition range, the target image displayed on the display interface will contain the user's face as much as possible. Compared with the solution in the related art that requires the user to stand at a fixed position to realize the face display, the embodiment of the present application expands the position range that can realize the face display, improves the flexibility of the face display, and can greatly improve the user. Experience.
此外,由于摄像头通常是固定的,其采集的图像背景和位置范围也是固定的。本申请实施例中,可以先检测人脸区域,然后使新的预览区域逐步靠近检测到的人脸区域,从而在保证所预览的目标图像内能够尽可能的包含人脸的同时,又能够产生一种类似在追踪人脸的预览效果,如此可以明显提升视觉效果和用户体验。In addition, since the camera is usually fixed, the background and position range of the captured image are also fixed. In the embodiment of the present application, the face area can be detected first, and then the new preview area is gradually approached to the detected face area, so as to ensure that the previewed target image can contain the face as much as possible, and it can also generate A preview effect similar to tracking human faces, which can significantly improve the visual effect and user experience.
为了便于理解,下面结合图5来对本申请实施例提供的图像显示方法进行举例说明。参见图5,在图像采集过程中,每获取到摄像机采集的一帧图像,就可以按照如下步骤来实现图像显示。For ease of understanding, the image display method provided by the embodiment of the present application will be described with reference to FIG. 5 as an example. Referring to Fig. 5, in the image acquisition process, each frame of image captured by the camera is acquired, the image display can be implemented according to the following steps.
步骤501:检测该图像中是否存在人脸。若存在人脸,则继续执行如下步骤502-步骤504;若不存在人脸,则继续执行如下步骤505-步骤508。Step 501: Detect whether there is a human face in the image. If there is a human face, continue to perform the following steps 502-504; if there is no human face, continue to perform the following steps 505-508.
步骤502:确定该图像中的人脸区域。Step 502: Determine the face area in the image.
步骤503:将该图像中尺寸与该显示界面的尺寸相同、中心点与该图像中的人脸区域的中心点相同的区域作为第一区域。Step 503: A region in the image with the same size as the size of the display interface and the same center point as the center point of the face region in the image is taken as the first region.
步骤504:若第一区域的位置与第二区域的位置之间的距离大于预设距离,则将第二区域的位置向第一区域的位置的方向移动预设距离,得到该图像中的目标区域的位置。Step 504: If the distance between the position of the first area and the position of the second area is greater than the preset distance, move the position of the second area to the position of the first area by the preset distance to obtain the target in the image The location of the area.
其中,第二区域是摄像机在采集到该图像之前采集的上一帧图像中的目标区域。Wherein, the second area is the target area in the last frame of image collected by the camera before the image is collected.
步骤505:判断上一帧图像中的目标区域是否是其中心区域;若是,则继续执行步骤506;若不是,则继续执行步骤507-步骤508。Step 505: Determine whether the target area in the previous frame of image is its central area; if it is, proceed to step 506; if not, proceed to step 507 to step 508.
其中,中心区域的中心点与图像中心点相同,中心区域的尺寸与该显示界 面的尺寸相同。Among them, the center point of the center area is the same as the image center point, and the size of the center area is the same as the size of the display interface.
步骤506:将该图像的中心区域作为该图像中的目标区域。Step 506: Use the central area of the image as the target area in the image.
步骤507:将该图像的中心区域作为第一区域。Step 507: Use the central area of the image as the first area.
步骤508:若第一区域的位置与第二区域的位置之间的距离大于预设距离,则将第二区域的位置向第一区域的位置的方向移动预设距离,得到该图像中的目标区域的位置。Step 508: If the distance between the position of the first area and the position of the second area is greater than the preset distance, move the position of the second area to the position of the first area by the preset distance to obtain the target in the image The location of the area.
在通过上述步骤504、步骤506或步骤508得到该图像中的目标区域之后,可以继续执行如下步骤509-步骤510来实现图像显示。After the target area in the image is obtained through step 504, step 506, or step 508, the following steps 509 to 510 can be performed to realize image display.
步骤509:裁剪出该图像中的目标区域,得到目标图像。Step 509: Cut out the target area in the image to obtain the target image.
步骤510:在该显示界面中显示目标图像。Step 510: Display the target image on the display interface.
图6是本申请实施例提供的一种图像显示装置的结构示意图。参见图6,该装置包括:FIG. 6 is a schematic structural diagram of an image display device provided by an embodiment of the present application. Referring to Figure 6, the device includes:
图像获取模块601,用于获取图像;The image acquisition module 601 is used to acquire an image;
第一确定模块602,用于确定该图像中的人脸区域;The first determining module 602 is configured to determine the face area in the image;
第二确定模块603,用于根据该图像中的人脸区域,确定该图像中的目标区域,目标区域的尺寸与显示界面的尺寸相同;The second determining module 603 is configured to determine a target area in the image according to the face area in the image, and the size of the target area is the same as the size of the display interface;
裁剪模块604,用于裁剪出该图像中的目标区域,得到目标图像;The cropping module 604 is used to crop out the target area in the image to obtain the target image;
显示模块605,用于在该显示界面中显示目标图像。The display module 605 is used to display the target image on the display interface.
可选地,第一确定模块602用于:Optionally, the first determining module 602 is used to:
确定该图像中的一个或多个检测框,该检测框内包含人脸;Determine one or more detection frames in the image, where the detection frames contain human faces;
将该图像中的一个或多个检测框中尺寸最大的一个检测框指示的区域作为该图像中的人脸区域。The area indicated by the largest detection frame in one or more detection frames in the image is taken as the face area in the image.
可选地,第二确定模块603用于:Optionally, the second determining module 603 is used to:
将该图像中尺寸与该显示界面的尺寸相同、中心点与该图像中的人脸区域的中心点相同的区域作为第一区域;Taking an area in the image that has the same size as the size of the display interface and the center point is the same as the center point of the face area in the image as the first area;
将在采集到该图像之前采集的上一帧图像中的目标区域作为第二区域;Taking the target area in the last frame of image collected before the image is collected as the second area;
根据第一区域和第二区域,确定该图像中的目标区域。According to the first area and the second area, the target area in the image is determined.
可选地,第二确定模块603用于:Optionally, the second determining module 603 is used to:
若第一区域的位置与第二区域的位置之间的距离小于或等于预设距离,则将第一区域作为该图像中的目标区域;If the distance between the position of the first area and the position of the second area is less than or equal to the preset distance, the first area is taken as the target area in the image;
若第一区域的位置与第二区域的位置之间的距离大于预设距离,则将第二区域的位置向第一区域的位置的方向移动该预设距离,得到目标位置;将该图像中位置与目标位置相同的区域作为该图像中的目标区域。If the distance between the position of the first area and the position of the second area is greater than the preset distance, the position of the second area is moved to the direction of the position of the first area by the preset distance to obtain the target position; The area with the same position as the target position is regarded as the target area in the image.
可选地,该装置还包括:Optionally, the device further includes:
第三确定模块,用于若该图像中不存在人脸区域,则将该图像中尺寸与该显示界面的尺寸相同、中心点与该图像的中心点相同的区域作为第一区域;The third determining module is configured to, if there is no face area in the image, use an area in the image with the same size as the size of the display interface and the same center point as the center point of the image as the first area;
第四确定模块,用于将在采集到该图像之前采集的上一帧图像中的目标区域作为第二区域;The fourth determining module is configured to use the target area in the last frame of image acquired before the image is acquired as the second area;
第五确定模块,用于根据第一区域和第二区域,确定该图像中的目标区域。The fifth determining module is used to determine the target area in the image according to the first area and the second area.
在本申请实施例中,获取图像,确定该图像中的人脸区域。之后,根据该图像中的人脸区域确定该图像中的目标区域,然后裁剪出该图像中的目标区域,得到目标图像。最后,在该显示界面中显示目标图像。如此,只要用户处于图像采集范围内,该显示界面中显示的目标图像内就会尽可能的包含用户的人脸。相比于相关技术中需要用户站在固定位置才能实现人脸显示的方案,本申请实施例扩大了能够实现人脸显示的位置范围,提高了人脸显示的灵活性,可以极大的提高用户体验。In this embodiment of the application, an image is acquired, and the face area in the image is determined. Then, the target area in the image is determined according to the face area in the image, and then the target area in the image is cut out to obtain the target image. Finally, the target image is displayed on the display interface. In this way, as long as the user is within the image acquisition range, the target image displayed on the display interface will contain the user's face as much as possible. Compared with the solution in the related art that requires the user to stand at a fixed position to realize the face display, the embodiment of the present application expands the position range that can realize the face display, improves the flexibility of the face display, and can greatly improve the user. Experience.
图7是本申请实施例提供的一种图像显示装置的结构示意图。参见图7,该装置包括:FIG. 7 is a schematic structural diagram of an image display device provided by an embodiment of the present application. Referring to Figure 7, the device includes:
处理器701,用于在获取的图像中确定人脸区域;根据该图像中的人脸区域,确定该图像中的目标区域,目标区域的尺寸与显示界面的尺寸相同;裁剪出该图像中的目标区域,得到目标图像;The processor 701 is configured to determine the face area in the acquired image; determine the target area in the image according to the face area in the image, and the size of the target area is the same as the size of the display interface; The target area, the target image is obtained;
显示器702,用于在该显示界面中显示目标图像。The display 702 is used to display a target image on the display interface.
可选地,处理器701用于:Optionally, the processor 701 is configured to:
确定该图像中的一个或多个检测框,该检测框内包含人脸;Determine one or more detection frames in the image, where the detection frames contain human faces;
将该图像中的一个或多个检测框中尺寸最大的一个检测框指示的区域作为该图像中的人脸区域。The area indicated by the largest detection frame in one or more detection frames in the image is taken as the face area in the image.
可选地,处理器701用于:Optionally, the processor 701 is configured to:
将该图像中尺寸与该显示界面的尺寸相同、中心点与该图像中的人脸区域的中心点相同的区域作为第一区域;Taking an area in the image that has the same size as the size of the display interface and the center point is the same as the center point of the face area in the image as the first area;
将在采集到该图像之前采集的上一帧图像中的目标区域作为第二区域;Taking the target area in the last frame of image collected before the image is collected as the second area;
根据第一区域和第二区域,确定该图像中的目标区域。According to the first area and the second area, the target area in the image is determined.
可选地,处理器701用于:Optionally, the processor 701 is configured to:
若第一区域的位置与第二区域的位置之间的距离小于或等于预设距离,则将第一区域作为该图像中的目标区域;If the distance between the position of the first area and the position of the second area is less than or equal to the preset distance, the first area is taken as the target area in the image;
若第一区域的位置与第二区域的位置之间的距离大于预设距离,则将第二区域的位置向第一区域的位置的方向移动预设距离,得到目标位置;将该图像中位置与目标位置相同的区域作为该图像中的目标区域。If the distance between the position of the first area and the position of the second area is greater than the preset distance, the position of the second area is moved to the direction of the position of the first area by the preset distance to obtain the target position; The same area as the target position is taken as the target area in the image.
可选地,处理器701用于:Optionally, the processor 701 is configured to:
若该图像中不存在人脸区域,则将该图像中尺寸与该显示界面的尺寸相同、中心点与该图像的中心点相同的区域作为第一区域;If there is no face area in the image, then an area in the image with the same size as the size of the display interface and the same center point as the center point of the image is taken as the first area;
将在采集到该图像之前采集的上一帧图像中的目标区域作为第二区域;Taking the target area in the last frame of image collected before the image is collected as the second area;
根据第一区域和第二区域,确定该图像中的目标区域。According to the first area and the second area, the target area in the image is determined.
可选地,该装置还包括:Optionally, the device further includes:
图像获取模块,用于获取图像。The image acquisition module is used to acquire images.
在本申请实施例中,在获取的图像中确定人脸区域。之后,根据该图像中的人脸区域确定该图像中的目标区域,然后裁剪出该图像中的目标区域,得到目标图像。最后,在该显示界面中显示目标图像。如此,只要用户处于图像采集范围内,该显示界面中显示的目标图像内就会尽可能的包含用户的人脸。相比于相关技术中需要用户站在固定位置才能实现人脸显示的方案,本申请实施例扩大了能够实现人脸显示的位置范围,提高了人脸显示的灵活性,可以极大的提高用户体验。In the embodiment of the present application, the human face area is determined in the acquired image. Then, the target area in the image is determined according to the face area in the image, and then the target area in the image is cut out to obtain the target image. Finally, the target image is displayed on the display interface. In this way, as long as the user is within the image acquisition range, the target image displayed on the display interface will contain the user's face as much as possible. Compared with the solution in the related art that requires the user to stand at a fixed position to realize the face display, the embodiment of the present application expands the position range that can realize the face display, improves the flexibility of the face display, and can greatly improve the user. Experience.
需要说明的是:上述实施例提供的图像显示装置在显示图像时,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。另外,上述实施例提供的图像显示装置与图像显示方法实施例属于同一构思,其具体实现过程详见方法实施例,这里不再赘述。It should be noted that when the image display device provided in the above embodiment displays images, only the division of the above functional modules is used as an example for illustration. In actual applications, the above functions can be allocated by different functional modules as needed, i.e. The internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the image display device provided in the foregoing embodiment and the image display method embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, and will not be repeated here.
图8是本申请实施例提供的一种终端800的结构示意图。终端800可以是:智能手机、平板电脑、MP3播放器(Moving Picture Experts Group Audio Layer III, 动态影像专家压缩标准音频层面3)、MP4(Moving Picture Experts Group Audio Layer IV,动态影像专家压缩标准音频层面4)播放器、笔记本电脑或台式电脑。终端800还可能被称为用户设备、便携式终端、膝上型终端、台式终端等其他名称。FIG. 8 is a schematic structural diagram of a terminal 800 provided by an embodiment of the present application. The terminal 800 can be: a smart phone, a tablet computer, an MP3 player (Moving Picture Experts Group Audio Layer III, a moving picture expert compresses standard audio layer 3), MP4 (Moving Picture Experts Group Audio Layer IV, a moving picture expert compresses a standard audio layer) 4) Player, laptop or desktop computer. The terminal 800 may also be called user equipment, portable terminal, laptop terminal, desktop terminal and other names.
通常,终端800包括有:处理器801和存储器802。Generally, the terminal 800 includes a processor 801 and a memory 802.
处理器801可以包括一个或多个处理核心,比如4核心处理器、8核心处理器等。处理器801可以采用DSP(Digital Signal Processing,数字信号处理)、FPGA(Field-Programmable Gate Array,现场可编程门阵列)、PLA(Programmable Logic Array,可编程逻辑阵列)中的至少一种硬件形式来实现。处理器801也可以包括主处理器和协处理器,主处理器是用于对在唤醒状态下的数据进行处理的处理器,也称CPU(Central Processing Unit,中央处理器);协处理器是用于对在待机状态下的数据进行处理的低功耗处理器。在一些实施例中,处理器801可以集成有GPU(Graphics Processing Unit,图像处理器),GPU用于负责显示屏所需要显示的内容的渲染和绘制。一些实施例中,处理器801还可以包括AI(Artificial Intelligence,人工智能)处理器,该AI处理器用于处理有关机器学习的计算操作。The processor 801 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and so on. The processor 801 may adopt at least one hardware form among DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array, Programmable Logic Array). accomplish. The processor 801 may also include a main processor and a coprocessor. The main processor is a processor used to process data in the wake state, also called a CPU (Central Processing Unit, central processing unit); the coprocessor is A low-power processor used to process data in the standby state. In some embodiments, the processor 801 may be integrated with a GPU (Graphics Processing Unit, image processor), and the GPU is used for rendering and drawing content that needs to be displayed on the display screen. In some embodiments, the processor 801 may further include an AI (Artificial Intelligence) processor, and the AI processor is used to process computing operations related to machine learning.
存储器802可以包括一个或多个计算机可读存储介质,该计算机可读存储介质可以是非暂态的。存储器802还可包括高速随机存取存储器以及非易失性存储器,比如一个或多个磁盘存储设备、闪存存储设备。在一些实施例中,存储器802中的非暂态的计算机可读存储介质用于存储至少一个指令,该至少一个指令用于被处理器801所执行以实现本申请实施例中方法实施例提供的图像显示方法中执行的操作。The memory 802 may include one or more computer-readable storage media, which may be non-transitory. The memory 802 may also include high-speed random access memory and non-volatile memory, such as one or more magnetic disk storage devices and flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 802 is used to store at least one instruction, and the at least one instruction is used to be executed by the processor 801 to implement the method provided in the embodiment of the present application. The operation performed in the image display method.
在一些实施例中,终端800还可选包括有:外围设备接口803和至少一个外围设备。处理器801、存储器802和外围设备接口803之间可以通过总线或信号线相连。各个外围设备可以通过总线、信号线或电路板与外围设备接口803相连。具体地,外围设备包括:射频电路804、显示屏805、摄像头组件806、音频电路807、定位组件808和电源809中的至少一种。In some embodiments, the terminal 800 may optionally further include: a peripheral device interface 803 and at least one peripheral device. The processor 801, the memory 802, and the peripheral device interface 803 may be connected by a bus or a signal line. Each peripheral device can be connected to the peripheral device interface 803 through a bus, a signal line, or a circuit board. Specifically, the peripheral device includes: at least one of a radio frequency circuit 804, a display screen 805, a camera component 806, an audio circuit 807, a positioning component 808, and a power supply 809.
外围设备接口803可被用于将I/O(Input/Output,输入/输出)相关的至少一个外围设备连接到处理器801和存储器802。在一些实施例中,处理器801、存储器802和外围设备接口803被集成在同一芯片或电路板上;在一些其他实施例中,处理器801、存储器802和外围设备接口803中的任意一个或两个可以 在单独的芯片或电路板上实现,本申请实施例对此不加以限定。The peripheral device interface 803 may be used to connect at least one peripheral device related to I/O (Input/Output) to the processor 801 and the memory 802. In some embodiments, the processor 801, the memory 802, and the peripheral device interface 803 are integrated on the same chip or circuit board; in some other embodiments, any one of the processor 801, the memory 802, and the peripheral device interface 803 or The two can be implemented on separate chips or circuit boards, which are not limited in the embodiment of the present application.
射频电路804用于接收和发射RF(Radio Frequency,射频)信号,也称电磁信号。射频电路804通过电磁信号与通信网络以及其他通信设备进行通信。射频电路804将电信号转换为电磁信号进行发送,或者,将接收到的电磁信号转换为电信号。可选地,射频电路804包括:天线系统、RF收发器、一个或多个放大器、调谐器、振荡器、数字信号处理器、编解码芯片组、用户身份模块卡等。射频电路804可以通过至少一种无线通信协议来与其它终端进行通信。该无线通信协议包括但不限于:城域网、各代移动通信网络(2G、3G、4G及5G)、无线局域网和/或WiFi(Wireless Fidelity,无线保真)网络。在一些实施例中,射频电路804还可以包括NFC(Near Field Communication,近距离无线通信)有关的电路,本申请实施例对此不加以限定。The radio frequency circuit 804 is used for receiving and transmitting RF (Radio Frequency, radio frequency) signals, also called electromagnetic signals. The radio frequency circuit 804 communicates with a communication network and other communication devices through electromagnetic signals. The radio frequency circuit 804 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals into electrical signals. Optionally, the radio frequency circuit 804 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, and the like. The radio frequency circuit 804 can communicate with other terminals through at least one wireless communication protocol. The wireless communication protocol includes, but is not limited to: metropolitan area networks, various generations of mobile communication networks (2G, 3G, 4G, and 5G), wireless local area networks, and/or WiFi (Wireless Fidelity, wireless fidelity) networks. In some embodiments, the radio frequency circuit 804 may also include a circuit related to NFC (Near Field Communication), which is not limited in the embodiment of the present application.
显示屏805用于显示UI(User Interface,用户界面)。该UI可以包括图形、文本、图标、视频及其它们的任意组合。当显示屏805是触摸显示屏时,显示屏805还具有采集在显示屏805的表面或表面上方的触摸信号的能力。该触摸信号可以作为控制信号输入至处理器801进行处理。此时,显示屏805还可以用于提供虚拟按钮和/或虚拟键盘,也称软按钮和/或软键盘。在一些实施例中,显示屏805可以为一个,设置在终端800的前面板;在另一些实施例中,显示屏805可以为至少两个,分别设置在终端800的不同表面或呈折叠设计;在其他一些实施例中,显示屏805可以是柔性显示屏,设置在终端800的弯曲表面上或折叠面上。甚至,显示屏805还可以设置成非矩形的不规则图形,也即异形屏。显示屏805可以采用LCD(Liquid Crystal Display,液晶显示屏)、OLED(Organic Light-Emitting Diode,有机发光二极管)等材质制备。The display screen 805 is used to display UI (User Interface). The UI can include graphics, text, icons, videos, and any combination thereof. When the display screen 805 is a touch display screen, the display screen 805 also has the ability to collect touch signals on or above the surface of the display screen 805. The touch signal can be input to the processor 801 as a control signal for processing. At this time, the display screen 805 may also be used to provide virtual buttons and/or virtual keyboards, also called soft buttons and/or soft keyboards. In some embodiments, there may be one display screen 805, which is arranged on the front panel of the terminal 800; in other embodiments, there may be at least two display screens 805, which are respectively arranged on different surfaces of the terminal 800 or in a folded design; In some other embodiments, the display screen 805 may be a flexible display screen, which is disposed on the curved surface or the folding surface of the terminal 800. Furthermore, the display screen 805 can also be set as a non-rectangular irregular pattern, that is, a special-shaped screen. The display screen 805 may be made of materials such as LCD (Liquid Crystal Display) and OLED (Organic Light-Emitting Diode).
摄像头组件806用于采集图像或视频。可选地,摄像头组件806包括前置摄像头和后置摄像头。通常,前置摄像头设置在终端的前面板,后置摄像头设置在终端的背面。在一些实施例中,后置摄像头为至少两个,分别为主摄像头、景深摄像头、广角摄像头、长焦摄像头中的任意一种,以实现主摄像头和景深摄像头融合实现背景虚化功能、主摄像头和广角摄像头融合实现全景拍摄以及VR(Virtual Reality,虚拟现实)拍摄功能或者其它融合拍摄功能。在一些实施例中,摄像头组件806还可以包括闪光灯。闪光灯可以是单色温闪光灯,也可以是双色温闪光灯。双色温闪光灯是指暖光闪光灯和冷光闪光灯的组合,可以用于不同色温下的光线补偿。The camera assembly 806 is used to capture images or videos. Optionally, the camera assembly 806 includes a front camera and a rear camera. Generally, the front camera is set on the front panel of the terminal, and the rear camera is set on the back of the terminal. In some embodiments, there are at least two rear cameras, each of which is a main camera, a depth-of-field camera, a wide-angle camera, and a telephoto camera, so as to realize the fusion of the main camera and the depth-of-field camera to realize the background blur function, the main camera Integrate with the wide-angle camera to realize panoramic shooting and VR (Virtual Reality) shooting functions or other fusion shooting functions. In some embodiments, the camera assembly 806 may also include a flash. The flash can be a single-color flash or a dual-color flash. Dual color temperature flash refers to a combination of warm light flash and cold light flash, which can be used for light compensation under different color temperatures.
音频电路807可以包括麦克风和扬声器。麦克风用于采集用户及环境的声波,并将声波转换为电信号输入至处理器801进行处理,或者输入至射频电路804以实现语音通信。出于立体声采集或降噪的目的,麦克风可以为多个,分别设置在终端800的不同部位。麦克风还可以是阵列麦克风或全向采集型麦克风。扬声器则用于将来自处理器801或射频电路804的电信号转换为声波。扬声器可以是传统的薄膜扬声器,也可以是压电陶瓷扬声器。当扬声器是压电陶瓷扬声器时,不仅可以将电信号转换为人类可听见的声波,也可以将电信号转换为人类听不见的声波以进行测距等用途。在一些实施例中,音频电路807还可以包括耳机插孔。The audio circuit 807 may include a microphone and a speaker. The microphone is used to collect sound waves of the user and the environment, and convert the sound waves into electrical signals to be input to the processor 801 for processing, or input to the radio frequency circuit 804 to implement voice communication. For the purpose of stereo collection or noise reduction, there may be multiple microphones, which are respectively set in different parts of the terminal 800. The microphone can also be an array microphone or an omnidirectional collection microphone. The speaker is used to convert the electrical signal from the processor 801 or the radio frequency circuit 804 into sound waves. The speaker can be a traditional thin-film speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, not only can the electrical signal be converted into human audible sound waves, but also the electrical signal can be converted into human inaudible sound waves for purposes such as distance measurement. In some embodiments, the audio circuit 807 may also include a headphone jack.
定位组件808用于定位终端800的当前地理位置,以实现导航或LBS(Location Based Service,基于位置的服务)。定位组件808可以是基于美国的GPS(Global Positioning System,全球定位系统)、中国的北斗系统、俄罗斯的格雷纳斯系统或欧盟的伽利略系统的定位组件。The positioning component 808 is used to locate the current geographic location of the terminal 800 to implement navigation or LBS (Location Based Service, location-based service). The positioning component 808 may be a positioning component based on the GPS (Global Positioning System, Global Positioning System) of the United States, the Beidou system of China, the Grenas system of Russia, or the Galileo system of the European Union.
电源809用于为终端800中的各个组件进行供电。电源809可以是交流电、直流电、一次性电池或可充电电池。当电源809包括可充电电池时,该可充电电池可以支持有线充电或无线充电。该可充电电池还可以用于支持快充技术。The power supply 809 is used to supply power to various components in the terminal 800. The power source 809 may be alternating current, direct current, disposable batteries, or rechargeable batteries. When the power source 809 includes a rechargeable battery, the rechargeable battery may support wired charging or wireless charging. The rechargeable battery can also be used to support fast charging technology.
在一些实施例中,终端800还包括有一个或多个传感器810。该一个或多个传感器810包括但不限于:加速度传感器811、陀螺仪传感器812、压力传感器813、指纹传感器814、光学传感器815以及接近传感器816。In some embodiments, the terminal 800 further includes one or more sensors 810. The one or more sensors 810 include, but are not limited to: an acceleration sensor 811, a gyroscope sensor 812, a pressure sensor 813, a fingerprint sensor 814, an optical sensor 815, and a proximity sensor 816.
加速度传感器811可以检测以终端800建立的坐标系的三个坐标轴上的加速度大小。比如,加速度传感器811可以用于检测重力加速度在三个坐标轴上的分量。处理器801可以根据加速度传感器811采集的重力加速度信号,控制显示屏805以横向视图或纵向视图进行用户界面的显示。加速度传感器811还可以用于游戏或用户的运动数据的采集。The acceleration sensor 811 can detect the magnitude of acceleration on the three coordinate axes of the coordinate system established by the terminal 800. For example, the acceleration sensor 811 can be used to detect the components of the gravitational acceleration on three coordinate axes. The processor 801 may control the display screen 805 to display the user interface in a horizontal view or a vertical view according to the gravity acceleration signal collected by the acceleration sensor 811. The acceleration sensor 811 may also be used for the collection of game or user motion data.
陀螺仪传感器812可以检测终端800的机体方向及转动角度,陀螺仪传感器812可以与加速度传感器811协同采集用户对终端800的3D动作。处理器801根据陀螺仪传感器812采集的数据,可以实现如下功能:动作感应(比如根据用户的倾斜操作来改变UI)、拍摄时的图像稳定、游戏控制以及惯性导航。The gyroscope sensor 812 can detect the body direction and rotation angle of the terminal 800, and the gyroscope sensor 812 can cooperate with the acceleration sensor 811 to collect the user's 3D actions on the terminal 800. The processor 801 can implement the following functions according to the data collected by the gyroscope sensor 812: motion sensing (such as changing the UI according to the user's tilt operation), image stabilization during shooting, game control, and inertial navigation.
压力传感器813可以设置在终端800的侧边框和/或显示屏805的下层。当压力传感器813设置在终端800的侧边框时,可以检测用户对终端800的握持信号,由处理器801根据压力传感器813采集的握持信号进行左右手识别或快 捷操作。当压力传感器813设置在显示屏805的下层时,由处理器801根据用户对显示屏805的压力操作,实现对UI界面上的可操作性控件进行控制。可操作性控件包括按钮控件、滚动条控件、图标控件、菜单控件中的至少一种。The pressure sensor 813 may be disposed on the side frame of the terminal 800 and/or the lower layer of the display screen 805. When the pressure sensor 813 is arranged on the side frame of the terminal 800, the user's holding signal of the terminal 800 can be detected, and the processor 801 performs left and right hand recognition or quick operation according to the holding signal collected by the pressure sensor 813. When the pressure sensor 813 is arranged on the lower layer of the display screen 805, the processor 801 controls the operability controls on the UI interface according to the pressure operation of the user on the display screen 805. The operability control includes at least one of a button control, a scroll bar control, an icon control, and a menu control.
指纹传感器814用于采集用户的指纹,由处理器801根据指纹传感器814采集到的指纹识别用户的身份,或者,由指纹传感器814根据采集到的指纹识别用户的身份。在识别出用户的身份为可信身份时,由处理器801授权该用户执行相关的敏感操作,该敏感操作包括解锁屏幕、查看加密信息、下载软件、支付及更改设置等。指纹传感器814可以被设置在终端800的正面、背面或侧面。当终端800上设置有物理按键或厂商Logo时,指纹传感器814可以与物理按键或厂商Logo集成在一起。The fingerprint sensor 814 is used to collect the user's fingerprint. The processor 801 identifies the user's identity according to the fingerprint collected by the fingerprint sensor 814, or the fingerprint sensor 814 identifies the user's identity according to the collected fingerprint. When it is recognized that the user's identity is a trusted identity, the processor 801 authorizes the user to perform related sensitive operations, including unlocking the screen, viewing encrypted information, downloading software, paying, and changing settings. The fingerprint sensor 814 may be provided on the front, back, or side of the terminal 800. When a physical button or a manufacturer logo is provided on the terminal 800, the fingerprint sensor 814 may be integrated with the physical button or the manufacturer logo.
光学传感器815用于采集环境光强度。在一个实施例中,处理器801可以根据光学传感器815采集的环境光强度,控制显示屏805的显示亮度。具体地,当环境光强度较高时,调高显示屏805的显示亮度;当环境光强度较低时,调低显示屏805的显示亮度。在另一个实施例中,处理器801还可以根据光学传感器815采集的环境光强度,动态调整摄像头组件806的拍摄参数。The optical sensor 815 is used to collect the ambient light intensity. In an embodiment, the processor 801 may control the display brightness of the display screen 805 according to the ambient light intensity collected by the optical sensor 815. Specifically, when the ambient light intensity is high, the display brightness of the display screen 805 is increased; when the ambient light intensity is low, the display brightness of the display screen 805 is decreased. In another embodiment, the processor 801 may also dynamically adjust the shooting parameters of the camera assembly 806 according to the ambient light intensity collected by the optical sensor 815.
接近传感器816也称距离传感器,通常设置在终端800的前面板。接近传感器816用于采集用户与终端800的正面之间的距离。在一个实施例中,当接近传感器816检测到用户与终端800的正面之间的距离逐渐变小时,由处理器801控制显示屏805从亮屏状态切换为息屏状态;当接近传感器816检测到用户与终端800的正面之间的距离逐渐变大时,由处理器801控制显示屏805从息屏状态切换为亮屏状态。The proximity sensor 816 is also called a distance sensor, and is usually arranged on the front panel of the terminal 800. The proximity sensor 816 is used to collect the distance between the user and the front of the terminal 800. In one embodiment, when the proximity sensor 816 detects that the distance between the user and the front of the terminal 800 gradually decreases, the processor 801 controls the display screen 805 to switch from the on-screen state to the off-screen state; when the proximity sensor 816 detects When the distance between the user and the front of the terminal 800 gradually increases, the processor 801 controls the display screen 805 to switch from the rest screen state to the bright screen state.
本领域技术人员可以理解,图8中示出的结构并不构成对终端800的限定,可以包括比图示更多或更少的组件,或者组合某些组件,或者采用不同的组件布置。Those skilled in the art can understand that the structure shown in FIG. 8 does not constitute a limitation on the terminal 800, and may include more or fewer components than shown in the figure, or combine certain components, or adopt different component arrangements.
图9是本申请实施例提供的一种服务器900的结构示意图。服务器900可以是后台服务器集群中的服务器。具体来讲:FIG. 9 is a schematic structural diagram of a server 900 provided by an embodiment of the present application. The server 900 may be a server in a background server cluster. Specifically:
服务器900包括CPU(Central Processing Unit,中央处理单元)901、包括RAM(Random Access Memory,随机存取存储器)902和ROM(Read-Only Memory,只读存储器)903的系统存储器904,以及连接系统存储器904和中央处理单元901的系统总线905。服务器900还包括帮助计算机内的各个器件之 间传输信息的基本I/O(Input/Output,输入/输出)系统906,和用于存储操作系统913、应用程序914和其他程序模块915的大容量存储设备907。The server 900 includes a CPU (Central Processing Unit) 901, a system memory 904 including RAM (Random Access Memory) 902 and ROM (Read-Only Memory) 903, and a system memory connected to it 904 and the system bus 905 of the central processing unit 901. The server 900 also includes a basic I/O (Input/Output) system 906 that helps transfer information between various devices in the computer, and a large-capacity storage system 913, application programs 914, and other program modules 915. Storage device 907.
基本输入/输出系统906包括有用于显示信息的显示器908和用于用户输入信息的诸如鼠标、键盘之类的输入设备909。其中显示器908和输入设备909都通过连接到系统总线905的输入/输出控制器910连接到中央处理单元901。基本输入/输出系统906还可以包括输入/输出控制器910以用于接收和处理来自键盘、鼠标或电子触控笔等多个其他设备的输入。类似地,输入/输出控制器910还提供输出到显示屏、打印机或其他类型的输出设备。The basic input/output system 906 includes a display 908 for displaying information and an input device 909 such as a mouse and a keyboard for the user to input information. The display 908 and the input device 909 are both connected to the central processing unit 901 through the input/output controller 910 connected to the system bus 905. The basic input/output system 906 may also include an input/output controller 910 for receiving and processing input from multiple other devices such as a keyboard, a mouse, or an electronic stylus. Similarly, the input/output controller 910 also provides output to a display screen, a printer, or other types of output devices.
大容量存储设备907通过连接到系统总线905的大容量存储控制器(未示出)连接到中央处理单元901。大容量存储设备907及其相关联的计算机可读介质为服务器900提供非易失性存储。也就是说,大容量存储设备907可以包括诸如硬盘或CD-ROM(Compact Disc Read-Only Memory,只读光盘)驱动器之类的计算机可读介质(未示出)。The mass storage device 907 is connected to the central processing unit 901 through a mass storage controller (not shown) connected to the system bus 905. The mass storage device 907 and its associated computer-readable medium provide non-volatile storage for the server 900. That is, the mass storage device 907 may include a computer-readable medium (not shown) such as a hard disk or a CD-ROM (Compact Disc Read-Only Memory) drive.
不失一般性,计算机可读介质可以包括计算机存储介质和通信介质。计算机存储介质包括用于存储诸如计算机可读指令、数据结构、程序模块或其他数据等信息的任何方法或技术实现的易失性和非易失性、可移动和不可移动介质。计算机存储介质包括RAM、ROM、EPROM(Electrically Erasable Programmable Read-Only Memory,可擦可编程只读存储器)、EEPROM(Electrically Erasable Programmable Read-Only Memory,电可擦可编程只读存储器)、闪存或其他固态存储其技术,以及包括CD-ROM、DVD(Digital Versatile Disc,数字通用光盘)或其他光学存储、磁带盒、磁带、磁盘存储或其他磁性存储设备。当然,本领域技术人员可知计算机存储介质不局限于上述几种。系统存储器904和大容量存储设备907可以统称为存储器。Without loss of generality, computer-readable media may include computer storage media and communication media. Computer storage media includes volatile and nonvolatile, removable and non-removable media implemented by any method or technology for storing information such as computer readable instructions, data structures, program modules, or other data. Computer storage media include RAM, ROM, EPROM (Electrically Erasable Programmable Read-Only Memory), EEPROM (Electrically Erasable Programmable Read-Only Memory), flash memory or other Solid-state storage technology, and includes CD-ROM, DVD (Digital Versatile Disc, Digital Versatile Disc) or other optical storage, tape cartridges, magnetic tape, magnetic disk storage or other magnetic storage devices. Of course, those skilled in the art may know that the computer storage medium is not limited to the above-mentioned types. The system memory 904 and the mass storage device 907 may be collectively referred to as memory.
根据本申请的各种实施例,服务器900还可以通过诸如因特网等网络连接到网络上的远程计算机运行。也即服务器900可以通过连接在系统总线905上的网络接口单元911连接到网络912,或者说,也可以使用网络接口单元911来连接到其他类型的网络或远程计算机系统(未示出)。According to various embodiments of the present application, the server 900 may also be connected to a remote computer on the network to run through a network such as the Internet. That is, the server 900 can be connected to the network 912 through the network interface unit 911 connected to the system bus 905, or in other words, the network interface unit 911 can also be used to connect to other types of networks or remote computer systems (not shown).
上述存储器还包括一个或者一个以上的程序,一个或者一个以上程序存储于存储器中,被配置由CPU执行。该一个或者一个以上程序包含用于进行本申请实施例中方法实施例提供的图像显示方法中执行的操作的指令。The foregoing memory also includes one or more programs, and one or more programs are stored in the memory and configured to be executed by the CPU. The one or more programs include instructions for performing operations performed in the image display method provided by the method embodiment in the embodiment of the present application.
在一些实施例中,还提供了一种计算机可读存储介质,该计算机可读存储介质内存储有计算机程序,该计算机程序被处理器执行时实现上述图2实施例提供的图像显示方法的步骤。比如,该计算机可读存储介质可以是ROM、RAM、CD-ROM、磁带、软盘和光数据存储设备等。In some embodiments, a computer-readable storage medium is also provided, the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the image display method provided in the embodiment of FIG. 2 are implemented. . For example, the computer-readable storage medium may be ROM, RAM, CD-ROM, magnetic tape, floppy disk, optical data storage device, etc.
值得注意的是,本申请实施例提到的计算机可读存储介质可以为非易失性存储介质,换句话说,可以是非瞬时性存储介质。It should be noted that the computer-readable storage medium mentioned in the embodiment of the present application may be a non-volatile storage medium, in other words, it may be a non-transitory storage medium.
应当理解的是,实现上述实施例的全部或部分步骤可以通过软件、硬件、固件或者其任意结合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。该计算机程序产品包括一个或多个计算机指令。该计算机指令可以存储在上述计算机可读存储介质中。It should be understood that all or part of the steps for implementing the foregoing embodiments may be implemented by software, hardware, firmware, or any combination thereof. When implemented by software, it can be implemented in the form of a computer program product in whole or in part. The computer program product includes one or more computer instructions. The computer instructions can be stored in the aforementioned computer-readable storage medium.
在一些实施例中,还提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述图2实施例提供的图像显示方法的步骤。In some embodiments, a computer program product containing instructions is also provided, which when running on a computer, causes the computer to execute the steps of the image display method provided in the embodiment of FIG. 2 above.
以上所述仅为本申请的可选实施例,并不用以限制本申请,凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。The above are only optional embodiments of this application and are not intended to limit this application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this application shall be included in the protection of this application. Within range.

Claims (12)

  1. 一种图像显示方法,其特征在于,所述方法包括:An image display method, characterized in that the method includes:
    获取图像,确定所述图像中的人脸区域;Acquiring an image, and determining a face area in the image;
    根据所述图像中的人脸区域,确定所述图像中的目标区域,所述目标区域的尺寸与显示界面的尺寸相同;Determining a target area in the image according to the face area in the image, where the size of the target area is the same as the size of the display interface;
    裁剪出所述图像中的目标区域,得到目标图像;Crop out the target area in the image to obtain the target image;
    在所述显示界面中显示所述目标图像。The target image is displayed on the display interface.
  2. 如权利要求1所述的方法,其特征在于,所述确定所述图像中的人脸区域,包括:The method of claim 1, wherein the determining the face area in the image comprises:
    确定所述图像中的一个或多个检测框,所述检测框内包含人脸;Determine one or more detection frames in the image, where the detection frames contain a human face;
    将所述图像中的一个或多个检测框中尺寸最大的一个检测框指示的区域作为所述图像中的人脸区域。The area indicated by the largest detection frame in one or more detection frames in the image is taken as the face area in the image.
  3. 如权利要求1或2所述的方法,其特征在于,所述根据所述图像中的人脸区域,确定所述图像中的目标区域,包括:The method according to claim 1 or 2, wherein the determining the target area in the image according to the face area in the image comprises:
    将所述图像中尺寸与所述显示界面的尺寸相同、中心点与所述图像中的人脸区域的中心点相同的区域作为第一区域;Taking an area in the image with the same size as the size of the display interface and the same center point as the center point of the face area in the image as the first area;
    将在采集到所述图像之前采集的上一帧图像中的目标区域作为第二区域;Taking the target area in the last frame of image collected before the image is collected as the second area;
    根据所述第一区域和所述第二区域,确定所述图像中的目标区域。According to the first area and the second area, a target area in the image is determined.
  4. 如权利要求3所述的方法,其特征在于,所述根据所述第一区域和所述第二区域,确定所述图像中的目标区域,包括:The method of claim 3, wherein the determining the target area in the image according to the first area and the second area comprises:
    若所述第一区域的位置与所述第二区域的位置之间的距离小于或等于预设距离,则将所述第一区域作为所述图像中的目标区域;If the distance between the position of the first area and the position of the second area is less than or equal to a preset distance, using the first area as the target area in the image;
    若所述第一区域的位置与所述第二区域的位置之间的距离大于预设距离,则将所述第二区域的位置向所述第一区域的位置的方向移动所述预设距离,得到目标位置;将所述图像中位置与所述目标位置相同的区域作为所述图像中的目标区域。If the distance between the position of the first area and the position of the second area is greater than the preset distance, the position of the second area is moved to the direction of the position of the first area by the preset distance , Obtain the target position; take an area in the image with the same position as the target position as the target area in the image.
  5. 如权利要求1所述的方法,其特征在于,所述方法还包括:The method of claim 1, wherein the method further comprises:
    若所述图像中不存在人脸区域,则将所述图像中尺寸与所述显示界面的尺寸相同、中心点与所述图像的中心点相同的区域作为第一区域;If there is no face area in the image, use an area in the image with the same size as the size of the display interface and the same center point as the center point of the image as the first area;
    将在采集到所述图像之前采集的上一帧图像中的目标区域作为第二区域;Taking the target area in the last frame of image collected before the image is collected as the second area;
    根据所述第一区域和所述第二区域,确定所述图像中的目标区域。According to the first area and the second area, a target area in the image is determined.
  6. 一种图像显示装置,其特征在于,所述装置包括:An image display device, characterized in that the device includes:
    处理器,用于在获取的图像中确定人脸区域;根据所述图像中的人脸区域,确定所述图像中的目标区域,所述目标区域的尺寸与显示界面的尺寸相同;裁剪出所述图像中的目标区域,得到目标图像;The processor is configured to determine the face area in the acquired image; determine the target area in the image according to the face area in the image, and the size of the target area is the same as the size of the display interface; Describe the target area in the image to obtain the target image;
    显示器,用于在所述显示界面中显示所述目标图像。The display is used to display the target image on the display interface.
  7. 如权利要求6所述的装置,其特征在于,所述处理器用于:The device of claim 6, wherein the processor is configured to:
    确定所述图像中的一个或多个检测框,所述检测框内包含人脸;Determine one or more detection frames in the image, where the detection frames contain a human face;
    将所述图像中的一个或多个检测框中尺寸最大的一个检测框指示的区域作为所述图像中的人脸区域。The area indicated by the largest detection frame in one or more detection frames in the image is taken as the face area in the image.
  8. 如权利要求6或7所述的装置,其特征在于,所述处理器用于:The device according to claim 6 or 7, wherein the processor is configured to:
    将所述图像中尺寸与所述显示界面的尺寸相同、中心点与所述图像中的人脸区域的中心点相同的区域作为第一区域;Taking an area in the image with the same size as the size of the display interface and the same center point as the center point of the face area in the image as the first area;
    将在采集到所述图像之前采集的上一帧图像中的目标区域作为第二区域;Taking the target area in the last frame of image collected before the image is collected as the second area;
    根据所述第一区域和所述第二区域,确定所述图像中的目标区域。According to the first area and the second area, a target area in the image is determined.
  9. 如权利要求8所述的装置,其特征在于,所述处理器用于:The device according to claim 8, wherein the processor is configured to:
    若所述第一区域的位置与所述第二区域的位置之间的距离小于或等于预设距离,则将所述第一区域作为所述图像中的目标区域;If the distance between the position of the first area and the position of the second area is less than or equal to a preset distance, using the first area as the target area in the image;
    若所述第一区域的位置与所述第二区域的位置之间的距离大于预设距离,则将所述第二区域的位置向所述第一区域的位置的方向移动所述预设距离,得到目标位置;将所述图像中位置与所述目标位置相同的区域作为所述图像中的目标区域。If the distance between the position of the first area and the position of the second area is greater than the preset distance, the position of the second area is moved to the direction of the position of the first area by the preset distance , Obtain the target position; take an area in the image with the same position as the target position as the target area in the image.
  10. 如权利要求6所述的装置,其特征在于,所述处理器还用于:The device according to claim 6, wherein the processor is further configured to:
    若所述图像中不存在人脸区域,则将所述图像中尺寸与所述显示界面的尺寸相同、中心点与所述图像的中心点相同的区域作为第一区域;If there is no face area in the image, use an area in the image with the same size as the size of the display interface and the same center point as the center point of the image as the first area;
    将在采集到所述图像之前采集的上一帧图像中的目标区域作为第二区域;Taking the target area in the last frame of image collected before the image is collected as the second area;
    根据所述第一区域和所述第二区域,确定所述图像中的目标区域。According to the first area and the second area, a target area in the image is determined.
  11. 如权利要求6所述的装置,其特征在于,所述装置还包括:The device according to claim 6, wherein the device further comprises:
    图像获取模块,用于获取图像。The image acquisition module is used to acquire images.
  12. 一种计算机设备,其特征在于,所述计算机设备包括处理器和存储器,所述存储器用于存放计算机程序,所述处理器用于执行所述存储器上所存放的程序,以实现权利要求1-5任一所述方法的步骤。A computer device, characterized in that the computer device includes a processor and a memory, the memory is used to store a computer program, and the processor is used to execute the program stored in the memory to implement claims 1-5 Steps of any of the described methods.
PCT/CN2021/089984 2020-04-30 2021-04-26 Image display method and apparatus, and computer device WO2021218926A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010364395.9 2020-04-30
CN202010364395.9A CN113592874A (en) 2020-04-30 2020-04-30 Image display method and device and computer equipment

Publications (1)

Publication Number Publication Date
WO2021218926A1 true WO2021218926A1 (en) 2021-11-04

Family

ID=78237286

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/089984 WO2021218926A1 (en) 2020-04-30 2021-04-26 Image display method and apparatus, and computer device

Country Status (2)

Country Link
CN (1) CN113592874A (en)
WO (1) WO2021218926A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114125286A (en) * 2021-11-18 2022-03-01 维沃移动通信有限公司 Shooting method and device thereof

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1908962A (en) * 2006-08-21 2007-02-07 北京中星微电子有限公司 People face track display method and system for real-time robust
US20180307897A1 (en) * 2016-05-28 2018-10-25 Samsung Electronics Co., Ltd. System and method for a unified architecture multi-task deep learning machine for object recognition
CN109089157A (en) * 2018-06-15 2018-12-25 广州华多网络科技有限公司 Method of cutting out, display equipment and the device of video pictures
CN110189378A (en) * 2019-05-23 2019-08-30 北京奇艺世纪科技有限公司 A kind of method for processing video frequency, device and electronic equipment
CN111145093A (en) * 2019-12-20 2020-05-12 北京五八信息技术有限公司 Image display method, image display device, electronic device, and storage medium
CN111583273A (en) * 2020-04-29 2020-08-25 京东方科技集团股份有限公司 Readable storage medium, display device and image processing method thereof

Family Cites Families (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3788969B2 (en) * 2002-10-25 2006-06-21 三菱電機株式会社 Real-time facial expression tracking device
TWI394121B (en) * 2006-12-18 2013-04-21 Sony Corp An image processing apparatus, an image processing method, and a recording medium
CN103597514B (en) * 2011-06-10 2016-04-06 松下电器产业株式会社 Object detection frame display device and object detection frame display packing
CN103458219A (en) * 2013-09-02 2013-12-18 小米科技有限责任公司 Method, device and terminal device for adjusting face in video call
US9773192B2 (en) * 2015-06-07 2017-09-26 Apple Inc. Fast template-based tracking
US9781350B2 (en) * 2015-09-28 2017-10-03 Qualcomm Incorporated Systems and methods for performing automatic zoom
CN105357436B (en) * 2015-11-03 2018-07-03 广东欧珀移动通信有限公司 For the image cropping method and system in image taking
CN107786812A (en) * 2017-10-31 2018-03-09 维沃移动通信有限公司 A kind of image pickup method, mobile terminal and computer-readable recording medium
CN109034013B (en) * 2018-07-10 2023-06-13 腾讯科技(深圳)有限公司 Face image recognition method, device and storage medium
CN109308469B (en) * 2018-09-21 2019-12-10 北京字节跳动网络技术有限公司 Method and apparatus for generating information
CN109936703A (en) * 2019-02-26 2019-06-25 成都第二记忆科技有限公司 The method and apparatus that the video of monocular camera shooting is reconstructed
CN110611787B (en) * 2019-06-10 2021-05-28 海信视像科技股份有限公司 Display and image processing method

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1908962A (en) * 2006-08-21 2007-02-07 北京中星微电子有限公司 People face track display method and system for real-time robust
US20180307897A1 (en) * 2016-05-28 2018-10-25 Samsung Electronics Co., Ltd. System and method for a unified architecture multi-task deep learning machine for object recognition
CN109089157A (en) * 2018-06-15 2018-12-25 广州华多网络科技有限公司 Method of cutting out, display equipment and the device of video pictures
CN110189378A (en) * 2019-05-23 2019-08-30 北京奇艺世纪科技有限公司 A kind of method for processing video frequency, device and electronic equipment
CN111145093A (en) * 2019-12-20 2020-05-12 北京五八信息技术有限公司 Image display method, image display device, electronic device, and storage medium
CN111583273A (en) * 2020-04-29 2020-08-25 京东方科技集团股份有限公司 Readable storage medium, display device and image processing method thereof

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114125286A (en) * 2021-11-18 2022-03-01 维沃移动通信有限公司 Shooting method and device thereof

Also Published As

Publication number Publication date
CN113592874A (en) 2021-11-02

Similar Documents

Publication Publication Date Title
WO2021008456A1 (en) Image processing method and apparatus, electronic device, and storage medium
CN109712224B (en) Virtual scene rendering method and device and intelligent device
US11517099B2 (en) Method for processing images, electronic device, and storage medium
WO2020221012A1 (en) Method for determining motion information of image feature point, task execution method, and device
WO2021143296A1 (en) Camera shot movement control method, device, apparatus, and storage medium
CN109166150B (en) Pose acquisition method and device storage medium
CN109862412B (en) Method and device for video co-shooting and storage medium
CN109922356B (en) Video recommendation method and device and computer-readable storage medium
WO2022134632A1 (en) Work processing method and apparatus
CN109886208B (en) Object detection method and device, computer equipment and storage medium
CN111754386B (en) Image area shielding method, device, equipment and storage medium
CN112565806B (en) Virtual gift giving method, device, computer equipment and medium
WO2021238564A1 (en) Display device and distortion parameter determination method, apparatus and system thereof, and storage medium
CN108845777B (en) Method and device for playing frame animation
WO2021027890A1 (en) License plate image generation method and device, and computer storage medium
US11720219B2 (en) Method, apparatus and device for displaying lyric, and storage medium
CN111385525B (en) Video monitoring method, device, terminal and system
CN108664300B (en) Application interface display method and device in picture-in-picture mode
CN111158575B (en) Method, device and equipment for terminal to execute processing and storage medium
WO2021218926A1 (en) Image display method and apparatus, and computer device
CN114594885A (en) Application icon management method, device and equipment and computer readable storage medium
CN113259772B (en) Barrage processing method, barrage processing system, barrage processing equipment and storage medium
US11962897B2 (en) Camera movement control method and apparatus, device, and storage medium
CN110660031B (en) Image sharpening method and device and storage medium
CN111381765B (en) Text box display method and device, computer equipment and storage medium

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

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21796389

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 21796389

Country of ref document: EP

Kind code of ref document: A1

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 27.06.2023)