CN116405645A - Projector graph correction focusing method and device and readable medium - Google Patents

Projector graph correction focusing method and device and readable medium Download PDF

Info

Publication number
CN116405645A
CN116405645A CN202310088456.7A CN202310088456A CN116405645A CN 116405645 A CN116405645 A CN 116405645A CN 202310088456 A CN202310088456 A CN 202310088456A CN 116405645 A CN116405645 A CN 116405645A
Authority
CN
China
Prior art keywords
projection
projector
focusing
correction
picture
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310088456.7A
Other languages
Chinese (zh)
Inventor
苏文露
苗晶
黄彦
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Jiangxi Xingchi Electronic Technology Co ltd
Original Assignee
Jiangxi Xingchi Electronic Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Jiangxi Xingchi Electronic Technology Co ltd filed Critical Jiangxi Xingchi Electronic Technology Co ltd
Priority to CN202310088456.7A priority Critical patent/CN116405645A/en
Publication of CN116405645A publication Critical patent/CN116405645A/en
Pending legal-status Critical Current

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
    • H04N9/3185Geometric adjustment, e.g. keystone or convergence
    • 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/3141Constructional details thereof
    • H04N9/317Convergence or focusing systems
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The invention discloses a projector graph correction focusing method, a device and a readable medium, wherein TOF data are acquired and corrected, the TOF data comprise a horizontal deflection angle, a vertical deflection angle and a projection distance of a projector, a projection cone model is built based on the corrected horizontal deflection angle, the corrected vertical deflection angle, a specific projection ratio of the projector and a specific horizontal and vertical field angle, and a display chip of the projector is equivalently positioned in the projection cone model; rotating the projection cone model in the horizontal direction and the vertical direction, and carrying out first trapezoid correction according to the projection cone model to obtain a first image correction picture; responding to the projection cone model with a turning angle in the turning direction, and performing second trapezoid correction on the first image correction picture according to the corrected turning angle to obtain a second image correction picture; and automatically focusing the second image correction picture according to the current projection distance to obtain a target rectangular image.

Description

Projector graph correction focusing method and device and readable medium
Technical Field
The invention relates to the field of projection correction, in particular to a projector graph correction focusing method and device and a readable medium.
Background
The image projected by the projector is mainly used for viewing, so that people hope to see a horizontal square image, the viewing comfort can be improved, but in practice, the projector is not perpendicular to the screen due to the limitation of the placement position of the projector, and the projected image is subjected to trapezoidal distortion.
In the prior art, depth information of a plurality of light spots is obtained by adopting a multi-point time-of-flight sensor, three-dimensional coordinates of the light spots on a projection plane are determined, a measurement normal vector of the projection plane relative to the time-of-flight sensor is determined according to the three-dimensional coordinates of the light spots, offset information of a projector is obtained according to the measurement normal vector, the scale of an original image of the projector is corrected based on the offset information, a point is arbitrarily selected from any side of the projection image, the point is used as a vertex of a rectangle to be constructed, the aspect ratio of the original image is used as the aspect ratio of the rectangle to be constructed, and the rectangle is generated in the area of the projection image; and selecting the rectangle with the largest area from the generated rectangles as a target rectangle. The method does not construct optimal constraint conditions, so that the selection of rectangular vertexes is complicated, the number of generated rectangles is large, the calculated amount is large, and the correction efficiency is low.
Disclosure of Invention
The problem of keystone distortion of the projected image caused by the limitation of the placement position of the projector is solved. An objective of the embodiments of the present application is to provide a method, an apparatus and a readable medium for correcting and focusing a projector graph, which solve the technical problems mentioned in the background section.
In a first aspect, embodiments of the present application provide a method for correcting and focusing a projector pattern, including the steps of:
s1, acquiring TOF data, correcting the TOF data, wherein the TOF data comprises a horizontal deflection angle, a vertical deflection angle and a projection distance of a projector, establishing a projection cone model based on the corrected horizontal deflection angle, the corrected vertical deflection angle and a specific projection ratio and horizontal and vertical field angles of the projector, and equivalently positioning a display chip of the projector in the projection cone model;
s2, rotating the projection cone model in the horizontal direction and the vertical direction, and carrying out first trapezoid correction according to the projection cone model to obtain a first image correction picture;
s3, responding to the fact that the projection cone model has a turning angle in the turning direction, and carrying out second trapezoid correction on the first image correction picture according to the corrected turning angle to obtain a second image correction picture;
and S4, acquiring the current projection distance, and automatically focusing the second image correction picture according to the current projection distance to obtain a target rectangular image.
Preferably, step S1 further includes: and acquiring a trigger signal, and acquiring TOF data through a TOF module according to the trigger signal.
Preferably, step S2 specifically includes:
s21, taking a tangent plane of the projection cone model on an imaging surface as a projection picture graph, and cutting off a first rectangle with the largest internal area based on the projection picture graph, wherein the aspect ratio of the first rectangle is the same as that of a standard image;
s22, taking four straight lines as the cone points of the projection cone model and four vertexes of the first rectangle, respectively intersecting the four straight lines with the display chip at four points, and converting the coordinates of the four points on the display chip into pixel point coordinates;
s23, generating a display area according to the coordinates of the four pixel points, and projecting a first image correction picture.
Preferably, the step S3 specifically includes:
and cutting a second rectangle with the largest inner area on the first image correction picture, wherein the aspect ratio of the second rectangle is the same as that of the standard image, and taking the second rectangle as a second image correction picture.
Preferably, the flip angle is acquired by a gyroscope or an acceleration sensor arranged on the projector, and the projection distance is the distance from the center of the screen to the TOF module.
Preferably, step S1 further includes:
each projector uses standard projection picture size as a reference, the measured reference projection distance and the difference value of the reference motor step number and the measured distance and the motor step number when the standard projection picture size is different from the other projection picture sizes are calibrated, the calibration result is used as the original projection parameter of each projector, and the corresponding relation between the projection distance difference value and the motor step number difference value is established;
the clear projection picture is aligned in a mechanical mode, the current horizontal deflection angle and the current vertical deflection angle are measured by adopting a TOF module, the current turning angle is measured by adopting a gyroscope or an acceleration sensor, and the current horizontal deflection angle, the current vertical deflection angle and the current turning angle are used as original angle parameters.
Preferably, step S4 specifically includes:
subtracting the reference projection distance from the current projection distance to obtain a projection distance difference value;
determining a focusing motor step number difference value according to the projection distance difference value and the corresponding relation;
adding the difference value of the step number of the focusing motor and the step number of the reference motor to obtain the step number of the current focusing motor corresponding to the current projection distance;
and automatically focusing the second image correction picture according to the current focusing motor step number to obtain a target rectangular image.
In a second aspect, embodiments of the present application provide a projector graphics correction focusing apparatus, including:
the model building module is configured to acquire TOF data and correct the TOF data, wherein the TOF data comprises a horizontal deflection angle, a vertical deflection angle and a projection distance of a projector, a projection cone model is built based on the corrected horizontal deflection angle, the corrected vertical deflection angle and a specific projection ratio of the projector, and horizontal and vertical view angles, and a display chip of the projector is equivalently positioned in the projection cone model;
the first-time correction module is configured to rotate the projection cone model in the horizontal direction and the vertical direction, and perform first-time trapezoidal correction according to the projection cone model to obtain a first-time image correction picture;
the second correcting module is configured to respond to the projection cone model to have a turnover angle in the turnover direction, and perform second trapezoid correction on the first image correcting picture according to the corrected turnover angle to obtain a second image correcting picture;
and the focusing module is configured to acquire the current projection distance, and automatically focus the second image correction picture according to the current projection distance to obtain a target rectangular image.
In a third aspect, embodiments of the present application provide an electronic device comprising one or more processors; and storage means for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to implement the method as described in any of the implementations of the first aspect.
In a fourth aspect, embodiments of the present application provide a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements a method as described in any of the implementations of the first aspect.
Compared with the prior art, the invention has the following beneficial effects:
(1) The projector graph correction focusing method compresses the projected trapezoidal image into a horizontally placed rectangular image by acquiring the deflection angle of the projector, so that the projected image can be automatically corrected into a rectangular image suitable for viewing no matter where the projector is positioned.
(2) The projector graph correction focusing method of the invention adopts the TOF module with the algorithm, and can directly output the angle value and the distance value, thereby simplifying the algorithm, realizing the automatic trapezoid correction function more easily, and having higher accuracy of the automatic trapezoid correction compared with similar products, smaller calculated amount and higher correction efficiency due to the unique calibration method.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings that are needed in the description of the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is an exemplary device frame pattern to which an embodiment of the present application may be applied;
FIG. 2 is a flow chart of a method for correcting and focusing a projector image according to an embodiment of the invention;
FIG. 3 is a schematic view of a projection cone model of a projector pattern correction focusing method according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of a first image correction of a projector graphics correction focusing method according to an embodiment of the invention;
FIG. 5 is a schematic view of a projector graphics correcting focusing apparatus according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a computer device suitable for use in implementing the embodiments of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention will be described in further detail below with reference to the accompanying drawings, and it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Fig. 1 illustrates an exemplary device architecture 100 in which a projector graphics correction focusing method or projector graphics correction focusing device of embodiments of the present application may be applied.
As shown in fig. 1, the apparatus architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 is used as a medium to provide communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
The user may interact with the server 105 via the network 104 using the terminal devices 101, 102, 103 to receive or send messages or the like. Various applications, such as a data processing class application, a file processing class application, and the like, may be installed on the terminal devices 101, 102, 103.
The terminal devices 101, 102, 103 may be hardware or software. When the terminal devices 101, 102, 103 are hardware, they may be various electronic devices including, but not limited to, smartphones, tablets, laptop and desktop computers, and the like. When the terminal devices 101, 102, 103 are software, they can be installed in the above-listed electronic devices. Which may be implemented as multiple software or software modules (e.g., software or software modules for providing distributed services) or as a single software or software module. The present invention is not particularly limited herein.
The server 105 may be a server providing various services, such as a background data processing server processing files or data uploaded by the terminal devices 101, 102, 103. The background data processing server can process the acquired file or data to generate a processing result.
It should be noted that, the projector graphic correction focusing method provided in the embodiment of the present application may be executed by the server 105, or may be executed by the terminal devices 101, 102, 103, and accordingly, the projector graphic correction focusing device may be disposed in the server 105, or may be disposed in the terminal devices 101, 102, 103.
It should be understood that the number of terminal devices, networks and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation. In the case where the processed data does not need to be acquired from a remote location, the above-described apparatus architecture may not include a network, but only a server or terminal device.
Fig. 2 shows a method for correcting and focusing a projector graph according to an embodiment of the present application, including the following steps:
s1, acquiring TOF data, correcting the TOF data, wherein the TOF data comprises a horizontal deflection angle, a vertical deflection angle and a projection distance of a projector, establishing a projection cone model based on the corrected horizontal deflection angle, the corrected vertical deflection angle and a specific projection ratio and horizontal and vertical field angles of the projector, and equivalently positioning a display chip of the projector in the projection cone model.
In a specific embodiment, step S1 further includes: and acquiring a trigger signal, and acquiring TOF data through a TOF module according to the trigger signal.
Specifically, the triggering signal may be triggered by a power-on triggering or triggering element, and in a specific embodiment, a displacement sensor, an acceleration sensor or a gyroscope may be used as the triggering element, and after the triggering element sends out the triggering signal, the projector starts an automatic trapezoidal correction function. In order to simplify the algorithm, the embodiment of the application adopts a TOF module with the algorithm, the transmitting element of the TOF module is a semiconductor laser generator capable of emitting multi-point (100 x100 = 1 ten thousand points) infrared laser, the receiving element is a camera, and the horizontal deflection angle, the vertical deflection angle and the projection distance of the projector can be output through the algorithm, wherein the projection distance is the distance from the center of the screen to the TOF module. The self-contained algorithm in the TOF module adopts the existing algorithm, which is not the key point of the application, so that the description is omitted. The horizontal deflection angle and the vertical deflection angle are substituted into the projection cone model, so that the first image correction can be completed, and the distance from the center of the screen to the TOF module can be used for automatic focusing. Specifically, the distortion information of the projection image is obtained according to the horizontal deflection angle and the vertical deflection angle, and then the maximum rectangle is obtained in the distortion area. The chips in the embodiments of the present application are described using DMD chips as an example, and other chips may be used in other embodiments.
In a specific embodiment, step S1 further includes:
each projector uses standard projection picture size as a reference, the measured reference projection distance and the difference value of the reference motor step number and the measured distance and the motor step number when the standard projection picture size is different from the other projection picture sizes are calibrated, the calibration result is used as the original projection parameter of each projector, and the corresponding relation between the projection distance difference value and the motor step number difference value is established;
the clear projection picture is aligned in a mechanical mode, the current horizontal deflection angle and the current vertical deflection angle are measured by adopting a TOF module, the current turning angle is measured by adopting a gyroscope or an acceleration sensor, and the current horizontal deflection angle, the current vertical deflection angle and the current turning angle are used as original angle parameters.
Specifically, due to manufacturing errors and assembly errors of optical parts of the lens, when each projector is in the same projection picture size, the measured projection distance and the motor step number are different, but the subsequent difference value is unchanged, that is, the measured distance and the motor step number are the same as those measured when other projection picture sizes are taken as a standard projection picture size (such as 50 inches), each projector needs to be calibrated, the measured projection distance and the motor step number when the standard projection picture size are calibrated as original projection parameters, then a corresponding table of the motor step number difference value corresponding to the projection distance difference value is made, the original projection parameters are subtracted from each measured projection distance, the difference value is taken as a table to obtain a motor step number difference value, and then the original projection parameters are added, namely the motor step number of the focusing motor under the current test distance. In the same way, calibration is also needed when the trapezoid correction is performed, and because of the manufacturing error of each optical machine and the assembly error of the whole machine, each projector can incline and deflect to different degrees in the factory state, and the calibration method is as follows: firstly, clear projection pictures are aligned in a mechanical mode, a TOF module is used for measuring the current horizontal deflection angle and the current vertical deflection angle, a gyroscope or an acceleration sensor is used for measuring the current turning angle, the 3 angles are used as original angle parameters, and the original angle parameters are subtracted from the angle measured when automatic trapezoid correction is carried out, so that the angle values substituted by a trapezoid correction algorithm are obtained. The original angle parameter refers to the position information of the projector when the projection picture is clear (called as an initial position); if the pose of the projector changes, the image is deformed, and at the moment, the data measured by TOF are real-time angle data along with the pose. The angle information of the projector pose change is real-time angle data measured by TOF (time of flight) and the original angle parameter at the initial position is subtracted, so that the relative change horizontal/vertical deflection angle can be obtained.
Specifically, referring to fig. 3, after the projection cone model is constructed, the position of the display chip is equivalent to the inside of the projection cone model, a coordinate system is built according to the position of the viewer, the projection imaging surface is right in front of the viewer (wall surface or screen), the projection cone model is rotated, and the projection cone model has 3 directions of rotation, namely, a horizontal direction, a vertical direction and a turnover direction. The display chip of the projector is equivalent to the projection in the cone model and is close to the cone point. In practice, the display chip is located outside the cone body, and the cone point of the model is equivalent to the entrance pupil point of the lens.
S2, rotating the projection cone model in the horizontal direction and the vertical direction, and carrying out first trapezoid correction according to the projection cone model to obtain a first image correction picture.
In a specific embodiment, step S2 specifically includes:
s21, taking a tangent plane of the projection cone model on an imaging surface as a projection picture graph, and cutting off a first rectangle with the largest internal area based on the projection picture graph, wherein the aspect ratio of the first rectangle is the same as that of a standard image;
s22, taking four straight lines as the cone points of the projection cone model and four vertexes of the first rectangle, respectively intersecting the four straight lines with the display chip at four points, and converting the coordinates of the four points on the display chip into pixel point coordinates;
s23, generating a display area according to the coordinates of the four pixel points, and projecting a first image correction picture.
Specifically, referring to fig. 4, the first image correction considers only the horizontal direction and the vertical direction, and cuts the projected cone model with the imaging surface (wall surface or screen) to obtain a projected picture pattern, which is a trapezoid, and cuts a rectangle with the largest area in the trapezoid, wherein the rectangle needs to satisfy 2 conditions: the aspect ratio is the same as the annotation image, and the rectangle is square (i.e., the long side of the rectangle is parallel to the horizontal plane or ground) at the viewer's angle. Connecting the cone points with four vertexes of the rectangle to obtain 4 lines, intersecting the 4 lines with an equivalent display chip surface to obtain 4 points on the display chip, namely, corresponding positions of the 4 vertexes of the corrected image on the display chip, converting coordinates of the 4 points on the display chip into pixel point coordinates, and generating a new display area by the image processing chip (FPGA, ARM or CPU) according to the 4 pixel point coordinates and taking the 4 points as boundaries, and projecting a square rectangular picture meeting the requirements through a projection lens.
S3, responding to the fact that the projection cone model has a turning angle in the turning direction, and carrying out second trapezoid correction on the first image correction picture according to the corrected turning angle to obtain a second image correction picture.
In a specific embodiment, step S3 specifically includes:
and cutting a second rectangle with the largest inner area on the first image correction picture, wherein the aspect ratio of the second rectangle is the same as that of the standard image, and taking the second rectangle as a second image correction picture.
Specifically, the first image correction establishes a projection distortion image area only according to the vertical/horizontal offset angle measured by TOF; the largest rectangular area is searched out as the first image correction picture. Since the actual projection screen is still irregular four sides due to the flip angle, a secondary correction is required. In the second image correction process, only the turning angle measured by a gyroscope or an acceleration sensor is considered, and the image is a distorted image after the first image correction picture is rotated by the angle; the maximum rectangular area is searched out as a second image correction picture in this distorted image area. The second image correction is that when the projector has a flip angle in the flip direction, the flip angle can be obtained through a gyroscope or an acceleration sensor, and a rectangle with the largest area is cut off on the basis of the first image correction picture, and the rectangle also needs to meet the following 2 conditions: equal aspect ratio and square rectangle.
Specifically, the aspect ratio of the standard image is m/n, and the steps of determining the first rectangle and the second rectangle in step S2 and step S3 are as follows:
1. light source position coordinates
(1) Establishing a coordinate system
Taking the center of the display chip as the origin of coordinates, and taking the right horizontal direction as the positive x axis; the vertical direction is positive as the y axis; the vertical line from the projector to the screen is the z-axis and the pointing direction to the screen is positive.
The actual output is obtained by adding offset on the basis of the actual output, and the offset is changed into a coordinate point with the lower left corner of the display chip
(2) Solving for light source coordinates (x, y, z)
The x coordinate of the light source is 0, and only y and z values are needed to be solved.
The method comprises the following steps: the corner point of the display chip and the corresponding corner point coordinate of the projection graph establish a linear equation;
the formula is adopted:
Figure BDA0004069608700000081
Figure BDA0004069608700000082
wherein: x is x 1 ,y 1 ,z 1 Is the coordinates of a point on a straight line; x is x 2 ,y 2 ,z 2 Is the coordinates of another point on the line.
2. After the screen rotates, determining new four points of distorted image on the projection screen
The method comprises the following steps: intersection of a spatial straight line (a straight line formed by the light source and four corners of the display chip) and a spatial plane.
The formula is adopted:
f=A x ×U x +A y ×U y +A z ×U z
Figure BDA0004069608700000083
Figure BDA0004069608700000084
Figure BDA0004069608700000085
wherein: (S) x ,S y ,S z ) Is the coordinates of a point on a straight line; (U) x ,U y ,U z ) Is the straight line direction vector;
(D x ,D y ,D z ) Is the coordinates of a point on a plane; (A) x ,A y ,A z ) Is a normal vector to the plane.
If f is not equal to 0, the straight line is parallel to the plane and has an intersection point; if f=0, the straight line is parallel to the plane without an intersection point.
3. Finding out the maximum rectangle on the screen
The method comprises the following steps: and finding out the maximum rectangle meeting the condition in a point-by-point query mode according to the characteristics of the rotated projection image.
The following are classified into several cases:
wherein, (x) i ,y i ,z i ) The four-point coordinate is the maximum rectangle; i= (1-4) represents four points of upper left, upper right, lower left and lower right; z 0 Is an initial distance 399.228; r is R x Is the rotation angle around the x axis; r is R y To rotate around the y-axis by an angle
A. When R is y =0,R x <>At 0:
when R is x <At 0 (upward projection):
x 1 =x 3
y 1 =(x 4 -x 3 )*n/m+y 3
z 1 =z 0 -y 1 *Sin(R x );
x 2 =x 4
y 2 =y 1
z 2 =z 1
when R is X >0 (downward projection):
x=x 2 -x 1
y=y 1 -y 3
if (x/y) > m/n:
x 1 =-y*m/n/2;
x 2 =-x 1
x 3 =x 1
x 4 =-x 1
if (x/y) < m/n:
x 3 =x 1
y 2 =(x 2 -x 1 )*n/m;
z 3 =z 0 +y 3 *Sin(Rx);
x 4 =x 2
y 4 =y 3
z 4 =z 3
B. when R is x =0,R y <>At 0:
when Ry <0 (clockwise projection):
x 1 =x;
y 1 =y;
z 1 =z;
x 2 =x 4
y 2 =y;
z 2 =z 4
x 3 =x 1
y 3 =y 4
z 3 =z 1
when R is y >0 (counterclockwise projection):
x 2 =x;
y 2 =y;
z 2 =z;
x 1 =x 3
y 1 =y;
z 1 =z 3
x 4 =x 2
y 4 =y 3
z 4 =z 2
C. when R is y <>0,R x <>At 0:
comparing the 3 rd and 4 th points, taking the high point as a datum point, and finding out that x and y are m to the connecting line of the 1 and 2 points: n scale points. The rectangle formed by the diagonal line of the point and the reference point is the rectangle.
When R is X >At 0: the 3 rd and 4 th points are compared, and the high point is used as a reference point.
(1) When 3 points are high:
starting from the midpoint X and Y of the 1,3 points, calculating the ratio of the distance between the horizontal line and the 12 line to the distance between the vertical line and the 13 line, and comparing with m/n;
if the ratio of the distance between the horizontal line and the 12 line to the distance between the vertical line and the 13 line is greater than m/n, adding Y+10, calculating new x, and repeating the first step by Y; if the ratio of the horizontal line to the 12 line distance and the vertical line to the 13 line distance after the first repetition is smaller than m/n, calculating again by Y-5, and if the ratio of the horizontal line to the 12 line distance and the vertical line to the 13 line distance after the first repetition is larger than m/n, calculating by Y+2, calculating new x, Y, repeating the first step; if the ratio of the horizontal line to the 12 line distance and the vertical line to the 13 line distance after the second repetition is smaller than m/n, Y-1 is the final point.
If the ratio of the horizontal line to 12 line distance and the vertical line to 13 line distance is less than m/n, the procedure is reversed. At this time, XY is the 1 st point, and the calculated XY is the 2 nd point.
(2) When 4 points are high:
starting from the midpoint X and Y of 2 and 4 points, the ratio of the horizontal line to 12 line distance and the vertical line to 24 line distance is calculated and compared with m/n:
if the ratio of the horizontal line to the 12 line distance to the vertical line to the 24 line distance is greater than m/n, adding Y+10, calculating new x, Y, and repeating the first step; if the ratio of the horizontal line to the 12 line distance and the vertical line to the 24 line distance after the first repetition is smaller than m/n, calculating again by Y-5, and if the ratio of the horizontal line to the 12 line distance and the vertical line to the 24 line distance after the first repetition is larger than m/n, calculating by Y+2, calculating new x, Y, repeating the first step; if the ratio of the horizontal line to the 12 line distance and the vertical line to the 24 line distance after the second repetition is smaller than m/n, Y-1 is the final point.
If the ratio of the horizontal line to 12 line distance and the vertical line to 24 line distance is less than m/n, the procedure is reversed. At this time, XY is the 2 nd point, and the calculated XY is the 1 st point.
...
4. Calculating the z-coordinate of a new rectangular coordinate point
The method comprises the following steps: knowing the plane equation after rotation, the z coordinate of any point (x, y) on the screen is found.
The formula is adopted:
Figure BDA0004069608700000111
wherein: (x) 0 ,y 0 ,z 0 ) Is any point on the screen;
(a, b, c) is a direction vector of the screen normal;
(x, y) is a point designated on the screen, and z is the z coordinate of the point (x, y) on the screen.
5. Find out the corresponding four crossing points (x i ,y i ,0)
The method comprises the following steps: and (3) calculating a corresponding intersection point on the display chip by using a connecting line of the new rectangular tetrad point and the light source.
The formula is adopted:
Figure BDA0004069608700000112
Figure BDA0004069608700000113
wherein: (x) 1 ,y 1 ,z 1 ) The coordinates of four corners of a new rectangle on the screen are obtained;
(x 2 ,y 2 ,z 2 ) Is the light source coordinates;
(x, y) is the coordinates of the point on the display chip.
Specifically, coordinates of the 4 points on the display chip are converted into pixel point coordinates, and the image processing chip (FPGA, ARM or CPU) generates a new display area according to the 4 pixel point coordinates and with the 4 points as boundaries, and projects a square rectangular picture meeting the requirements through the projection lens.
The process of converting coordinates on the display chip into pixel coordinates is as follows:
let the vertex coordinates be a two-dimensional array b [ i, j ]:
wherein: b [ i ] - -horizontal coordinate values;
b < j > -a vertical coordinate value;
unit conversion:
assuming that the pixel point coordinates are two-dimensional arrays B [ i, j ];
wherein: bi=M/bi;
B[j]=N/b[i];
wherein, projection resolution: m x N.
And S4, acquiring the current projection distance, and automatically focusing the second image correction picture according to the current projection distance to obtain a target rectangular image.
In a specific embodiment, step S4 specifically includes:
subtracting the reference projection distance from the current projection distance to obtain a projection distance difference value;
determining a focusing motor step number difference value according to the projection distance difference value and the corresponding relation;
adding the difference value of the step number of the focusing motor and the step number of the reference motor to obtain the step number of the current focusing motor corresponding to the current projection distance;
and automatically focusing the second image correction picture according to the current focusing motor step number to obtain a target rectangular image.
Specifically, the automatic focusing according to the embodiment of the application is mainly performed by using a table look-up method, a corresponding table of the projection distance and the number of steps of the focusing motor is measured through an actual test, the original projection parameter is subtracted from the projection distance measured each time, the difference value is taken to look up the table to obtain the difference value of the number of steps of the focusing motor, and then the original parameter is added, namely the number of steps of the focusing motor under the current test distance. And further focusing according to the step number of the focusing motor, and finally realizing automatic focusing to obtain a projection image with high definition.
With further reference to fig. 5, as an implementation of the method shown in the foregoing figures, the present application provides an embodiment of a projector graphics correction focusing apparatus, which corresponds to the method embodiment shown in fig. 2, and which is particularly applicable to various electronic devices.
The embodiment of the application provides a projector graph correction focusing device, which comprises:
the model building module 1 is configured to acquire TOF data and correct the TOF data, wherein the TOF data comprises a horizontal deflection angle, a vertical deflection angle and a projection distance of a projector, a projection cone model is built based on the corrected horizontal deflection angle, the corrected vertical deflection angle and a specific projection ratio of the projector, and horizontal and vertical view angles, and a display chip of the projector is equivalently positioned in the projection cone model;
a first-time correction module 2 configured to rotate the projection cone model in the horizontal direction and the vertical direction, and perform a first-time trapezoidal correction according to the projection cone model, so as to obtain a first-time image correction picture;
a second-time correction module 3 configured to perform a second-time trapezoidal correction on the first-time image correction picture according to the corrected flip angle in response to the projection cone model having the flip angle in the flip direction, to obtain a second-time image correction picture;
and the focusing module 4 is configured to acquire the current projection distance, and automatically focus the second image correction picture according to the current projection distance to obtain a target rectangular image.
Referring now to fig. 6, there is illustrated a schematic diagram of a computer apparatus 600 suitable for use in implementing an electronic device (e.g., a server or terminal device as illustrated in fig. 1) of an embodiment of the present application. The electronic device shown in fig. 6 is only an example and should not impose any limitation on the functionality and scope of use of the embodiments of the present application.
As shown in fig. 6, the computer apparatus 600 includes a Central Processing Unit (CPU) 601 and a Graphics Processor (GPU) 602, which can perform various appropriate actions and processes according to programs stored in a Read Only Memory (ROM) 603 or programs loaded from a storage section 609 into a Random Access Memory (RAM) 604. In the RAM604, various programs and data required for the operation of the apparatus 600 are also stored. The CPU 601, GPU602, ROM 603, and RAM604 are connected to each other through a bus 605. An input/output (I/O) interface 606 is also connected to the bus 605.
The following components are connected to the I/O interface 606: an input portion 607 including a keyboard, a mouse, and the like; an output portion 608 including a speaker, such as a Liquid Crystal Display (LCD), etc.; a storage portion 609 including a hard disk and the like; and a communication section 610 including a network interface card such as a LAN card, a modem, or the like. The communication section 610 performs communication processing via a network such as the internet. The drive 611 may also be connected to the I/O interface 606 as needed. A removable medium 612 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 611 as necessary, so that a computer program read out therefrom is mounted into the storage section 609 as necessary.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method shown in the flowcharts. In such embodiments, the computer program may be downloaded and installed from a network via the communication portion 610, and/or installed from the removable medium 612. The above-described functions defined in the method of the present application are performed when the computer program is executed by a Central Processing Unit (CPU) 601 and a Graphics Processor (GPU) 602.
It should be noted that the computer readable medium described in the present application may be a computer readable signal medium or a computer readable medium, or any combination of the two. The computer readable medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor apparatus, device, or means, or a combination of any of the foregoing. More specific examples of the computer-readable medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution apparatus, device, or apparatus. In the present application, however, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may be any computer readable medium that is not a computer readable medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution apparatus, device, or apparatus. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations of the present application may be written in one or more programming languages, including an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or it may be connected to an external computer (for example, through the Internet using an Internet service provider).
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based devices which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules involved in the embodiments described in the present application may be implemented by software, or may be implemented by hardware. The described modules may also be provided in a processor.
As another aspect, the present application also provides a computer-readable medium that may be contained in the electronic device described in the above embodiment; or may exist alone without being incorporated into the electronic device. The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: TOF data are acquired and corrected, the TOF data comprise a horizontal deflection angle, a vertical deflection angle and a projection distance of a projector, a projection cone model is built based on the corrected horizontal deflection angle, the corrected vertical deflection angle and a specific projection ratio and horizontal and vertical field angles of the projector, and a display chip of the projector is equivalently positioned in the projection cone model; rotating the projection cone model in the horizontal direction and the vertical direction, and carrying out first trapezoid correction according to the projection cone model to obtain a first image correction picture; responding to the projection cone model with a turning angle in the turning direction, and performing second trapezoid correction on the first image correction picture according to the corrected turning angle to obtain a second image correction picture; and acquiring the current projection distance, and automatically focusing the second image correction picture according to the current projection distance to obtain a target rectangular image.
The foregoing description is only of the preferred embodiments of the present application and is presented as a description of the principles of the technology being utilized. It will be appreciated by persons skilled in the art that the scope of the invention referred to in this application is not limited to the specific combinations of features described above, but it is intended to cover other embodiments in which any combination of features described above or equivalents thereof is possible without departing from the spirit of the invention. Such as the above-described features and technical features having similar functions (but not limited to) disclosed in the present application are replaced with each other.

Claims (10)

1. A projector graphics correction focusing method, comprising the steps of:
s1, acquiring TOF data, correcting the TOF data, wherein the TOF data comprises a horizontal deflection angle, a vertical deflection angle and a projection distance of a projector, a projection cone model is built based on the corrected horizontal deflection angle, the corrected vertical deflection angle, a specific projection ratio of the projector and horizontal and vertical field angles, and a display chip of the projector is equivalently positioned in the projection cone model;
s2, rotating the projection cone model in the horizontal direction and the vertical direction, and carrying out first trapezoid correction according to the projection cone model to obtain a first image correction picture;
s3, responding to the fact that the projection cone model has a turnover angle in the turnover direction, and performing second trapezoid correction on the first image correction picture according to the corrected turnover angle to obtain a second image correction picture;
and S4, acquiring a current projection distance, and automatically focusing the second image correction picture according to the current projection distance to obtain a target rectangular image.
2. The projector graphics correction focusing method as claimed in claim 1, wherein said step S1 further comprises: and acquiring a trigger signal, and acquiring the TOF data through the TOF module according to the trigger signal.
3. The method for correcting and focusing a projector graphics according to claim 1, wherein the step S2 specifically comprises:
s21, taking a tangent plane of the projection cone model on an imaging surface as a projection picture graph, and cutting a first rectangle with the largest internal area based on the projection picture graph, wherein the aspect ratio of the first rectangle is the same as that of a standard image;
s22, using cone points of the projection cone model and four vertexes of the first rectangle as four straight lines, respectively intersecting the four straight lines with the display chip at four points, and converting coordinates of the four points on the display chip into pixel point coordinates;
s23, generating a display area according to the four pixel point coordinates, and projecting the first image correction picture.
4. The method for correcting and focusing a projector graphics according to claim 1, wherein the step S3 specifically comprises:
and cutting a second rectangle with the largest inner area on the first image correction picture, wherein the aspect ratio of the second rectangle is the same as that of a standard image, and the second rectangle is taken as the second image correction picture.
5. The projector pattern correction focusing method as claimed in claim 1, wherein the flip angle is obtained by a gyroscope or an acceleration sensor provided on the projector, and the projection distance is a distance from a center of the screen to the TOF module.
6. The projector graphics correction focusing method as claimed in claim 1, wherein said step S1 further comprises:
each projector uses standard projection picture size as a reference, the measured reference projection distance and the difference value of the reference motor step number and the measured distance and the motor step number when the standard projection picture size is different from the other projection picture sizes are calibrated, the calibration result is used as the original projection parameter of each projector, and the corresponding relation between the projection distance difference value and the motor step number difference value is established;
and (3) aligning clear projection pictures in a mechanical mode, measuring the current horizontal deflection angle and the current vertical deflection angle by adopting the TOF module, measuring the current turning angle by adopting a gyroscope or an acceleration sensor, and taking the current horizontal deflection angle, the current vertical deflection angle and the current turning angle as original angle parameters.
7. The method for correcting and focusing a projector graphics according to claim 6, wherein the step S4 specifically comprises:
subtracting the reference projection distance from the current projection distance to obtain a projection distance difference;
determining a focusing motor step number difference value according to the projection distance difference value and the corresponding relation;
adding the focusing motor step number difference value with the reference motor step number to obtain a current focusing motor step number corresponding to the current projection distance;
and automatically focusing the second image correction picture according to the current focusing motor step number to obtain a target rectangular image.
8. A projector graphics correction focusing apparatus, comprising:
the model building module is configured to acquire TOF data and correct the TOF data, wherein the TOF data comprises a horizontal deflection angle, a vertical deflection angle and a projection distance of a projector, a projection cone model is built based on the corrected horizontal deflection angle, the corrected vertical deflection angle, a specific projection ratio of the projector and horizontal and vertical field angles, and a display chip of the projector is equivalently positioned in the projection cone model;
the first-time correction module is configured to rotate the projection cone model in the horizontal direction and the vertical direction, and perform first-time trapezoidal correction according to the projection cone model to obtain a first-time image correction picture;
the second-time correction module is configured to respond to the projection cone model to have a turnover angle in the turnover direction, and perform second trapezoid correction on the first-time image correction picture according to the corrected turnover angle to obtain a second-time image correction picture;
and the focusing module is configured to acquire the current projection distance, and automatically focus the second image correction picture according to the current projection distance to obtain a target rectangular image.
9. An electronic device, comprising:
one or more processors;
storage means for storing one or more programs,
when executed by the one or more processors, causes the one or more processors to implement the method of any of claims 1-7.
10. A computer readable storage medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements the method according to any of claims 1-7.
CN202310088456.7A 2023-02-09 2023-02-09 Projector graph correction focusing method and device and readable medium Pending CN116405645A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310088456.7A CN116405645A (en) 2023-02-09 2023-02-09 Projector graph correction focusing method and device and readable medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310088456.7A CN116405645A (en) 2023-02-09 2023-02-09 Projector graph correction focusing method and device and readable medium

Publications (1)

Publication Number Publication Date
CN116405645A true CN116405645A (en) 2023-07-07

Family

ID=87016720

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310088456.7A Pending CN116405645A (en) 2023-02-09 2023-02-09 Projector graph correction focusing method and device and readable medium

Country Status (1)

Country Link
CN (1) CN116405645A (en)

Similar Documents

Publication Publication Date Title
CN111127655B (en) House layout drawing construction method and device, and storage medium
KR102580961B1 (en) 3D modeling system and method based on photography, automatic 3D modeling device and method
US10789672B2 (en) Method and device for performing mapping on spherical panoramic image
JP6057298B2 (en) Rapid 3D modeling
JP4435145B2 (en) Method and apparatus for providing panoramic image by calibrating geometric information
US6574376B1 (en) Arithmetic unit for image transformation and monitoring system
JPWO2018235163A1 (en) Calibration apparatus, calibration chart, chart pattern generation apparatus, and calibration method
CN112804507A (en) Projector correction method, projector correction system, storage medium, and electronic device
CN113077548B (en) Collision detection method, device, equipment and storage medium for object
CN110988849A (en) Calibration method and device of radar system, electronic equipment and storage medium
CN113256742B (en) Interface display method and device, electronic equipment and computer readable medium
CN110940312A (en) Monocular camera ranging method and system combined with laser equipment
CN114286068A (en) Focusing method, focusing device, storage medium and projection equipment
Jiang et al. An accurate and flexible technique for camera calibration
CN114449249B (en) Image projection method, image projection device, storage medium and projection apparatus
JP2019525509A (en) Horizontal parallax stereo panorama import method
CN114463436A (en) Calibration method, system, equipment and storage medium of galvanometer scanning device
CN113129346A (en) Depth information acquisition method and device, electronic equipment and storage medium
CN116109684B (en) Online video monitoring two-dimensional and three-dimensional data mapping method and device for variable electric field station
CN116405645A (en) Projector graph correction focusing method and device and readable medium
US20220180592A1 (en) Collaborative Augmented Reality Measurement Systems and Methods
US20240153128A1 (en) Method of detecting collision of objects, device, and storage medium
CN112132909B (en) Parameter acquisition method and device, media data processing method and storage medium
CN114339179A (en) Projection correction method, projection correction device, storage medium and projection equipment
JP2006338167A (en) Image data creation method

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