WO2020124976A1 - 图像处理方法及装置、电子设备及存储介质 - Google Patents

图像处理方法及装置、电子设备及存储介质 Download PDF

Info

Publication number
WO2020124976A1
WO2020124976A1 PCT/CN2019/092866 CN2019092866W WO2020124976A1 WO 2020124976 A1 WO2020124976 A1 WO 2020124976A1 CN 2019092866 W CN2019092866 W CN 2019092866W WO 2020124976 A1 WO2020124976 A1 WO 2020124976A1
Authority
WO
WIPO (PCT)
Prior art keywords
coordinates
coordinate
image
virtual
coordinate system
Prior art date
Application number
PCT/CN2019/092866
Other languages
English (en)
French (fr)
Inventor
郑聪瑶
Original Assignee
北京市商汤科技开发有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 北京市商汤科技开发有限公司 filed Critical 北京市商汤科技开发有限公司
Priority to SG11202010312QA priority Critical patent/SG11202010312QA/en
Priority to KR1020207031294A priority patent/KR102461232B1/ko
Priority to JP2020561756A priority patent/JP7026825B2/ja
Publication of WO2020124976A1 publication Critical patent/WO2020124976A1/zh
Priority to US17/038,273 priority patent/US20210012530A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/08Projecting images onto non-planar surfaces, e.g. geodetic screens
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/30Determination of transform parameters for the alignment of images, i.e. image registration
    • G06T7/33Determination of transform parameters for the alignment of images, i.e. image registration using feature-based methods
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/20Input arrangements for video game devices
    • A63F13/21Input arrangements for video game devices characterised by their sensors, purposes or types
    • A63F13/213Input arrangements for video game devices characterised by their sensors, purposes or types comprising photodetecting means, e.g. cameras, photodiodes or infrared cells
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/40Processing input control signals of video game devices, e.g. signals generated by the player or derived from the environment
    • A63F13/42Processing input control signals of video game devices, e.g. signals generated by the player or derived from the environment by mapping the input signals into game commands, e.g. mapping the displacement of a stylus on a touch screen to the steering angle of a virtual vehicle
    • A63F13/428Processing input control signals of video game devices, e.g. signals generated by the player or derived from the environment by mapping the input signals into game commands, e.g. mapping the displacement of a stylus on a touch screen to the steering angle of a virtual vehicle involving motion or position input signals, e.g. signals representing the rotation of an input controller or a player's arm motions sensed by accelerometers or gyroscopes
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/50Controlling the output signals based on the game progress
    • A63F13/52Controlling the output signals based on the game progress involving aspects of the displayed game scene
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/55Controlling game characters or game objects based on the game progress
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/60Generating or modifying game content before or while executing the game program, e.g. authoring tools specially adapted for game development or game-integrated level editor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T19/00Manipulating 3D models or images for computer graphics
    • G06T19/20Editing of 3D images, e.g. changing shapes or colours, aligning objects or positioning parts
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/18Image warping, e.g. rearranging pixels individually
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/60Analysis of geometric attributes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/70Determining position or orientation of objects or cameras
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/70Determining position or orientation of objects or cameras
    • G06T7/73Determining position or orientation of objects or cameras using feature-based methods
    • G06T7/75Determining position or orientation of objects or cameras using feature-based methods involving models
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/46Descriptors for shape, contour or point-related descriptors, e.g. scale invariant feature transform [SIFT] or bags of words [BoW]; Salient regional features
    • G06V10/462Salient features, e.g. scale invariant feature transforms [SIFT]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/10Terrestrial scenes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/60Type of objects
    • G06V20/64Three-dimensional objects
    • G06V20/653Three-dimensional objects by matching three-dimensional models, e.g. conformal mapping of Riemann surfaces
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F2300/00Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game
    • A63F2300/60Methods for processing data by generating or executing the game program
    • A63F2300/66Methods for processing data by generating or executing the game program for rendering three dimensional images

Definitions

  • the present application relates to the field of information technology, and in particular, to an image processing method and device, electronic equipment, and storage medium.
  • the 3D coordinate has one more coordinate value than the 2D coordinate, so that the 3D coordinate can have one more dimension of interaction than the 2D coordinate.
  • the user's movement in the 3D space is collected and converted into the control of the game character in three mutually perpendicular directions, such as front, back, left, right, up and down.
  • the user may need to input at least two operations, which simplifies user control and improves the user experience.
  • this kind of interaction based on the 3D coordinates requires a corresponding 3D device.
  • the user needs to wear a 3D somatosensory device (wearable device) that detects its movement in a three-dimensional space; or, a 3D camera needs to be used to collect the user’s 3D coordinates. Movement in space. Whether the user's movement in the 3D space is determined by the 3D somatosensory device or the 3D camera, the hardware cost is relatively high.
  • the embodiments of the present application desire to provide an image processing method and apparatus, electronic equipment, and storage medium.
  • An image processing method including:
  • Relative coordinates are determined based on the first 2D coordinates and the second 2D coordinates, where the relative coordinates are used to characterize the relative position between the first part and the second part;
  • An image processing device including:
  • the first acquisition module is configured to acquire a 2D image of the target object
  • a second acquisition module configured to acquire the first 2D coordinates of the first key point and the second 2D coordinates of the second key point according to the 2D image, wherein the first key point is the first of the target object An imaging point of a part in the 2D image; the second key point is an imaging point of the second part of the target object in the 2D image;
  • a first determination module configured to determine relative coordinates based on the first 2D coordinates and the second 2D coordinates, wherein the relative coordinates are used to characterize the relative position between the first part and the second part;
  • the projection module is configured to project the relative coordinates into a virtual three-dimensional space and obtain 3D coordinates corresponding to the relative coordinates, wherein the 3D coordinates are used to control the coordinate transformation of the target object on the controlled device.
  • An electronic device including:
  • a processor connected to the memory, is configured to implement the image processing method provided by any of the foregoing technical solutions by executing computer-executable instructions stored on the memory.
  • a computer storage medium that stores computer-executable instructions; after being executed by a processor, the computer-executable instructions can implement the image processing method provided by any of the foregoing technical solutions.
  • a computer program after being executed by a processor, can implement an image processing method provided by any of the foregoing technical solutions.
  • the technical solution provided by the embodiment of the present application directly uses the relative coordinates between the first key point of the first part and the second key point of the second part of the target object in the 2D image to convert into the virtual three-dimensional space, thereby obtaining the relative The 3D coordinates corresponding to the coordinates; use this 3D coordinates to interact with the controlled device; instead of using the 3D body sensing device to collect 3D coordinates, the hardware structure for interaction based on the 3D coordinates is simplified and the hardware cost is saved.
  • FIG. 1 is a schematic flowchart of a first image processing method provided by an embodiment of this application.
  • FIG. 2 is a schematic diagram of a viewing cone provided by an embodiment of this application.
  • FIG. 3 is a schematic flowchart of determining a relative coordinate provided by an embodiment of the present application.
  • FIG. 4 is a schematic flowchart of a second image processing method provided by an embodiment of this application.
  • 5A is a schematic diagram of a display effect provided by an embodiment of the present application.
  • 5B is a schematic diagram of another display effect provided by an embodiment of the present application.
  • FIG. 6 is a schematic structural diagram of an image processing device according to an embodiment of the present application.
  • FIG. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
  • this embodiment provides an image processing method, including:
  • Step S110 Acquire a 2D image of the target object
  • Step S120 Acquire the first 2D coordinates of the first key point and the second 2D coordinates of the second key point according to the 2D image, where the first key point is the first part of the target object in the An imaging point in the 2D image; the second key point is an imaging point in the 2D image of the second part of the target object;
  • Step S130 Determine relative coordinates based on the first 2D coordinates and the second 2D coordinates, where the relative coordinates are used to characterize the relative position between the first part and the second part;
  • Step S140 Project the relative coordinates into a virtual three-dimensional space and obtain 3D coordinates corresponding to the relative coordinates; wherein, the 3D coordinates are used to control the controlled device to perform a predetermined operation.
  • the predetermined operation here includes but is not limited to the coordinate transformation of the target object on the controlled device.
  • the acquired 2D (two-dimensional) image of the target object where the 2D image can be an image collected by any 2D camera.
  • the 2D image can be collected by using a monocular camera located on the controlled device.
  • the monocular camera may also be a camera connected to the controlled device.
  • the collection area of the camera and the viewing area of the controlled device at least partially overlap.
  • the controlled device is a game device such as a smart TV.
  • the game device includes a display screen, an area where the display screen can be viewed is the viewing area, and the collection area is an area that the camera can collect.
  • the collection area of the camera overlaps with the viewing area.
  • the step S110 of acquiring a 2D image may include: acquiring a 2D image using a two-dimensional (2D) camera, or receiving a 2D image from an acquisition device.
  • the target object may be: the hands and torso of the human body.
  • the 2D image may be an image including the hands and torso of the human body.
  • the first part is the hand of the human body, and the second part is the torso part.
  • the first part may be the eyeball of the eye, and the second part may be the entire eye.
  • the first part may be a foot of a human body, and the second part may be a torso of the human body.
  • the imaging area of the first part in the 2D image is smaller than the imaging area of the second part in the 2D image.
  • both the first 2D coordinate and the second 2D coordinate may be coordinate values in the first 2D coordinate system.
  • the first 2D coordinate system may be a 2D coordinate system formed by the plane where the 2D image is located.
  • the first 2D coordinates and the second 2D coordinates determine the relative coordinates characterizing the relative positions between the first key point and the second key point. Then the relative coordinates are projected into the virtual three-dimensional space.
  • the virtual three-dimensional space may be a preset three-dimensional space, and the 3D coordinates of the relative coordinates in the virtual three-dimensional space are obtained.
  • the 3D coordinates may be used for interaction based on the 3D coordinates related to the display interface.
  • the virtual three-dimensional space may be various types of virtual three-dimensional spaces, and the coordinate range of the virtual three-dimensional space may range from negative infinity to positive infinity.
  • a virtual camera can be provided in the virtual three-dimensional space.
  • Figure 2 shows the viewing cone corresponding to the angle of view of a virtual camera.
  • the virtual camera may be a mapping of the physical camera of the 2D image in a virtual three-dimensional space.
  • the viewing cone may include a near clamping surface, a top surface, a right surface, and a left surface not marked in FIG. 2.
  • the virtual viewpoint of the virtual three-dimensional space may be located on the near clip plane, for example, the virtual viewpoint is located on the center point of the near clip plane.
  • the relative coordinates (2D coordinates) of the first key point relative to the second key point can be converted into a virtual three-dimensional space to obtain the first key point relative to the second 3D (three-dimensional) coordinates of key points.
  • the near clip plane may also be called: near clipping plane; it is a plane close to the virtual viewpoint in the virtual three-dimensional space, and includes the starting plane of the virtual viewpoint. In the virtual three-dimensional space, it gradually extends from the near clamping surface to the distance.
  • the interaction based on the 3D coordinates is: performing operation control according to the coordinate transformation of the target object in the virtual three-dimensional space at two moments.
  • the interaction based on the 3D coordinates includes:
  • the parameters of the game character on the corresponding three coordinate axes are controlled. For example, taking the movement control of a game character as an example, the game character moves in a three-dimensional space and can move back and forth, left and right, and jump up and down. After the relative coordinates of the user's hand with respect to the torso are converted into the three-dimensional space, the game character is controlled to move back and forth, left and right, and up and down according to the coordinate transformation amount or rate of change of the relative coordinates converted into the virtual three-dimensional space at two times.
  • the relative coordinates are projected onto the x-axis coordinates in the virtual three-dimensional space, which is used to control the forward and backward movement of the game character
  • the relative coordinates are projected onto the y-axis coordinates in the virtual three-dimensional space, which is used to control the left and right movement of the game character.
  • the relative coordinates are projected to the coordinates on the z-axis in the virtual three-dimensional space, which is used to control the height of the game character jumping up and down.
  • the display image in the display interface can be divided into at least: a background layer and a foreground layer, which can be determined as the control background layer according to the current 3D coordinate position of the z-axis coordinate on the virtual three-dimensional space
  • the display image in the display interface may be further divided into: a background layer, a foreground layer, and one or more intermediate layers between the background layer and the foreground layer.
  • determine the layer that the 3D coordinates act on then combine the coordinate values of the 3D coordinates on the x axis and the y axis to determine that the 3D coordinates are acting on the layer Which graphic element to further control the transformation of the graphic element affected by the 3D coordinates or perform the corresponding response operation.
  • the virtual three-dimensional space may be a predefined three-dimensional space. Specifically, the virtual three-dimensional space is defined in advance according to the collection parameters of the collected 2D image.
  • the virtual three-dimensional space may include: a virtual imaging plane and a virtual viewpoint. The vertical distance between the virtual viewpoint and the virtual imaging plane may be determined according to the focal length in the acquisition parameter.
  • the size of the virtual imaging plane may be determined according to the size of the control plane of the controlled device. For example, the size of the virtual imaging plane is positively related to the size of the control plane of the controlled device.
  • the control plane may be equal to the size of the display interface that receives the interaction based on the 3D coordinates.
  • the method further includes: interacting with the controlled device based on the 3D coordinates, and the interaction may include: interaction between the user and the controlled device.
  • the 3D coordinates can be regarded as user input so as to enable the controlled device to perform specific operations and realize the interaction between the user and the controlled device.
  • the method further includes: controlling the coordinate transformation of the target object on the controlled device based on the amount or rate of change on three coordinate axes in the virtual three-dimensional space at two moments before and after.
  • the step S120 may include: acquiring the first key point in the first 2D coordinate system corresponding to the 2D image, and acquiring the second key point in The second 2D coordinate in the first 2D coordinate system. That is, both the first 2D coordinate and the second 2D coordinate are determined based on the first 2D coordinate system.
  • the step S130 may include: relative coordinates of imaging with respect to the second part, including: constructing a second 2D coordinate system according to the second 2D coordinates; converting the first 2D coordinates Map to the second 2D coordinate system to obtain a third 2D coordinate.
  • the step S130 may include:
  • Step S131 Construct a second 2D coordinate system according to the second 2D coordinate
  • Step S132 Determine a conversion parameter mapped from the first 2D coordinate system to the second 2D coordinate system according to the first 2D coordinate system and the second 2D coordinate system; wherein, the conversion parameter is used to determine the Relative coordinates.
  • the step S130 may further include:
  • Step S133 Based on the conversion parameters, the first 2D coordinate is mapped to the second 2D coordinate system to obtain a third 2D coordinate.
  • the second key points may be outer contour points imaged in the second part.
  • a second 2D coordinate system can be constructed according to the coordinates of the second key point.
  • the origin of the second 2D coordinate system may be the center point of the outer contour formed by the connection of the plurality of second key points.
  • both the first 2D coordinate system and the second 2D coordinate system are boundary coordinate systems.
  • the coordinates in the first 2D coordinate system can be mapped to the second 2D according to the sizes and/or center coordinates of the two 2D coordinate systems Conversion parameters in the coordinate system.
  • the first 2D coordinate can be directly mapped to the second 2D coordinate system to obtain the third 2D coordinate.
  • the third 2D coordinate is the coordinate after the first 2D coordinate is mapped to the second 2D coordinate system.
  • the step S132 may include:
  • the conversion parameter is determined based on the first ratio.
  • the step S132 may further include:
  • a conversion parameter between the first 2D coordinate system and the second 2D coordinate system is determined.
  • the first ratio may be: the conversion ratio of the first 2D coordinate system and the second 2D coordinate system in the first direction
  • the second ratio may be: the first 2D coordinate system and The conversion ratio of the second 2D coordinate system in the second direction.
  • the second direction is the direction of the y-axis; if the first direction is the direction of the y-axis, the second direction is the x-axis Direction.
  • the conversion parameter includes two conversion ratios, respectively a first size and a second size in the first direction to obtain a first ratio, and a third size between the third size and the fourth size in the second direction Two ratio.
  • the step S132 may include:
  • cam h is the distance between two edges in the second direction of the 2D image.
  • the first direction and the second direction are perpendicular to each other.
  • the conversion parameter may also introduce an adjustment factor.
  • the adjustment factor includes: a first adjustment factor and/or a second adjustment factor.
  • the adjustment factor may include a weighting factor and/or a scale factor. If the adjustment factor is a scale factor, the conversion parameter may be: a product of the first ratio and/or the second ratio and the scale factor. If the adjustment factor is a weighting factor, the conversion parameter may be: a weighted sum of the first ratio and/or the second ratio and the weighting factor.
  • the step S134 may include: mapping the first 2D coordinate to the second 2D coordinate system based on the conversion parameter and the center coordinate of the first 2D coordinate system to obtain a third 2D coordinates.
  • the third 2D coordinate may represent the position of the first part relative to the second part.
  • the step S134 may include: determining the third 2D coordinate by using the following functional relationship:
  • (x 3 , y 3 ) is the third 2D coordinate; (x 1 , y 1 ) is the first 2D coordinate; (x t , y t ) is the center point of the second part at the first A coordinate in a 2D coordinate system.
  • x represents the coordinate value in the first direction
  • y represents the coordinate value in the second direction
  • the step S140 may include:
  • the 3D coordinates of the first key point projected into the virtual three-dimensional space are determined.
  • the third 2D coordinate may be directly projected to project the third 2D coordinate into the virtual imaging plane.
  • the third 2D coordinates are normalized, and then projected into the virtual imaging plane after the normalization.
  • the distance between the virtual viewpoint and the virtual imaging plane may be a known distance.
  • the normalization process When performing the normalization process, it may be performed based on the size of the 2D image, or may be determined based on a predetermined size. There are many ways of the normalization process.
  • the normalization process reduces the inconvenience of data processing caused by the excessive change in the third 2D coordinates of the 2D images collected at different acquisition times, and simplifies the subsequent data processing.
  • the normalizing the third 2D coordinate to obtain a fourth 2D coordinate includes: combining the size of the second part and the center coordinate of the second 2D coordinate system, the The third 2D coordinates are normalized to obtain the fourth 2D coordinates.
  • the combining of the size of the second part and the center coordinate of the second 2D coordinate system to normalize the third 2D coordinate to obtain the fourth 2D coordinate includes:
  • (x 4 , y 4 ) is the fourth 2D coordinate;
  • (x 1 , y 1 ) is the first 2D coordinate;
  • (x t , y t ) is the center point of the second local The coordinates in the first 2D coordinate system;
  • (x i , y i ) are the coordinates of the center point of the 2D image in the first 2D coordinate system.
  • the 2D image is generally rectangular, and the center point of the 2D image here is the center point of the rectangle.
  • torso w is the size of the 2D image in the first direction
  • torso h is the size of the 2D image in the second direction
  • K is the first 2D coordinate mapped to the second 2D coordinate system in the first direction Conversion parameter in the direction
  • S is the conversion parameter of the first 2D coordinate mapped to the second 2D coordinate system in the second direction
  • the first direction is perpendicular to the second direction.
  • the solution function of the fourth 2D coordinate may be as follows:
  • the combination of the fourth 2D coordinates and the distance from the virtual viewpoint in the virtual three-dimensional space to the virtual imaging plane determines the 3D coordinates of the first key point projected into the virtual three-dimensional space Including: combining the fourth 2D coordinates, the distance from the virtual viewpoint in the virtual three-dimensional space to the virtual imaging plane and the zoom ratio, determining the 3D coordinates of the first key point projected into the virtual three-dimensional space; For example, the following functional relationship may be used to determine the 3D coordinates:
  • x4 is the coordinate value of the fourth 2D coordinate in the first direction
  • y4 is the coordinate value of the fourth 2D coordinate in the second direction
  • dds is the scaling ratio
  • d is the virtual in the virtual three-dimensional space The distance from the viewpoint to the virtual imaging plane.
  • the zoom ratio may be a predetermined static value, or may be dynamically determined according to the distance of the collected object (for example, the collected user) from the camera.
  • the method further includes:
  • the step S120 may include:
  • the first 2D coordinates of the first key point and the second 2D coordinates of the second key point of each target object are obtained to obtain M sets of the 3D coordinates.
  • contour detection for example, face detection can detect how many control users are in a 2D image, and then obtain the corresponding 3D coordinates based on each control user.
  • step S130 For example, if 3 users are detected in a 2D image, you need to obtain the image areas of the 3 users in the 2D image, and then based on the 2D coordinates of the key points of the hands and torso of the 3 users, And through the execution of step S130 to step S150, 3D coordinates corresponding to three users in the virtual three-dimensional space can be obtained.
  • the method includes:
  • Step S210 display the control effect based on the 3D coordinates in the first display area
  • Step S220 Display the 2D image in the second display area corresponding to the first display area.
  • the control effect will be displayed in the first display area, and the 2D image is displayed in the second area.
  • the first display area and the second display area may correspond to different display screens, for example, the first display area may correspond to the first display screen, and the second display area may correspond to the second display Screen; the first display screen and the second display screen are arranged side by side.
  • first display area and the second display area may be different display areas of the same display screen.
  • the first display area and the second display area may be two display areas arranged in parallel.
  • an image with a control effect is displayed in the first display area, and a 2D image is displayed in the second display area juxtaposed with the first display area.
  • the 2D image displayed in the second display area is a 2D image currently collected in real time or a video frame currently collected in 2D video in real time.
  • the displaying the 2D image in the second display area corresponding to the first display area includes:
  • the second reference figure of the second key point is displayed on the 2D image displayed in the second display area.
  • the first reference graphic is displayed superimposed on the first key point, and by displaying the first reference graphic, the position of the first key point can be highlighted.
  • the display parameters such as color and/or brightness used in the first reference image are distinguished from the display parameters such as color and/or brightness that are imaged by other parts of the target object.
  • the second reference graphic is also superimposed and displayed on the second key point, so that it is convenient for the user to visually judge himself based on the first reference graphic and the second reference graphic The relative positional relationship between the first part and the second part, so that the subsequent targeted adjustment.
  • the display parameters such as color and/or brightness used by the second reference graphic are distinguished from the display parameters such as color and/or brightness that are imaged by other parts of the target object.
  • the display parameters of the first reference graphic and the second reference graphic are different, which is convenient for the user to visually Make a distinction and improve the user experience.
  • the method further includes:
  • An association indication graphic is generated, wherein one end of the association indication graphic points to the first reference graphic, and the other end of the second association indication graphic points to a controlled element on the controlled device.
  • the controlled element may include: a controlled object such as a game object or a cursor displayed on the controlled device.
  • the first reference graphic and/or the second reference graphic are also displayed on the 2D image displayed in the second display area.
  • associated indication graphics are displayed together on the first display area and the second display area.
  • this embodiment provides an image processing apparatus, including:
  • the first acquisition module 110 is configured to acquire a 2D image of the target object
  • the second obtaining module 120 is configured to obtain the first 2D coordinates of the first key point and the second 2D coordinates of the second key point according to the 2D image, wherein the first key point is the first An imaging point of a part in the 2D image; the second key point is an imaging point of the second part of the target object in the 2D image;
  • the first determining module 130 is configured to determine relative coordinates based on the first 2D coordinates and the second 2D coordinates, wherein the relative coordinates are used to characterize the relative position between the first part and the second part ;
  • the projection module 140 is configured to project the relative coordinates into a virtual three-dimensional space and obtain 3D coordinates corresponding to the relative coordinates, where the 3D coordinates are used to control the controlled device to perform a predetermined operation.
  • the predetermined operation here includes but is not limited to the coordinate transformation of the target object on the controlled device.
  • the first acquisition module 110, the second acquisition module 120, the first determination module 130, and the projection module 140 may be program modules. After the program modules are executed by the processor, the above modules can be implemented. Features.
  • the first acquisition module 110, the second acquisition module 120, the first determination module 130, and the projection module 140 may be soft and hard combination modules, and the soft and hard combination modules may include: various programmable arrays ; For example, complex programmable array or field programmable array.
  • the first acquisition module 110, the second acquisition module 120, the first determination module 130, and the projection module 140 may be pure hardware modules, and the pure hardware modules may be dedicated integrated circuits.
  • the first 2D coordinate and the second 2D coordinate are 2D coordinates located within the first 2D coordinate system.
  • the second acquiring module 120 is configured to acquire the first 2D coordinates of the first key point in the first 2D coordinate system corresponding to the 2D image, and acquire the second The second 2D coordinate with the key point in the first 2D coordinate system;
  • the first determining module 130 is configured to construct a second 2D coordinate system according to the second 2D coordinate; map the first 2D coordinate to the second 2D coordinate system to obtain a third 2D coordinate.
  • the first determining module 130 is further configured to determine the mapping from the first 2D coordinate system to the second 2D coordinate system based on the first 2D coordinate system and the second 2D coordinate system Conversion parameter; based on the conversion parameter, mapping the first 2D coordinate to the second 2D coordinate system to obtain a third 2D coordinate.
  • the first determining module 130 is configured to determine the first size of the 2D image in the first direction, determine the second size of the second part in the first direction; determine the A first ratio between the first size and the second size; the conversion parameter is determined according to the first ratio.
  • the first determining module 130 is further configured to determine a third size of the 2D image in the second direction and determine a fourth size of the second part in the second direction, wherein , The second direction is perpendicular to the first direction; according to the second ratio between the second dimension and the third dimension; the first ratio and the second ratio are combined to determine the first Conversion parameters between the 2D coordinate system and the second 2D coordinate system.
  • the first determining module 130 is specifically configured to determine the conversion parameter using the following functional relationship:
  • the first determining module 130 is configured to determine the third 2D coordinate using the following functional relationship:
  • (x 3 , y 3 ) is the third 2D coordinate; (x 1 , y 1 ) is the first 2D coordinate; (x t , y t ) is the center point of the second part at the first A coordinate in a 2D coordinate system.
  • the projection module 140 is configured to normalize the third 2D coordinate to obtain a fourth 2D coordinate; combining the fourth 2D coordinate and the virtual viewpoint to the virtual in the virtual three-dimensional space The distance in the imaging plane determines the 3D coordinates of the first key point projected into the virtual three-dimensional space.
  • the projection module 140 is configured to combine the size of the second part and the center coordinate of the second 2D coordinate system to normalize the third 2D coordinate to obtain the first Four 2D coordinates.
  • the projection module 140 is configured to determine the projection of the first key point to the fourth 2D coordinate, the distance from the virtual viewpoint in the virtual three-dimensional space to the virtual imaging plane, and the zoom ratio 3D coordinates in the virtual three-dimensional space.
  • the projection module 140 may be configured to determine the 3D coordinates based on the following functional relationship:
  • (x 1 , y 1 ) is the first 2D coordinate;
  • (x t , y t ) is the coordinate of the center point of the second part in the first 2D coordinate system;
  • (x i , y i ) is the coordinate of the center point of the 2D image in the first 2D coordinate system;
  • torso w is the size of the 2D image in the first direction;
  • torso h is the size of the 2D image in the second direction Size;
  • K is the conversion parameter of the first 2D coordinate mapped to the second 2D coordinate system in the first direction;
  • S is the first 2D coordinate mapped to the second 2D coordinate system in the second direction
  • the conversion parameter of; the first direction is perpendicular to the second direction.
  • the projection module 140 is configured to determine the projection of the first key point to the fourth 2D coordinate, the distance from the virtual viewpoint in the virtual three-dimensional space to the virtual imaging plane, and the zoom ratio 3D coordinates in the virtual three-dimensional space.
  • the projection module 140 may be configured to determine the 3D coordinates using the following functional relationship:
  • x4 is the coordinate value of the fourth 2D coordinate in the first direction
  • y4 is the coordinate value of the fourth 2D coordinate in the second direction
  • dds is the scaling ratio
  • d is the virtual in the virtual three-dimensional space The distance from the viewpoint to the virtual imaging plane.
  • the device further includes:
  • a second determination module configured to determine the number M of the target objects on the 2D image and the 2D image area of the target object on the 2D image;
  • the second obtaining module 120 is configured to obtain the first 2D coordinates of the first key point and the second 2D coordinates of the second key point of each target object according to the 2D image area, to Obtain M sets of the 3D coordinates.
  • the device includes:
  • a first display module configured to display the control effect based on the 3D coordinates in the first display area
  • the second display module is configured to display the 2D image in a second display area corresponding to the first display area.
  • the second display module is further configured to display the first finger of the first key point on the 2D image displayed in the second display area according to the first 2D coordinates Generation graphics; and/or, according to the second 2D coordinates, displaying the second reference graphics of the second key point on the 2D image displayed in the second display area.
  • the device further includes:
  • the control module is configured to control the coordinate transformation of the target object on the controlled device based on the amount or rate of change on three coordinate axes in the virtual three-dimensional space at the two moments before and after.
  • This example provides an image processing method including:
  • each frame converts the current frame to BGRA format, and flips it as needed.
  • the data stream is saved as an object with time stamp.
  • the current frame is detected by the face handle and the face recognition result and the number of faces are obtained. This result assists the tracking of the key points of the human pose.
  • the hand key point is the aforementioned first key point.
  • the hand key point may be a wrist key point.
  • the shoulder key point and waist key point of the human body may be torso key points, which are the second key points mentioned in the foregoing embodiments.
  • the new coordinates of the hand relative to the body are calculated through the relative coefficients, the recalibrated hand coordinates, and the body center coordinates.
  • the operation space to be projected is generated in the virtual three-dimensional space, the distance D between the observation point and the receiving operation object is calculated, and the viewpoint coordinates are converted into the coordinates of the operation cursor in the three-dimensional space through X, Y and D.
  • the conversion function of the key point of the hand into the second 2D coordinate system corresponding to the torso can be as follows:
  • the conversion function of the key points of the hand into the second 2D coordinate system corresponding to the torso can be:
  • torso represents the coordinates of the key points of the torso in the first 2D coordinate system
  • cam-center is the center coordinate of the first 2D coordinate corresponding to the 2D image.
  • a scaling ratio may be introduced, and the value range of the scaling ratio may be between 1 and 3, or between 1.5 and 2.
  • d can be the distance between (x c , y c , z c ) and (x j , y j , z j ).
  • the 3D coordinates converted into the virtual three-dimensional space can be:
  • an image processing device including:
  • Memory used to store information
  • a processor connected to the memory, is configured to execute the image processing method provided by the foregoing one or more technical solutions by executing computer-executable instructions stored on the memory, for example, as shown in FIG. 1, FIG. 3, and FIG. One or more of the methods shown in 4.
  • the memory may be various types of memory, such as random access memory, read-only memory, flash memory, etc.
  • the memory can be used for information storage, for example, storing computer-executable instructions.
  • the computer executable instructions may be various program instructions, for example, target program instructions and/or source program instructions.
  • the processor may be various types of processors, for example, a central processor, a microprocessor, a digital signal processor, a programmable array, a digital signal processor, an application specific integrated circuit, or an image processor.
  • the processor may be connected to the memory through a bus.
  • the bus may be an integrated circuit bus or the like.
  • the terminal device may further include: a communication interface, and the communication interface may include: a network interface, for example, a local area network interface, a transceiver antenna, and the like.
  • the communication interface is also connected to the processor and can be used for information transmission and reception.
  • the image processing device further includes a camera, which may be a 2D camera, and may collect 2D images.
  • a camera which may be a 2D camera, and may collect 2D images.
  • the terminal device further includes a human-machine interaction interface.
  • the human-machine interaction interface may include various input and output devices, such as a keyboard, a touch screen, and the like.
  • Embodiments of the present application provide a computer storage medium that stores computer executable code; after the computer executable code is executed, the image processing method provided by one or more of the foregoing technical solutions can be implemented, for example , One or more of the methods shown in Figures 1, 3, and 4.
  • the storage medium includes: mobile storage devices, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disks or optical disks and other media that can store program codes.
  • the storage medium may be a non-transitory storage medium.
  • An embodiment of the present application provides a computer program product, where the program product includes computer-executable instructions; after the computer-executable instructions are executed, the image processing method provided by any of the foregoing implementations can be implemented, for example, as shown in FIGS. 1 and 3 And one or more of the methods shown in FIG. 4.
  • the disclosed device and method may be implemented in other ways.
  • the device embodiments described above are only schematic.
  • the division of the units is only a division of logical functions.
  • the displayed or discussed components are coupled to each other, or directly coupled, or the communication connection may be through some interfaces, and the indirect coupling or communication connection of the device or unit may be electrical, mechanical, or other forms of.
  • the above-mentioned units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place or distributed to multiple network units; Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
  • the functional units in the embodiments of the present application may all be integrated into one processing module, or each unit may be separately used as a unit, or two or more units may be integrated into one unit; the above integration
  • the unit can be implemented in the form of hardware, or in the form of hardware plus software functional units.
  • the foregoing program may be stored in a computer-readable storage medium, and when the program is executed, Including the steps of the above method embodiments; and the foregoing storage media include: mobile storage devices, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disks or optical disks, etc. A medium that can store program codes.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Human Computer Interaction (AREA)
  • Software Systems (AREA)
  • Architecture (AREA)
  • Computer Graphics (AREA)
  • Computer Hardware Design (AREA)
  • General Engineering & Computer Science (AREA)
  • Geometry (AREA)
  • Processing Or Creating Images (AREA)
  • User Interface Of Digital Computer (AREA)
  • Image Processing (AREA)

Abstract

本申请实施例提供一种图像处理方法及装置、电子设备及存储介质。所述方法包括:获取目标对象的2D图像;根据所述2D图像,获取第一关键点的第一2D坐标和第二关键点的第二2D坐标,其中,所述第一关键点为所述目标对象的第一局部在所述2D图像中的成像点;所述第二关键点为所述目标对象的第二局部在所述2D图像中的成像点;基于第一2D坐标及所述第二2D坐标,确定相对坐标,其中,所述相对坐标用于表征所述第一局部和所述第二局部之间的相对位置;将所述相对坐标投影到虚拟三维空间内并获得与所述相对坐标对应的3D坐标,其中,所述3D坐标用于控制受控设备上目标对象坐标变换。

Description

图像处理方法及装置、电子设备及存储介质
相关申请的交叉引用
本申请基于申请号为201811572680.9、申请日为2018年12月21日的中国专利申请提出,并要求该中国专利申请的优先权,该中国专利申请的全部内容通过引用结合在本申请中。
技术领域
本申请涉及信息技术领域,尤其涉及一种图像处理方法及装置、电子设备及存储介质。
背景技术
随着信息技术的发展,出现了3D视频和3D体感游戏等基于所述3D坐标的交互。3D坐标相对于2D坐标多了一个方向的坐标值,如此,3D坐标比2D坐标能够具有多一个维度的交互。
例如,采集用户在3D空间内的移动,并转换为对游戏角色在前后、左右、上下等三个相互垂直方向上的控制。若采用2D坐标来控制,用户可能需要输入至少两个操作,如此,简化了用户控制,提升了用户体验。
通常这种基于所述3D坐标的交互,需要相应的3D设备,例如,用户需要佩戴检测其在三维空间内运动的3D体感设备(可穿戴设备);或者,需要利用3D摄像头来采集用户在3D空间内的移动。不管是通过3D体感设备还是3D摄像头来确定用户在3D空间内的移动,硬件成本相对较高。
发明内容
有鉴于此,本申请实施例期望提供一种图像处理方法及装置、电子设备及存储介质。
本申请的技术方案是这样实现的:
一种图像处理方法,包括:
获取目标对象的2D图像;
根据所述2D图像,获取第一关键点的第一2D坐标和第二关键点的第二2D坐标,其中,所述第一关键点为所述目标对象的第一局部在所述2D图像中的成像点;所述第二关键点为所述目标对象的第二局部在所述2D图像中的成像点;
基于第一2D坐标及所述第二2D坐标,确定相对坐标,其中,所述相对坐标用于表征所述第一局部和所述第二局部之间的相对位置;
将所述相对坐标投影到虚拟三维空间内并获得与所述相对坐标对应的3D坐标,其中,所述3D坐标用于控制上目标对象坐标变换。
一种图像处理装置,包括:
第一获取模块,配置为获取目标对象的2D图像;
第二获取模块,配置为根据所述2D图像,获取第一关键点的第一2D坐标和第二 关键点的第二2D坐标,其中,所述第一关键点为所述目标对象的第一局部在所述2D图像中的成像点;所述第二关键点为所述目标对象的第二局部在所述2D图像中的成像点;
第一确定模块,配置为基于第一2D坐标及所述第二2D坐标,确定相对坐标,其中,所述相对坐标用于表征所述第一局部和所述第二局部之间的相对位置;
投影模块,配置为将所述相对坐标投影到虚拟三维空间内并获得与所述相对坐标对应的3D坐标,其中,所述3D坐标用于控制受控设备上目标对象坐标变换。
一种电子设备,包括:
存储器;
处理器,与所述存储器连接,用于通过执行存储在所述存储器上的计算机可执行指令实现前述任意技术方案提供的图像处理方法。
一种计算机存储介质,所述计算机存储介质存储有计算机可执行指令;所述计算机可执行指令被处理器执行后,能够实现前述任意技术方案提供的图像处理方法。
一种计算机程序,所述计算机程序被处理器执行后,能够实现前述任意技术方案提供的图像处理方法。
本申请实施例提供的技术方案,直接利用2D图像中目标对象的第一局部的第一关键点和第二局部的第二关键点之间的相对坐标,转换到虚拟三维空间内,从而得到相对坐标所对应的3D坐标;利用这种3D坐标与受控设备进行交互;而不用3D人体感应设备来采集3D坐标,简化了基于3D坐标进行交互的硬件结构,节省了硬件成本。
附图说明
图1为本申请实施例提供的第一种图像处理方法的流程示意图;
图2为本申请实施例提供的一种视锥的示意图;
图3为本申请实施例提供的一种相对坐标的确定流程示意图;
图4为本申请实施例提供的第二种图像处理方法的流程示意图;
图5A为本申请实施例提供的一种显示效果示意图;
图5B为本申请实施例提供的另一种显示效果示意图;
图6为本申请实施例提供的一种图像处理装置的结构示意图;
图7为本申请实施例提供的一种电子设备的结构示意图。
具体实施方式
以下结合说明书附图及具体实施例对本申请的技术方案做进一步的详细阐述。
如图1所示,本实施例提供一种图像处理方法,包括:
步骤S110:获取目标对象的2D图像;
步骤S120:根据所述2D图像,获取第一关键点的第一2D坐标和第二关键点的第二2D坐标,其中,所述第一关键点为所述目标对象的第一局部在所述2D图像中的成像点;所述第二关键点为所述目标对象的第二局部在所述2D图像中的成像点;
步骤S130:基于第一2D坐标及所述第二2D坐标,确定相对坐标,其中,所述相对坐标用于表征所述第一局部和所述第二局部之间的相对位置;
步骤S140:将所述相对坐标投影到虚拟三维空间内并获得与所述相对坐标对应的3D坐标;其中,所述3D坐标用于控制受控设备执行预定操作。此处的预定操作包括但不限于受控设备上目标对象的坐标变换。
在本实施例中,获取的目标对象的2D(two-dimensional)图像,此处的2D图像可 以用任意一个2D摄像头采集的图像。例如,利用普通RGB的摄像头采集的RGB图像,或者,YUV图像;再例如,所述2D图像还可为BGRA格式的2D图像。在本实施例中,可以利用位于受控设备上的单目摄像头就可以完成所述2D图像的采集。或者,该单目摄像头还可以与所述受控设备连接的摄像头。该摄像头的采集区域和所述受控设备的观看区域至少部分重叠。例如,所述受控设备为智能电视等游戏设备,游戏设备包括显示屏,能够观看到所述显示屏的区域为所述观看区域,而所述采集区域为摄像头能够采集到的区域。优选地,所述摄像头的采集区域与所述观看区域重叠。
在本实施例中,所述步骤S110获取2D图像可包括:利用二维(2D)摄像头采集2D图像,或者,从采集设备接收2D图像。
所述目标对象可为:人体的手部和躯干部分。所述2D图像可为包含有人体的手部和躯干部分的成像。例如,所述第一局部为所述人体的手部,所述第二局部为所述躯干部分。再例如,所述第一局部可为眼睛的眼珠,所述第二局部可为整个眼睛。再例如,所述第一局部可为人体的脚部,第二局部可为人体的躯干。
在一些实施例中,在所述2D图像中所述第一局部的成像面积小于所述第二局部在所述2D图像中的成像面积。
在本实施例中,所述第一2D坐标和第二2D坐标均可为在第一2D坐标系中的坐标值。例如,所述第一2D坐标系可为所述2D图像所在平面构成的2D坐标系。
在步骤S130中结合,第一2D坐标和第二2D坐标确定出表征第一关键点与第二关键点之间相对位置的相对坐标。然后将该相对坐标投影到虚拟三维空间内。该虚拟三维空间可为预设的三维空间,得到该相对坐标在虚拟三维空间内的3D坐标。该3D坐标可以用于与显示界面相关的基于所述3D坐标的交互。
所述虚拟三维空间可为各种类型的虚拟三维空间,该虚拟三维空间的坐标范围可以从负无穷大一直到正无穷大。在该虚拟三维空间内可以设置有虚拟摄像机。图2所示为一种虚拟摄像机的视角所对应的视锥。该虚拟摄像机在本实施例中可为所述2D图像的物理摄像机在虚拟三维空间内的映射。所述视锥可包括:近夹面、顶面、右面及在图2中未标注的左面等。在本实施例中,所述虚拟三维空间的虚拟视点可位于所述近夹面上,例如,所述虚拟视点位于所述近夹面的中心点。根据如图2所示的视锥,可以将第一关键点相对于第二关键点的相对坐标(2D坐标)转换到虚拟三维空间内得到所述第一关键点在三维空间内相对于第二关键点的3D(three-dimensional)坐标。
所述近夹面又可以称之为:近剪裁平面;为虚拟三维空间中靠近虚拟视点的一个平面,包含所述虚拟视点的起始平面。在所述虚拟三维空间中从所述近夹面逐步向远方延伸。
所述基于所述3D坐标的交互为:根据目标对象两个时刻在虚拟三维空间内的坐标变换进行操作控制。例如,以游戏角色的控制为例,所述基于所述3D坐标的交互包括:
基于前后两个时刻在虚拟三维空间内三个坐标轴上的变化量或变化率,控制游戏角色在对应的三个坐标轴上的参数。例如,以游戏角色的移动控制为例,游戏角色在三维空间内移动,可以前后移动、左右移动及上下跳动。用户的手部相对于躯干的相对坐标转换到三维空间内之后,根据两个时刻相对坐标转换到虚拟三维空间内的坐标变换量或变化率,分别控制游戏角色前后移动、左右移动及上下跳动。具体如,将相对坐标投影到虚拟三维空间内的x轴上的坐标,用于控制游戏角色前后移动,将相对坐标投影到虚拟三维空间内y轴上的坐标,用于控制游戏角色的左右移动,将相对坐标投影到虚拟三维空间内的z轴上的坐标,用于控制游戏角色上下跳动的高度。
在一些实施例中,显示界面内的显示图像至少可以分为:背景图层及前景图层,可以根据当前3D坐标在虚拟三维空间上z轴坐标位置,确定出该3D坐标是控制背景图 层上的图形元素变换或执行对应的响应操作,还是控制前景图层上的图形元素变换或执行对应的响应操作。
在另一些实施例中,显示界面内的显示图像还可以分为:背景图层、前景图层位于背景图层和前景图层之间的一个或多个中间图层。同样地,根据当前得到的3D坐标中z轴的坐标值,确定3D坐标所作用的图层;再结合3D坐标在x轴和y轴的坐标值,确定3D坐标所作用的是该图层中的哪一个图形元素,从而进一步控制被3D坐标所作用的图形元素的变换或执行对应的响应操作。
当然以上,仅是对根据3D坐标进行基于所述3D坐标的交互的举例,具体的实现方式有很多种,不局限于上述任意一种。
所述虚拟三维空间可为预先定义的一个三维空间。具体如,根据所述采集2D图像的采集参数,预先定义了虚拟三维空间。所述虚拟三维空间可包括:虚拟成像平面及虚拟视点构成。所述虚拟视点与所述虚拟成像平面之间的垂直距离可根据所述采集参数中的焦距来确定。在一些实施例中,所述虚拟成像平面的尺寸可根据受控设备的控制平面的尺寸来确定。例如,所述虚拟成像平面的尺寸与所述受控设备的控制平面的尺寸正相关。该控制平面可等于接收基于所述3D坐标的交互的显示界面的尺寸。
如此,在本实施例中,通过相对坐标投影到虚拟三维空间内,就可以模拟获得了基于深度摄像头或者3D体感设备得到3D坐标进行基于所述3D坐标的交互的控制效果,直接沿用2D摄像头即可,由于通常2D摄像头的硬件成本比3D体感设备或3D摄像头低,直接沿用2D摄像头显然降低了基于所述3D坐标的交互的成本,且实现了基于3D坐标的交互。故在一些实施例中,所述方法还包括:基于所述3D坐标与受控设备进行交互,该交互可包括:用户与受控设备之间的交互。所述3D坐标可视作用户输入从而使得控制受控设备执行特定的操作,实现用户与受控设备之间的交互。
故在一些实施例中,所述方法还包括:基于前后两个时刻在虚拟三维空间内三个坐标轴上的变化量或变化率,控制受控设备上目标对象坐标变换。
在一些实施例中,所述步骤S120可包括:获取所述第一关键点在所述2D图像所对应的第一2D坐标系内所述第一2D坐标,并获取所述第二关键点在所述第一2D坐标系内的所述第二2D坐标。即所述第一2D坐标和第二2D坐标都是基于第一2D坐标系确定的。
在一些实施例中,所述步骤S130可包括:相对于所述第二局部的成像的相对坐标,包括:根据所述第二2D坐标,构建第二2D坐标系;将所述第一2D坐标映射到所述第二2D坐标系,获得第三2D坐标。
具体地如,如图3所示,所述步骤S130可包括:
步骤S131:根据所述第二2D坐标,构建第二2D坐标系;
步骤S132:根据所述第一2D坐标系和第二2D坐标系,确定从第一2D坐标系映射到所述第二2D坐标系的转换参数;其中,所述转换参数,用于确定所述相对坐标。
在一些实施例中,所述步骤S130还可包括:
步骤S133:基于所述转换参数,将所述第一2D坐标映射到所述第二2D坐标系,获得第三2D坐标。
在本实施例中,所述第二局部的第二关键点至少两个,例如,所述第二关键点可为第二局部成像的外轮廓点。根据所述第二关键点的坐标可以构建一个第二2D坐标系。该第二2D坐标系的原点可为多个所述第二关键点连接形成的外轮廓的中心点。
在本申请实施例中,所述第一2D坐标系和所述第二2D坐标系都是有边界的坐标系。
在确定出所述第一2D坐标系和所述第二2D坐标系之后,就可以根据两个2D坐标 系的尺寸和/或中心坐标,得到第一2D坐标系内的坐标映射到第二2D坐标系内的转换参数。
基于该转换参数,就可以直接将所述第一2D坐标映射到所述第二2D坐标系,得到所述第三2D坐标。例如,该第三2D坐标为第一2D坐标映射到第二2D坐标系之后的坐标。
在一些实施例中,所述步骤S132可包括:
确定所述2D图像在第一方向上的第一尺寸,确定所述第二局部在第一方向上的第二尺寸;
确定所述第一尺寸及所述第二尺寸之间的第一比值;
基于所述第一比值确定所述转换参数。
在另一些实施例中,所述步骤S132还可包括:
确定所述2D图像在第二方向上的第三尺寸,确定所述第二局部在第二方向上的第四尺寸,其中,所述第二方向垂直于所述第一方向;
根据所述第三尺寸与所述第四尺寸之间的第二比值;
结合所述第一比值和所述第二比值,确定所述第一2D坐标系和所述第二2D坐标系之间的转换参数。
例如,所述第一比值可为:所述第一2D坐标系和所述第二2D坐标系在第一方向上的转换比值;所述第二比值可为:所述第一2D坐标系和所述第二2D坐标系在第二方向上的转换比值。
在本实施例中,若所述第一方向为x轴所在的方向,则第二方向为y轴所在的方向;若所述第一方向为y轴所在的方向,则第二方向为x轴所在的方向。
在本实施例中,所述转换参数包括两个转换比值,分别是第一方向上第一尺寸和第二尺寸得到第一比值,和第二方向上第三尺寸与第四尺寸之间的第二比值。
在一些实施例中,所述步骤S132可包括:
利用如下函数关系,确定所述转换参数:
Figure PCTCN2019092866-appb-000001
其中,cam w为所述第一尺寸;torso w为所述第三尺寸;cam h为所述第二尺寸;torso h为所述第四尺寸;K为所述第一2D坐标映射到第二2D坐标系在所述第一方向上的转换参数;S为所述第一2D坐标映射到第二2D坐标系在所述第二方向上的转换参数。
所述cam w在2D图像第一方向上两个边缘之间的距离。cam h为2D图像第二方向上两个边缘之间的距离。第一方向和第二方向相互垂直。
所述K即为前述第一比值;所述S即为前述第二比值。在一些实施例中,所述转换参数除了所述第一比值和所述第二比值以外,还可以引入调整因子,例如,所述调整因子包括:第一调整因子和/或第二调整因子。所述调整因子可包括:加权因子和/或比例因子。若所述调整因子为比例因子,则所述转换参数可为:所述第一比值和/或第二比值与比例因子的乘积。若所述调整因子为加权因子,则所述转换参数可为:所述第一比值和/或第二比值与加权因子的加权和。
在一些实施例中,所述步骤S134可包括:基于所述转换参数及所述第一2D坐标系的中心坐标,将所述第一2D坐标映射到所述第二2D坐标系,获得第三2D坐标。在一定程度上,所述第三2D坐标可以表示所述第一局部相对于所述第二局部的位置。
具体地如,所述步骤S134可包括:利用如下函数关系确定所述第三2D坐标:
(x 3,y 3)=((x 1-x t)*K+x i,(y 1-y t)*S+y i)公式(2)
(x 3,y 3)为所述第三2D坐标;(x 1,y 1)为所述第一2D坐标;(x t,y t)为所述第二局部的中心点在所述第一2D坐标系内的坐标。
在本实施例中,x均表示第一方向上的坐标值;y为表示第二方向上的坐标值。
在一些实施例中,所述步骤S140可包括:
对所述第三2D坐标进行归一化处理得到第四2D坐标;
结合所述第四2D坐标及所述虚拟三维空间内虚拟视点到虚拟成像平面内的距离,确定所述第一关键点投影到所述虚拟三维空间内的3D坐标。
在一些实施例中,可以直接对第三2D坐标进行投影,以将第三2D坐标投影到虚拟成像平面内。在本实施例中,为了方便计算,会对第三2D坐标进行归一化处理,在归一化处理之后再投影到虚拟成像平面内。
在本实施例中,虚拟视点与虚拟成像平面之间的距离可为已知的距离。
在进行归一化处理时,可以基于2D图像的尺寸来进行,也可以是基于某一个预先定义的尺寸来确定。所述归一化处理的方式有多种,通过归一化处理,减少不同采集时刻采集的2D图像的第三2D坐标变化过大导致的数据处理不便的现象,简化了后续的数据处理。
在一些实施例中,所述对所述第三2D坐标进行归一化处理得到第四2D坐标,包括:结合所述第二局部的尺寸及所述第二2D坐标系的中心坐标,对所述第三2D坐标进行归一化处理得到所述第四2D坐标。
例如,所述结合所述第二局部的尺寸及所述第二2D坐标系的中心坐标,对所述第三2D坐标进行归一化处理得到所述第四2D坐标,包括:
(x 4,y 4)=[((x 1-x t)*K+x i)/torso w,(1-((y 1-y t)*S+y i))/torso h]公式(3)
其中,(x 4,y 4)为所述第四2D坐标;(x 1,y 1)为所述第一2D坐标;(x t,y t)为所述第二局部的中心点在所述第一2D坐标系内的坐标;(x i,y i)为所述2D图像的中心点在所述第一2D坐标系内的坐标。所述2D图像通常为矩形的,此处的2D图像的中心点为矩形的中心点。torso w为所述2D图像在第一方向上的尺寸;torso h为所述2D图像在第二方向上的尺寸;K为所述第一2D坐标映射到第二2D坐标系在所述第一方向上的转换参数;S为所述第一2D坐标映射到第二2D坐标系在所述第二方向上的转换参数;所述第一方向垂直于所述第二方向。
由于第二2D坐标系的中心坐标值为:(0.5*torso w,0.5*torso h)。故所述第四2D坐标的求解函数可如下所示:
Figure PCTCN2019092866-appb-000002
在一些实施例中,所述结合所述第四2D坐标及所述虚拟三维空间内虚拟视点到虚拟成像平面内的距离,确定所述第一关键点投影到所述虚拟三维空间内的3D坐标,包括:结合所述第四2D坐标、所述虚拟三维空间内虚拟视点到虚拟成像平面内的距离及缩放比例,确定所述第一关键点投影到所述虚拟三维空间内的3D坐标;具体地如,可利用如下函数关系,确定所述3D坐标:
(x 4*dds,y 4*dds,d)公式(5)
其中,x4为所述第四2D坐标在第一方向上的坐标值;y4为所述第四2D坐标在第 二方向上的坐标值;dds为缩放比例;d为所述虚拟三维空间内虚拟视点到虚拟成像平面内的距离。
在本实施例中,所述缩放比例可为预先确定的静态值,也可以是动态根据被采集对象(例如,被采集用户)距离摄像头的距离确定的。
在一些实施例中,所述方法还包括:
确定所述2D图像上所述目标对象的数目M及每个所述目标对象在所述2D图像上的2D图像区域;
所述步骤S120可包括:
根据所述2D图像区域,获得每一个所述目标对象的所述第一关键点的第一2D坐标和所述第二关键点的第二2D坐标,以获得M组所述3D坐标。
例如,通过轮廓检测等处理,例如,人脸检测可以检测出一个2D图像中有多少个控制用户在,然后基于每一个控制用户得到对应的3D坐标。
例如,若在一个2D图像中检测到3个用户的成像,则需要分别获得3个用户在该2D图像内的图像区域,然后基于3个用户的手部和躯干部分的关键点的2D坐标,并通过步骤S130至步骤S150的执行,可以得到3个用户分别对应虚拟三维空间内的3D坐标。
在一些实施例中,如图4所示,所述方法包括:
步骤S210:在第一显示区域内显示基于所述3D坐标的控制效果;
步骤S220:在与所述第一显示区域对应的第二显示区域内显示所述2D图像。
为了提升用户体验,方便用户根据第一显示区域和第二显示区域的内容,修正自己的动作,会在第一显示区域显示控制效果,而第二区域显示所述2D图像。
在一些实施例中,所述第一显示区域和所述第二显示区域可以对应不同的显示屏,例如,第一显示区域可对应于第一显示屏,第二显示区域可对应于第二显示屏;所述第一显示屏和第二显示屏并列设置。
在另一些实施例中,所述第一显示区域和第二显示区域可为同一个显示屏的不同显示区域。所述第一显示区域和所述第二显示区域可为并列设置的两个显示区域。
如图5A所示,在第一显示区域内显示有控制效果的图像,并在与第一显示区域并列的第二显示区域内显示有2D图像。在一些实施例中,第二显示区域显示的2D图像为当前实时采集的2D图像或者2D视频中当前实时采集的视频帧。
在一些实施例中,所述在与所述第一显示区域对应的第二显示区域内显示所述2D图像,包括:
根据所述第一2D坐标,在所述第二显示区域内显示的所述2D图像上显示所述第一关键点的第一指代图形;
和/或,
根据所述第二2D坐标,在所述第二显示区域内显示的所述2D图像上显示所述第二关键点的第二指代图形。
在一些实施例中,第一指代图形是叠加显示在所述第一关键点上的,通过第一指代图形的显示,可以突出显示所述第一关键点的位置。例如,所述第一指代图像使用的色彩和/或亮度等显示参数区分于所述目标对象其他部分成像的色彩和/或亮度等显示参数。
在另一些实施例中,所述第二指代图形同样是叠加显示在所述第二关键点上的,如此,方便用户根据第一指代图形和第二指代图形从视觉上判断出自身的第一局部和第二局部之间的相对位置关系,从而后续有针对性的调整。
例如,所述第二指代图形使用的色彩和/或亮度等显示参数区分于所述目标对象其他 部分成像的色彩和/或亮度等显示参数。
在一些实施例中,为了区分所述第一指代图形和所述第二指代图形,所述第一指代图形和所述第二指代图形的显示参数不同,方便用户通过视觉效果简便进行区分,提升用户体验。
在还有一些实施例中,所述方法还包括:
生成关联指示图形,其中,所述关联指示图形的一端指向所述第一指代图形,所述第二关联指示图形的另一端指向所述受控设备上受控元素。
该受控元素可包括:受控设备上显示的游戏对象或光标等受控对象。
如图5B所示,在第二显示区域显示的2D图像上还显示有第一指代图形和/或第二指代图形。并在第一显示区域和第二显示区域上共同显示有关联指示图形。
如图6所示,本实施例提供一种图像处理装置,包括:
第一获取模块110,配置为获取目标对象的2D图像;
第二获取模块120,配置为根据所述2D图像,获取第一关键点的第一2D坐标和第二关键点的第二2D坐标,其中,所述第一关键点为所述目标对象的第一局部在所述2D图像中的成像点;所述第二关键点为所述目标对象的第二局部在所述2D图像中的成像点;
第一确定模块130,配置为基于第一2D坐标及所述第二2D坐标,确定相对坐标,其中,所述相对坐标用于表征所述第一局部和所述第二局部之间的相对位置;
投影模块140,配置为将所述相对坐标投影到虚拟三维空间内并获得与所述相对坐标对应的3D坐标,其中,所述3D坐标用于控制受控设备执行预定操作。此处的预定操作包括但不限于受控设备上目标对象的坐标变换。
在一些实施例中,所述第一获取模块110、第二获取模块120、第一确定模块130及投影模块140可为程序模块,所述程序模块被处理器执行后,能够实现上述各个模块的功能。
在另一些实施例中,所述第一获取模块110、第二获取模块120、第一确定模块130及投影模块140可为软硬结合模块,该软硬结合模块可包括:各种可编程阵列;例如,复杂可编程阵列或者现场可编程阵列。
在还有一些实施例中,所述第一获取模块110、第二获取模块120、第一确定模块130及投影模块140可为纯硬件模块,该纯硬件模块可为专用集成电路。
在一些实施例中,所述第一2D坐标和所述第二2D坐标为位于第一2D坐标系内的2D坐标。
在一些实施例中,所述第二获取模块120,配置为获取所述第一关键点在所述2D图像所对应的第一2D坐标系内所述第一2D坐标,并获取所述第二关键点在所述第一2D坐标系内的所述第二2D坐标;
所述第一确定模块130,配置为根据所述第二2D坐标,构建第二2D坐标系;将所述第一2D坐标映射到所述第二2D坐标系,获得第三2D坐标。
在另一些实施例中,所述第一确定模块130,还配置为根据所述第一2D坐标系和第二2D坐标系,确定从第一2D坐标系映射到所述第二2D坐标系的转换参数;基于所述转换参数,将所述第一2D坐标映射到所述第二2D坐标系,获得第三2D坐标。
在一些实施例中,所述第一确定模块130,配置为确定所述2D图像在第一方向上的第一尺寸,确定所述第二局部在第一方向上的第二尺寸;确定所述第一尺寸及所述第二尺寸之间的第一比值;根据所述第一比值确定转换参数。
在另一些实施例中,所述第一确定模块130,还配置为确定所述2D图像在第二方 向上的第三尺寸,确定所述第二局部在第二方向上的第四尺寸,其中,所述第二方向垂直于所述第一方向;根据所述第二尺寸与所述第三尺寸之间的第二比值;结合所述第一比值及所述第二比值确定所述第一2D坐标系和所述第二2D坐标系之间的转换参数。
在一些实施例中,所述第一确定模块130,具体用于利用如下函数关系,确定所述转换参数:
Figure PCTCN2019092866-appb-000003
其中,cam w为所述第一尺寸;torso w为所述第三尺寸;cam h为所述第二尺寸;torso h为所述第四尺寸;K为所述第一2D坐标映射到第二2D坐标系在所述第一方向上的转换参数;S为所述第一2D坐标映射到第二2D坐标系在所述第二方向上的转换参数。
在一些实施例中,所述第一确定模块130,配置为利用如下函数关系确定所述第三2D坐标:
(x 3,y 3)=((x 1-x t)*K+x i,(y 1-y t)*S+y i)
(x 3,y 3)为所述第三2D坐标;(x 1,y 1)为所述第一2D坐标;(x t,y t)为所述第二局部的中心点在所述第一2D坐标系内的坐标。
在一些实施例中,所述投影模块140,配置为对所述第三2D坐标进行归一化处理得到第四2D坐标;结合所述第四2D坐标及所述虚拟三维空间内虚拟视点到虚拟成像平面内的距离,确定所述第一关键点投影到所述虚拟三维空间内的3D坐标。
在一些实施例中,所述投影模块140,配置为结合所述第二局部的尺寸及所述第二2D坐标系的中心坐标,对所述第三2D坐标进行归一化处理得到所述第四2D坐标。
在一些实施例中,所述投影模块140,配置为结合所述第四2D坐标、所述虚拟三维空间内虚拟视点到虚拟成像平面内的距离及缩放比例,确定所述第一关键点投影到所述虚拟三维空间内的3D坐标。
在一些实施例中,所述投影模块140,可配置为基于以下函数关系确定所述3D坐标:
(x 4,y 4)=[((x 1-x t)*K+x i)/torso w,(1-((y 1-y t)*S+y i))/torso h]公式(2)
其中,(x 1,y 1)为所述第一2D坐标;(x t,y t)为所述第二局部的中心点在所述第一2D坐标系内的坐标;(x i,y i)为所述2D图像的中心点在所述第一2D坐标系内的坐标;torso w为所述2D图像在第一方向上的尺寸;torso h为所述2D图像在第二方向上的尺寸;K为所述第一2D坐标映射到第二2D坐标系在所述第一方向上的转换参数;S为所述第一2D坐标映射到第二2D坐标系在所述第二方向上的转换参数;所述第一方向垂直于所述第二方向。
在一些实施例中,所述投影模块140,配置为结合所述第四2D坐标、所述虚拟三维空间内虚拟视点到虚拟成像平面内的距离及缩放比例,确定所述第一关键点投影到所述虚拟三维空间内的3D坐标。
进一步地,所述投影模块140,可配置为利用如下函数关系,确定所述3D坐标:
(x 4*dds,y 4*dds,d)公式(5)
其中,x4为所述第四2D坐标在第一方向上的坐标值;y4为所述第四2D坐标在第二方向上的坐标值;dds为缩放比例;d为所述虚拟三维空间内虚拟视点到虚拟成像平面内的距离。
在一些实施例中,所述装置还包括:
第二确定模块,配置为确定所述2D图像上所述目标对象的数目M及所述目标对象 在所述2D图像上的2D图像区域;
所述第二获取模块120,配置为根据所述2D图像区域,获得每一个所述目标对象的所述第一关键点的第一2D坐标和所述第二关键点的第二2D坐标,以获得M组所述3D坐标。
在一些实施例中,所述装置包括:
第一显示模块,配置为在第一显示区域内显示基于所述3D坐标的控制效果;
第二显示模块,配置为在与所述第一显示区域对应的第二显示区域内显示所述2D图像。
在一些实施例中,所述第二显示模块,还配置为根据所述第一2D坐标,在所述第二显示区域内显示的所述2D图像上显示所述第一关键点的第一指代图形;和/或,根据所述第二2D坐标,在所述第二显示区域内显示的所述2D图像上显示所述第二关键点的第二指代图形。
在一些实施例中,所述装置还包括:
控制模块,配置为基于前后两个时刻在虚拟三维空间内三个坐标轴上的变化量或变化率,控制受控设备上目标对象坐标变换。
以下结合上述任意实施例提供一个具体示例:
示例1:
本示例提供一种图像处理方法包括:
实时识别人体姿势关键点,通过公式与算法实现无需手握或穿戴设备的在虚拟环境中做出精度较高的操作。
读取脸部识别模型与人体姿势关键点识别模型并建立相对应句柄,同时配置追踪参数。
打开视频流,每一帧将当前帧转换为BGRA格式,并根据需要进行翻转,数据流存为带有时间戳的对象。
通过人脸句柄检测当前帧并得到人脸识别结果及人脸数量,此结果协助人体姿势(human pose)关键点追踪。
检测当前帧的人体姿势,并通过追踪句柄追踪实时人体关键点。
得到人体姿势关键点后定位到手部关键点,从而得到手部位于摄像头识别图像中的像素点。该手部关键点为前述第一关键点,具体如,该手部关键点具体可为手腕关键点。
此处假设手部将成为之后的操作光标。
通过同样方式定位人体肩膀关键点及腰部关键点,计算出身体中心位置的像素坐标。人体肩部关键点及腰部关键点可为躯干关键点,为前述实施例中提到的第二关键点。
以图片正中心为原点重新标定上述坐标,以用于后期三维转换。
设定人体上半身为参照,求出场景与人体的相对系数。
为了使姿势操控***保持不同场景中稳定的表现,即无论用户在镜头中任何方位或者离镜头多远,都能达到同样的操控效果,我们使用操纵光标与身体中心的相对位置。
通过相对系数与重新标定的手部坐标、身体中心坐标计算出手部相对于身体的新坐标。
保留新坐标与识别空间,即摄像头图像尺寸的X和Y比例。
在虚拟三维空间中生成需要投影操作空间,计算出观察点和接收操作物体的距离D,通过X、Y和D将视点坐标转为操作光标在三维空间中的坐标。
如存在虚拟操作平面,则取操作光标坐标的x和y值,代入透视投影和屏幕映射公式得到操作屏幕空间中的像素点。
可以应用到多个用户多个光标同时操作。
假设摄像机所采集的2D图像对应的第一2D坐标系中左下角为(0,0)且右上角为(cam w,cam h);
假设手部关键点在2D图像所对应的第一2D坐标系内的坐标为:(x 1,y 1);
假设躯干中心点在第一2D坐标系内的坐标为:(x t,y t);
假设2D图像的中心点在第一2D坐标系内的坐标为:(x i,y i)。
则存在转换参数如下:
所述转换参数:
Figure PCTCN2019092866-appb-000004
手部关键点转换到躯干所对应的第二2D坐标系内的转换函数可如下:
(x 3,y 3)=((x 1-x t)*K+x i,(y 1-y t)*S+y i)公式(6)。
若摄像机所采集的2D图像对应的第一2D坐标系中左下角为(0,0)且右下角为(cam w,cam h);
则手部关键点转换到躯干所对应的第二2D坐标系内的转换函数可如下:(x 3,y 3)=((x 1-x t)*K+x i,(y t-y 1)*S+y i)公式(6)。
综合之后,手部关键点转换到躯干所对应的第二2D坐标系内的转换函数可为:
(hand-torso)*(cam/torse)+cam-center;其中,hand表示手部关键点在第一
2D坐标系内的坐标;torso表示躯干关键点在第一2D坐标系内的坐标;cam-center为2D图像对应的第一2D坐标的中心坐标。
在归一化的处理过程中,可以引入缩放比例,所述缩放比例的取值范围可为1至3之间,也可以是1.5至2之间。
在三维虚拟空间内可以根据构建的三维虚拟空间得到如下坐标:
虚拟视点的坐标:(x c,y c,z c)
虚拟控制平面的坐标:(x j,y j,z j)
d的可为(x c,y c,z c)与(x j,y j,z j)之间距离。
通过归一化处理之后,将得到归一化后的第四2D坐标为:
(x 4,y 4)=[(x 1-x t)*cam w+0.5,0.5-(y 1-y t)*cam h]公式(7)。
而转换到虚拟三维空间内的3D坐标可为:
Figure PCTCN2019092866-appb-000005
如图7所示,本申请实施例提供了一种图像处理设备,包括:
存储器,用于存储信息;
处理器,与所述存储器连接,用于通过执行存储在所述存储器上的计算机可执行指令,能够实现前述一个或多个技术方案提供的图像处理方法,例如,如图1、图3及图4所示的方法中的一个或多个。
该存储器可为各种类型的存储器,可为随机存储器、只读存储器、闪存等。所述存储器可用于信息存储,例如,存储计算机可执行指令等。所述计算机可执行指令可为各种程序指令,例如,目标程序指令和/或源程序指令等。
所述处理器可为各种类型的处理器,例如,中央处理器、微处理器、数字信号处理器、可编程阵列、数字信号处理器、专用集成电路或图像处理器等。
所述处理器可以通过总线与所述存储器连接。所述总线可为集成电路总线等。
在一些实施例中,所述终端设备还可包括:通信接口,该通信接口可包括:网络接口、例如,局域网接口、收发天线等。所述通信接口同样与所述处理器连接,能够用于信息收发。
在一些实施例中,所述图像处理设备还包括摄像头,该摄像头可为2D摄像头,可以采集2D图像。
在一些实施例中,所述终端设备还包括人机交互接口,例如,所述人机交互接口可包括各种输入输出设备,例如,键盘、触摸屏等。
本申请实施例提供了一种计算机存储介质,所述计算机存储介质存储有计算机可执行代码;所述计算机可执行代码被执行后,能够实现前述一个或多个技术方案提供的图像处理方法,例如,如图1、图3及图4所示的方法中的一个或多个。
所述存储介质包括:移动存储设备、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。所述存储介质可为非瞬间存储介质。
本申请实施例提供一种计算机程序产品,所述程序产品包括计算机可执行指令;所述计算机可执行指令被执行后,能够实现前述任意实施提供的图像处理方法,例如,如图1、图3及图4所示的方法中的一个或多个。
在本申请所提供的几个实施例中,应该理解到,所揭露的设备和方法,可以通过其它的方式实现。以上所描述的设备实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,如:多个单元或组件可以结合,或可以集成到另一个***,或一些特征可以忽略,或不执行。另外,所显示或讨论的各组成部分相互之间的耦合、或直接耦合、或通信连接可以是通过一些接口,设备或单元的间接耦合或通信连接,可以是电性的、机械的或其它形式的。
上述作为分离部件说明的单元可以是、或也可以不是物理上分开的,作为单元显示的部件可以是、或也可以不是物理单元,即可以位于一个地方,也可以分布到多个网络单元上;可以根据实际的需要选择其中的部分或全部单元来实现本实施例方案的目的。
另外,在本申请各实施例中的各功能单元可以全部集成在一个处理模块中,也可以是各单元分别单独作为一个单元,也可以两个或两个以上单元集成在一个单元中;上述集成的单元既可以采用硬件的形式实现,也可以采用硬件加软件功能单元的形式实现。
本领域普通技术人员可以理解:实现上述方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成,前述的程序可以存储于一计算机可读取存储介质中,该程序在执行时,执行包括上述方法实施例的步骤;而前述的存储介质包括:移动存储设备、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。

Claims (31)

  1. 一种图像处理方法,包括:
    获取目标对象的2D图像;
    根据所述2D图像,获取第一关键点的第一2D坐标和第二关键点的第二2D坐标,其中,所述第一关键点为所述目标对象的第一局部在所述2D图像中的成像点;所述第二关键点为所述目标对象的第二局部在所述2D图像中的成像点;
    基于第一2D坐标及所述第二2D坐标,确定相对坐标,其中,所述相对坐标用于表征所述第一局部和所述第二局部之间的相对位置;
    将所述相对坐标投影到虚拟三维空间内并获得与所述相对坐标对应的3D坐标,其中,所述3D坐标用于控制受控设备上目标对象坐标变换。
  2. 根据权利要求1所述的方法,其中,
    所述第一2D坐标和所述第二2D坐标为位于第一2D坐标系内的2D坐标。
  3. 根据权利要求2所述的方法,其中,
    所述基于第一2D坐标及所述第二2D坐标,确定相对坐标,包括:
    根据所述第二2D坐标,构建第二2D坐标系;
    将所述第一2D坐标映射到所述第二2D坐标系,获得第三2D坐标;
    根据第三2D坐标确定所述相对坐标。
  4. 根据权利要求3所述的方法,其中,所述将所述第一2D坐标映射到所述第二2D坐标系,获得第三2D坐标,还包括:
    根据所述第一2D坐标系和第二2D坐标系,确定从所述第一2D坐标系映射到所述第二2D坐标系的转换参数;基于所述转换参数,将所述第一2D坐标映射到所述第二2D坐标系,获得第三2D坐标。
  5. 根据权利要求4所述的方法,其中,
    所述根据所述第一2D坐标系和第二2D坐标系,确定从第一2D坐标系映射到所述第二2D坐标系的转换参数,包括:确定所述2D图像在第一方向上的第一尺寸,确定所述第二局部在第一方向上的第二尺寸;
    确定所述第一尺寸及所述第二尺寸之间的第一比值;
    根据所述第一比值确定所述转换参数。
  6. 根据权利要求5所述的方法,其中,所述根据所述第一比值确定所述转换参数,还包括:
    确定所述2D图像在第二方向上的第三尺寸,确定所述第二局部在第二方向上的第四尺寸,其中,所述第二方向垂直于所述第一方向;
    确定所述第三尺寸与所述第四尺寸之间的第二比值;
    结合所述第一比值和第二比值,确定所述转换参数。
  7. 根据权利要求4至6任一项所述的方法,其中,
    所述基于所述转换参数,将所述第一2D坐标映射到所述第二2D坐标系,获得第三2D坐标,包括:
    基于所述转换参数及所述第一2D坐标系的中心坐标,将所述第一2D坐标映射到所述第二2D坐标系,获得第三2D坐标。
  8. 根据权利要求3至7任一项所述的方法,其中,
    所述将所述相对坐标投影到虚拟三维空间内并获得与所述相对坐标对应的3D坐标,包括:
    对所述第三2D坐标进行归一化处理得到第四2D坐标;
    结合所述第四2D坐标及所述虚拟三维空间内虚拟视点到虚拟成像平面内的距离,确定所述第一关键点投影到所述虚拟三维空间内的3D坐标。
  9. 根据权利要求8所述的方法,其中,
    所述对所述第三2D坐标进行归一化处理得到第四2D坐标,包括:
    结合所述第二局部的尺寸及所述第二2D坐标系的中心坐标,对所述第三2D坐标进行归一化处理得到所述第四2D坐标。
  10. 根据权利要求8或9所述的方法,其中,所述结合所述第四2D坐标及所述虚拟三维空间内虚拟视点到虚拟成像平面内的距离,确定所述第一关键点投影到所述虚拟三维空间内的3D坐标,包括:
    结合所述第四2D坐标、所述虚拟三维空间内虚拟视点到虚拟成像平面内的距离及缩放比例,确定所述第一关键点投影到所述虚拟三维空间内的3D坐标。
  11. 根据权利要求1至10任一项所述的方法,其中,所述方法还包括:
    确定所述目标对象的数目M及每个目标对象在所述2D图像的2D图像区域,所述M为大于1的整数;
    所述根据所述2D图像,获取第一关键点的第一2D坐标和第二关键点的第二2D坐标,包括:
    根据所述2D图像区域,获得每一个所述目标对象的所述第一关键点的第一2D坐标和所述第二关键点的第二2D坐标,以获得M组所述3D坐标。
  12. 根据权利要求1至11任一项所述的方法,其中,所述方法还包括:
    在第一显示区域内显示基于所述3D坐标的控制效果;
    在与所述第一显示区域对应的第二显示区域内显示所述2D图像。
  13. 根据权利要求12所述的方法,其中,所述在与所述第一显示区域对应的第二显示区域内显示所述2D图像,包括:
    根据所述第一2D坐标,在所述第二显示区域内显示的所述2D图像上显示所述第一关键点的第一指代图形,所述第一指代图形是叠加显示在所述第一关键点上的图像;
    和/或,
    根据所述第二2D坐标,在所述第二显示区域内显示的所述2D图像上显示所述第二关键点的第二指代图形,所述第二指代图形是叠加显示在所述第二关键点上的图像。
  14. 根据权利要求1至13任一项所述的方法,所述方法还包括:
    基于前后两个时刻在虚拟三维空间内三个坐标轴上的变化量或变化率,控制受控设备上目标对象坐标变换。
  15. 一种图像处理装置,包括:
    第一获取模块,配置为获取目标对象的2D图像;
    第二获取模块,配置为根据所述2D图像,获取第一关键点的第一2D坐标和第二关键点的第二2D坐标,其中,所述第一关键点为所述目标对象的第一局部在所述2D图像中的成像点;所述第二关键点为所述目标对象的第二局部在所述2D图像中的成像点;
    第一确定模块,配置为基于第一2D坐标及所述第二2D坐标,确定相对坐标,其中,所述相对坐标用于表征所述第一局部和所述第二局部之间的相对位置;
    投影模块,配置为将所述相对坐标投影到虚拟三维空间内并获得与所述相对坐标对应的3D坐标,其中,所述3D坐标用于控制受控设备上目标对象坐标变换。
  16. 根据权利要求15所述的装置,其中,
    所述第一2D坐标和所述第二2D坐标为位于第一2D坐标系内的2D坐标。
  17. 根据权利要求16所述的装置,其中,
    所述第一确定模块,配置为根据所述第二2D坐标,构建第二2D坐标系;将所述第一2D坐标映射到所述第二2D坐标系,获得第三2D坐标。
  18. 根据权利要求17所述的装置,其中,
    所述第一确定模块,还配置为根据所述第一2D坐标系和第二2D坐标系,确定从所述第一2D坐标系映射到所述第二2D坐标系的转换参数,基于所述转换参数,将所述第一2D坐标映射到所述第二2D坐标系,获得第三2D坐标。
  19. 根据权利要求18所述的装置,其中,
    所述第一确定模块,配置为确定所述2D图像在第一方向上的第一尺寸,确定所述第二局部在第一方向上的第二尺寸;确定所述第一尺寸及所述第二尺寸之间的第一比值;根据所述第一比值确定所述转换参数。
  20. 根据权利要求19所述的装置,其中,
    所述第一确定模块,还配置为确定所述2D图像在第二方向上的第三尺寸,确定所述第二局部在第二方向上的第四尺寸,其中,所述第二方向垂直于所述第一方向;根据所述第三尺寸与所述第四尺寸之间的第二比值;结合所述第一比值和第二比值,确定所述转换参数。
  21. 根据权利要求18至20中任一项所述的装置,其中,
    所述第一确定模块,配置为基于所述转换参数及所述第一2D坐标系的中心坐标,将所述第一2D坐标映射到所述第二2D坐标系,获得第三2D坐标。
  22. 根据权利要求18至21任一项所述的装置,其中,
    所述投影模块,配置为对所述第三2D坐标进行归一化处理得到第四2D坐标;结合所述第四2D坐标及所述虚拟三维空间内虚拟视点到虚拟成像平面内的距离,确定所述第一关键点投影到所述虚拟三维空间内的3D坐标。
  23. 根据权利要求22所述的装置,其中,
    所述投影模块,配置为结合所述第二局部的尺寸及所述第二2D坐标系的中心坐标,对所述第三2D坐标进行归一化处理得到所述第四2D坐标。
  24. 根据权利要求22或23所述的装置,其中,
    所述投影模块,配置为结合所述第四2D坐标、所述虚拟三维空间内虚拟视点到虚拟成像平面内的距离及缩放比例,确定所述第一关键点投影到所述虚拟三维空间内的3D坐标。
  25. 根据权利要求15至24任一项所述的装置,其中,所述装置还包括:
    第二确定模块,配置为确定所述2D图像上所述目标对象的数目M及所述目标对象在所述2D图像上的2D图像区域;
    所述第二获取模块,配置为根据所述2D图像区域,获得每一个所述目标对象的所述第一关键点的第一2D坐标和所述第二关键点的第二2D坐标,以获得M组所述3D坐标。
  26. 根据权利要求15至25任一项所述的装置,其中,所述装置包括:
    第一显示模块,配置为在第一显示区域内显示基于所述3D坐标的控制效果;
    第二显示模块,配置为在与所述第一显示区域对应的第二显示区域内显示所述2D图像。
  27. 根据权利要求26所述的装置,其中,所述第二显示模块,还配置为根据所述第一2D坐标,在所述第二显示区域内显示的所述2D图像上显示所述第一关键点的第一指代图形;和/或,根据所述第二2D坐标,在所述第二显示区域内显示的所述2D图像上显示所述第二关键点的第二指代图形。
  28. 根据权利要求15至17任一项所述的装置,其中,所述装置还包括:
    控制模块,配置为基于前后两个时刻在虚拟三维空间内三个坐标轴上的变化量或变化率,控制受控设备上目标对象坐标变换。
  29. 一种电子设备,其中,包括:
    存储器;
    处理器,与所述存储器连接,用于通过执行存储在所述存储器上的计算机可执行指令实现权利要求1至14任一项提供的方法。
  30. 一种计算机存储介质,所述计算机存储介质存储有计算机可执行指令;所述计算机可执行指令被处理器执行后,能够实现权利要求1至14任一项提供的方法。
  31. 一种计算机程序,其中,所述计算机程序被处理器执行后,能够实现权利要求1至14任一项提供的方法。
PCT/CN2019/092866 2018-12-21 2019-06-25 图像处理方法及装置、电子设备及存储介质 WO2020124976A1 (zh)

Priority Applications (4)

Application Number Priority Date Filing Date Title
SG11202010312QA SG11202010312QA (en) 2018-12-21 2019-06-25 Image processing method and apparatus, electronic device and storage medium
KR1020207031294A KR102461232B1 (ko) 2018-12-21 2019-06-25 화상 처리 방법 및 장치, 전자 디바이스, 및 저장 매체
JP2020561756A JP7026825B2 (ja) 2018-12-21 2019-06-25 画像処理方法及び装置、電子機器並びに記憶媒体
US17/038,273 US20210012530A1 (en) 2018-12-21 2020-09-30 Image processing method and apparatus, electronic device and storage medium

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201811572680.9 2018-12-21
CN201811572680.9A CN111353930B (zh) 2018-12-21 2018-12-21 数据处理方法及装置、电子设备及存储介质

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US17/038,273 Continuation US20210012530A1 (en) 2018-12-21 2020-09-30 Image processing method and apparatus, electronic device and storage medium

Publications (1)

Publication Number Publication Date
WO2020124976A1 true WO2020124976A1 (zh) 2020-06-25

Family

ID=71100233

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/092866 WO2020124976A1 (zh) 2018-12-21 2019-06-25 图像处理方法及装置、电子设备及存储介质

Country Status (7)

Country Link
US (1) US20210012530A1 (zh)
JP (1) JP7026825B2 (zh)
KR (1) KR102461232B1 (zh)
CN (1) CN111353930B (zh)
SG (1) SG11202010312QA (zh)
TW (1) TWI701941B (zh)
WO (1) WO2020124976A1 (zh)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109675315B (zh) * 2018-12-27 2021-01-26 网易(杭州)网络有限公司 游戏角色模型的生成方法、装置、处理器及终端
KR20220018760A (ko) 2020-08-07 2022-02-15 삼성전자주식회사 단말에 3d 캐릭터 이미지를 제공하는 엣지 데이터 네트워크 및 그 동작 방법
CN111985384A (zh) * 2020-08-14 2020-11-24 深圳地平线机器人科技有限公司 获取脸部关键点的3d坐标及3d脸部模型的方法和装置
CN111973984B (zh) * 2020-09-10 2024-07-09 网易(杭州)网络有限公司 虚拟场景的坐标控制方法、装置、电子设备及存储介质
CN112465890A (zh) * 2020-11-24 2021-03-09 深圳市商汤科技有限公司 深度检测方法、装置、电子设备和计算机可读存储介质
US11461975B2 (en) * 2020-12-03 2022-10-04 Realsee (Beijing) Technology Co., Ltd. Method and apparatus for generating guidance among viewpoints in a scene
TWI793764B (zh) * 2021-09-14 2023-02-21 大陸商北京集創北方科技股份有限公司 屏下光學指紋鏡頭位置補償方法、屏下光學指紋採集裝置及資訊處理裝置
CN114849238B (zh) * 2022-06-02 2023-04-07 北京新唐思创教育科技有限公司 动画执行方法、装置、设备及介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120275722A1 (en) * 2012-06-03 2012-11-01 Tianzhi Yang Evaluating mapping between spatial point sets
CN104134235A (zh) * 2014-07-25 2014-11-05 深圳超多维光电子有限公司 真实空间和虚拟空间的融合方法和融合***
CN104240289A (zh) * 2014-07-16 2014-12-24 崔岩 一种基于单个相机的三维数字化重建方法及***
CN104778720A (zh) * 2015-05-07 2015-07-15 东南大学 一种基于空间不变特性的快速体积测量方法
CN106559660A (zh) * 2015-09-29 2017-04-05 杭州海康威视数字技术股份有限公司 2d视频中展示目标3d信息的方法及装置

Family Cites Families (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6973202B2 (en) * 1998-10-23 2005-12-06 Varian Medical Systems Technologies, Inc. Single-camera tracking of an object
US8249334B2 (en) * 2006-05-11 2012-08-21 Primesense Ltd. Modeling of humanoid forms from depth maps
NO327279B1 (no) * 2007-05-22 2009-06-02 Metaio Gmbh Kamerapositurestimeringsanordning og- fremgangsmate for foroket virkelighetsavbildning
US8233206B2 (en) * 2008-03-18 2012-07-31 Zebra Imaging, Inc. User interaction with holographic images
US8487871B2 (en) * 2009-06-01 2013-07-16 Microsoft Corporation Virtual desktop coordinate transformation
US20120192088A1 (en) * 2011-01-20 2012-07-26 Avaya Inc. Method and system for physical mapping in a virtual world
US9032334B2 (en) * 2011-12-21 2015-05-12 Lg Electronics Inc. Electronic device having 3-dimensional display and method of operating thereof
US20140181759A1 (en) * 2012-12-20 2014-06-26 Hyundai Motor Company Control system and method using hand gesture for vehicle
KR102068048B1 (ko) * 2013-05-13 2020-01-20 삼성전자주식회사 3차원 영상 제공 시스템 및 방법
US20220036646A1 (en) * 2017-11-30 2022-02-03 Shenzhen Keya Medical Technology Corporation Methods and devices for performing three-dimensional blood vessel reconstruction using angiographic image
CN108648280B (zh) * 2018-04-25 2023-03-31 深圳市商汤科技有限公司 虚拟角色驱动方法及装置、电子设备和存储介质
CN109191507B (zh) * 2018-08-24 2019-11-05 北京字节跳动网络技术有限公司 三维人脸图像重建方法、装置和计算机可读存储介质
CN110909580B (zh) * 2018-09-18 2022-06-10 北京市商汤科技开发有限公司 数据处理方法及装置、电子设备及存储介质
CN110248148B (zh) * 2018-09-25 2022-04-15 浙江大华技术股份有限公司 一种确定定位参数的方法及装置
CN111340932A (zh) * 2018-12-18 2020-06-26 富士通株式会社 图像处理方法以及信息处理设备
CN111949111B (zh) * 2019-05-14 2022-04-26 Oppo广东移动通信有限公司 交互控制方法、装置、电子设备及存储介质

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120275722A1 (en) * 2012-06-03 2012-11-01 Tianzhi Yang Evaluating mapping between spatial point sets
CN104240289A (zh) * 2014-07-16 2014-12-24 崔岩 一种基于单个相机的三维数字化重建方法及***
CN104134235A (zh) * 2014-07-25 2014-11-05 深圳超多维光电子有限公司 真实空间和虚拟空间的融合方法和融合***
CN104778720A (zh) * 2015-05-07 2015-07-15 东南大学 一种基于空间不变特性的快速体积测量方法
CN106559660A (zh) * 2015-09-29 2017-04-05 杭州海康威视数字技术股份有限公司 2d视频中展示目标3d信息的方法及装置

Also Published As

Publication number Publication date
SG11202010312QA (en) 2020-11-27
JP2021520577A (ja) 2021-08-19
KR20200138349A (ko) 2020-12-09
TW202025719A (zh) 2020-07-01
TWI701941B (zh) 2020-08-11
CN111353930B (zh) 2022-05-24
JP7026825B2 (ja) 2022-02-28
KR102461232B1 (ko) 2022-10-28
US20210012530A1 (en) 2021-01-14
CN111353930A (zh) 2020-06-30

Similar Documents

Publication Publication Date Title
WO2020124976A1 (zh) 图像处理方法及装置、电子设备及存储介质
US8933886B2 (en) Instruction input device, instruction input method, program, recording medium, and integrated circuit
US9342142B2 (en) Display control apparatus, display control method, and display control program
CN116324677A (zh) 响应于检测到的手势的非接触式照片捕获
US20150339512A1 (en) Method for correcting user's gaze direction in image, machine-readable storage medium and communication terminal
WO2021143282A1 (zh) 三维人脸模型生成方法、装置、计算机设备及存储介质
KR20170031733A (ko) 디스플레이를 위한 캡처된 이미지의 시각을 조정하는 기술들
JPWO2014141504A1 (ja) 3次元ユーザインタフェース装置及び3次元操作処理方法
CN108090463B (zh) 对象控制方法、装置、存储介质和计算机设备
JPWO2005119591A1 (ja) 表示制御方法および装置、プログラム、並びに携帯機器
CN115917474A (zh) 在三维环境中呈现化身
US10607069B2 (en) Determining a pointing vector for gestures performed before a depth camera
US11138743B2 (en) Method and apparatus for a synchronous motion of a human body model
KR101256046B1 (ko) 공간 제스처 인식을 위한 신체 트래킹 방법 및 시스템
US20130187852A1 (en) Three-dimensional image processing apparatus, three-dimensional image processing method, and program
CN108764135B (zh) 图像生成方法、装置,及电子设备
CN106200911A (zh) 一种基于双摄像头的体感控制方法、移动终端及***
US10345595B2 (en) Head mounted device with eye tracking and control method thereof
CN110858095A (zh) 可由头部操控的电子装置与其操作方法
CN114201028B (zh) 扩增实境***与其锚定显示虚拟对象的方法
CN109685881B (zh) 一种体绘制方法、装置及智能设备
CN114764295A (zh) 立体场景切换方法、装置、终端及存储介质
CN114093020A (zh) 动作捕捉方法、装置、电子设备及存储介质
US11380071B2 (en) Augmented reality system and display method for anchoring virtual object thereof
US20230343052A1 (en) Information processing apparatus, information processing method, and program

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

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 20207031294

Country of ref document: KR

Kind code of ref document: A

ENP Entry into the national phase

Ref document number: 2020561756

Country of ref document: JP

Kind code of ref document: A

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19900884

Country of ref document: EP

Kind code of ref document: A1