Summary of the invention
The technical problem to be solved by the present invention is in view of the deficiencies of the prior art, provide a kind of Picture Calibration side, projector
Method, a kind of projector's Picture Calibration device and projector.
The technical scheme to solve the above technical problems is that
A kind of projector's frame correction method, comprising:
Projected picture is projected to curtain, is incident upon whole vertex of the projected picture in the curtain;
Obtain the image comprising the curtain and the projected picture;
The figure R3 that the projected picture not distorted is constructed in described image transforms to the figure R2 of the projected picture
The figure R3, obtains transformation matrix;
It is converted according to figure R1 of the transformation matrix to the curtain, obtains figure R4;
The vertex d on the figure R3 is obtained respectivelyiCorresponding vertex D on to the figure R4iVector ni, i=1,2,
3 ..., N, N are vertex quantity;
According to the vector niThe projected picture is corrected.
The beneficial effects of the present invention are: the present invention is by perspective transformation matrix, by the image of shooting projected picture and
The relative displacement of four angular vertexs of curtain is converted into the 4 keystone absolute displacements of projector's picture, images without considering
Head puts the factors such as distance, angle and shake, even if shooting projected picture and curtain from side, also can accurately be automatically performed ladder
Shape correction, to make projector's picture be paved with curtain automatically, with correction course is simple rapidly, correction cost is low, accuracy is high
And practical advantage.
Herein on basis, the present invention can also be improved as follows.
Further, after image of the acquisition comprising the curtain and the projected picture, further includes:
Edge detection is carried out to the curtain in described image, obtains the figure R1 of the curtain;
Edge detection is carried out to the projected picture in described image, obtains the figure R2 of the projected picture.
Beneficial effect using above-mentioned further scheme is: by edge detection method in image curtain edge and throwing
Shadow picture edge is detected, and more accurate edge pattern can be obtained, to further increase the standard of subsequent correction process
True property.
Further, the figure R3 that the projected picture not distorted is constructed in described image, specifically includes:
Two-dimensional coordinate system is established in described image;
Obtain the length and width for the projected picture not distorted;
The figure R3 for the projected picture not distorted is constructed in the two-dimensional coordinate system according to the length and the width.
Beneficial effect using above-mentioned further scheme is: by the way that figure R3 is constructed the Neng Goubian in two-dimensional coordinate system
Coordinate in each vertex for obtaining figure R3 calculates the correspondence that can quickly calculate from figure R3 to figure R4 by coordinate
The vector on vertex improves computational efficiency.
Further, any side of the figure R3 is parallel with the X-axis of the two-dimensional coordinate system or Y-axis.
Beneficial effect using above-mentioned further scheme is: by setting any side of figure R3 to and two-dimensional coordinate system
X-axis or Y-axis it is parallel, computational efficiency can be further increased.
Further, the projected picture not distorted is constructed in the two-dimensional coordinate system according to the length and the width
Figure R3, specifically include:
Calculate the length-width ratio of the length and the width;
The figure R3 for the projected picture not distorted is constructed in the two-dimensional coordinate system according to the length-width ratio.
Further, according to the vector niThe projected picture is corrected, is specifically included:
Obtain the vector niDivide vector length n in the X-axis of the two-dimensional coordinate systemxiDivide vector length in Y-axis
Spend nyi;
Divide vector length n according in the X-axisxi, level correction is carried out to i-th of vertex of the projected picture;
Divide vector length n according in the Y-axisyi, i-th of vertex of the projected picture is corrected vertically.
Further, projected picture is projected to curtain, is incident upon whole vertex of the projected picture in the curtain,
It specifically includes:
Projected picture is projected to curtain;
It controls the projected picture to reduce, until whole vertex of the projected picture are incident upon in the curtain.
The another technical solution that the present invention solves above-mentioned technical problem is as follows:
A kind of projector, using projector's frame correction method as described in any in above-mentioned technical proposal to projected picture
It is corrected.
The another technical solution that the present invention solves above-mentioned technical problem is as follows:
A kind of projector's Picture Calibration device, comprising:
Optical projection system makes whole vertex of the projected picture be incident upon institute for projecting projected picture to curtain
It states in curtain;
Photographic device, for obtaining the image comprising the curtain and the projected picture;
Processor, for constructing the figure R3 for the projected picture not distorted in described image, by the projected picture
Figure R2 transforms to the figure R3, obtains transformation matrix;Become according to figure R1 of the transformation matrix to the curtain
It changes, obtains figure R4;The vertex d on the figure R3 is obtained respectivelyiCorresponding vertex D on to the figure R4iVector ni, i=
1,2,3 ..., N, N are vertex quantity;
Correction system, for according to the vector niThe projected picture is corrected.
Further, the processor is specifically used for carrying out edge detection to the curtain in described image, obtains the curtain
The figure R1 of cloth;
Edge detection is carried out to the projected picture in described image, obtains the figure R2 of the projected picture.
Further, the processor is specifically used for establishing two-dimensional coordinate system in described image;
Obtain the length and width for the projected picture not distorted;
The figure R3 for the projected picture not distorted is constructed in the two-dimensional coordinate system according to the length and the width.
Further, any side of the figure R3 is parallel with the X-axis of the two-dimensional coordinate system or Y-axis.
Further, the processor is specifically used for calculating the length-width ratio of the length and the width;
The figure R3 for the projected picture not distorted is constructed in the two-dimensional coordinate system according to the length-width ratio.
Further, the processor is specifically used for obtaining the vector niPoint in the X-axis of the two-dimensional coordinate system
Vector length nxiDivide vector length n in Y-axisyi;
Divide vector length n according in the X-axisxi, level correction is carried out to i-th of vertex of the projected picture;
Divide vector length n according in the Y-axisyi, i-th of vertex of the projected picture is corrected vertically.
Further, the optical projection system is specifically used for projecting projected picture to curtain;
It controls the projected picture to reduce, until whole vertex of the projected picture are incident upon in the curtain.
The another technical solution that the present invention solves above-mentioned technical problem is as follows:
A kind of projector, including projector's Picture Calibration device as described in any in above-mentioned technical proposal.
The advantages of additional aspect of the invention, will be set forth in part in the description, and will partially become from the following description
It obtains obviously, or practice is recognized through the invention.
Specific embodiment
The principle and features of the present invention will be described below with reference to the accompanying drawings, and illustrated embodiment is served only for explaining the present invention,
It is not intended to limit the scope of the present invention.
Currently, projector is generally mated curtain use, the shape size phase of projected picture and curtain that projector goes out
Together, under normal circumstances, the projected picture that projector goes out can completely be paved with curtain, but ought project in actual use
The small deviation of machine placement angle will result in projected picture and not be overlapped with curtain, so projector can all provide keystone
Function.However current keystone scheme has many defects, is based on this, the present invention provides a kind of projector's Picture Calibrations
Method, a kind of projector's Picture Calibration device and corresponding projector.
As shown in Figure 1, for the flow diagram that provides of embodiment of projector's frame correction method of the present invention, the correction side
Method includes:
S1 projects projected picture to curtain, is incident upon whole vertex of projected picture in curtain.
It should be understood that curtain is typically hung from wall, it, can be by the face of curtain in order to more clearly identify the curtain in image
Color is set as different from the color of metope.
Preferably, ater can be set by curtain.Metope is usually rarely ater, therefore, using black curtain,
The scope of application is wider.
Similarly, in order to more clearly identify the projected picture in image, the color at the edge of projected picture can be set
It is set to different from the color of curtain.
Preferably, the solid-color image different from curtain color can be set by the color of projected picture.
S2 obtains the image comprising curtain and projected picture.
It should be noted that the image of projected picture can be shot by the camera being arranged in projector, then lead to
The information processing unit that internal circuit configuration is transferred in projector is crossed to be handled.It can also be shot by user's handheld terminal,
Such as mobile phone, camera, tablet computer, then by information transmission modes such as WLAN, bluetooth, USB data lines, will take
Image transmitting handled to projector.
S3 constructs the figure R3 for the projected picture not distorted in the picture, and the figure R2 of projected picture is transformed to figure
R3 obtains transformation matrix.
It should be understood that the projected picture not distorted refers to the picture completely spread out on projector to curtain, and draw
The size in face is usually adjustable, and to adapt to curtain, and its length-width ratio is fixed, and currently, the projection that projector goes out
Picture is usually rectangle, and therefore, length-width ratio is fixed, and the shape for the projected picture not distorted also determines therewith.The projection not distorted
The specific size of picture can be arranged according to actual needs.
Perspective transform operation is carried out to the figure R2 of projected picture, the perspective transformation matrix of figure R3 is transformed to from figure R2
It uniquely determines, can usually be calculated, and perspective transform is theoretical and perspective transformation matrix calculation method is digital picture
Process field maturation disclosure, details are not described herein.
S4 converts according to figure R1 of the transformation matrix to curtain, obtains figure R4.
It should be understood that can carry out edge detection after obtaining image to image, identify two nested rectangles, edge
Detection is digital image processing field maturation disclosure, and details are not described herein.Those skilled in the art can also be according to reality
Border demand selects other image-recognizing methods to identify the shape of projected picture and curtain, and there are many mature for fields
Technology will not enumerate herein.
S5 obtains the vertex d on figure R3 respectivelyiCorresponding vertex D on to figure R4iVector ni, i=1,2,3 ..., N,
N is vertex quantity.
It should be noted that therefore, vertex quantity is 4 currently, the projected picture of projector is all rectangle.
And the present invention is to be based on projector when projecting projected picture to curtain, the problem of generating slight error, can not be paved with curtain, is mentioned
Bearing calibration out, therefore, two vertex are that corresponding vertex refers to correcting the coincidence of latter two vertex.
For example, as illustrated in fig. 2, it is assumed that correction after, the vertex d of figure R31With the vertex D of figure R41It is overlapped, then vertex
D1It is exactly vertex d1Corresponding vertex.
In another example as shown in figure 3, when the shape of projected picture and curtain is polygon, it is assumed that after correction, figure R3's
Vertex d2With the vertex D of figure R42It is overlapped, then vertex D2It is exactly vertex d2Corresponding vertex.
It should be understood that vertex still remains, and the present invention still can be used when in projected picture and curtain including curl
In method carry out Picture Calibration.
S6, according to vector niProjected picture is corrected.
It should be understood that vector niIndicate the vertex d of figure R3iCorresponding vertex D on to figure R4iDirection and distance, it is right accordingly
The respective vertices of projected picture are adjusted, and make the mobile direction in the corresponding vertex of projected picture and distance, it will be able to realize and throw
The automatic accurate correction of shadow picture.Entire correction course can be realized by the correction program that projector carries.
The present embodiment is by perspective transformation matrix, by the phase of four angular vertexs of projected picture and curtain in the image of shooting
The 4 keystone absolute displacements of projector's picture are converted into displacement, without consider camera put distance, angle and
The factors such as shake also can accurately be automatically performed keystone, to make to project even if shooting projected picture and curtain from side
Machine picture is paved with curtain automatically, has the advantages that correction course is simple rapidly, correction cost is low, accuracy is high and practical.
Optionally, in some embodiments, after image of the acquisition comprising curtain and projected picture, further includes:
Edge detection is carried out to the curtain in image, obtains the figure R1 of curtain;
Edge detection is carried out to the projected picture in image, obtains the figure R2 of projected picture.
By edge detection method in image curtain edge and projected picture edge detect, can obtain more
Accurate edge pattern, to further increase the accuracy of subsequent correction process.
Optionally, in some embodiments, the figure R3 for constructing the projected picture not distorted in the picture, specifically includes:
Two-dimensional coordinate system is established in the picture;
Obtain the length and width for the projected picture not distorted;
The figure R3 for the projected picture not distorted is constructed in two-dimensional coordinate system according to length and width.
It should be understood that the specific length and width of figure R3 can be arranged according to actual needs, guarantee the length-width ratio of figure R3
It is identical as the length-width ratio of the actual projected picture not distorted.
By that in two-dimensional coordinate system, can be convenient for figure R3 building to obtain the coordinate on each vertex of figure R3, lead to
It crosses coordinate and calculates the vector that can quickly calculate from figure R3 to the corresponding vertex of figure R4, improve computational efficiency.
Optionally, in some embodiments, any side of figure R3 is parallel with the X-axis of two-dimensional coordinate system or Y-axis.
By setting parallel with the X-axis of two-dimensional coordinate system or Y-axis for any side of figure R3, meter can be further increased
Calculate efficiency.
Preferably, any side of figure R3 is overlapped with the X-axis of two-dimensional coordinate system or Y-axis.
Optionally, in some embodiments, the shadowgraph not distorted is constructed in two-dimensional coordinate system according to length and width
The figure R3 in face, specifically includes:
The length-width ratio of computational length and width;
The figure R3 for the projected picture not distorted is constructed in two-dimensional coordinate system according to length-width ratio.
Optionally, in some embodiments, according to vector niProjected picture is corrected, is specifically included:
Obtain vector niDivide vector length n in the X-axis of two-dimensional coordinate systemxiDivide vector length n in Y-axisyi;
Divide vector length n according in X-axisxi, level correction is carried out to i-th of vertex of projected picture;
Divide vector length n according in Y-axisyi, i-th of vertex of projected picture is corrected vertically.
Optionally, in some embodiments, projected picture is projected to curtain, whole vertex of projected picture is made to be incident upon curtain
In cloth, specifically include:
Projected picture is projected to curtain;
It controls projected picture to reduce, until whole vertex of projected picture are incident upon in curtain.
Preferably, projected picture can be contracted to minimum dimension, this ensures that whole vertex of projected picture are all
It is incident upon in curtain.
It is appreciated that in some embodiments, may include such as implementation optional some or all of in the various embodiments described above
Mode.
Below with a specific example, invention is further described.
Firstly, projector projects lily projected picture to black curtain, environmental colors are white.Then, to projection
Picture is adjusted roughly, substantially overlaps projected picture with curtain.
Then, the ceaselessly size of reduced projection picture, is all located at 4 vertex of projected picture within the scope of curtain.This
When, obtained projected picture, can not be complete with curtain as shown in figure 4, it can be seen from the figure that there are deviations on the right side of projected picture
It is overlapped.
At this point, shooting curtain, obtained image is as shown in figure 5, it can be seen from the figure that due between projector and curtain
Angle there are certain deviations, therefore, in the image shot, curtain also produces deformation.
Then, edge detection is carried out to curtain, obtains quadrangle R1, edge detection is carried out to projected picture, obtains four sides
Shape R2.
Then, the width and height of projector lens output picture are obtained, wherein width is w pixel, is highly h pixel,
In general, width is 1920 pixels, it is highly 1080 pixels.
Then, a plane coordinate system XOY is established on the image, and coordinate origin, X-direction, Y direction can be selected freely
It is fixed.A quadrangle R3 is constructed on coordinate system according to width and height, selectes d in coordinate system XOY1=(0, h), d2=(w,
h)、d3=(0,0), d4Four vertex=(w, 0), as shown in fig. 6, being sequentially connected four points constitutes a quadrangle R3.For convenient for
Illustrate, the long side of setting quadrangle R3 is overlapped with Y-axis, and short side is overlapped with X-axis.
Four vertex of quadrangle R3 and four vertex of quadrangle R2 have and only one perspective transform third-order matrix, note
For matrix M, after the perspective transform of matrix M, crooked quadrangle R2 may map to smooth vertical and horizontal quadrangle R3.Together
Reason, for quadrangle R1 after matrix M conversion, an available new quadrangle is denoted as R4.As shown in fig. 7, the upper left of R4, the right side
Upper, lower-left, bottom right four angular coordinate score and are not denoted as D1=(x0, y0), D2=(x1, y1), D3=(x2, y2), D4=(x3, y3).
Then, vertex d is calculated separately1To vertex D1Displacement, vertex d2To vertex D2Displacement, vertex d3To vertex D3's
Displacement, vertex d4To vertex D4Displacement.
As a result as follows: vertex d1In the mobile x0 pixel of X-axis, mobile (y0-h) a pixel of Y-axis;Vertex d2It is mobile in X-axis
(x1-w) a pixel, mobile (y1-h) a pixel of Y-axis;Vertex d3In the mobile x2 pixel of X-axis, the mobile y2 pixel of Y-axis;Vertex
d4In mobile (x3-w) a pixel of X-axis, the mobile y3 pixel of Y-axis.
Coordinate system X-axis corresponds to the horizontal direction of projector's picture, and coordinate system Y-axis corresponds to the vertical direction of projector's picture.
After above-mentioned displacement data is sent to the keystone control module of projector, projector can execute keystone automatically, and 4 points
After movement, projected picture is paved with curtain.
In other embodiments of the invention, a kind of projector is also provided, using as described in any in above-described embodiment
Projector's frame correction method is corrected projected picture.
As shown in figure 8, for the structural framing figure that provides of embodiment of projector's Picture Calibration device of the present invention, which is filled
It sets and includes:
Optical projection system 1 makes whole vertex of projected picture be incident upon curtain for projecting projected picture to curtain
It is interior;
Photographic device 2, for obtaining the image comprising curtain and projected picture;
Processor 3 becomes the figure R2 of projected picture for constructing the figure R3 for the projected picture not distorted in the picture
Figure R3 is changed to, transformation matrix is obtained;It is converted according to figure R1 of the transformation matrix to curtain, obtains figure R4;It obtains respectively
Take the vertex d on figure R3iCorresponding vertex D on to figure R4iVector ni, i=1,2,3 ..., N, N is vertex quantity;
Correction system 4, for according to vector niProjected picture is corrected.
Optionally, in some embodiments, processor 3 is specifically used for carrying out edge detection to the curtain in image, obtains
The figure R1 of curtain;
Edge detection is carried out to the projected picture in image, obtains the figure R2 of projected picture.
Optionally, in some embodiments, processor 3 is specifically used for establishing two-dimensional coordinate system in the picture;
Obtain the length and width for the projected picture not distorted;
The figure R3 for the projected picture not distorted is constructed in two-dimensional coordinate system according to length and width.
Optionally, in some embodiments, any side of figure R3 is parallel with the X-axis of two-dimensional coordinate system or Y-axis.
Optionally, in some embodiments, processor 3 is specifically used for the length-width ratio of computational length and width;
The figure R3 for the projected picture not distorted is constructed in two-dimensional coordinate system according to length-width ratio.
Optionally, in some embodiments, processor 3 is specifically used for obtaining vector niIn the X-axis of two-dimensional coordinate system
Divide vector length nxiDivide vector length n in Y-axisyi;
Divide vector length n according in X-axisxi, level correction is carried out to i-th of vertex of projected picture;
Divide vector length n according in Y-axisyi, i-th of vertex of projected picture is corrected vertically.
Optionally, in some embodiments, optical projection system 1 is specifically used for projecting projected picture to curtain;
It controls projected picture to reduce, until whole vertex of projected picture are incident upon in curtain.
It is appreciated that in some embodiments, may include such as implementation optional some or all of in the various embodiments described above
Mode.
It should be noted that the various embodiments described above are product embodiments corresponding with first embodiment of the method, for product
In embodiment the explanation of each optional embodiment can with reference in above-mentioned each method embodiment pair it should be noted that no longer superfluous herein
It states.
In other implementations of the invention, a kind of projector is also provided, including the throwing as described in any in above-described embodiment
Shadow machine Picture Calibration device.
Reader should be understood that in the description of this specification reference term " one embodiment ", " is shown " some embodiments "
The description of example ", " specific example " or " some examples " etc. mean specific features described in conjunction with this embodiment or example, structure,
Material or feature are included at least one embodiment or example of the invention.In the present specification, above-mentioned term is shown
The statement of meaning property need not be directed to identical embodiment or example.Moreover, particular features, structures, materials, or characteristics described
It may be combined in any suitable manner in any one or more of the embodiments or examples.In addition, without conflicting with each other, this
The technical staff in field can be by the spy of different embodiments or examples described in this specification and different embodiments or examples
Sign is combined.
In several embodiments provided herein, it should be understood that disclosed device and method can pass through it
Its mode is realized.For example, the apparatus embodiments described above are merely exemplary, for example, the division of unit, only
A kind of logical function partition, there may be another division manner in actual implementation, for example, multiple units or components can combine or
Person is desirably integrated into another system, or some features can be ignored or not executed.
Unit may or may not be physically separated as illustrated by the separation member, shown as a unit
Component may or may not be physical unit, it can and it is in one place, or may be distributed over multiple networks
On unit.It can select some or all of unit therein according to the actual needs to realize the mesh of the embodiment of the present invention
's.
More than, only a specific embodiment of the invention, but scope of protection of the present invention is not limited thereto, and it is any to be familiar with
Those skilled in the art in the technical scope disclosed by the present invention, can readily occur in various equivalent modifications or substitutions,
These modifications or substitutions should be covered by the protection scope of the present invention.Therefore, protection scope of the present invention should be wanted with right
Subject to the protection scope asked.