[go: up one dir, main page]

CN111405258B - Projection method, apparatus, device and computer readable storage medium - Google Patents

Projection method, apparatus, device and computer readable storage medium Download PDF

Info

Publication number
CN111405258B
CN111405258B CN202010370864.8A CN202010370864A CN111405258B CN 111405258 B CN111405258 B CN 111405258B CN 202010370864 A CN202010370864 A CN 202010370864A CN 111405258 B CN111405258 B CN 111405258B
Authority
CN
China
Prior art keywords
projection
image
initial
target
pixel coordinates
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
CN202010370864.8A
Other languages
Chinese (zh)
Other versions
CN111405258A (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.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen 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 Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN202010370864.8A priority Critical patent/CN111405258B/en
Publication of CN111405258A publication Critical patent/CN111405258A/en
Application granted granted Critical
Publication of CN111405258B publication Critical patent/CN111405258B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N9/00Details of colour television systems
    • H04N9/12Picture reproducers
    • H04N9/31Projection devices for colour picture display, e.g. using electronic spatial light modulators [ESLM]
    • H04N9/3179Video signal processing therefor
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N9/00Details of colour television systems
    • H04N9/12Picture reproducers
    • H04N9/31Projection devices for colour picture display, e.g. using electronic spatial light modulators [ESLM]
    • H04N9/3179Video signal processing therefor
    • H04N9/3185Geometric adjustment, e.g. keystone or convergence

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • Geometry (AREA)
  • Controls And Circuits For Display Device (AREA)
  • Projection Apparatus (AREA)

Abstract

The invention provides a projection method, which relates to the technical field of image processing, and comprises the following steps: acquiring an initial image of a file to be projected, and performing corner detection on the initial image to obtain initial pixel coordinates of each corner in the initial image; converting the initial pixel coordinates to obtain target pixel coordinates of each corner point; obtaining the length-width ratio of a projection image, and obtaining a target projection image according to the length-width ratio, the target pixel coordinates and the initial image; and projecting the target projection image. The invention also provides a projection device, equipment and a computer readable storage medium. The invention can realize the rapid projection of the object file and simplify the projection operation.

Description

Projection method, apparatus, device and computer readable storage medium
Technical Field
The present invention relates to the field of image processing technologies, and in particular, to a projection method, apparatus, device, and computer readable storage medium.
Background
Currently, in working summary, PPT is usually demonstrated with an in-house projector to be demonstrated to a leader or customer. If a document needs to be projected and displayed temporarily, the document to be displayed is firstly scanned through scanning equipment and is converted into an electronic file, and then the electronic file is uploaded to a terminal for displaying, so that the operation is complicated. Therefore, a method for rapidly projecting a physical document is needed.
Disclosure of Invention
The invention mainly aims to provide a projection method, a projection device, projection equipment and a computer readable storage medium, and aims to realize rapid projection of a physical file and simplify projection operation.
In order to achieve the above object, the present invention provides a projection method including:
acquiring an initial image of a file to be projected, and performing corner detection on the initial image to obtain initial pixel coordinates of each corner in the initial image;
converting the initial pixel coordinates to obtain target pixel coordinates of each corner point;
obtaining the length-width ratio of a projection image, and obtaining a target projection image according to the length-width ratio, the target pixel coordinates and the initial image;
and projecting the target projection image.
Optionally, the step of converting the initial pixel coordinate to obtain a target pixel coordinate of each corner includes:
calculating to obtain an initial centroid coordinate according to the initial pixel coordinate;
acquiring a coordinate offset value between the initial centroid coordinate and a preset centroid coordinate;
and calculating the target pixel coordinates of each corner point according to the coordinate offset value and the initial pixel coordinates.
Optionally, the step of obtaining the aspect ratio of the projection image and obtaining the target projection image according to the aspect ratio, the target pixel coordinates and the initial image includes:
acquiring the length-width ratio of a projection image, and determining imaging point pixel coordinates according to the length-width ratio;
calculating to obtain a homography matrix according to the imaging point pixel coordinates and the target pixel coordinates;
and converting the initial image based on the homography matrix to obtain a target projection image.
Optionally, the step of converting the initial image based on the homography matrix to obtain a target projection image includes:
converting the initial image based on the homography matrix to obtain an initial projection image;
generating a corresponding projection image selection interface based on the initial projection image;
and receiving a projection image selection instruction triggered based on the projection image selection interface, and determining a target projection image according to the projection image selection instruction.
Optionally, before the step of converting the initial pixel coordinate to obtain the target pixel coordinate of each corner, the method further includes:
acquiring the number of corner points in the initial image, and detecting whether the number is a preset value or not;
if yes, executing the steps of: converting the initial pixel coordinates to obtain target pixel coordinates of each corner point;
if not, generating corresponding prompt information to prompt a user to adjust the position of the file to be projected.
Optionally, the step of projecting the target projection image includes:
acquiring a projection distance, and determining a target projection size according to the projection distance and the image size of the target projection image;
determining a target projection ratio according to the target projection size and the projection distance;
and scaling the target projection image based on the target projection ratio to perform projection.
Optionally, the step of projecting the target projection image includes:
searching a third party projection device and establishing communication connection with the searched third party projection device;
and transmitting the target projection image to the third party projection device based on the communication connection, so that the third party projection device projects the target projection image.
In addition, to achieve the above object, the present invention also provides a projection apparatus including:
the first acquisition module is used for acquiring an initial image of a file to be projected, and carrying out corner detection on the initial image to obtain initial pixel coordinates of each corner in the initial image;
the coordinate conversion module is used for converting the initial pixel coordinates to obtain target pixel coordinates of each corner point;
the second acquisition module is used for acquiring the length-width ratio of the projection image and acquiring a target projection image according to the length-width ratio, the target pixel coordinates and the initial image;
and the image projection module is used for projecting the target projection image.
In addition, in order to achieve the above object, the present invention also provides a projection apparatus including a memory, a processor, and a projection program stored on the memory and executable by the processor, wherein the projection program, when executed by the processor, implements the steps of the projection method as described above.
In addition, in order to achieve the above object, the present invention also provides a computer-readable storage medium having a projection program stored thereon, wherein the projection program, when executed by a processor, implements the steps of the projection method as described above.
The invention provides a projection method, a projection device, projection equipment and a computer readable storage medium, wherein the initial image of a file to be projected is acquired firstly, and corner detection is carried out on the initial image to obtain initial pixel coordinates of each corner in the initial image; then, converting the initial pixel coordinates to obtain target pixel coordinates of each corner point; and obtaining the aspect ratio of the projection image, obtaining a target projection image according to the aspect ratio, the target pixel coordinates and the initial image, and projecting the target projection image. In the method, the initial image of the file to be projected is obtained through direct shooting, then a series of processing is carried out to obtain the target projection image which can be used for projection so as to project, and the quick projection of the file to be projected can be realized.
Drawings
FIG. 1 is a schematic diagram of a hardware operating environment according to an embodiment of the present invention;
FIG. 2 is a schematic flow chart of a first embodiment of the projection method of the present invention;
fig. 3 is a schematic functional block diagram of a projection apparatus according to a first embodiment of the present invention.
The achievement of the objects, functional features and advantages of the present invention will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
Referring to fig. 1, fig. 1 is a schematic device structure diagram of a hardware running environment according to an embodiment of the present invention.
The projection device according to the embodiment of the invention may be an intelligent projection robot, or may be a terminal device such as a PC (personal computer ) or a notebook computer.
As shown in fig. 1, the projection device may include: a processor 1001, such as a CPU (Central Processing Unit ), a communication bus 1002, a user interface 1003, a network interface 1004, a memory 1005. Wherein the communication bus 1002 is used to enable connected communications between these components; the user interface 1003 may include a Display, an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may further include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a Wireless interface (e.g., wireless-Fidelity, wi-Fi interface); the memory 1005 may be a high-speed random access memory (random access memory, RAM) or a stable memory (non-volatile memory), such as a disk memory, and the memory 1005 may alternatively be a storage device independent of the processor 1001. It will be appreciated by those skilled in the art that the projection device structure shown in FIG. 1 is not limiting of the projection device and may include more or fewer components than shown, or may combine certain components, or a different arrangement of components.
With continued reference to fig. 1, an operating system, a network communication module, and a projection program may be included in memory 1005, which is one type of computer storage medium in fig. 1. In fig. 1, the network communication module may be used to connect to a server and perform data communication with the server; and the processor 1001 may be used to call the projection program stored in the memory 1005 and execute the projection method provided by the embodiment of the present invention.
Based on the above hardware structure, various embodiments of the projection method of the present invention are presented.
The invention provides a projection method.
Referring to fig. 2, fig. 2 is a flowchart illustrating a projection method according to a first embodiment of the invention.
In this embodiment, the projection method is applied to a projection system, and the projection system includes:
step S10, obtaining an initial image of a file to be projected, and detecting corner points of the initial image to obtain initial pixel coordinates of each corner point in the initial image;
in this embodiment, the projection method is implemented by a projection device, which may be an intelligent projection robot, or may be a PC, a notebook computer, or other devices, and the projection device is illustrated by taking the intelligent projection robot as an example. The intelligent projection robot is provided with a camera for shooting an initial image of a file to be projected. The camera can freely rotate 360 degrees so as to facilitate shooting.
In this embodiment, a user may place a file to be projected (such as a paper file, a photo, a leaflet, etc.) on a plane, and place the intelligent projection robot on a plane at the same time, for example, all place the file to be projected on a desktop, and the user may adjust the angle of the camera of the intelligent projection robot according to the placement position of the file to be projected, and then trigger a projection instruction by triggering a button on the intelligent projection robot or a voice operation, etc., at this time, when the intelligent projection robot receives the projection instruction, the intelligent projection robot captures an initial image of the file to be projected through the camera, and then performs corner detection on the initial image, so as to obtain initial pixel coordinates of each corner in the initial image.
Corner detection is a method used to obtain image features in a computer vision system, where a corner is generally defined as an intersection point of two edges, and in a broad sense, a corner refers to an image point having specific features, which have specific coordinates in an image, and some mathematical features. The corner points in this embodiment are points corresponding to the vertices of the file to be projected on the initial image. When the corner detection is carried out, the detection can be carried out by adopting a Harris (Harris) corner detection mode, the Harris corner is a corner extraction algorithm directly based on a gray level diagram, the stability is high, and the detection precision of the L-shaped corner (namely right angle) is high. Of course, in the implementation, other modes such as Shi-Tomasi (history-thomas) corner detection can also be adopted.
Step S20, converting the initial pixel coordinates to obtain target pixel coordinates of each corner point;
and then, converting the initial pixel coordinates to obtain target pixel coordinates of each corner point. The purpose of converting the initial pixel coordinates is to correct the initial image based on the converted target pixel coordinates to obtain a final target projection image.
Specifically, step S20 includes:
step a21, calculating to obtain an initial centroid coordinate according to the initial pixel coordinate;
step a22, obtaining a coordinate offset value between the initial centroid coordinate and a preset centroid coordinate;
and a step a23 of calculating the target pixel coordinates of each corner point according to the coordinate offset value and the initial pixel coordinates.
In this embodiment, an initial centroid coordinate is calculated according to an initial pixel coordinate. Centroid coordinates refer to the position of points in a graph relative to each vertex in a geometric structure. The initial centroid coordinates in this embodiment are the positions of the points in the graph formed by the points corresponding to the initial pixel coordinates relative to each vertex. In general, 4 corner points may be detected based on an image of a document to be projected, and then a corresponding initial centroid coordinate may be calculated according to initial pixel coordinates of the 4 corner points, and a specific calculation method may refer to the prior art.
Then, a coordinate offset value between the initial centroid coordinates and the preset centroid coordinates is obtained. The preset centroid coordinate is a preset centroid coordinate calculated based on 4 vertexes of the initial image, and may be set to be (0, 0) for easy calculation. Wherein, sitThe target offset value may include a lateral coordinate offset value and a longitudinal coordinate offset value. For example, if the initial pixel coordinates of each corner point are A1 (x A0 ,y A0 )、B1(x B0 ,y B0 )、C1(x C0 ,y C0 )、D1(x D0 ,y D0 ) The corresponding initial centroid coordinates are (x 1, y 1), and the preset centroid coordinates are (0, 0), so that a transverse coordinate offset value is Δx=x1-x0=x1, and a longitudinal coordinate offset value is Δy=y1-y0=y1.
And finally, calculating the target pixel coordinates of each corner point according to the coordinate offset value and the initial pixel coordinates. For example, the corresponding target pixel coordinates A2 (x A0 -△x,y A0 -△y)、B2(x B0 -△x,y B0 -△y)、C2(x C0 -△x,y C0 -△y)、D2(x D0 -△x,y D0 -△y)。
Step S30, obtaining the length-width ratio of a projection image, and obtaining a target projection image according to the length-width ratio, the target pixel coordinates and the initial image;
after the target pixel coordinates of each angular point in the initial image are obtained, the aspect ratio of the projection image is obtained, and the target projection image is obtained according to the aspect ratio, the target pixel coordinates and the initial image. The aspect ratio of the projected image may be preset, for example, 1: 2. 2: 1. 4:3 or 3:4, the aspect ratio option can be provided in advance for the user to select, and specifically, the aspect ratio option can be displayed in a display screen of the intelligent projection robot for the user to select; communication connection between the intelligent projection robot and the user side can be suggested, the length-width ratio option is sent to the user side for selection by the user, and further a selection instruction returned by the user is received, so that the length-width ratio of the projection image is obtained.
For the acquisition of a target projection image, the aspect ratio of the projection image can be acquired first, and the pixel coordinates of an imaging point are determined according to the aspect ratio; then, calculating to obtain a homography matrix according to the pixel coordinates of the imaging points, the length-width ratio and the target pixel coordinates; and converting the initial image based on the homography matrix to obtain a target projection image. The specific acquisition process may refer to the following second embodiment, and will not be described herein.
And step S40, projecting the target projection image.
And projecting the target projection image after the target projection image is obtained. The specific projection mode comprises the following two modes: 1) The intelligent projection robot has a projection function, and can zoom a target projection image based on the target projection ratio after the target projection ratio is acquired so as to project; 2) The method comprises the steps of matching with third-party projection equipment to realize projection, specifically, searching the third-party projection equipment, and establishing communication connection with the searched third-party projection equipment; the target projection image is then transmitted to a third party projection device based on the communication connection such that the third party projection device projects the target projection image. For a specific projection procedure, reference is made to the following third and fourth embodiments.
The invention provides a projection method, which comprises the steps of firstly obtaining an initial image of a file to be projected, and detecting angular points of the initial image to obtain initial pixel coordinates of each angular point in the initial image; then, converting the initial pixel coordinates to obtain target pixel coordinates of each corner point; and obtaining the aspect ratio of the projection image, obtaining a target projection image according to the aspect ratio, the target pixel coordinates and the initial image, and projecting the target projection image. In this embodiment, an initial image of a file to be projected is obtained by direct shooting, and then a series of processing is performed to obtain a target projection image for projection, so that the file to be projected can be projected quickly.
Further, based on the above-described first embodiment, a second embodiment of the projection method of the present invention is proposed.
In this embodiment, step S30 may include:
step a31, obtaining the length-width ratio of a projection image, and determining imaging point pixel coordinates according to the length-width ratio;
in this embodiment, the process of acquiring the target projection image is specifically as follows:
firstly, the aspect ratio of the projection image is obtained, and the aspect ratio of the projection image can be preset and is a preset ratio, for example, 1: 2. 2: 1. 4:3 or 3:4, the aspect ratio option can be provided in advance for the user to select, and specifically, the aspect ratio option can be displayed in a display screen of the intelligent projection robot for the user to select; communication connection between the intelligent projection robot and the user side can be suggested, the length-width ratio option is sent to the user side for selection by the user, and further a selection instruction returned by the user is received, so that the length-width ratio of the projection image is obtained.
Imaging point pixel coordinates are then determined based on the aspect ratio. The imaging point pixel sitting marks are pixel coordinates on an imaging plane (namely the imaging plane of the intelligent projection robot camera). The different aspect ratios are configured with corresponding imaging point pixel coordinates.
Step a32, calculating to obtain a homography matrix according to the imaging point pixel coordinates and the target pixel coordinates;
then, a homography matrix is calculated according to the imaging point pixel coordinates and the target pixel coordinates. Specifically, the pixel coordinates of the imaging points are matched with the coordinates of the target pixels to obtain a plurality of groups of coordinates, and then the groups of coordinates are brought into a preset formula, and finally the homography matrix is obtained through calculation.
For convenience of description, assuming that the corner points include 4, the corresponding coordinates of the target pixels are respectively denoted as A 1 (u 1 ,v 1 )、B 1 (u 2 ,v 2 )、C 1 (u 3 ,v 3 )、D 1 (u 4 ,v 4 ) The pixel coordinates of the imaging points are respectively marked as A 2 (u' 1 ,v' 1 ),B 2 (u' 2 ,v' 2 ),C 2 (u' 3 ,v' 3 ),D 2 (u' 4 ,v' 4 ) For A 1 And A is a 2 Matching, wherein the homography matrix is H, and the matching comprises the following steps:
Figure BDA0002475665900000081
thus, there are:
u′ 1 =H 11 u 1 +H 12 v 1 +H 13
v′ 1 =H 21 u 1 +H 22 v 1 +H 23
1=H 31 u 1 +H 32 v 1 +H 33
according to the above, can obtain
u' 1 (H 31 u 1 +H 32 v 1 +H 33 )=H 11 u 1 +H 12 v 1 +H 13
v' 1 (H 31 u 1 +H 32 v 1 +H 33 )=H 21 u 1 +H 22 v 1 +H 23
Let h= (H) 11 ,H 12 ,H 13 ,H 21 ,H 22 ,H 23 ,H 31 ,H 32 ,1) T Since the homography matrix is a homogeneous matrix, the last element is normalized to 1.
Thus, the above can be written as
a x h=0,
a y h=0,
Wherein,,
a x =(-u 1 ,-u 2 ,-1,0,0,0,u 1 u' 1 ,v 1 u' 1 ,u' 1 )
a y =(0,0,0,-u 1 ,-v 1 ,-1,v' 1 u 1 ,v' 1 v 1 ,v' 1 )
therefore, a pair of matching points can obtain the two equations, because the H matrix has 8 degrees of freedom, at least 4 pairs of points are needed to obtain the H matrix, and therefore, the target pixel coordinates and the target pixel coordinates are matched to obtain 4 sets of coordinates, and the H matrix can be obtained.
And a step a33 of converting the initial image based on the homography matrix to obtain a target projection image.
After the homography matrix H is obtained, converting the initial image based on the homography matrix to obtain a target projection image. The pixel point coordinates of all points in the initial image are multiplied by the homography matrix to obtain the pixel point coordinates corresponding to all points on the target projection image, so as to obtain the target projection image.
Further, since matching is performed sequentially based on the position at the time of matching. For example, in the above example, if A 1 、B 1 、C 1 And D 1 Sequentially connected to form a rectangle A 2 、B 2 、C 2 And D 2 The sequential connection may form a rectangle. Upon matching, there are 4 results: 1) A is that 1 And A is a 2 、B 1 And B is connected with 2 、C 1 And C 2 、D 1 And D 2 ;1)A 1 And B is connected with 2 、B 1 And C 2 、C 1 And D 2 、D 1 And A is a 2 ;1)A 1 And C 2 、B 1 And D 2 、C 1 And A is a 2 、D 1 And B is connected with 2 ;1)A 1 And D 2 、B 1 And A is a 2 、C 1 And B is connected with 2 、D 1 And C 2 . That is, in matching pixel coordinates, A 1 Possibly with A 2 Matching (at this time, B) 1 And B is connected with 2 Matching, C 1 And C 2 Matching, D 1 And D 2 Match), possibly with B 2 、C 2 Or D 2 4 matching situations can exist in matching, and 4 corresponding projection images are needed to be obtained for determining a final target projection image. Step a33 includes:
step a331, converting the initial image based on the homography matrix to obtain an initial projection image;
step a332, generating a corresponding projection image selection interface based on the initial projection image;
step a333, receiving a projection image selection instruction triggered based on the projection image selection interface, and determining a target projection image according to the projection image selection instruction.
In the embodiment, an initial image is converted based on a homography matrix to obtain an initial projection image; that is, the pixel coordinates of all points in the initial image are multiplied by the homography matrix to obtain the pixel coordinates corresponding to all points on the initial projection image, so as to obtain the initial projection image. If the number of the angular points is 4, the corresponding initial projection image also comprises 4 angular points. Then, generating a corresponding projection image selection interface based on the initial projection image, wherein the projection image selection interface can be directly displayed in a display screen of the intelligent projection robot, and the projection image selection interface can be sent to a user side for selection by a user through communication connection between the intelligent projection robot and the user side; and finally, receiving a projection image selection instruction triggered based on the projection image selection interface, and determining a target projection image according to the projection image selection instruction.
Through the mode, the initial image of the file to be projected can be converted to obtain the target projection image, so that the subsequent projection display is facilitated.
Further, based on the above-described first and second embodiments, a third embodiment of the projection method of the present invention is proposed.
In this embodiment, before step S20, the projection method may further include:
step A, obtaining the number of corner points in the initial image, and detecting whether the number is a preset value or not;
in this embodiment, to ensure that the initial image of the document to be projected is completely captured, that is, the corners of the document to be projected are all captured, it may be determined by detecting whether the number of corner points in the initial image is a preset value.
Specifically, the number of corner points in the initial image is obtained, and whether the number is a preset value is detected. Wherein the preset value is preset, optionally 4, because general documents such as paper documents, photos, handbill, etc. each include 4 vertices. Of course, it is understood that, in the implementation, the preset value may be preset according to the document to be displayed.
If yes, execute step S20: converting the initial pixel coordinates to obtain target pixel coordinates of each corner point;
if not, executing the step B, and generating corresponding prompt information to prompt a user to adjust the position of the file to be projected.
If the number of the angular points is a preset value, the initial image shooting of the file to be projected is complete, and at this time, the steps are executed: and converting the initial pixel coordinates to obtain target pixel coordinates of each corner point, and further continuing to execute the subsequent steps. For specific implementation, reference may be made to the embodiments described above.
If the number of the corner points is not a preset value, the initial image shooting of the file to be projected is incomplete, and corresponding prompt information is generated at the moment so as to prompt a user to adjust the position of the file to be projected. The prompting mode can be voice prompting, and meanwhile, the user can be informed of the current position of the file to be projected so as to move conveniently, and specifically, the image of the file to be projected can be sent to the user side through communication connection between the intelligent projection robot and the user side, or the shot image of the file to be projected can be displayed in a display screen on the intelligent projection robot.
In this embodiment, by detecting whether the number of corner points in the initial image is a preset value, and reminding the user to adjust the position of the file to be projected in time when the number of corner points is not the preset value, the shooting integrity of the initial image of the file to be projected can be ensured, and the integrity of the target projection image can be further ensured.
Further, based on the above-described first and second embodiments, a fourth embodiment of the projection method of the present invention is proposed.
In this embodiment, step S40 may include:
step a41, obtaining a projection distance, and determining a target projection size according to the projection distance and the image size of the target projection image;
as one of the projection modes, the intelligent projection robot has a projection function, and after the target projection ratio is acquired, the target projection image is scaled based on the target projection ratio to perform projection.
Specifically, the projection distance is obtained first, and the projection size of the target is determined according to the projection distance and the image size of the projection image of the target. The projection distance is the distance between the intelligent projection robot and the projection curtain or the wall surface, an infrared signal transmitting device and an infrared signal receiving device can be arranged in the intelligent projection robot, when projection is carried out, an infrared beam is firstly transmitted through the infrared signal transmitting device, reflection is formed when the infrared beam is irradiated on the wall surface or the projection curtain, then a reflection signal is received through the infrared signal receiving device, and further the distance between the intelligent projection robot and the projection curtain or the wall surface is calculated based on the time difference between the infrared signal transmitting time and the reflection signal receiving time. The image size of the target projection image includes an image width and an image height, and the corresponding target projection size also includes a projection width and a projection height. The determination of the projection size of the target can be based on the projection distance, the image size of the projection image of the target and a preset mapping relation. The preset mapping relation comprises projection distances of different intervals and mapping relations between image sizes of different ranges and target projection sizes.
Here, it should be noted that, since too close or too far distance affects the projection effect, or even cannot be projected, after the projection distance is obtained, it may be detected whether the projection distance is within a preset distance range, so as to detect whether the intelligent projection robot is within a projectable range. If the projection distance is not within the preset distance range, corresponding prompt information is generated to prompt the user to move the intelligent projection robot. If the projection distance is within the preset distance range, continuing to execute the step a41, obtaining the projection distance, determining the projection size of the target according to the projection distance and the image size of the target projection image, and executing the subsequent steps.
Step a42, determining a target projection ratio according to the target projection size and the projection distance;
and a step a43 of scaling the target projection image based on the target projection ratio to perform projection.
Then, a target projection ratio is determined from the target projection size and the projection distance, the target projection ratio being equal to a ratio of the projection distance to the projection width. Further, the target projection image is scaled based on the target projection ratio to be projected.
Of course, in the implementation, the target projection image may be scaled according to a predetermined projection ratio to perform projection. The preset projection ratio is preset, and the intelligent projection robot is suitable for being placed in a certain preset position range, so that a target projection image can be projected onto a wall surface or a projection curtain in a proper size based on the preset projection ratio.
By the method, after the target projection ratio is obtained, the target projection image is scaled based on the target projection ratio, so that the file to be projected can be projected quickly.
Further, based on the above-described first and second embodiments, a fifth embodiment of the projection method of the present invention is proposed.
In this embodiment, step S40 may further include:
step a44, searching for a third party projection device and establishing communication connection with the searched third party projection device;
and a step a45 of transmitting the target projection image to the third party projection device based on the communication connection so that the third party projection device projects the target projection image.
As another projection mode, the projection method can be matched with a third party projection device to realize projection, specifically, the third party projection device can be searched through the bluetooth module, communication connection is established between the third party projection device and the searched third party projection device, and then, the target projection image is sent to the third party projection device based on the communication connection, so that the third party projection device projects the target projection image.
By the method, after the corresponding target projection image is obtained through initial image processing of the file to be projected, the file to be projected is matched with the third-party projection equipment, so that the file to be projected can be projected quickly.
The invention also provides a projection device.
Referring to fig. 3, fig. 3 is a schematic functional block diagram of a projection apparatus according to a first embodiment of the present invention.
In this embodiment, the projection apparatus includes:
the first obtaining module 10 is configured to obtain an initial image of a file to be projected, and perform corner detection on the initial image to obtain initial pixel coordinates of each corner in the initial image;
the coordinate conversion module 20 is configured to convert the initial pixel coordinate to obtain a target pixel coordinate of each corner;
a second obtaining module 30, configured to obtain an aspect ratio of the projection image, and obtain a target projection image according to the aspect ratio, the target pixel coordinates, and the initial image;
and the image projection module 40 is used for projecting the target projection image.
Wherein, each virtual function module of the projection device is stored in the memory 1005 of the projection device shown in fig. 1, and is used for implementing all functions of the projection program; when each module is executed by the processor 1001, the function of fast projection of the physical file can be realized.
Further, the coordinate conversion module 20 includes:
the first calculation unit is used for calculating and obtaining initial centroid coordinates according to the initial pixel coordinates;
the offset value acquisition unit is used for acquiring a coordinate offset value between the initial centroid coordinate and a preset centroid coordinate;
and the second calculation unit is used for calculating the target pixel coordinates of each corner point according to the coordinate offset value and the initial pixel coordinates.
Further, the second obtaining module 30 includes:
a first determining unit, configured to obtain an aspect ratio of a projection image, and determine imaging point pixel coordinates according to the aspect ratio;
the third calculation unit is used for calculating a homography matrix according to the imaging point pixel coordinates and the target pixel coordinates;
and the image conversion unit is used for converting the initial image based on the homography matrix to obtain a target projection image.
Further, the image conversion unit is specifically configured to:
converting the initial image based on the homography matrix to obtain an initial projection image;
generating a corresponding projection image selection interface based on the initial projection image;
and receiving a projection image selection instruction triggered based on the projection image selection interface, and determining a target projection image according to the projection image selection instruction.
Further, the projection device further includes:
the detection module is used for acquiring the number of corner points in the initial image and detecting whether the number is a preset value or not;
the coordinate conversion module 20 is specifically configured to: if the number is a preset value, converting the initial pixel coordinates to obtain target pixel coordinates of each corner point;
and the prompting module is used for generating corresponding prompting information to prompt a user to adjust the position of the file to be projected if the number is not a preset value.
Further, the image projection module 40 includes:
the second determining unit is used for obtaining a projection distance and determining a target projection size according to the projection distance and the image size of the target projection image;
a third determining unit configured to determine a target projection ratio according to the target projection size and the projection distance;
and the image projection unit is used for scaling the target projection image based on the target projection ratio so as to project.
Further, the image projection module 40 includes:
the device searching unit is used for searching the third-party projection device and establishing communication connection with the searched third-party projection device;
and the image sending unit is used for sending the target projection image to the third party projection device based on the communication connection so that the third party projection device projects the target projection image.
The function implementation of each module in the projection device corresponds to each step in the projection method embodiment, and the function and implementation process thereof are not described in detail herein.
The present invention also provides a computer-readable storage medium having stored thereon a projection program which, when executed by a processor, implements the steps of the projection method according to any of the above embodiments.
The specific embodiments of the computer readable storage medium of the present invention are substantially the same as the above-described embodiments of the projection method, and are not described herein.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, 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 process, method, article, or system. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The foregoing embodiment numbers of the present invention are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) as described above, including several instructions for causing a device (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the method according to the embodiments of the present invention.
The foregoing description is only of the preferred embodiments of the present invention, and is not intended to limit the scope of the invention, but rather is intended to cover any equivalents of the structures or equivalent processes disclosed herein or in the alternative, which may be employed directly or indirectly in other related arts.

Claims (8)

1. A projection method, characterized in that the projection method comprises the steps of:
shooting and acquiring an initial image of a file to be projected through a camera, and detecting angular points of the initial image to obtain initial pixel coordinates of each angular point in the initial image;
converting the initial pixel coordinates to obtain target pixel coordinates of each corner point;
obtaining the length-width ratio of a projection image, and obtaining a target projection image according to the length-width ratio, the target pixel coordinates and the initial image, wherein the length-width ratio of the projection image is a preset ratio;
projecting the target projection image;
the step of converting the initial pixel coordinates to obtain target pixel coordinates of each corner point includes:
calculating to obtain an initial centroid coordinate according to the initial pixel coordinate;
acquiring a coordinate offset value between the initial centroid coordinate and a preset centroid coordinate;
calculating to obtain target pixel coordinates of each corner point according to the coordinate offset value and the initial pixel coordinates;
the step of obtaining the aspect ratio of the projection image and obtaining the target projection image according to the aspect ratio, the target pixel coordinates and the initial image comprises the following steps:
acquiring an aspect ratio of a projection image, and determining imaging point pixel coordinates according to the aspect ratio, wherein the imaging point pixel coordinates are pixel coordinates on a projection imaging plane of the camera;
calculating to obtain a homography matrix according to the imaging point pixel coordinates and the target pixel coordinates;
and converting the initial image based on the homography matrix to obtain a target projection image.
2. The projection method of claim 1, wherein the step of converting the initial image based on the homography matrix to obtain a target projection image comprises:
converting the initial image based on the homography matrix to obtain an initial projection image;
generating a corresponding projection image selection interface based on the initial projection image;
and receiving a projection image selection instruction triggered based on the projection image selection interface, and determining a target projection image according to the projection image selection instruction.
3. The projection method according to any one of claims 1 to 2, wherein before the step of converting the initial pixel coordinates to obtain target pixel coordinates for each corner, the projection method further comprises:
acquiring the number of corner points in the initial image, and detecting whether the number is a preset value or not;
if yes, executing the steps of: converting the initial pixel coordinates to obtain target pixel coordinates of each corner point;
if not, generating corresponding prompt information to prompt a user to adjust the position of the file to be projected.
4. The projection method according to any one of claims 1 to 2, wherein the step of projecting the target projection image includes:
acquiring a projection distance, and determining a target projection size according to the projection distance and the image size of the target projection image;
determining a target projection ratio according to the target projection size and the projection distance;
and scaling the target projection image based on the target projection ratio to perform projection.
5. The projection method according to any one of claims 1 to 2, wherein the step of projecting the target projection image includes:
searching a third party projection device and establishing communication connection with the searched third party projection device;
and transmitting the target projection image to the third party projection device based on the communication connection, so that the third party projection device projects the target projection image.
6. A projection device, the projection device comprising:
the first acquisition module is used for shooting and acquiring an initial image of a file to be projected through a camera, and detecting angular points of the initial image to obtain initial pixel coordinates of each angular point in the initial image;
the coordinate conversion module is used for converting the initial pixel coordinates to obtain target pixel coordinates of each corner point;
the second acquisition module is used for acquiring the length-width ratio of the projection image and obtaining a target projection image according to the length-width ratio, the target pixel coordinates and the initial image, wherein the length-width ratio of the projection image is a preset ratio;
the image projection module is used for projecting the target projection image;
wherein, the coordinate conversion module is further used for:
calculating to obtain an initial centroid coordinate according to the initial pixel coordinate;
acquiring a coordinate offset value between the initial centroid coordinate and a preset centroid coordinate;
calculating to obtain target pixel coordinates of each corner point according to the coordinate offset value and the initial pixel coordinates;
the second obtaining module is further configured to:
acquiring an aspect ratio of a projection image, and determining imaging point pixel coordinates according to the aspect ratio, wherein the imaging point pixel coordinates are pixel coordinates on a projection imaging plane of the camera;
calculating to obtain a homography matrix according to the imaging point pixel coordinates and the target pixel coordinates;
and converting the initial image based on the homography matrix to obtain a target projection image.
7. A projection device comprising a memory, a processor and a projection program stored on the memory and executable by the processor, wherein the projection program, when executed by the processor, implements the steps of the projection method according to any one of claims 1 to 5.
8. A computer readable storage medium, characterized in that the computer readable storage medium has stored thereon a projection program, wherein the projection program, when executed by a processor, implements the steps of the projection method according to any of claims 1 to 5.
CN202010370864.8A 2020-04-30 2020-04-30 Projection method, apparatus, device and computer readable storage medium Active CN111405258B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010370864.8A CN111405258B (en) 2020-04-30 2020-04-30 Projection method, apparatus, device and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010370864.8A CN111405258B (en) 2020-04-30 2020-04-30 Projection method, apparatus, device and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN111405258A CN111405258A (en) 2020-07-10
CN111405258B true CN111405258B (en) 2023-06-20

Family

ID=71430002

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010370864.8A Active CN111405258B (en) 2020-04-30 2020-04-30 Projection method, apparatus, device and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN111405258B (en)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112051867B (en) * 2020-09-15 2023-03-07 成都极米科技股份有限公司 Method and device for automatically adjusting projection position, projection equipment, system and medium
CN112348909A (en) * 2020-10-26 2021-02-09 北京市商汤科技开发有限公司 Target positioning method, device, equipment and storage medium
CN114485388A (en) * 2020-10-26 2022-05-13 成都极米科技股份有限公司 Projection equipment control method and device, projection equipment and storage medium
CN113160305B (en) * 2021-02-23 2023-04-25 歌尔光学科技有限公司 Parallel detection method, equipment, storage medium and device
CN113365040B (en) * 2021-02-24 2023-03-14 深圳市火乐科技发展有限公司 Projection correction method, projection correction device, storage medium and electronic equipment
CN114157847A (en) * 2021-11-11 2022-03-08 深圳市普渡科技有限公司 Projection method, system, terminal device, robot and storage medium
CN114125411B (en) * 2021-12-01 2024-05-28 深圳市火乐科技发展有限公司 Projection device correction method, projection device correction device, storage medium and projection device
CN114972238B (en) * 2022-05-20 2024-04-23 广东正业科技股份有限公司 Method and device for calculating cladding value of laminated battery cell and storage medium
CN116095290B (en) * 2023-04-11 2024-03-26 深圳新智联软件有限公司 Projection automatic framing method and device and electronic equipment

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105554486A (en) * 2015-12-22 2016-05-04 Tcl集团股份有限公司 Projection calibration method and device
CN105704466A (en) * 2016-01-29 2016-06-22 北京小鸟科技发展有限责任公司 A DLP projection method, a DLP projection apparatus and a DLP projector
CN107845068A (en) * 2016-09-18 2018-03-27 富士通株式会社 Image aspects converting means and method
CN109167986A (en) * 2018-09-04 2019-01-08 黔东南民族职业技术学院 A kind of teaching projection method and system
CN110769218A (en) * 2018-10-10 2020-02-07 成都极米科技股份有限公司 Image processing method, projection apparatus, and photographing apparatus
CN110996081A (en) * 2019-12-06 2020-04-10 北京一数科技有限公司 Projection picture correction method and device, electronic equipment and readable storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105554486A (en) * 2015-12-22 2016-05-04 Tcl集团股份有限公司 Projection calibration method and device
CN105704466A (en) * 2016-01-29 2016-06-22 北京小鸟科技发展有限责任公司 A DLP projection method, a DLP projection apparatus and a DLP projector
CN107845068A (en) * 2016-09-18 2018-03-27 富士通株式会社 Image aspects converting means and method
CN109167986A (en) * 2018-09-04 2019-01-08 黔东南民族职业技术学院 A kind of teaching projection method and system
CN110769218A (en) * 2018-10-10 2020-02-07 成都极米科技股份有限公司 Image processing method, projection apparatus, and photographing apparatus
CN110996081A (en) * 2019-12-06 2020-04-10 北京一数科技有限公司 Projection picture correction method and device, electronic equipment and readable storage medium

Also Published As

Publication number Publication date
CN111405258A (en) 2020-07-10

Similar Documents

Publication Publication Date Title
CN111405258B (en) Projection method, apparatus, device and computer readable storage medium
US8860795B2 (en) Masquerading detection system, masquerading detection method, and computer-readable storage medium
US9998719B2 (en) Non-planar surface projecting system, auto-calibration method thereof, and auto-calibration device thereof
US12167180B2 (en) Information processing device, information processing method, program, projection device, and information processing system
US10204404B2 (en) Image processing device and image processing method
CN107950019B (en) Information processing apparatus, information processing method, and computer-readable storage medium
TW201346216A (en) Virtual ruler
US10433119B2 (en) Position determination device, position determining method, and storage medium
WO2011007746A1 (en) Fingertip-manipulation-type information providing system, interactive manipulation device, computer program, and storage medium
CN107562288B (en) Response method based on infrared touch device, infrared touch device and medium
CN114640833B (en) Projection picture adjusting method, device, electronic equipment and storage medium
US20200042777A1 (en) Method, apparatus and device for determining an object, and storage medium for the same
US9319666B1 (en) Detecting control points for camera calibration
CN113329179B (en) Shooting alignment method, device, equipment and storage medium
US20160054806A1 (en) Data processing apparatus, data processing system, control method for data processing apparatus, and storage medium
CN112912936A (en) Mixed reality system, program, mobile terminal device and method
CN115278184B (en) Projection picture correction method and device
CN115086631B (en) Image generation method and information processing device
CN115147843A (en) Text recognition method, device, storage medium and computer equipment
WO2023274090A1 (en) Scanning method and system for portable electronic device, and electronic device and storage medium
CN113412612A (en) Information processing apparatus, information processing method, and recording medium
CN115953443B (en) Image registration method and device based on edge characteristics, user terminal and medium
CN117830432A (en) A calibration method for grating projection system based on SSA-BP neural network
CN114723800B (en) Point cloud data correction method and correction device, electronic device and storage medium
Cutter et al. Real time camera phone guidance for compliant document image acquisition without sight

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