CN111405258A - Projection method, device, equipment and computer readable storage medium - Google Patents
Projection method, device, equipment and computer readable storage medium Download PDFInfo
- Publication number
- CN111405258A CN111405258A CN202010370864.8A CN202010370864A CN111405258A CN 111405258 A CN111405258 A CN 111405258A CN 202010370864 A CN202010370864 A CN 202010370864A CN 111405258 A CN111405258 A CN 111405258A
- Authority
- CN
- China
- Prior art keywords
- projection
- image
- target
- initial
- 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.)
- Granted
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N9/00—Details of colour television systems
- H04N9/12—Picture reproducers
- H04N9/31—Projection devices for colour picture display, e.g. using electronic spatial light modulators [ESLM]
- H04N9/3179—Video signal processing therefor
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N9/00—Details of colour television systems
- H04N9/12—Picture reproducers
- H04N9/31—Projection devices for colour picture display, e.g. using electronic spatial light modulators [ESLM]
- H04N9/3179—Video signal processing therefor
- H04N9/3185—Geometric adjustment, e.g. keystone or convergence
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 carrying out 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; acquiring the aspect ratio of the projected image, and obtaining a target projected image according to the aspect 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 real object file and simplify the projection operation.
Description
Technical Field
The present invention relates to the field of image processing technologies, and in particular, to a projection method, an apparatus, a device, and a computer-readable storage medium.
Background
Currently, when a work report is made, it is common to demonstrate the PPT using an indoor projector to demonstrate to a leader or client. If there is a temporary file to be displayed in a projection manner, the file to be displayed must be scanned by a scanning device, converted into an electronic file, and then uploaded to a terminal for displaying, so that the operation is complex. Therefore, a method for realizing fast projection of a physical file 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 the rapid projection of a real object file and simplify the 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 carrying out 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;
acquiring the aspect ratio of the projected image, and obtaining a target projected image according to the aspect ratio, the target pixel coordinates and the initial image;
and projecting the target projection image.
Optionally, 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;
and calculating to obtain the target pixel coordinate of each corner point according to the coordinate deviation value and the initial pixel coordinate.
Optionally, the obtaining an aspect ratio of the projection image, and obtaining a target projection image according to the aspect ratio, the target pixel coordinate, and the initial image includes:
acquiring the aspect ratio of a projected image, and determining the pixel coordinates of an imaging point according to the aspect ratio;
calculating to obtain a homography matrix according to the pixel coordinates of the imaging points 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;
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 coordinates to obtain the target pixel coordinates of each corner point, the method further includes:
acquiring the number of angular points in the initial image, and detecting whether the number is a preset value;
if yes, executing the following steps: 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;
scaling the target projection image based on the target projection ratio to project.
Optionally, the step of projecting the target projection image includes:
searching third-party projection equipment and establishing communication connection with the searched third-party projection equipment;
and sending the target projection image to the third-party projection equipment based on the communication connection so that the third-party projection equipment projects the target projection image.
In addition, to achieve the above object, the present invention also provides a projection apparatus comprising:
the device comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring an initial image of a file to be projected and carrying out corner point detection on the initial image to obtain initial pixel coordinates of each corner 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 projected image and obtaining a target projected image according to the length-width ratio, the target pixel coordinate and the initial image;
and the image projection module is used for projecting the target projection image.
In addition, to achieve the above object, the present invention further provides a projection apparatus, which includes 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, to achieve the above object, the present invention further 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 device, equipment and a computer readable storage medium, which are characterized in that an initial image of a file to be projected is obtained first, and angular point detection is carried out on 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 acquiring the length-width ratio of the projected image, acquiring a target projected image according to the length-width ratio, the target pixel coordinate and the initial image, and projecting the target projected image. In the method, the initial image of the file to be projected is obtained through direct shooting, and then the target projection image which can be used for projection is obtained through a series of processing so as to carry out projection, so that the rapid projection of the file to be projected can be realized.
Drawings
FIG. 1 is a schematic diagram of an apparatus architecture 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 a projection method according to the present invention;
fig. 3 is a functional block diagram of a projection apparatus according to a first embodiment of the invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Referring to fig. 1, fig. 1 is a schematic device structure diagram of a hardware operating environment according to an embodiment of the present invention.
The projection device according to the embodiment of the present invention may be an intelligent projection robot, or may be a terminal device such as a Personal Computer (PC) or a notebook computer.
As shown in fig. 1, the projection apparatus may include: a processor 1001, such as a CPU (Central processing unit), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. The communication bus 1002 is used for realizing connection communication among the components; the user interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a Wireless interface (e.g., a Wi-Fi interface, Wireless-Fidelity, Wi-Fi interface); the memory 1005 may be a Random Access Memory (RAM) or a non-volatile memory (non-volatile memory), such as a magnetic disk memory, and the memory 1005 may optionally be a storage device independent of the processor 1001. Those skilled in the art will appreciate that the projection device configuration shown in fig. 1 does not constitute a limitation of the projection device and may include more or fewer components than shown, or some components may be combined, or a different arrangement of components.
With continued reference to fig. 1, a memory 1005, which is one type of computer storage medium in fig. 1, may include an operating system, a network communication module, and a projection program. 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 configured to call a 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 proposed.
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 including:
step S10, obtaining 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;
in this embodiment, the projection method is implemented by a projection device, which may be an intelligent projection robot, or a device such as a PC or a notebook computer, and the projection device is described 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. Wherein, this camera can 360 free rotations to in shoot.
In this embodiment, a user may place a to-be-projected file (such as a paper file, a photo, a leaflet, etc.) on a plane, and simultaneously place an intelligent projection robot on a plane, for example, all of the to-be-projected files are placed on a desktop, the user may adjust an angle of a camera of the intelligent projection robot according to a placement position of the to-be-projected file, and then trigger a projection instruction by triggering a button on the intelligent projection robot, or by voice operation, and at this time, when the intelligent projection robot receives the projection instruction, the intelligent projection robot obtains an initial image of the to-be-projected file through shooting by 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.
The corner point in the embodiment is a point corresponding to a vertex of a file to be projected on an initial image, and during corner point detection, detection can be performed by using a Harris corner point detection method, wherein the Harris corner point is a corner point extraction algorithm directly based on a gray scale image, and has high stability, and particularly high detection precision on a L type corner point (namely right angle).
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, acquiring a coordinate offset value between the initial centroid coordinate and a preset centroid coordinate;
step a23, 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 obtained by calculation according to the initial pixel coordinate. Centroid coordinates refer to the position of a point in the graph relative to each vertex in the geometry. The initial centroid coordinate in this embodiment is a position of a point in a graph formed by points corresponding to the initial pixel coordinate relative to each vertex. Generally speaking, 4 corner points can be detected based on the image of the document to be projected, and then, the corresponding initial centroid coordinates can be calculated according to the initial pixel coordinates of the 4 corner points, and the specific calculation method can refer to the prior art.
Then, a coordinate offset value between the initial centroid coordinate and the preset centroid coordinate is obtained. The preset centroid coordinate is calculated based on the preset 4 vertexes of the initial image, and may be (0,0) for convenience of calculation. Wherein the coordinate offset value may include a horizontal coordinate offset value and a vertical coordinate offset value. For example, if the initial pixel coordinates of each corner point are A1 (x)A0,yA0)、B1(xB0,yB0)、C1(xC0,yC0)、D1(xD0,yD0) The corresponding initial centroid coordinates are (x1, y1), the preset centroid coordinates are (0,0), so that the transverse coordinate offset value is △ x, x1, x0, x1, and the longitudinal coordinate offset value is △ y, y1, y0, y1 can be calculated.
And finally, calculating to obtain the target pixel coordinates of each corner point according to the coordinate offset value and the initial pixel coordinates. For example, in the above example, the corresponding target pixel coordinate A2 (x) may be obtainedA0-△x,yA0-△y)、B2(xB0-△x,yB0-△y)、C2(xC0-△x,yC0-△y)、D2(xD0-△x,yD0-△y)。
Step S30, acquiring the length-width ratio of the projected image, and obtaining a target projected image according to the length-width ratio, the target pixel coordinates and the initial image;
after the target pixel coordinates of each corner point in the initial image are obtained, the length-width ratio of the projected image is obtained, and the target projected image is obtained according to the length-width ratio, the target pixel coordinates and the initial image. The aspect ratio of the projection image may be preset, and is a preset ratio, such as 1: 2. 2: 1. 4: 3 or 3: 4, an aspect ratio option can also be provided in advance for a 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; the communication connection between the intelligent projection robot and the user side can also be suggested, the length-width ratio option is sent to the user side for the user to select, and then the selection instruction returned by the user is received, so that the length-width ratio of the projected image is obtained.
For the acquisition of the target projection image, the length-width ratio of the projection image can be acquired firstly, and the pixel coordinates of the imaging point are determined according to the length-width 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 then converting the initial image based on the homography matrix to obtain a target projection image. For a specific obtaining process, reference may be made to the following second embodiment, which is not described herein again.
Step S40, projecting the target projection image.
And projecting the target projection image after the target projection image is obtained. The specific projection modes include the following two modes: 1) the intelligent projection robot has a projection function, and can zoom a target projection image based on a target projection ratio after the target projection ratio is obtained so as to project the target projection image; 2) the method comprises the steps of matching with third-party projection equipment to realize projection, specifically, searching the third-party projection equipment first, and establishing communication connection with the searched third-party projection equipment; and then transmitting the target projection image to a third-party projection device based on the communication connection so that the third-party projection device projects the target projection image. Specific projection processes can be referred to the third and fourth embodiments described below.
The invention provides a projection method, which comprises the steps of firstly obtaining an initial image of a file to be projected, and carrying out corner point detection on the initial image to obtain initial pixel coordinates of each corner point in the initial image; then, converting the initial pixel coordinates to obtain target pixel coordinates of each corner point; and acquiring the length-width ratio of the projected image, acquiring a target projected image according to the length-width ratio, the target pixel coordinate and the initial image, and projecting the target projected image. In the embodiment of the invention, the initial image of the file to be projected is obtained by direct shooting, and then the target projection image which can be used for projection is obtained through a series of processing so as to carry out projection, so that the rapid projection of the file to be projected can be realized.
Further, based on the first embodiment, a second embodiment of the projection method of the present invention is proposed.
In this embodiment, step S30 may include:
step a31, acquiring the aspect ratio of the projected image, and determining the pixel coordinates of the imaging point according to the aspect ratio;
in this embodiment, the process of acquiring the target projection image is specifically as follows:
the aspect ratio of the projection image is obtained first, and the aspect ratio of the projection image may be preset and may be a preset ratio, such as 1: 2. 2: 1. 4: 3 or 3: 4, an aspect ratio option can also be provided in advance for a 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; the communication connection between the intelligent projection robot and the user side can also be suggested, the length-width ratio option is sent to the user side for the user to select, and then the selection instruction returned by the user is received, so that the length-width ratio of the projected image is obtained.
Imaging point pixel coordinates are then determined from the aspect ratio. The pixel coordinates of the imaging point are recorded as the 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 pixel coordinates of the imaging point and the target pixel coordinates;
and then, calculating to obtain a homography matrix according to the pixel coordinates of the imaging points and the target pixel coordinates. Specifically, the pixel coordinates of the imaging point are matched with the target pixel coordinates to obtain a plurality of groups of coordinates, each group of coordinates is then substituted into a preset formula, and finally, a homography matrix is obtained through calculation.
For convenience of explanation, assume that the corner includes 4 corners, and the coordinates of the corresponding target pixels are respectively denoted as a1(u1,v1)、B1(u2,v2)、C1(u3,v3)、D1(u4,v4) Let the pixel coordinates of the imaging point be A2(u'1,v'1),B2(u'2,v'2),C2(u'3,v'3),D2(u'4,v'4) In respect of A1And A2Matching, the homography matrix is H, then there are:
thus, there are:
u′1=H11u1+H12v1+H13,
v′1=H21u1+H22v1+H23,
1=H31u1+H32v1+H33,
according to the above formula, it is obtained
u'1(H31u1+H32v1+H33)=H11u1+H12v1+H13,
v'1(H31u1+H32v1+H33)=H21u1+H22v1+H23,
Let H be (H)11,H12,H13,H21,H22,H23,H31,H32,1)TSince the homography matrix is a homogeneous matrix, theTo normalize the last element to 1.
Thus, the above formula can be written as
axh=0,
ayh=0,
Wherein the content of the first and second substances,
ax=(-u1,-u2,-1,0,0,0,u1u'1,v1u'1,u'1)
ay=(0,0,0,-u1,-v1,-1,v'1u1,v'1v1,v'1)
therefore, a pair of matching points can obtain the above two equations, and since the H matrix has 8 degrees of freedom, at least 4 pairs of points are needed to obtain the H matrix, and therefore, the H matrix can be obtained by matching the target pixel coordinates with the target pixel coordinates to obtain 4 sets of coordinates.
Step a33, converting the initial image based on the homography matrix to obtain a target projection image.
And 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, the matching is performed sequentially based on the position when the matching is performed. For example, in the above examples, if A1、B1、C1And D1Connected in sequence to form a rectangle A2、B2、C2And D2The sequential connection may form a rectangle. On match, there are 4 results: 1) a. the1And A2、B1And B2、C1And C2、D1And D2;1)A1And B2、B1And C2、C1And D2、D1And A2;1)A1And C2、B1And D2、C1And A2、D1And B2;1)A1And D2、B1And A2、C1And B2、D1And C2. That is, in the process of matching pixel coordinates, A1Possibly with A2Match (at this time, B1And B2Matching, C1And C2Matching, D1And D2Match) with B is also possible2、C2Or D2Matching, that is, there may be 4 matching cases, and there are 4 corresponding projection images, and in order to determine the final target projection image, the preliminary obtained projection image needs to be subjected to. 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 this embodiment, the initial image is converted based on the homography matrix to obtain an initial projection image; that is, 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 initial projection image, so as to obtain the initial projection image. If the number of the corner points is 4, the corresponding initial projection image also comprises 4. 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 can also be sent to a user side through communication connection between the intelligent projection robot and the user side so as to be selected by the user; 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.
By the mode, the initial image of the file to be projected can be converted to obtain the target projection image, so that projection display can be performed subsequently.
Further, based on the first and second embodiments described above, 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, acquiring the number of angular points in the initial image, and detecting whether the number is a preset value;
in this embodiment, in order to ensure that the initial image of the file to be projected is completely photographed, that is, all corners of the file to be projected are photographed, the number of the corners in the initial image may be determined by detecting whether the number of the corners in the initial image is a preset number.
Specifically, the number of corner points in the initial image is obtained, and whether the number is a preset number or not is detected. The preset value is preset, and optionally may be set to 4, because general documents such as paper documents, photos, flyers, etc. all include 4 vertices. Of course, it is understood that the preset value may be preset according to the document to be displayed in the specific implementation.
If yes, go to step S20: converting the initial pixel coordinates to obtain target pixel coordinates of each corner point;
and 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, it is indicated that the initial image of the file to be projected is completely shot, and at this time, the following 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. The specific implementation process can refer to the above embodiment.
If the number of the angular points is not a preset value, it is indicated that the initial image shooting of the file to be projected is incomplete, and at this time, corresponding prompt information is generated to prompt a user to adjust the position of the file to be projected. The prompting mode can be voice prompt, and meanwhile, the user can be informed of the current position of the file to be projected so as to be convenient for the user to move.
In this embodiment, whether the number of the angular points in the initial image is a preset value or not is detected, and when the number of the angular points is not the preset value, a user is timely reminded to adjust the position of the file to be projected, so that the initial image of the file to be projected can be completely shot, and the integrity of the target projected image can be further ensured.
Further, based on the first and second embodiments described above, a fourth embodiment of the projection method of the present invention is proposed.
In this embodiment, step S40 may include:
step a41, acquiring 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 acquiring the target projection ratio, the intelligent projection robot may perform projection by scaling the target projection image based on the target projection ratio.
Specifically, a projection distance is acquired first, and a target projection size is determined according to the projection distance and the image size of the target projection image. Wherein, the projection distance is the distance between intelligent projection robot and projection curtain or the wall promptly, can set up infrared signal transmitting device and infrared signal receiving device in intelligent projection robot, when carrying out the projection, launch a branch of infrared light through infrared signal transmitting device earlier, form the reflection when shining on the wall or on the projection curtain, then receive the reflection signal through infrared signal receiving device, and then based on the time difference of infrared signal emission time and reflection signal reception time, calculate the distance that obtains intelligent projection robot apart from projection curtain or wall. The image size of the target projection image includes an image width and an image height, and correspondingly, the target projection size also includes a projection width and a projection height. The determination of the target projection size may be based on the projection distance, the image size of the target projection image, and a preset mapping relationship. The preset mapping relation comprises the projection distances of different intervals and the mapping relation between the image sizes in different ranges and the target projection size.
Here, it should be noted that, since too close or too far distance may affect the projection effect, or even fail to project, 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. And if the projection distance is not within the preset distance range, generating corresponding prompt information to prompt a user to move the intelligent projection robot. If the projection distance is within the preset distance range, continuing to execute the step a41 to obtain the projection distance, determining the target projection size according to the projection distance and the image size of the target projection image, and further executing the subsequent steps.
Step a42, determining a target projection ratio according to the target projection size and the projection distance;
step a43, scaling the target projection image based on the target projection ratio for projection.
Then, a target projection ratio is determined according to the target projection size and the projection distance, wherein the target projection ratio is equal to the ratio of the projection distance to the projection width. Further, the target projection image is scaled based on the target projection ratio to perform projection.
Of course, in the implementation, the target projection image may be scaled according to a preset projection ratio to perform projection. The preset projection ratio is preset, the intelligent projection robot is suitable for being placed in a certain preset position range under the condition, and therefore the 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 aid of the mode, the target projection image can be zoomed based on the target projection ratio after the target projection ratio is obtained, so that the file to be projected can be rapidly projected.
Further, a fifth embodiment of the projection method of the present invention is proposed based on the above-described first and second embodiments.
In this embodiment, step S40 may further include:
step a44, searching a third-party projection device, and establishing communication connection with the searched third-party projection device;
step a45, 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.
As another projection mode, the projection mode 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 with 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 mode, after the initial image of the file to be projected is processed to obtain the corresponding target projection image, the target projection image is matched with third-party projection equipment to realize rapid projection of the file to be projected.
The invention also provides a projection device.
Referring to fig. 3, fig. 3 is a functional block diagram of a projection apparatus according to a first embodiment of the 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;
a coordinate conversion module 20, configured to convert the initial pixel coordinates to obtain target pixel coordinates of each corner point;
the second obtaining module 30 is configured to obtain an aspect ratio of the projection image, and obtain a target projection image according to the aspect ratio, the target pixel coordinate, and the initial image;
and the image projection module 40 is used for projecting the target projection image.
Each virtual function module of the projection apparatus is stored in the memory 1005 of the projection device shown in fig. 1, and is used for implementing all functions of a projection program; when executed by the processor 1001, the modules may implement a function of fast projecting a physical file.
Further, the coordinate conversion module 20 includes:
the first calculating unit is used for calculating to obtain an initial centroid coordinate according to the initial pixel coordinate;
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 and obtaining the target pixel coordinates of each corner point according to the coordinate deviation value and the initial pixel coordinates.
Further, the second obtaining module 30 includes:
the first determining unit is used for acquiring the aspect ratio of the projected image and determining the pixel coordinates of the imaging point according to the aspect ratio;
the third calculation unit is used for calculating to obtain a homography matrix according to the pixel coordinates of the imaging point 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;
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 apparatus further includes:
the detection module is used for acquiring the number of the angular 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 coordinate to obtain a target pixel coordinate of each corner point;
and the prompting module is used for generating corresponding prompting information if the number is not a preset value so as to prompt a user to adjust the position of the file to be projected.
Further, the image projection module 40 includes:
the second determining unit is used for acquiring 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 perform projection.
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 equipment based on the communication connection so as to enable the third-party projection equipment to project the target projection image.
The function implementation of each module in the projection apparatus corresponds to each step in the projection method embodiment, and the function and implementation process thereof are not described in detail here.
The present invention also provides a computer readable storage medium having a projection program stored thereon, which when executed by a processor implements the steps of the projection method as described in any of the above embodiments.
The specific embodiment of the computer-readable storage medium of the present invention is substantially the same as the embodiments of the projection method described above, and is not described herein again.
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 an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) as described above, and includes instructions for enabling a device (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.
Claims (10)
1. A projection method, characterized in that the projection method comprises the steps of:
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;
converting the initial pixel coordinates to obtain target pixel coordinates of each corner point;
acquiring the aspect ratio of the projected image, and obtaining a target projected image according to the aspect ratio, the target pixel coordinates and the initial image;
and projecting the target projection image.
2. The projection method of claim 1, wherein the step of converting the initial pixel coordinates to obtain the target pixel coordinates of each corner point comprises:
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 to obtain the target pixel coordinate of each corner point according to the coordinate deviation value and the initial pixel coordinate.
3. The projection method of claim 1, wherein the step of obtaining an aspect ratio of the projection image and obtaining a target projection image based on the aspect ratio, the target pixel coordinates and the initial image comprises:
acquiring the aspect ratio of a projected image, and determining the pixel coordinates of an imaging point according to the aspect ratio;
calculating to obtain a homography matrix according to the pixel coordinates of the imaging points and the target pixel coordinates;
and converting the initial image based on the homography matrix to obtain a target projection image.
4. The projection method of claim 3, wherein the step of transforming 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;
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.
5. The projection method according to any of claims 1 to 4, wherein the step of converting the initial pixel coordinates to obtain the target pixel coordinates of each corner point further comprises:
acquiring the number of angular points in the initial image, and detecting whether the number is a preset value;
if yes, executing the following steps: 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.
6. The projection method of any of claims 1 to 4, wherein the step of projecting the target projection image comprises:
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;
scaling the target projection image based on the target projection ratio to project.
7. The projection method of any of claims 1 to 4, wherein the step of projecting the target projection image comprises:
searching third-party projection equipment and establishing communication connection with the searched third-party projection equipment;
and sending the target projection image to the third-party projection equipment based on the communication connection so that the third-party projection equipment projects the target projection image.
8. A projection device, the projection device comprising:
the device comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring an initial image of a file to be projected and carrying out corner point detection on the initial image to obtain initial pixel coordinates of each corner 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 projected image and obtaining a target projected image according to the length-width ratio, the target pixel coordinate and the initial image;
and the image projection module is used for projecting the target projection image.
9. A projection device, characterized in that the projection device comprises 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 claimed in any one of claims 1 to 7.
10. 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 of any one of claims 1 to 7.
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 true CN111405258A (en) | 2020-07-10 |
CN111405258B 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) |
Cited By (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112051867A (en) * | 2020-09-15 | 2020-12-08 | 成都极米科技股份有限公司 | 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 |
CN112584116A (en) * | 2021-02-24 | 2021-03-30 | 深圳市火乐科技发展有限公司 | Projection correction method, projection correction device, storage medium and electronic equipment |
CN114125411A (en) * | 2021-12-01 | 2022-03-01 | 深圳市火乐科技发展有限公司 | Projection equipment correction method and device, storage medium and projection equipment |
CN114157847A (en) * | 2021-11-11 | 2022-03-08 | 深圳市普渡科技有限公司 | Projection method, system, terminal device, robot and storage medium |
CN114485388A (en) * | 2020-10-26 | 2022-05-13 | 成都极米科技股份有限公司 | Projection equipment control method and device, projection equipment and storage medium |
CN114972238A (en) * | 2022-05-20 | 2022-08-30 | 广东正业科技股份有限公司 | Method and device for calculating laminated battery cell coating value and storage medium |
CN113160305B (en) * | 2021-02-23 | 2023-04-25 | 歌尔光学科技有限公司 | Parallel detection method, device, storage medium and apparatus |
CN116095290A (en) * | 2023-04-11 | 2023-05-09 | 深圳新智联软件有限公司 | Projection automatic framing method and device and electronic equipment |
CN114972238B (en) * | 2022-05-20 | 2024-04-23 | 广东正业科技股份有限公司 | Method and device for calculating cladding value of laminated battery cell and storage medium |
Citations (6)
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 |
-
2020
- 2020-04-30 CN CN202010370864.8A patent/CN111405258B/en active Active
Patent Citations (6)
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 |
Cited By (15)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112051867A (en) * | 2020-09-15 | 2020-12-08 | 成都极米科技股份有限公司 | Method and device for automatically adjusting projection position, projection equipment, system and medium |
CN112051867B (en) * | 2020-09-15 | 2023-03-07 | 成都极米科技股份有限公司 | Method and device for automatically adjusting projection position, projection equipment, system and medium |
CN114485388A (en) * | 2020-10-26 | 2022-05-13 | 成都极米科技股份有限公司 | Projection equipment control method and device, projection equipment and storage medium |
CN112348909A (en) * | 2020-10-26 | 2021-02-09 | 北京市商汤科技开发有限公司 | Target positioning method, device, equipment and storage medium |
CN113160305B (en) * | 2021-02-23 | 2023-04-25 | 歌尔光学科技有限公司 | Parallel detection method, device, storage medium and apparatus |
CN112584116B (en) * | 2021-02-24 | 2021-06-29 | 深圳市火乐科技发展有限公司 | Projection correction method, projection correction device, storage medium and electronic equipment |
CN113365040A (en) * | 2021-02-24 | 2021-09-07 | 深圳市火乐科技发展有限公司 | Projection correction method, projection correction device, storage medium and electronic equipment |
CN113365040B (en) * | 2021-02-24 | 2023-03-14 | 深圳市火乐科技发展有限公司 | Projection correction method, projection correction device, storage medium and electronic equipment |
CN112584116A (en) * | 2021-02-24 | 2021-03-30 | 深圳市火乐科技发展有限公司 | 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 |
CN114125411A (en) * | 2021-12-01 | 2022-03-01 | 深圳市火乐科技发展有限公司 | Projection equipment correction method and device, storage medium and projection equipment |
CN114972238A (en) * | 2022-05-20 | 2022-08-30 | 广东正业科技股份有限公司 | Method and device for calculating laminated battery cell coating value and storage medium |
CN114972238B (en) * | 2022-05-20 | 2024-04-23 | 广东正业科技股份有限公司 | Method and device for calculating cladding value of laminated battery cell and storage medium |
CN116095290A (en) * | 2023-04-11 | 2023-05-09 | 深圳新智联软件有限公司 | Projection automatic framing method and device and electronic equipment |
CN116095290B (en) * | 2023-04-11 | 2024-03-26 | 深圳新智联软件有限公司 | Projection automatic framing method and device and electronic equipment |
Also Published As
Publication number | Publication date |
---|---|
CN111405258B (en) | 2023-06-20 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111405258A (en) | Projection method, device, equipment and computer readable storage medium | |
US9998719B2 (en) | Non-planar surface projecting system, auto-calibration method thereof, and auto-calibration device thereof | |
JP6338595B2 (en) | Mobile device based text detection and tracking | |
US10204404B2 (en) | Image processing device and image processing method | |
US10433119B2 (en) | Position determination device, position determining method, and storage medium | |
JP4975679B2 (en) | Notebook information processing apparatus and projective transformation parameter calculation method | |
CN104994367B (en) | A kind of image correction method and camera | |
JP2007183948A (en) | Method and apparatus for providing panoramic view with geometric correction | |
US10276075B1 (en) | Device, system and method for automatic calibration of image devices | |
KR102248459B1 (en) | Apparatus and methdo for calibrating a camera | |
CN110769228B (en) | Method and device for realizing projection picture splicing and projection system | |
CN114820814A (en) | Camera pose calculation method, device, equipment and storage medium | |
CN110784691A (en) | Projection device, projection system and image correction method | |
WO2010013289A1 (en) | Camera calibration image creation apparatus and camera calibration image creation program | |
CN112912936A (en) | Mixed reality system, program, mobile terminal device, and method | |
CN112950759B (en) | Three-dimensional house model construction method and device based on house panoramic image | |
CN110084880A (en) | The device and method of 3-D image processing | |
JP6099281B2 (en) | Book reading system and book reading method | |
JP2003036142A (en) | System and method for presentation | |
CN113412612A (en) | Information processing apparatus, information processing method, and recording medium | |
JP2010086193A (en) | Presentation material distribution system and distribution system for indication position data on presentation material | |
CN112215966A (en) | Virtual image and real user photo group photo method | |
CN115174879B (en) | Projection screen correction method, apparatus, computer device and storage medium | |
US20230126591A1 (en) | System and method for calibrating a three-dimensional scanning device | |
CN115174878B (en) | Projection picture correction method, apparatus and storage medium |
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 |