CN107506162B - Coordinate mapping method, computer-readable storage medium, and projector - Google Patents

Coordinate mapping method, computer-readable storage medium, and projector Download PDF

Info

Publication number
CN107506162B
CN107506162B CN201710758476.5A CN201710758476A CN107506162B CN 107506162 B CN107506162 B CN 107506162B CN 201710758476 A CN201710758476 A CN 201710758476A CN 107506162 B CN107506162 B CN 107506162B
Authority
CN
China
Prior art keywords
coordinate
axis
reference coordinates
coordinate system
straight line
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.)
Active
Application number
CN201710758476.5A
Other languages
Chinese (zh)
Other versions
CN107506162A (en
Inventor
陈维亮
徐强
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Goertek Techology Co Ltd
Original Assignee
Goertek Techology 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 Goertek Techology Co Ltd filed Critical Goertek Techology Co Ltd
Priority to CN201710758476.5A priority Critical patent/CN107506162B/en
Publication of CN107506162A publication Critical patent/CN107506162A/en
Application granted granted Critical
Publication of CN107506162B publication Critical patent/CN107506162B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/14Digital output to display device ; Cooperation and interconnection of the display device with other functional units
    • G06F3/1454Digital output to display device ; Cooperation and interconnection of the display device with other functional units involving copying of the display data of a local workstation or window to a remote workstation or window so that an actual copy of the data is displayed simultaneously on two or more displays, e.g. teledisplay
    • G06F3/1462Digital output to display device ; Cooperation and interconnection of the display device with other functional units involving copying of the display data of a local workstation or window to a remote workstation or window so that an actual copy of the data is displayed simultaneously on two or more displays, e.g. teledisplay with means for detecting differences between the image stored in the host and the images displayed on the remote displays
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/50Depth or shape recovery

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The embodiment of the invention provides a coordinate mapping method, a computer readable storage medium and a projector, which are applied to the technical field of computers and can ensure the accuracy of coordinate mapping. The method comprises the following steps: responding to an operation triggered by a user on a projection image, and acquiring a first coordinate corresponding to a gesture point of the operation in a first coordinate system corresponding to a depth image; determining the distance from the first coordinate to a coordinate axis mapping straight line obtained in advance, wherein the coordinate axis mapping straight line is a straight line mapped by a coordinate axis of a second coordinate system corresponding to the projected image in the first coordinate system corresponding to the depth image; and determining a second coordinate of the first coordinate mapped in the second coordinate system according to the distance and a coordinate ratio between the first coordinate system and the second coordinate system obtained in advance.

Description

Coordinate mapping method, computer-readable storage medium, and projector
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a coordinate mapping method, a computer-readable storage medium, and a projector.
Background
With the development of the field of artificial intelligence, interactive intelligent projectors are gradually widely used. The interactive intelligent projector is used for projecting an image of an operation interface of the electronic equipment to a certain carrier, and mapping position coordinates of a user gesture point in a projected image according to a depth-of-field image with user gesture point information, so that a user can complete interactive operation based on the projection carrier instead of interactive operation based on interactive equipment such as an electronic display screen and a mouse.
In general, when the projected image and the depth-of-field image are completely overlapped and the two image pixels correspond to each other, the projector may map the position coordinates of the user gesture point in the projected image according to the depth-of-field image with the user gesture point information. However, in actual use, the movement of the projector may cause the two images to have a deviation, and further, the two images cannot be overlapped, so that the mapping result is inaccurate.
Disclosure of Invention
Embodiments of the present invention provide a coordinate mapping method, a computer-readable storage medium, and a projector, so as to ensure accuracy of coordinate mapping.
The coordinate mapping method provided by the embodiment of the invention comprises the following steps:
responding to an operation triggered by a user on a projection image, and acquiring a first coordinate corresponding to a gesture point of the operation in a first coordinate system corresponding to a depth image;
determining the distance from the first coordinate to a coordinate axis mapping straight line obtained in advance, wherein the coordinate axis mapping straight line is a straight line mapped by a coordinate axis of a second coordinate system corresponding to the projected image in the first coordinate system corresponding to the depth image;
and determining a second coordinate of the first coordinate mapped in the second coordinate system according to the distance and a coordinate ratio between the first coordinate system and the second coordinate system obtained in advance.
In an alternative embodiment, the coordinate ratio includes an X-axis direction coordinate ratio and a Y-axis direction coordinate ratio, and the method further includes:
marking N first reference coordinates in the second coordinate system, wherein the N first reference coordinates are not positioned on the same coordinate axis, and N is greater than or equal to 3;
determining N second reference coordinates corresponding to the N first reference coordinates in the first coordinate system;
determining the coordinate proportion in the X-axis direction according to the ratio of the X-axis distance between two first reference coordinates in the N first reference coordinates to the X-axis distance between two corresponding second reference coordinates in the N second reference coordinates;
and determining the coordinate proportion in the Y-axis direction according to the ratio of the Y-axis distance between two first reference coordinates in the N first reference coordinates to the Y-axis distance between two corresponding second reference coordinates in the N second reference coordinates.
In an optional embodiment, said marking N first reference coordinates in said second coordinate system comprises:
and respectively marking a first reference coordinate on an X axis, a Y axis and a coordinate origin in the second coordinate system.
In an optional embodiment, the determining the N first reference coordinates is followed by N second reference coordinates corresponding to the first coordinate system, further comprises:
determining a first linear equation of the X axis of the second coordinate system mapped in the first coordinate system according to two second reference coordinates in the N second reference coordinates, wherein the two second reference coordinates correspond to two first reference coordinates on the X axis in the second coordinate system;
determining a second linear equation mapped by the Y axis of the second coordinate system in the first coordinate system according to the other two second reference coordinates in the N second reference coordinates, wherein the other two second reference coordinates correspond to the two first reference coordinates on the Y axis in the second coordinate system; the mapping straight line comprises straight lines corresponding to the first straight line equation and the second straight line equation respectively.
In an optional embodiment, the determining a first linear equation of the first coordinate system mapped by the X-axis of the second coordinate system according to two of the N second reference coordinates comprises:
determining the first linear equation k according to the following formula1
Figure BDA0001392717320000031
Wherein X1 is the X-axis coordinate value of one of the two second reference coordinates, Y1 is the Y-axis coordinate value of the one second reference coordinate, X2 is the X-axis coordinate value of the other one of the two second reference coordinates, and Y2 is the Y-axis coordinate value of the other one of the two second reference coordinates.
In an alternative embodiment, the determining the second linear equation of the mapping of the Y-axis of the second coordinate system in the first coordinate system according to the other two second reference coordinates of the N second reference coordinates includes:
determining the second linear equation k according to the following formula2
Figure BDA0001392717320000032
Wherein X1 is the X-axis coordinate value of one of the other two second reference coordinates, Y1 is the Y-axis coordinate value of the second reference coordinate, X3 is the X-axis coordinate value of the other one of the other two second reference coordinates, and Y3 is the Y-axis coordinate value of the other one of the other two second reference coordinates.
In an optional embodiment, the determining, according to the distance and a coordinate ratio between the first coordinate system and the second coordinate system obtained in advance, a second coordinate to which the first coordinate is mapped in the second coordinate system includes:
determining a second coordinate (x, y) of the first coordinate mapped in the second coordinate system according to the following formula:
the coordinate proportion in the X-axis direction is equal to the distance/X between the first coordinate and a straight line corresponding to the first straight line equation;
and the Y-axis direction coordinate proportion is the distance/Y between the first coordinate and the straight line corresponding to the second straight line equation.
In an alternative embodiment, the distance between the first coordinate and the line corresponding to the first line equation is:
Figure BDA0001392717320000041
wherein X4, Y4 are the X-axis, Y-axis coordinates of the first coordinate, respectively;
the distance between the first coordinate and a straight line corresponding to the second straight line equation is as follows:
Figure BDA0001392717320000042
the invention provides a coordinate mapping device, comprising:
the acquisition module is used for responding to the operation triggered by a user on the projection image, and acquiring a first coordinate corresponding to the gesture point of the operation in a first coordinate system corresponding to the depth image;
the first determining module is used for determining the distance from the first coordinate to a coordinate axis mapping straight line obtained in advance, wherein the coordinate axis mapping straight line is a straight line of a coordinate axis of a second coordinate system corresponding to the projected image mapped in the first coordinate system corresponding to the depth image;
and the second determining module is used for determining a second coordinate mapped in the second coordinate system by the first coordinate according to the distance and a coordinate ratio between the first coordinate system and the second coordinate system obtained in advance.
In an alternative embodiment, the coordinate ratio includes an X-axis direction coordinate ratio and a Y-axis direction coordinate ratio, and the apparatus further includes a third determination module including:
the marking submodule is used for marking N first reference coordinates in the second coordinate system, the N first reference coordinates are not located on the same coordinate axis, and N is larger than or equal to 3;
the first determining submodule is used for determining N second reference coordinates corresponding to the N first reference coordinates in the first coordinate system;
the second determining submodule is used for determining the coordinate proportion in the X-axis direction according to the ratio of the X-axis distance between two first reference coordinates in the N first reference coordinates to the X-axis distance between two corresponding second reference coordinates in the N second reference coordinates;
and the third determining submodule is used for determining the proportion of the coordinate in the Y-axis direction according to the ratio of the Y-axis distance between two first reference coordinates in the N first reference coordinates to the Y-axis distance between two corresponding second reference coordinates in the N second reference coordinates.
In an alternative embodiment, the tagging submodule is specifically configured to:
and respectively marking a first reference coordinate on an X axis, a Y axis and a coordinate origin in the second coordinate system.
In an optional embodiment, the apparatus further comprises a fourth determining module, and the fourth determining module comprises:
a fourth determining submodule, configured to determine, after the first determining submodule is triggered, a first linear equation mapped in the first coordinate system by the X axis of the second coordinate system according to two second reference coordinates in the N second reference coordinates, where the two second reference coordinates correspond to two first reference coordinates on the X axis of the second coordinate system;
a fifth determining submodule, configured to determine, after triggering the first determining submodule, a second linear equation mapped in the first coordinate system by the Y axis of the second coordinate system according to another two second reference coordinates in the N second reference coordinates, where the another two second reference coordinates correspond to two first reference coordinates on the Y axis of the second coordinate system;
the mapping straight line comprises straight lines corresponding to the first straight line equation and the second straight line equation respectively.
In an optional embodiment, the fourth determining sub-module is specifically configured to:
determining the first linear equation k according to the following formula1
Figure BDA0001392717320000051
Wherein X1 is the X-axis coordinate value of one of the two second reference coordinates, Y1 is the Y-axis coordinate value of the one second reference coordinate, X2 is the X-axis coordinate value of the other one of the two second reference coordinates, and Y2 is the Y-axis coordinate value of the other one of the two second reference coordinates.
In an optional embodiment, the fifth determining sub-module is specifically configured to:
determining the second linear equation k according to the following formula2
Figure BDA0001392717320000052
Wherein X1 is the X-axis coordinate value of one of the other two second reference coordinates, Y1 is the Y-axis coordinate value of the second reference coordinate, X3 is the X-axis coordinate value of the other one of the other two second reference coordinates, and Y3 is the Y-axis coordinate value of the other one of the other two second reference coordinates.
In an optional embodiment, the second determining module is specifically configured to:
determining a second coordinate (x, y) of the first coordinate mapped in the second coordinate system according to the following formula:
the coordinate proportion in the X-axis direction is equal to the distance/X between the first coordinate and a straight line corresponding to the first straight line equation;
and the Y-axis direction coordinate proportion is the distance/Y between the first coordinate and the straight line corresponding to the second straight line equation.
In an alternative embodiment, the distance between the first coordinate and the line corresponding to the first line equation is:
Figure BDA0001392717320000061
wherein X4, Y4 are the X-axis, Y-axis coordinates of the first coordinate, respectively;
the distance between the first coordinate and a straight line corresponding to the second straight line equation is as follows:
Figure BDA0001392717320000062
the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used for enabling the computer to execute the coordinate mapping method provided by the embodiment of the invention.
The embodiment of the invention provides a projector, which comprises: the coordinate mapping system comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the processor executes the program to realize the coordinate mapping method provided by the embodiment of the invention.
According to the coordinate mapping method, the computer-readable storage medium and the projector provided by the embodiment of the invention, the first coordinate corresponding to the gesture point triggered by the user in the first coordinate system is obtained, the distance from the first coordinate to the coordinate axis mapping straight line is calculated, and the second coordinate is obtained according to the distance and the preset coordinate ratio between the first coordinate system and the second coordinate system. The coordinate axis mapping straight line is a straight line corresponding to the coordinate axis of the second coordinate system, so that the distance is a distance value from the first coordinate to the coordinate axis of the second coordinate system in the first coordinate system, and the distance is mapped to a numerical value corresponding to the second coordinate system according to a coordinate proportion acquired in advance, so that the second coordinate can be acquired. Therefore, when the projection image and the depth image are not overlapped, the first coordinate can be mapped to the second coordinate according to the proportional relation, and the accuracy of coordinate mapping is further ensured.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and those skilled in the art can also obtain other drawings according to the drawings without creative efforts.
Fig. 1 is a flowchart of a coordinate mapping method according to an embodiment of the present invention;
FIG. 2 is another flowchart of a coordinate mapping method according to an embodiment of the present invention;
fig. 3 is a schematic diagram of an optional position of a first reference coordinate of the coordinate mapping method according to the embodiment of the present invention;
FIG. 4 is a flowchart of a coordinate mapping method according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a coordinate mapping apparatus according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The terminology used in the embodiments of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in the examples of the present invention and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, and "a" and "an" generally include at least two, but do not exclude at least one, unless the context clearly dictates otherwise.
It should be understood that the term "and/or" as used herein is merely one type of association that describes an associated object, meaning that three relationships may exist, e.g., a and/or B may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" herein generally indicates that the former and latter related objects are in an "or" relationship.
It should be understood that although the terms first, second, third, etc. may be used to describe XXX in embodiments of the present invention, these XXX should not be limited to these terms. These terms are used only to distinguish XXX. For example, a first XXX may also be referred to as a second XXX, and similarly, a second XXX may also be referred to as a first XXX, without departing from the scope of embodiments of the present invention.
The words "if", as used herein, may be interpreted as "at … …" or "at … …" or "in response to a determination" or "in response to a detection", depending on the context. Similarly, the phrases "if determined" or "if detected (a stated condition or event)" may be interpreted as "when determined" or "in response to a determination" or "when detected (a stated condition or event)" or "in response to a detection (a stated condition or event)", depending on the context.
It is also noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a good or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such good or system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a commodity or system that includes the element.
It is further worth noting that the order between the steps in the embodiments of the present invention may be adjusted, and is not necessarily performed in the order illustrated below.
The embodiment of the invention provides a coordinate mapping method, which is applied to a coordinate mapping device, wherein the coordinate mapping device can be coordinate mapping software and can also be a functional plug-in of related software. Specifically, the execution subject of the coordinate mapping method may be a processor on the interactive intelligent projector, and of course, may also be a processor in communication with the intelligent projector.
As shown in fig. 1, the coordinate mapping method provided in the embodiment of the present invention includes the following steps:
s101: and responding to the operation triggered by the user on the projection image, and acquiring a first coordinate corresponding to the gesture point of the operation in a first coordinate system corresponding to the depth image.
It will be appreciated that the projected image may be an image projected by a projector onto the plane of a pre-defined carrier, which may be a table, a wall, air, etc. Specifically, the content of the projected image may be an operation interface of a mobile phone or an operation interface of a computer, or may be an operation interface of an application program. Specifically, in an application scenario, the projector projects an operation interface of the ordering application program onto a desktop, the operation interface on the desktop is a projected image, and a user can order based on the projected image. In the application scenario, if the user operates the dish a, that is, selects the dish a, the coordinate of the dish a in the first coordinate system is the first coordinate. Optionally, the coordinate corresponding to the dish a is a coordinate of a reference point in an area defined by the dish a in the projection image, and specifically, the reference point may be a central point of the area, which is not limited to this.
Optionally, the operation may specifically be a single click, a double click, a long press, a move, and the like.
It can be understood that, a user touches the carrier plane to contact the carrier plane through a finger to operate an object such as an icon in a projection image projected on the carrier plane, and this embodiment defines a central point of a contact area between the finger and the carrier plane during operation as a gesture point. In practice, the gesture point may be determined by a depth image, which is specifically described in the following embodiments.
In practical application, the projector projects an operation interface of the electronic device communicating with the projector onto a plane of a preset carrier to form a projected image, and a user can use a finger to operate on the plane of the carrier carrying the projected image, for example, the user moves a certain icon in the projected image through the finger, selects a certain icon in the projected image, and the like. At this time, the projector collects the distance from the preset point to each preset collection point in the depth image collection area on the carrier plane, that is, the depth image records the coordinate of each collection point in the first coordinate system corresponding to the depth image and also records the distance from each collection point to the preset point. It can be understood that, when the user operates the projection image with a finger, the distance between the collection point in the region where the finger is located and the preset point is necessarily shorter than the distance between other collection points and the preset point, and therefore, the projector can determine the finger region according to the depth image. It will be further appreciated that, typically, the user uses the finger pad at the tip of the finger to contact the carrier plane for operation, and therefore, in the determined finger region, the region close to the tip of the finger is the contact region of the finger and the carrier plane, and a gesture point can be selected from the contact region. Optionally, a center point of the contact area is determined as a gesture point operated by the user. Therefore, the projector can determine the gesture point operated by the user through the distance information, namely the depth information, in the depth image, and further determine the first coordinate corresponding to the gesture point.
Optionally, if the upper left corner of the depth image is taken as the origin of coordinates, the longitudinal coordinates of each acquisition point in the contact area close to the fingertip, that is, the Y-axis coordinates, are smaller in coordinate value, so that the longitudinal direction of each acquisition point in the finger area in the first coordinate system can be determined; of course, the fingertip of the finger may also be recognized based on existing image recognition techniques to determine the contact area.
Preferably, the depth image acquisition area in the above embodiments is greater than or equal to the area defined by the projection image.
S102: and determining the distance from the first coordinate to a coordinate axis mapping straight line obtained in advance, wherein the coordinate axis mapping straight line is a straight line mapped by the coordinate axis of the second coordinate system corresponding to the projected image in the first coordinate system corresponding to the depth image.
The distance may be a distance in the first coordinate system.
It can be understood that the distance from the first coordinate to the coordinate axis mapping straight line is a distance from a point to a straight line, and therefore, the distance can be obtained according to a distance equation from a point to a straight line.
S103: and determining a second coordinate of the first coordinate mapped in the second coordinate system according to the distance and a coordinate ratio between the first coordinate system and the second coordinate system obtained in advance.
According to the coordinate mapping method provided by the embodiment of the invention, the first coordinate corresponding to the gesture point operated by the user in the first coordinate system is firstly obtained, and the distance between the first coordinate and the coordinate axis mapping straight line in the first coordinate system is mapped into the distance value of the second coordinate system based on the coordinate proportion, so that the second coordinate is obtained. According to the embodiment of the invention, the mapping is carried out through the coordinate proportion, so that the accuracy of the mapping result can be ensured.
The following describes the present embodiment by referring to an optional application scenario.
The projector is communicated with the smart phone, and projects an operation interface of the catering application in the smart phone onto the desktop to form a projection image. Simultaneously, the projector collects depth images. When a user operates the projection image on the desktop through fingers, the first coordinate of the gesture point of the user on the desktop is obtained according to the distance information in the depth image. The first coordinate is a coordinate in a first coordinate system corresponding to the depth image, and the first coordinate is actually required to be based on a coordinate in a second coordinate system corresponding to the projection image in the process of executing the operation, so that the first coordinate is required to be mapped to the coordinate in the second coordinate system corresponding to the projection image under the condition that the collection point of the depth collection area corresponding to the depth image is not in one-to-one correspondence with the pixel point in the projection image, and further, the coordinate mapping method in the embodiment of the present invention is required to be used for mapping.
Specifically, a linear equation of two coordinate axes of a second coordinate system in a first coordinate system is obtained in advance, then a distance from the first coordinate system to the two linear equations is determined, the distance is a distance in the first coordinate system, and then the distance is converted into a numerical value in the second coordinate system according to a coordinate ratio between the first coordinate system and the second coordinate system which is measured in advance, so that a second coordinate is obtained.
The coordinate ratios and the manner of obtaining the linear equations are described in the following embodiments.
Specifically, the coordinate ratio includes an X-axis direction coordinate ratio and a Y-axis direction coordinate ratio.
In an alternative embodiment, as shown in fig. 2, the step of obtaining the coordinate ratio of the X-axis and the Y-axis comprises:
s201: and marking N first reference coordinates in a second coordinate system, wherein the N first reference coordinates are not positioned on the same coordinate axis, and N is greater than or equal to 3.
It should be noted that the coordinate value of the first reference coordinate may be set in advance. Alternatively, the first reference coordinate may be set on the X-axis, the Y-axis, and the origin of coordinates in the second coordinate system, respectively. Specifically, as shown in fig. 3, the first reference coordinate may be set at an upper left corner pixel, a lower left corner pixel, and a lower right corner pixel of the projection image, where the first reference coordinate is a pixel coordinate corresponding to the pixel in the second coordinate system. For example, if the device resolution of the projection image is 1920 × 1080, the first reference coordinates are (1920,0), (0,1080), and (0,0), respectively.
Of course, the position of the first reference coordinate is not limited to the position shown in fig. 3, and the first reference coordinate may also be at a position closer to the origin of the second coordinate system than the position marked in fig. 3.
Alternatively, the way of marking the first reference coordinate may be: highlighting a pixel point corresponding to the first reference coordinate in the projected image; or highlighting the corresponding pixel point of the first area taking the first reference coordinate as the center in the projection image.
S202: and determining N second reference coordinates corresponding to the N first reference coordinates in the first coordinate system.
It can be understood that, after the first reference coordinate is marked, for example, the pixel point corresponding to the first area of the first reference coordinate is highlighted, the user can distinguish the first area in the projected image, and then can place any object on the carrier plane bearing the projected image at the position corresponding to the first area.
S203: and determining the coordinate proportion in the X-axis direction according to the ratio of the X-axis distance between two first reference coordinates in the N first reference coordinates to the X-axis distance between two corresponding second reference coordinates in the N second reference coordinates.
S204: and determining the coordinate proportion in the Y-axis direction according to the ratio of the Y-axis distance between two first reference coordinates in the N first reference coordinates to the Y-axis distance between two corresponding second reference coordinates in the N second reference coordinates.
Optionally, as shown in fig. 4 on the basis of fig. 2, the embodiment of the present invention further includes:
s205: and determining a first linear equation of the X axis of the second coordinate system mapped in the first coordinate system according to two second reference coordinates in the N second reference coordinates, wherein the two second reference coordinates correspond to the two first reference coordinates on the X axis in the second coordinate system.
Alternatively, the straight line equation may be determined by a two-point equation. For example, if the two first reference coordinates on the X axis in the second coordinate system are (X1, y1), (X2, and y2), respectively, the first linear equation may be (X1, y1), (X2, and y2)
Figure BDA0001392717320000121
S206: determining a second linear equation mapped in the first coordinate system by the Y axis of the second coordinate system according to the other two second reference coordinates in the N second reference coordinates, wherein the other two second reference coordinates correspond to the two first reference coordinates on the Y axis in the second coordinate system; the mapping straight line comprises straight lines corresponding to the first straight line equation and the second straight line equation respectively.
Optionally, the determination manner of the second linear equation is similar to the determination manner of the first linear equation in S205, and then the second linear equation can be obtained as
Figure BDA0001392717320000122
S207: determining second coordinates (x, y) of the first coordinates mapped in said second coordinate system according to the following formula: the coordinate proportion in the X-axis direction is the distance/X between the first coordinate and the straight line corresponding to the first straight line equation; and the proportion of the coordinate in the Y-axis direction is equal to the distance/Y between the first coordinate and the straight line corresponding to the second straight line equation.
Specifically, the distance between the first coordinate and the straight line corresponding to the first straight line equation can be calculated by a point-to-straight line distance formula. Assuming that the first coordinate is (x4, y4), the distance between the first coordinate and the line corresponding to the first line equation is
Figure BDA0001392717320000123
The distance between the first coordinate and the straight line corresponding to the second linear equation is
Figure BDA0001392717320000131
As shown in fig. 5, corresponding to the foregoing method embodiment, an embodiment of the present invention further provides a coordinate mapping apparatus, including: an acquisition module 410, a first determination module 420, and a second determination module 430.
The obtaining module 410 is configured to, in response to an operation triggered by a user on a projection image, obtain a first coordinate, corresponding to a gesture point of the operation, in a first coordinate system corresponding to a depth image.
The first determining module 420 is configured to determine a distance between the first coordinate and a coordinate axis mapping straight line obtained in advance, where the coordinate axis mapping straight line is a straight line of a coordinate axis of a second coordinate system corresponding to the projection image mapped in the first coordinate system corresponding to the depth image.
And a second determining module 430, configured to determine, according to the distance and a coordinate ratio between the first coordinate system and the second coordinate system obtained in advance, a second coordinate mapped in the second coordinate system by the first coordinate.
In an alternative embodiment, the coordinate ratio includes an X-axis coordinate ratio and a Y-axis coordinate ratio, the apparatus further includes a third determining module 440, and the third determining module 440 includes: a marking sub-module 441, a first determination sub-module 442, a second determination sub-module 443, and a third determination sub-module 444.
And the marking submodule 441 is configured to mark N first reference coordinates in the second coordinate system, where the N first reference coordinates are not located on the same coordinate axis, and N is greater than or equal to 3.
The first determining sub-module 442 is configured to determine N second reference coordinates of the N first reference coordinates in the first coordinate system.
The second determining submodule 443 is configured to determine the coordinate ratio in the X-axis direction according to a ratio of an X-axis distance between two first reference coordinates in the N first reference coordinates to an X-axis distance between two corresponding second reference coordinates in the N second reference coordinates.
The third determining submodule 444 is configured to determine the Y-axis direction coordinate ratio according to a ratio of a Y-axis distance between two first reference coordinates in the N first reference coordinates to a Y-axis distance between two corresponding second reference coordinates in the N second reference coordinates.
In an alternative embodiment, the tagging submodule 441 is specifically configured to:
and respectively marking a first reference coordinate on an X axis, a Y axis and a coordinate origin in the second coordinate system.
In an optional implementation, the apparatus further includes a fourth determining module 450, where the fourth determining module 450 includes:
a fourth determining submodule 451, configured to determine, after triggering the first determining submodule 442, a first linear equation mapped in the first coordinate system by the X-axis of the second coordinate system according to two second reference coordinates of the N second reference coordinates, where the two second reference coordinates correspond to two first reference coordinates on the X-axis of the second coordinate system;
a fifth determining submodule 452, configured to determine, after triggering the first determining submodule 442, a second equation of a straight line mapped in the first coordinate system by the Y-axis of the second coordinate system according to another two second reference coordinates in the N second reference coordinates, where the another two second reference coordinates correspond to the two first reference coordinates on the Y-axis of the second coordinate system.
The mapping straight line comprises straight lines corresponding to the first straight line equation and the second straight line equation respectively.
In an alternative embodiment, the fourth determining sub-module 451 is specifically configured to:
determining the first linear equation k according to the following formula1
Figure BDA0001392717320000141
Wherein X1 is the X-axis coordinate value of one of the two second reference coordinates, Y1 is the Y-axis coordinate value of the one second reference coordinate, X2 is the X-axis coordinate value of the other one of the two second reference coordinates, and Y2 is the Y-axis coordinate value of the other one of the two second reference coordinates.
In an optional embodiment, the fifth determining submodule 452 is specifically configured to:
determining the second linear equation k according to the following formula2
Figure BDA0001392717320000142
Wherein X1 is the X-axis coordinate value of one of the other two second reference coordinates, Y1 is the Y-axis coordinate value of the second reference coordinate, X3 is the X-axis coordinate value of the other one of the other two second reference coordinates, and Y3 is the Y-axis coordinate value of the other one of the other two second reference coordinates.
In an optional embodiment, the second determining module 443 is specifically configured to:
determining a second coordinate (x, y) of the first coordinate mapped in the second coordinate system according to the following formula:
the coordinate proportion in the X-axis direction is equal to the distance/X between the first coordinate and a straight line corresponding to the first straight line equation;
and the Y-axis direction coordinate proportion is the distance/Y between the first coordinate and the straight line corresponding to the second straight line equation.
In an alternative embodiment, the distance between the first coordinate and the line corresponding to the first line equation is:
Figure BDA0001392717320000151
wherein X4, Y4 are X-axis, Y-axis coordinates of the first coordinate, respectively.
The distance between the first coordinate and a straight line corresponding to the second straight line equation is as follows:
Figure BDA0001392717320000152
the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used for enabling the computer to execute the coordinate mapping method provided by the embodiment of the invention.
One or more embodiments of the present invention provide a computer-readable storage medium, wherein the computer-readable storage medium may be a computer-readable storage medium stored in a memory or a computer-readable storage medium that exists independently and is not attached to any other terminal. The computer readable storage medium stores one or more programs (which in one or more embodiments may be one or more physical disk storage devices, flash memory devices or other non-volatile solid state storage devices, CD-ROMs, optical storage, etc.), wherein the programs, when executed by one or more processors, may perform the methods of any of the embodiments described above.
The embodiment of the invention provides a projector, which comprises: the coordinate mapping system comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the processor executes the program to realize the coordinate mapping method provided by the embodiment of the invention.
It should be noted that, for the device embodiment, since it is basically similar to the method embodiment, the description is simpler, and the relevant points can be referred to only the partial description of the method embodiment.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (9)

1. A coordinate mapping method, comprising:
responding to an operation triggered by a user on a projection image, and acquiring a first coordinate corresponding to a gesture point of the operation in a first coordinate system corresponding to a depth image;
determining the distance from the first coordinate to a coordinate axis mapping straight line obtained in advance, wherein the coordinate axis mapping straight line is a straight line mapped by a coordinate axis of a second coordinate system corresponding to the projected image in the first coordinate system corresponding to the depth image;
determining a second coordinate mapped in the second coordinate system by the first coordinate according to the distance and a coordinate ratio between the first coordinate system and the second coordinate system obtained in advance;
marking N first reference coordinates in the second coordinate system, and determining N second reference coordinates corresponding to the N first reference coordinates in the first coordinate system;
the coordinate proportion comprises an X-axis direction coordinate proportion and a Y-axis direction coordinate proportion, the X-axis direction coordinate proportion is determined according to the ratio of the X-axis distance between two first reference coordinates in the N first reference coordinates to the X-axis distance between two corresponding second reference coordinates in the N second reference coordinates, and the Y-axis direction coordinate proportion is determined according to the ratio of the Y-axis distance between two first reference coordinates in the N first reference coordinates to the Y-axis distance between two corresponding second reference coordinates in the N second reference coordinates;
determining a first linear equation of the X axis of the second coordinate system mapped in the first coordinate system according to two second reference coordinates in the N second reference coordinates, wherein the two second reference coordinates correspond to two first reference coordinates on the X axis in the second coordinate system;
the determining a first linear equation of the mapping of the X-axis of the second coordinate system in the first coordinate system according to two of the N second reference coordinates includes:
determining the first linear equation k according to the following formula1
Figure FDA0002621050070000011
Wherein X1 is the X-axis coordinate value of one of the two second reference coordinates, Y1 is the Y-axis coordinate value of the one second reference coordinate, X2 is the X-axis coordinate value of the other one of the two second reference coordinates, and Y2 is the Y-axis coordinate value of the other one of the two second reference coordinates.
2. The method of claim 1, further comprising:
and marking N first reference coordinates in the second coordinate system, wherein the N first reference coordinates are not positioned on the same coordinate axis, and N is greater than or equal to 3.
3. The method of claim 2, wherein said labeling N first reference coordinates in said second coordinate system comprises:
and respectively marking a first reference coordinate on an X axis, a Y axis and a coordinate origin in the second coordinate system.
4. The method of claim 3, wherein the determining the N first reference coordinates is subsequent to the corresponding N second reference coordinates in the first coordinate system, further comprising:
determining a second linear equation mapped by the Y axis of the second coordinate system in the first coordinate system according to the other two second reference coordinates in the N second reference coordinates, wherein the other two second reference coordinates correspond to the two first reference coordinates on the Y axis in the second coordinate system; the mapping straight line comprises straight lines corresponding to the first straight line equation and the second straight line equation respectively.
5. The method of claim 4, wherein determining a second line equation for mapping the Y-axis of the second coordinate system in the first coordinate system from two other second reference coordinates of the N second reference coordinates comprises:
determining the second linear equation k according to the following formula2
Figure FDA0002621050070000021
Wherein X1 is the X-axis coordinate value of one of the other two second reference coordinates, Y1 is the Y-axis coordinate value of the second reference coordinate, X3 is the X-axis coordinate value of the other one of the other two second reference coordinates, and Y3 is the Y-axis coordinate value of the other one of the other two second reference coordinates.
6. The method according to claim 5, wherein the determining a second coordinate of the first coordinate mapped in the second coordinate system according to the distance and a coordinate ratio between the first coordinate system and the second coordinate system obtained in advance comprises:
determining a second coordinate (x, y) of the first coordinate mapped in the second coordinate system according to the following formula:
the coordinate proportion in the X-axis direction is equal to the distance/X between the first coordinate and a straight line corresponding to the first straight line equation;
and the Y-axis direction coordinate proportion is the distance/Y between the first coordinate and the straight line corresponding to the second straight line equation.
7. The method of claim 6,
the distance between the first coordinate and a straight line corresponding to the first straight line equation is as follows:
Figure FDA0002621050070000031
wherein X4, Y4 are the X-axis, Y-axis coordinates of the first coordinate, respectively;
the distance between the first coordinate and a straight line corresponding to the second straight line equation is as follows:
Figure FDA0002621050070000032
8. a computer-readable storage medium storing computer-executable instructions for causing a computer to perform the coordinate mapping method of any one of claims 1 to 7.
9. A projector, comprising: memory, processor and computer program stored on the memory and executable on the processor, characterized in that the processor implements the coordinate mapping method according to any of claims 1-7 when executing the program.
CN201710758476.5A 2017-08-29 2017-08-29 Coordinate mapping method, computer-readable storage medium, and projector Active CN107506162B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710758476.5A CN107506162B (en) 2017-08-29 2017-08-29 Coordinate mapping method, computer-readable storage medium, and projector

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710758476.5A CN107506162B (en) 2017-08-29 2017-08-29 Coordinate mapping method, computer-readable storage medium, and projector

Publications (2)

Publication Number Publication Date
CN107506162A CN107506162A (en) 2017-12-22
CN107506162B true CN107506162B (en) 2020-10-09

Family

ID=60694230

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710758476.5A Active CN107506162B (en) 2017-08-29 2017-08-29 Coordinate mapping method, computer-readable storage medium, and projector

Country Status (1)

Country Link
CN (1) CN107506162B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109961479B (en) * 2017-12-25 2021-01-08 大族激光科技产业集团股份有限公司 Positioning method applied to battery module bus welding production line and welding production line
CN108803895A (en) * 2018-05-04 2018-11-13 歌尔科技有限公司 Coordinate determination method, device and equipment
CN108762492B (en) * 2018-05-14 2021-03-09 歌尔光学科技有限公司 Method, device and equipment for realizing information processing based on virtual scene and storage medium
CN111625210B (en) * 2019-02-27 2023-08-04 杭州海康威视系统技术有限公司 Large screen control method, device and equipment
CN112199756A (en) * 2020-10-30 2021-01-08 久瓴(江苏)数字智能科技有限公司 Method and device for automatically determining distance between straight lines
CN113313772B (en) * 2021-07-28 2021-10-15 浙江华睿科技股份有限公司 Calibration method, calibration device, electronic equipment and storage medium
CN114155433B (en) * 2021-11-30 2022-07-19 北京新兴华安智慧科技有限公司 Illegal land detection method and device, electronic equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2706762A3 (en) * 2012-09-05 2015-03-11 Acer Incorporated Multimedia processing system and audio signal processing method
CN104820523A (en) * 2015-05-19 2015-08-05 京东方科技集团股份有限公司 Method and device for realizing touch control
CN106095199A (en) * 2016-05-23 2016-11-09 广州华欣电子科技有限公司 A kind of touch-control localization method based on projection screen and system
CN106125994A (en) * 2016-06-17 2016-11-16 深圳迪乐普数码科技有限公司 Coordinate matching method and use control method and the terminal of this coordinate matching method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2706762A3 (en) * 2012-09-05 2015-03-11 Acer Incorporated Multimedia processing system and audio signal processing method
CN104820523A (en) * 2015-05-19 2015-08-05 京东方科技集团股份有限公司 Method and device for realizing touch control
CN106095199A (en) * 2016-05-23 2016-11-09 广州华欣电子科技有限公司 A kind of touch-control localization method based on projection screen and system
CN106125994A (en) * 2016-06-17 2016-11-16 深圳迪乐普数码科技有限公司 Coordinate matching method and use control method and the terminal of this coordinate matching method

Also Published As

Publication number Publication date
CN107506162A (en) 2017-12-22

Similar Documents

Publication Publication Date Title
CN107506162B (en) Coordinate mapping method, computer-readable storage medium, and projector
US20200357188A1 (en) Mixed-reality system, program, method, and portable terminal device
CN108553894B (en) Display control method and device, electronic equipment and storage medium
CN111708366A (en) Robot, method and device for controlling action of robot, and computer-readable storage medium
CN107204044B (en) Picture display method based on virtual reality and related equipment
KR20130119233A (en) Apparatus for acquiring 3 dimension virtual object information without pointer
US20150169134A1 (en) Methods circuits apparatuses systems and associated computer executable code for providing projection based human machine interfaces
US10037135B2 (en) Method and electronic device for user interface
TW201939260A (en) Method, apparatus, and terminal for simulating mouse operation by using gesture
TWI671675B (en) Information display method and device
JP2016184362A (en) Input device, input operation detection method, and input operation detection computer program
CN114138121A (en) User gesture recognition method, device and system, storage medium and computing equipment
CN111240469A (en) Calibration method and device for hand motion capture, electronic device and storage medium
CN106406572A (en) Cursor control method and apparatus
CN106598422B (en) hybrid control method, control system and electronic equipment
CN106569716B (en) Single-hand control method and control system
US20140189486A1 (en) Non-Transitory Computer Readable Medium Storing Document Sharing Program, Terminal Device and Document Sharing Method
CN113867562B (en) Touch screen point reporting correction method and device and electronic equipment
CN103558957A (en) Method and device for screen operation of mobile terminal
CN113557492B (en) Method, system and non-transitory computer readable recording medium for assisting object control using two-dimensional camera
US20160018917A1 (en) Touch system, touch apparatus, and mobile device
US9235338B1 (en) Pan and zoom gesture detection in a multiple touch display
CN103631962A (en) Display method and equipment for image label
EP2975503A2 (en) Touch device and corresponding touch method
JP2015001902A (en) Electronic apparatus

Legal Events

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