[go: up one dir, main page]

CN111104821A - Image generation method and device - Google Patents

Image generation method and device Download PDF

Info

Publication number
CN111104821A
CN111104821A CN201811251793.9A CN201811251793A CN111104821A CN 111104821 A CN111104821 A CN 111104821A CN 201811251793 A CN201811251793 A CN 201811251793A CN 111104821 A CN111104821 A CN 111104821A
Authority
CN
China
Prior art keywords
point
image processing
human hand
generating
vertex
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201811251793.9A
Other languages
Chinese (zh)
Inventor
罗国中
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Microlive Vision Technology Co Ltd
Original Assignee
Beijing Microlive Vision Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Microlive Vision Technology Co Ltd filed Critical Beijing Microlive Vision Technology Co Ltd
Priority to CN201811251793.9A priority Critical patent/CN111104821A/en
Publication of CN111104821A publication Critical patent/CN111104821A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/20Movements or behaviour, e.g. gesture recognition
    • G06V40/28Recognition of hand or arm movements, e.g. recognition of deaf sign language
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/04Context-preserving transformations, e.g. by using an importance map
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/107Static hand or arm
    • G06V40/11Hand-related biometrics; Hand pose recognition
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/107Static hand or arm
    • G06V40/117Biometrics derived from hands

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Multimedia (AREA)
  • Health & Medical Sciences (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Health & Medical Sciences (AREA)
  • Psychiatry (AREA)
  • Social Psychology (AREA)
  • Image Processing (AREA)

Abstract

The disclosure discloses an image generation method, an image generation device, an electronic device and a computer-readable storage medium. The image generation method comprises the following steps: acquiring a video, wherein the video comprises a human hand; identifying the human hand in the video and acquiring human hand information; and generating an image processing area according to the human hand information. The embodiment of the disclosure determines the attribute of the area needing image processing through the hand information to dynamically generate the image processing area, and solves the technical problems of fixed and inflexible image processing area in the prior art.

Description

Image generation method and device
Technical Field
The present disclosure relates to the field of image processing, and in particular, to an image generation method and apparatus, an electronic device, and a computer-readable storage medium.
Background
With the development of computer technology, the application range of the intelligent terminal is widely improved, for example, the intelligent terminal can listen to music, play games, chat on internet, take pictures and the like. For the photographing technology of the intelligent terminal, the photographing pixels of the intelligent terminal reach more than ten million pixels, and the intelligent terminal has higher definition and the photographing effect comparable to that of a professional camera.
At present, when an intelligent terminal is used for photographing, not only can photographing effects of traditional functions be realized by using photographing software built in when the intelligent terminal leaves a factory, but also photographing effects with additional functions can be realized by downloading an Application program (APP for short) from a network end, for example, the APP with functions of dark light detection, a beauty camera, super pixels and the like can be realized. The beautifying function of the intelligent terminal generally comprises beautifying processing effects of skin color adjustment, skin grinding, large eye, face thinning and the like, and can perform beautifying processing of the same degree on all faces recognized in an image. At present, other image processing can be performed on the image shot by the intelligent terminal through the APP, such as adding some features.
However, the processing of the image described above can only be performed for a specific area, such as a full image or a pre-designated area, such as a predetermined size area in the center of the screen; if the processing area needs to be changed, the processing area needs to be reset, and the method is very inflexible and tedious in operation.
Disclosure of Invention
In a first aspect, an embodiment of the present disclosure provides an image generation method, including: acquiring a video, wherein the video comprises a human hand; identifying the human hand in the video and acquiring human hand information; and generating an image processing area according to the human hand information.
Further, after the generating an image processing area according to the human hand information, the method further includes:
acquiring a preset image processing mode; and processing the images in the majority of image processing areas by using the image processing mode.
Further, the identifying the human hand in the video and acquiring human hand information includes: a first human hand and a second human hand in the video are identified, and a first position point representing the position of the first human hand and a second position point representing the position of the second human hand are obtained.
Further, the generating an image processing area according to the human hand information includes: generating a region parameter of an image processing region according to the first position point and the second position point; and generating the image processing area according to the area parameter.
Further, the generating a region parameter of an image processing region according to the first position point and the second position point includes: generating a first positioning point and a second positioning point according to the first position point, wherein a connecting line between the first positioning point and the second positioning point is vertical to a first connecting line between the first position point and the second position point; generating a third positioning point and a fourth positioning point according to the second position point, wherein a connecting line between the third positioning point and the fourth positioning point is vertical to a first connecting line between the first position point and the second position point; and taking the first positioning point, the second positioning point, the third positioning point and the fourth positioning point as area parameters of an image processing area.
Further, the generating a first positioning point and a second positioning point according to the first positioning point includes: taking a preset point on the first connecting line; making a vertical line of the first connecting line through the preset point; making a first straight line through the first position point, so that an included angle between the first straight line and the first connecting line is a first preset included angle; making a second straight line through the first position point, so that the included angle between the second straight line and the first connecting line is a second preset included angle; taking the intersection point of the first straight line and the perpendicular line as a first positioning point; and taking the intersection point of the second straight line and the perpendicular line as a second positioning point.
Further, the distance from the preset point to the first position point is a length of the first connecting line in a fixed proportion.
Further, the generating a region parameter of an image processing region according to the first position point and the second position point includes: generating a first triangle by taking the first position point as a first vertex, wherein the first triangle also comprises a third vertex and a fourth vertex; generating a second triangle by taking the second position point as a second vertex, wherein the second triangle also comprises a fifth vertex and a sixth vertex; and taking the third vertex, the fourth vertex, the fifth vertex and the sixth vertex as area parameters of an image processing area.
Further, the generating an image processing area according to the human hand information includes: generating positioning points of an image processing area according to the hand information; and generating an image processing area according to the positioning point.
Further, the generating an image processing area according to the human hand information includes: generating a scaling of an image processing area according to the hand information; and generating an image processing area according to the scaling.
In a second aspect, an embodiment of the present disclosure provides an image generating apparatus, including:
the video acquisition module is used for acquiring a video, wherein the video comprises a hand;
the human hand information acquisition module is used for identifying human hands in the video and acquiring human hand information;
and the processing area generating module is used for generating an image processing area according to the human hand information.
Further, the image generation apparatus further includes:
the processing mode acquisition module is used for acquiring a preset image processing mode;
and the image processing module is used for processing the images in the majority of image processing areas by using the image processing mode.
Further, the human hand information acquiring module includes:
and the human hand recognition module is used for recognizing a first human hand and a second human hand in the video and acquiring a first position point and a second position point.
Further, the processing region generating module includes:
the parameter generating module is used for generating area parameters of the image processing area according to the first position point and the second position point;
and the image processing area generation submodule is used for generating the image processing area according to the area parameters.
Further, the parameter generating module is configured to: generating a first positioning point and a second positioning point according to the first position point, wherein a connecting line between the first positioning point and the second positioning point is vertical to a first connecting line between the first position point and the second position point; generating a third positioning point and a fourth positioning point according to the second position point, wherein a connecting line between the third positioning point and the fourth positioning point is vertical to a first connecting line between the first position point and the second position point; and taking the first positioning point, the second positioning point, the third positioning point and the fourth positioning point as area parameters of an image processing area.
Further, the parameter generating module is configured to: taking a preset point on the first connecting line; making a vertical line of the first connecting line through the preset point; making a first straight line through the first position point, so that an included angle between the first straight line and the first connecting line is a first preset included angle; making a second straight line through the first position point, so that the included angle between the second straight line and the first connecting line is a second preset included angle; taking the intersection point of the first straight line and the perpendicular line as a first positioning point; and taking the intersection point of the second straight line and the perpendicular line as a second positioning point.
Further, the distance from the preset point to the first position point is a length of the first connecting line in a fixed proportion.
Further, the parameter generating module is configured to: generating a first triangle by taking the first position point as a first vertex, wherein the first triangle also comprises a third vertex and a fourth vertex; generating a second triangle by taking the second position point as a second vertex, wherein the second triangle also comprises a fifth vertex and a sixth vertex; and taking the third vertex, the fourth vertex, the fifth vertex and the sixth vertex as area parameters of an image processing area.
Further, the processing area generating module is configured to: generating positioning points of an image processing area according to the hand information; and generating an image processing area according to the positioning point.
Further, the processing area generating module is configured to: generating a scaling of an image processing area according to the hand information; and generating an image processing area according to the scaling.
In a third aspect, an embodiment of the present disclosure provides an electronic device, including: at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform any of the image generation methods of the preceding first aspect.
In a fourth aspect, the present disclosure provides a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores computer instructions for causing a computer to execute the image generation method of any one of the foregoing first aspects.
The disclosure discloses an image generation method, an image generation device, an electronic device and a computer-readable storage medium. The image generation method comprises the following steps: acquiring a video, wherein the video comprises a human hand; identifying the human hand in the video and acquiring human hand information; and generating an image processing area according to the human hand information. The embodiment of the disclosure determines the attribute of the area needing image processing through the hand information to dynamically generate the image processing area, and solves the technical problems of fixed and inflexible image processing area in the prior art.
The foregoing is a summary of the present disclosure, and for the purposes of promoting a clear understanding of the technical means of the present disclosure, the present disclosure may be embodied in other specific forms without departing from the spirit or essential attributes thereof.
Drawings
In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present disclosure, and other drawings can be obtained according to the drawings without creative efforts for those skilled in the art.
Fig. 1 is a flowchart of an image generation method provided by an embodiment of the present disclosure;
fig. 2 is a schematic diagram of a method for generating parameters of an image processing area according to an embodiment of the present disclosure;
fig. 3 is a schematic diagram of another image processing region parameter generation method provided in the embodiment of the present disclosure;
fig. 4 is a schematic diagram of another image processing region parameter generation method provided in the embodiment of the present disclosure;
5a-5e are schematic diagrams of specific examples of image generation methods provided by embodiments of the present disclosure;
fig. 6 is a schematic structural diagram of an image generating apparatus provided in the embodiment of the present disclosure;
fig. 7 is a schematic structural diagram of an electronic device provided according to an embodiment of the present disclosure.
Detailed Description
The embodiments of the present disclosure are described below with specific examples, and other advantages and effects of the present disclosure will be readily apparent to those skilled in the art from the disclosure in the specification. It is to be understood that the described embodiments are merely illustrative of some, and not restrictive, of the embodiments of the disclosure. The disclosure may be embodied or carried out in various other specific embodiments, and various modifications and changes may be made in the details within the description without departing from the spirit of the disclosure. It is to be noted that the features in the following embodiments and examples may be combined with each other without conflict. All other embodiments, which can be derived by a person skilled in the art from the embodiments disclosed herein without making any creative effort, shall fall within the protection scope of the present disclosure.
It is noted that various aspects of the embodiments are described below within the scope of the appended claims. It should be apparent that the aspects described herein may be embodied in a wide variety of forms and that any specific structure and/or function described herein is merely illustrative. Based on the disclosure, one skilled in the art should appreciate that one aspect described herein may be implemented independently of any other aspects and that two or more of these aspects may be combined in various ways. For example, an apparatus may be implemented and/or a method practiced using any number of the aspects set forth herein. Additionally, such an apparatus may be implemented and/or such a method may be practiced using other structure and/or functionality in addition to one or more of the aspects set forth herein.
It should be noted that the drawings provided in the following embodiments are only for illustrating the basic idea of the present disclosure, and the drawings only show the components related to the present disclosure rather than the number, shape and size of the components in actual implementation, and the type, amount and ratio of the components in actual implementation may be changed arbitrarily, and the layout of the components may be more complicated.
In addition, in the following description, specific details are provided to facilitate a thorough understanding of the examples. However, it will be understood by those skilled in the art that the aspects may be practiced without these specific details.
Fig. 1 is a flowchart of a first embodiment of an image generation method provided in this disclosure, where the image generation method provided in this embodiment may be executed by an image generation apparatus, the image generation apparatus may be implemented as software, or implemented as a combination of software and hardware, and the image generation apparatus may be integrated in some device in an image processing system, such as an image processing server or an image processing terminal device. As shown in fig. 1, the method comprises the steps of:
step S101, acquiring a video, wherein the video comprises a hand;
the acquired video may be acquired by an image sensor, which refers to various devices that can capture images, and typical image sensors are video cameras, still cameras, and the like. In this embodiment, the image sensor may be a camera on a mobile terminal, such as a front-facing or rear-facing camera on a smart phone, and a video image acquired by the camera may be directly displayed on a display screen of the smart phone.
The video also comprises a human hand, and the human hand can be a human hand collected by the image sensor.
Step S103, identifying the human hand in the video and acquiring human hand information;
when the human hand is recognized, the position of the human hand can be positioned by using the color features, the human hand is segmented from the background, and feature extraction and recognition are carried out on the found and segmented human hand image. Specifically, color information of an image and position information of the color information are acquired by using an image sensor; comparing the color information with preset hand color information; identifying first color information, wherein the error between the first color information and the preset human hand color information is smaller than a first threshold value; and forming the outline of the human hand by using the position information of the first color information. Preferably, in order to avoid interference of the ambient brightness to the color information, image data of an RGB color space acquired by the image sensor may be mapped to an HSV color space, information in the HSV color space is used as contrast information, and preferably, a hue value in the HSV color space is used as color information, so that the hue information is minimally affected by brightness, and the interference of the brightness can be well filtered. The position of the human hand is roughly determined by using the human hand outline, and then the key point extraction is carried out on the human hand. The method comprises the steps of extracting key points of a human hand on an image, namely searching corresponding position coordinates of each key point of a human hand outline in a human hand image, namely key point positioning, wherein the process needs to be carried out based on the corresponding characteristics of the key points, searching and comparing in the image according to the characteristics after the image characteristics capable of clearly identifying the key points are obtained, and accurately positioning the positions of the key points on the image. Since the keypoints only occupy a very small area (usually only a few to tens of pixels) in the image, the regions occupied by the features corresponding to the keypoints on the image are usually very limited and local, and there are two feature extraction methods currently used: (1) extracting one-dimensional range image features vertical to the contour; (2) and extracting the two-dimensional range image characteristics of the key point square neighborhood. There are many ways to implement the above two methods, such as ASM and AAM methods, statistical energy function methods, regression analysis methods, deep learning methods, classifier methods, batch extraction methods, and so on. The number, accuracy and speed of the key points used by the various implementation methods are different, and the method is suitable for different application scenes. Similarly, for other target objects, the same principles can be used to identify the target object.
After the human hand is recognized, a polygon is defined outside the outer contour of the human hand to serve as an external detection frame of the human hand, the external detection frame is used for replacing the human hand and describing the position of the human hand, a rectangle is taken as an example, after key points of the human hand are recognized, the width of the widest part of the human hand and the length of the longest part of the human hand can be calculated, and the external detection frame of the human hand is recognized according to the width and the length. One implementation of calculating the longest and widest points of the human hand is to extract the boundary key points of the human hand, calculate the difference between the X coordinates of the two boundary key points with the farthest X coordinate distance as the length of the rectangle width, and calculate the difference between the Y coordinates of the two boundary key points with the farthest Y coordinate distance as the length of the rectangle length. If the hand contracts into a fist shape, the external detection frame can be set to be a minimum circle covering the fist. Specifically, the center point of the external detection frame can be used as the position of the hand, and the center point of the external detection frame is the intersection point of the diagonals of the external detection frame; the centre of the circle may also be substituted for the location of the fist.
The human hand information further includes detected human hand key points, the number of the key points may be set, and generally, the human hand information may include key points and joint key points of a human hand contour, each key point has a fixed number, for example, the key points may be numbered from top to bottom according to the sequence of the contour key point, the thumb joint key point, the index finger joint key point, the middle finger joint key point, the ring finger joint key point, and the little finger joint key point, in a typical application, the number of the key points is 22, and each key point has a fixed number. In one embodiment, the location of the human hand may also be represented using a keypoint of the palm center.
In one embodiment, the human hand may include a first human hand and a second human hand, and the human hand information may be a position of the human hand, and specifically may be a first position point representing the position of the first human hand and a second position point representing the position of the second human hand. In this embodiment, the first hand and the second hand may be left hand and right hand of the first person, or may be hands of two persons. The position of the human hand can be determined by a central point of the external detection frame of the human hand or a preset key point in the key points of the human hand. The hand position here may be directly the center point of the external detection frame or a predetermined key point in the hand key point, or may have a certain relationship with the center point of the external detection frame or the predetermined key point in the hand key point, for example, the hand position may be located at a position 1 length unit on the positive direction of the Y axis of the center point, and the length unit may be a self-defined length unit, for example, 1 length unit is equal to 1cm, and the like, which is not limited herein. In summary, the position of the human hand can be determined by a certain relationship.
In one embodiment, before calculating the human hand information, the method further comprises the step of performing smoothing and coordinate normalization processing on the identification data of the human hand. Specifically, the smoothing process may be averaging images in the multi-frame video, taking the averaged image as an identified image, corresponding to a human hand in the present disclosure, identifying the human hand in the multi-frame image, then performing weighted averaging on the human hand image, taking the human hand image obtained after averaging as the identified human hand, and calculating the human hand information. The coordinate normalization processing is to unify the coordinate range, and if the coordinates of the hand image collected by the camera and the hand image displayed on the display screen are not unified, a mapping relation is needed to map the large coordinate system to the small coordinate system. And obtaining the information of the human hand after smoothing processing and normalization processing.
And step S103, generating an image processing area according to the human hand information.
In one embodiment, according to the human hand information, positioning points of an image processing area are generated; and generating an image processing area according to the positioning point.
In one embodiment, a region parameter of the image processing region is generated according to the first position point and the second position point; and generating the image processing area according to the area parameter. In this embodiment, a first positioning point and a second positioning point are generated according to the first position point, and a connection line between the first positioning point and the second positioning point is perpendicular to a first connection line between the first position point and the second position point; generating a third positioning point and a fourth positioning point according to the second position point, wherein a connecting line between the third positioning point and the fourth positioning point is vertical to a first connecting line between the first position point and the second position point; and taking the first positioning point, the second positioning point, the third positioning point and the fourth positioning point as area parameters of an image processing area. As shown in fig. 2, a schematic diagram of a method for generating the first positioning point, the second positioning point, the third positioning point and the fourth positioning point is shown, where 201 is a first position point, 202 is a second position point, a point 203 and a point 204 are generated according to 201, where a connecting line between the point 203 and the point 204 is perpendicular to a connecting line between the point 201 and the point 202, and similarly, a point 205 and a point 206 may be generated.
Further, in this embodiment, a preset point is taken from the first connection line, a perpendicular line of the first connection line is made through the preset point, a first straight line is made through the first position point, an included angle between the first straight line and the first connection line is a first preset included angle, a second straight line is made through the first position point, an included angle between the second straight line and the first connection line is a second preset included angle, an intersection point of the first straight line and the perpendicular line is taken as a first positioning point, an intersection point of the second straight line and the perpendicular line is taken as a second positioning point, a determination method of a third positioning point and a fourth positioning point is the same as a determination method of the first positioning point and the second positioning point and is not repeated, as shown in fig. 3, the generation method of the first positioning point and the second positioning point is described above, wherein point 301 and point 302 are the first position point and the second position point, point 303 is a first point on the first connection line between point 301 and point 302, a predetermined point 301 and a predetermined point 304 are obtained by taking a length of the first positioning point 301 and the second positioning point 301 as a predetermined angle, and a predetermined point 301 and a predetermined point, and a predetermined point 301 and a predetermined point may be obtained by processing that the length of the first positioning point 301 and a predetermined point, and a predetermined point 301.
In another embodiment, the generating the region parameter of the image processing region according to the first position point and the second position point includes: generating a first triangle by taking the first position point as a first vertex, wherein the first triangle also comprises a third vertex and a fourth vertex; generating a second triangle by taking the second position point as a second vertex, wherein the second triangle also comprises a fifth vertex and a sixth vertex; and taking the third vertex, the fourth vertex, the fifth vertex and the sixth vertex as area parameters of an image processing area. And generating the image processing area by taking two vertexes of the side of the first triangle opposite to the first vertex and two vertexes of the side of the second triangle opposite to the second vertex as vertexes of the image processing area. Specifically, referring to fig. 4, a triangle is generated by using the first vertex 401 as one vertex, the triangle further includes a third vertex 403 and a fourth vertex 404, the triangle is generated by using the second vertex 402 as one vertex, the triangle further includes a fifth vertex 405 and a sixth vertex 406, and the third vertex, the fourth vertex, the fifth vertex and the sixth vertex are used as the area parameters of the image processing area. And generating a quadrilateral image processing area by taking the third vertex, the fourth vertex, the fifth vertex and the sixth vertex as 4 vertices of the image processing area. In this embodiment, various methods may be used for generating the triangle, for example, the triangle may be a triangle of a fixed size with a fixed angle to the horizontal line, the method for generating the triangle is not limited herein, and any method for generating the triangle may be used in the present disclosure.
It should be noted that, in the present disclosure, the image processing area may be in any shape, and is not limited to the quadrilateral shape in the above embodiment, for example, the image processing area may be in a circular shape, at this time, a center of the circular shape may be located by using a position of a human hand as a positioning point, and a radius length of the circular shape may be determined by using a size of the human hand as a reference, so as to generate the image processing area, and other shapes are not described again.
In one embodiment, the human hand information and the image processing area have a corresponding relationship, parameters of the corresponding image processing area are inquired according to the human hand information, and the image processing area is generated according to the parameters; or the human hand information is used as an intermediate parameter, the parameter of the image processing area is generated according to the human hand information, and the image processing area is generated according to the parameter. In this embodiment, the hand information may be the size of the hand, the size of the hand may be represented by the size of the circumscribed detection frame of the hand, the size correspondence relationship between the circumscribed detection frame and the image processing area may be set in advance, or dynamically determining the size of the image processing area according to the size of the circumscribed detection frame, taking the dynamic determination of the size of the image processing area as an example, the original size of the circumscribed detection frame of the human hand, in which the human hand is detected for the first time, may be set to 1, at which time the original size of the image processing area is displayed, when the human hand moves back and forth relative to the image sensor, the area of the external detection frame changes, for example, the human hand moves backwards, the area of the external detection frame is 0.5 times of the area of the external detection frame of the human hand which detects the human hand for the first time, and the image processing area is also zoomed into 0.5 times of the original size; when the human hand moves forwards, the area of the external detection frame is 2 times of the area of the external detection frame of the human hand which detects the human hand for the first time, the image processing area is also zoomed into 2 times of the original size, and therefore the zoom of the image processing area can be flexibly controlled; of course, the scaling can be controlled by a certain function, for example, the original area of the external detection box is set to be S, and the current area is set to be S1Assuming that the scaling of the image processing region is R, R ═ S may be set1/S)2Thus, the scaling of the image processing area is not linear, and more effects can be achieved. Of course, this scalingThe control function may be arbitrarily set as required, and the above manner is merely an example. The human hand information in the display size information of the image processing area obtained according to the human hand information is not limited to the area of the external detection frame, and may also be the side length of the external detection frame, or the distance between the human hand key points, etc., and is not limited herein.
In another embodiment, after the step S103, the method further includes:
step S104: acquiring a preset image processing mode;
step S105: and processing the images in the majority of image processing areas by using the image processing mode.
The preset image processing mode can be color change processing, beautifying processing and the like on the image. The preset image processing method may be any image processing method, and the present disclosure is not limited to a specific processing method.
The disclosure discloses an image generation method, an image generation device, an electronic device and a computer-readable storage medium. The image generation method comprises the following steps: acquiring a video, wherein the video comprises a human hand; identifying the human hand in the video and acquiring human hand information; and generating an image processing area according to the human hand information. The embodiment of the disclosure determines the attribute of the area needing image processing through the hand information to dynamically generate the image processing area, and solves the technical problems of fixed and inflexible image processing area in the prior art.
For ease of understanding, reference is made to fig. 5a-5e, which are specific examples of one image generation method disclosed in the present disclosure. Referring to fig. 5a, a video is obtained, the video including a human hand; as shown in fig. 5b, an image processing area is generated according to the position of the human hand, in this example, the image processing area is a quadrangle, wherein the size of the hand is different and the length of the two parallel sides of the quadrangle is different because the two hands are at different distances from the image sensor; as described in fig. 5c to 5e, the size and position of the image processing area are changed according to the information of the human hand according to the distance between the hands and the position and angle of the hand, so that the shape, size, etc. of the image processing area can be flexibly controlled using the human hand information.
Fig. 6 is a schematic structural diagram of an embodiment of an image generating apparatus provided in an embodiment of the present disclosure, and as shown in fig. 6, the apparatus 600 includes: a video acquisition module 601, a human hand information acquisition module 602, and a processing area generation module 603. Wherein,
the video acquisition module 601 is used for acquiring a video, wherein the video comprises a human hand;
a human hand information obtaining module 602, configured to identify a human hand in the video and obtain human hand information;
a processing area generating module 603, configured to generate an image processing area according to the human hand information.
Further, the image generating apparatus 600 further includes:
a processing mode obtaining module 604, configured to obtain a preset image processing mode;
and the image processing module 605 is configured to process the images in the plurality of image processing areas by using the image processing method.
Further, the human hand information obtaining module 602 includes:
and the human hand recognition module is used for recognizing a first human hand and a second human hand in the video and acquiring a first position point representing the position of the first human hand and a second position point representing the position of the second human hand.
Further, the processing area generating module 603 includes:
the parameter generating module is used for generating area parameters of the image processing area according to the first position point and the second position point;
and the image processing area generation submodule is used for generating the image processing area according to the area parameters.
Further, the parameter generating module is configured to:
generating a first positioning point and a second positioning point according to the first position point, wherein a connecting line between the first positioning point and the second positioning point is vertical to a first connecting line between the first position point and the second position point;
generating a third positioning point and a fourth positioning point according to the second position point, wherein a connecting line between the third positioning point and the fourth positioning point is vertical to a first connecting line between the first position point and the second position point;
and taking the first positioning point, the second positioning point, the third positioning point and the fourth positioning point as area parameters of an image processing area.
Further, the parameter generating module is configured to:
taking a preset point on the first connecting line;
making a vertical line of the first connecting line through the preset point;
making a first straight line through the first position point, so that an included angle between the first straight line and the first connecting line is a first preset included angle;
making a second straight line through the first position point, so that the included angle between the second straight line and the first connecting line is a second preset included angle;
taking the intersection point of the first straight line and the perpendicular line as a first positioning point;
and taking the intersection point of the second straight line and the perpendicular line as a second positioning point.
Further, the distance from the preset point to the first position point is a length of the first connecting line in a fixed proportion.
Further, the parameter generating module is configured to:
generating a first triangle by taking the first position point as a first vertex, wherein the first triangle also comprises a third vertex and a fourth vertex;
generating a second triangle by taking the second position point as a second vertex, wherein the second triangle also comprises a fifth vertex and a sixth vertex;
and taking the third vertex, the fourth vertex, the fifth vertex and the sixth vertex as area parameters of an image processing area.
Further, the processing area generating module 603 is configured to:
generating positioning points of an image processing area according to the hand information;
and generating an image processing area according to the positioning point.
Further, the processing area generating module 603 is configured to:
generating a scaling of an image processing area according to the hand information;
and generating an image processing area according to the scaling.
The apparatus shown in fig. 6 can perform the method of the embodiment shown in fig. 1, and reference may be made to the related description of the embodiment shown in fig. 1 for a part of this embodiment that is not described in detail. The implementation process and technical effect of the technical solution refer to the description in the embodiment shown in fig. 1, and are not described herein again.
Referring now to FIG. 7, shown is a schematic diagram of an electronic device 700 suitable for use in implementing embodiments of the present disclosure. The electronic devices in the embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., car navigation terminals), and the like, and fixed terminals such as digital TVs, desktop computers, and the like. The electronic device shown in fig. 7 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 7, electronic device 700 may include a processing means (e.g., central processing unit, graphics processor, etc.) 701 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)702 or a program loaded from storage 708 into a Random Access Memory (RAM) 703. In the RAM 703, various programs and data necessary for the operation of the electronic apparatus 700 are also stored. The processing device 701, the ROM 702, and the RAM 703 are connected to each other by a bus 704. An input/output (I/O) interface 705 is also connected to bus 704.
Generally, the following devices may be connected to the I/O interface 705: input devices 706 including, for example, a touch screen, touch pad, keyboard, mouse, image sensor, microphone, accelerometer, gyroscope, or the like; an output device 707 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 708 including, for example, magnetic tape, hard disk, etc.; and a communication device 709. The communication means 709 may allow the electronic device 700 to communicate wirelessly or by wire with other devices to exchange data. While fig. 7 illustrates an electronic device 700 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such embodiments, the computer program may be downloaded and installed from a network via the communication means 709, or may be installed from the storage means 708, or may be installed from the ROM 702. The computer program, when executed by the processing device 701, performs the above-described functions defined in the methods of the embodiments of the present disclosure.
It should be noted that the computer readable medium in the present disclosure can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: acquiring at least two internet protocol addresses; sending a node evaluation request comprising the at least two internet protocol addresses to node evaluation equipment, wherein the node evaluation equipment selects the internet protocol addresses from the at least two internet protocol addresses and returns the internet protocol addresses; receiving an internet protocol address returned by the node evaluation equipment; wherein the obtained internet protocol address indicates an edge node in the content distribution network.
Alternatively, the computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: receiving a node evaluation request comprising at least two internet protocol addresses; selecting an internet protocol address from the at least two internet protocol addresses; returning the selected internet protocol address; wherein the received internet protocol address indicates an edge node in the content distribution network.
Computer program code for carrying out operations for aspects of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present disclosure may be implemented by software or hardware. Where the name of a unit does not in some cases constitute a limitation of the unit itself, for example, the first retrieving unit may also be described as a "unit for retrieving at least two internet protocol addresses".
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the disclosure herein is not limited to the particular combination of features described above, but also encompasses other embodiments in which any combination of the features described above or their equivalents does not depart from the spirit of the disclosure. For example, the above features and (but not limited to) the features disclosed in this disclosure having similar functions are replaced with each other to form the technical solution.

Claims (13)

1. An image generation method, comprising:
acquiring a video, wherein the video comprises a human hand;
identifying the human hand in the video and acquiring human hand information;
and generating an image processing area according to the human hand information.
2. The image generation method according to claim 1, further comprising, after the generating an image processing region from the human hand information:
acquiring a preset image processing mode;
and processing the images in the majority of image processing areas by using the image processing mode.
3. The image generation method of claim 1, wherein the recognizing a human hand in the video and acquiring human hand information comprises:
a first human hand and a second human hand in the video are identified, and a first position point representing the position of the first human hand and a second position point representing the position of the second human hand are obtained.
4. The image generation method according to claim 3, wherein the generating an image processing region from the human hand information includes:
generating a region parameter of an image processing region according to the first position point and the second position point;
and generating the image processing area according to the area parameter.
5. The image generation method of claim 4, wherein generating the region parameter of the image processing region based on the first location point and the second location point comprises:
generating a first positioning point and a second positioning point according to the first position point, wherein a connecting line between the first positioning point and the second positioning point is vertical to a first connecting line between the first position point and the second position point;
generating a third positioning point and a fourth positioning point according to the second position point, wherein a connecting line between the third positioning point and the fourth positioning point is vertical to a first connecting line between the first position point and the second position point;
and taking the first positioning point, the second positioning point, the third positioning point and the fourth positioning point as area parameters of an image processing area.
6. The image generation method of claim 5, wherein generating a first localization point and a second localization point from the first location point comprises:
taking a preset point on the first connecting line;
making a vertical line of the first connecting line through the preset point;
making a first straight line through the first position point, so that an included angle between the first straight line and the first connecting line is a first preset included angle;
making a second straight line through the first position point, so that the included angle between the second straight line and the first connecting line is a second preset included angle;
taking the intersection point of the first straight line and the perpendicular line as a first positioning point;
and taking the intersection point of the second straight line and the perpendicular line as a second positioning point.
7. The image generating method according to claim 6, wherein the distance from the preset point to the first position point is a length of a fixed proportion of the length of the first link.
8. The image generation method of claim 4, wherein generating the region parameter of the image processing region based on the first location point and the second location point comprises:
generating a first triangle by taking the first position point as a first vertex, wherein the first triangle also comprises a third vertex and a fourth vertex;
generating a second triangle by taking the second position point as a second vertex, wherein the second triangle also comprises a fifth vertex and a sixth vertex;
and taking the third vertex, the fourth vertex, the fifth vertex and the sixth vertex as area parameters of an image processing area.
9. The image generation method according to claim 1, wherein the generating an image processing region from the human hand information includes:
generating positioning points of an image processing area according to the hand information;
and generating an image processing area according to the positioning point.
10. The image generation method according to claim 1, wherein the generating an image processing region from the human hand information includes:
generating a scaling of an image processing area according to the hand information;
and generating an image processing area according to the scaling.
11. An image generation apparatus, comprising:
the video acquisition module is used for acquiring a video, wherein the video comprises a hand;
the human hand information acquisition module is used for identifying human hands in the video and acquiring human hand information;
and the processing area generating module is used for generating an image processing area according to the human hand information.
12. An electronic device, comprising:
a memory for storing non-transitory computer readable instructions; and
a processor for executing the computer readable instructions such that the processor when executing implements the image generation method according to any of claims 1-10.
13. A computer-readable storage medium storing non-transitory computer-readable instructions that, when executed by a computer, cause the computer to perform the image generation method of any one of claims 1-10.
CN201811251793.9A 2018-10-25 2018-10-25 Image generation method and device Pending CN111104821A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811251793.9A CN111104821A (en) 2018-10-25 2018-10-25 Image generation method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811251793.9A CN111104821A (en) 2018-10-25 2018-10-25 Image generation method and device

Publications (1)

Publication Number Publication Date
CN111104821A true CN111104821A (en) 2020-05-05

Family

ID=70418392

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811251793.9A Pending CN111104821A (en) 2018-10-25 2018-10-25 Image generation method and device

Country Status (1)

Country Link
CN (1) CN111104821A (en)

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010009311A (en) * 2008-06-26 2010-01-14 Panasonic Corp User interface device
US20120062736A1 (en) * 2010-09-13 2012-03-15 Xiong Huaixin Hand and indicating-point positioning method and hand gesture determining method used in human-computer interaction system
US20120293544A1 (en) * 2011-05-18 2012-11-22 Kabushiki Kaisha Toshiba Image display apparatus and method of selecting image region using the same
CN104243791A (en) * 2013-06-19 2014-12-24 联想(北京)有限公司 Information processing method and electronic device
CN104298343A (en) * 2013-07-17 2015-01-21 联想(新加坡)私人有限公司 Special gestures for camera control and image processing operations
CN104463782A (en) * 2013-09-16 2015-03-25 联想(北京)有限公司 Image processing method, device and electronic apparatus
CN105787971A (en) * 2016-03-23 2016-07-20 联想(北京)有限公司 Information processing method and electronic equipment
CN105893942A (en) * 2016-03-25 2016-08-24 中国科学技术大学 eSC and HOG-based adaptive HMM sign language identifying method
KR101856547B1 (en) * 2017-06-29 2018-05-11 링크플로우 주식회사 Method for processing of signal of user and apparatus for performing the method
CN108271416A (en) * 2016-10-31 2018-07-10 深圳市汇顶科技股份有限公司 Hand-held posture detection method, capacitive touch device and electronic equipment

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010009311A (en) * 2008-06-26 2010-01-14 Panasonic Corp User interface device
US20120062736A1 (en) * 2010-09-13 2012-03-15 Xiong Huaixin Hand and indicating-point positioning method and hand gesture determining method used in human-computer interaction system
US20120293544A1 (en) * 2011-05-18 2012-11-22 Kabushiki Kaisha Toshiba Image display apparatus and method of selecting image region using the same
CN104243791A (en) * 2013-06-19 2014-12-24 联想(北京)有限公司 Information processing method and electronic device
CN104298343A (en) * 2013-07-17 2015-01-21 联想(新加坡)私人有限公司 Special gestures for camera control and image processing operations
CN104463782A (en) * 2013-09-16 2015-03-25 联想(北京)有限公司 Image processing method, device and electronic apparatus
CN105787971A (en) * 2016-03-23 2016-07-20 联想(北京)有限公司 Information processing method and electronic equipment
CN105893942A (en) * 2016-03-25 2016-08-24 中国科学技术大学 eSC and HOG-based adaptive HMM sign language identifying method
CN108271416A (en) * 2016-10-31 2018-07-10 深圳市汇顶科技股份有限公司 Hand-held posture detection method, capacitive touch device and electronic equipment
KR101856547B1 (en) * 2017-06-29 2018-05-11 링크플로우 주식회사 Method for processing of signal of user and apparatus for performing the method

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
DANIELE NICO 等: "Left and right hand recognition in upper limb amputees", pages 120 - 132 *
凌云翔 等: "基于多点触摸的自然手势识别方法研究", pages 127 - 132 *

Similar Documents

Publication Publication Date Title
US20210174124A1 (en) Method, device and storage medium for determining camera posture information
CN110348543B (en) Fundus image recognition method and device, computer equipment and storage medium
CN108615248B (en) Method, device and equipment for relocating camera attitude tracking process and storage medium
CN108648235B (en) Relocation method, device and storage medium for camera attitude tracking process
CN109947886B (en) Image processing method, image processing device, electronic equipment and storage medium
CN110059685B (en) Character area detection method, device and storage medium
CN110058685B (en) Virtual object display method and device, electronic equipment and computer-readable storage medium
CN110072046B (en) Image synthesis method and device
CN108830186B (en) Text image content extraction method, device, equipment and storage medium
CN110070551B (en) Video image rendering method and device and electronic equipment
CN113706440B (en) Image processing method, device, computer equipment and storage medium
CN110298785A (en) Image beautification method, device and electronic equipment
CN111062981A (en) Image processing method, device and storage medium
CN110288519A (en) Image beautification method, device and electronic equipment
CN111199169A (en) Image processing method and device
CN110288521A (en) Image beautification method, device and electronic equipment
CN110941327A (en) Display method and device for virtual object
CN110363860A (en) 3D model reconstruction method, device and electronic equipment
CN110069125A (en) The control method and device of virtual objects
CN110738185B (en) Form object identification method, form object identification device and storage medium
CN109981989B (en) Method and device for rendering image, electronic equipment and computer readable storage medium
CN110069126B (en) Virtual object control method and device
CN110264431A (en) Video beautification method, device and electronic equipment
CN110222576B (en) Boxing action recognition method and device and electronic equipment
CN110047126B (en) Method, apparatus, electronic device, and computer-readable storage medium for rendering image

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information
CB02 Change of applicant information

Country or region after: China

Address after: 100080 408, 4th floor, 51 Zhichun Road, Haidian District, Beijing

Applicant after: Tiktok Technology Co.,Ltd.

Address before: 100080 408, 4th floor, 51 Zhichun Road, Haidian District, Beijing

Applicant before: BEIJING MICROLIVE VISION TECHNOLOGY Co.,Ltd.

Country or region before: China