WO2016197670A2 - 一种梯形校正方法和投影机 - Google Patents
一种梯形校正方法和投影机 Download PDFInfo
- Publication number
- WO2016197670A2 WO2016197670A2 PCT/CN2016/077711 CN2016077711W WO2016197670A2 WO 2016197670 A2 WO2016197670 A2 WO 2016197670A2 CN 2016077711 W CN2016077711 W CN 2016077711W WO 2016197670 A2 WO2016197670 A2 WO 2016197670A2
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- tilt
- regions
- projector
- region
- image
- Prior art date
Links
Images
Definitions
- This application relates to, but is not limited to, projection techniques.
- the position of the projector should be at right angles to the projection screen as much as possible to ensure the projection effect. If the vertical of the two is not guaranteed, the screen will have a trapezoidal shape. In this case, the user needs to use the "Keystone" function to correct the trapezoid to ensure that the picture is a standard rectangle.
- the related art automatic trapezoidal correction generally uses an acceleration sensor to obtain the tilt angle of the projector, thereby performing vertical trapezoidal correction on the projector. This method requires a very high consistency for the projector and it is necessary to calibrate each machine. In this way, only vertical keystone correction can be performed, horizontal trapezoidal correction cannot be performed, and horizontal keystone correction is basically achieved by manual adjustment, but manual adjustment usually requires multiple adjustments, which is time consuming and the adjustment result is incomplete. As expected.
- This article provides a trapezoidal correction method and projector that automatically implements the horizontal trapezoidal correction of the projector without manual intervention.
- a trapezoidal correction method comprising:
- the projector is horizontally corrected according to the tilt direction and the tilt angle.
- the image that is output when the projector projects the solid color light by the camera includes:
- the camera outputs a picture when the projector projects the solid color light according to the preset sensitivity parameter, the shutter parameter and the aperture parameter to obtain the image.
- the grayscale parameter includes a grayscale value.
- the calculating grayscale parameters of the N regions in the horizontal direction of the image includes:
- the average value corresponding to all the pixels in any of the regions is averaged and used as the grayscale value of any of the regions.
- determining, according to the gray-scale parameters of the N regions, the tilt direction and the tilt coefficient of the image including:
- the two regions are region A and region B;
- the tilt direction is a first tilt direction
- the tilt coefficient is a grayscale value of the area A and the area B
- the oblique direction is a second oblique direction
- the tilt coefficient is a grayscale value of the region B and the region A The ratio of the grayscale values.
- the method further includes: the pre-stored correspondence relationship between the tilt angle and the tilt coefficient is stored in the projector after being measured in advance;
- the method of determining comprises:
- Determining a preset number of tilt angles performing, for each of the determined tilt angles, a step of acquiring an image output by the projector by the camera, and a step of calculating a gray scale parameter of the N regions of the image in a horizontal direction, And the step of calculating the tilt direction and the tilt coefficient corresponding to the image according to the brightness parameter of the N regions, and the tilt system calculated through the foregoing steps
- the number is the inclination coefficient corresponding to each of the inclination angles.
- a projector comprising:
- the acquiring unit is set to: obtain an image output by the projector through the camera;
- a calculating unit configured to: calculate a gray parameter of the N regions in the horizontal direction of the image; wherein the N regions are obtained by dividing the image in a horizontal direction according to a preset rule, where N is greater than or equal to a positive integer of 2;
- a first determining unit configured to: determine a tilt direction and a tilt coefficient corresponding to the image according to the gray parameter of the N regions;
- the second determining unit is configured to: determine the tilt angle corresponding to the tilt coefficient according to the tilt coefficient and the correspondence data of the pre-stored tilt angle and the tilt coefficient;
- the correction unit is configured to perform horizontal trapezoidal correction on the projector according to the tilt direction and the tilt angle.
- the obtaining unit is configured to:
- the camera outputs a picture when the projector projects the solid color light according to the preset sensitivity parameter, the shutter parameter and the aperture parameter to obtain the image.
- the grayscale parameter includes a grayscale value.
- the computing unit is configured to:
- the average value corresponding to all the pixels in any of the regions is averaged and used as the grayscale value of any of the regions.
- the first determining unit is configured to:
- the two regions are region A and region B;
- the tilt direction is a first tilt direction
- the tilt coefficient is a grayscale value of the area A and the area B
- the inclination coefficient is a ratio of a grayscale value of the region B to a grayscale value of the region A.
- a computer readable storage medium storing computer executable instructions for performing the method of any of the above.
- the trapezoidal correction method and the projector provided by the embodiment of the present invention acquire an image outputted by the projector when the solid color light is projected by the camera; calculate gray scale parameters of the N regions of the image in the horizontal direction; wherein the N The region is obtained by dividing the image in a horizontal direction according to a preset rule, where N is a positive integer greater than or equal to 2; determining a tilt direction and a tilt coefficient corresponding to the image according to the grayscale parameters of the N regions; The inclination coefficient and the correspondence data of the pre-stored inclination angle and the inclination coefficient determine an inclination angle corresponding to the inclination coefficient; and the projector performs horizontal trapezoidal correction according to the inclination direction and the inclination angle.
- the technical solution provided by the embodiment of the invention can automatically realize the horizontal trapezoidal correction of the projector without manual intervention.
- FIG. 1 is a schematic flowchart of a trapezoidal correction method according to an embodiment of the present invention
- FIG. 2 is a schematic structural diagram of a projector according to an embodiment of the present invention.
- the technical solution provided by the embodiment of the present invention is applied to a projector with a camera.
- the projector with the auto focus function is usually provided with a camera.
- a brief introduction will be made to the relevant principle: when the projector is projected onto a predetermined object surface such as a wall surface, if it is a vertical wall projection, the obtained brightness is uniform, and the diffuse reflection of the wall surface is horizontal. The direction is equal to the left and right, and is received by the camera at the same angle, the obtained light is equal to the left and right, and the projected picture is uniform in brightness. If it is not a vertical wall projection, the diffuse reflection area in the horizontal direction is different from the left and right sides of the screen.
- the projection picture is uneven in brightness.
- by capturing the projection picture and performing brightness differentiation comparison of the left and right pictures it is possible to obtain whether the projection is tilted in the horizontal direction, and obtain the severity of the tilt according to the size of the brightness difference, thereby depending on the degree of tilt. To perform horizontal keystone correction.
- the embodiment of the invention provides a trapezoidal correction method. As shown in FIG. 1 , the method includes:
- Step 101 Obtain an image output by the projector when the solid color light is projected by the camera.
- Step 101 which may include:
- the camera outputs a picture when the projector projects the solid color light according to the preset sensitivity parameter, the shutter parameter and the aperture parameter to obtain the image.
- the color of the solid color when the projector is projected may be white, red, green, blue, or yellow. In the embodiment of the present invention, only a solid color is required, and the color is not specifically limited.
- Step 102 Calculate gradation parameters of the N regions of the image in the horizontal direction.
- the N regions are obtained by dividing the image in a horizontal direction according to a preset rule, where N is a positive integer greater than or equal to 2.
- the grayscale parameter includes a grayscale value.
- Step 102 which may include:
- the average value corresponding to all the pixels in any of the regions is averaged and used as the grayscale value of any of the regions.
- the above-described preset rule for dividing the image into N regions can be determined as needed, for example, can be defined as dividing the image into four regions in the horizontal direction.
- Step 103 Determine a tilt direction and a tilt coefficient corresponding to the image according to the grayscale parameters of the N regions.
- Step 103 which may include:
- the two regions are region A and region B;
- the tilt direction is a first tilt direction
- the tilt coefficient is a grayscale value of the area A and the area B
- the oblique direction is a second oblique direction
- the tilt coefficient is a grayscale value of the region B and the region A The ratio of the grayscale values.
- Step 104 Determine an inclination angle corresponding to the inclination coefficient according to the inclination coefficient and the correspondence data of the pre-stored inclination angle and the inclination coefficient.
- the method of determining comprises:
- Determining a preset number of tilt angles performing, for each of the determined tilt angles, a step of acquiring an image output by the projector by the camera, and a step of calculating a gray scale parameter of the N regions of the image in a horizontal direction, And the step of calculating the tilt direction and the tilt coefficient corresponding to the image according to the brightness parameters of the N regions, and using the tilt coefficient calculated through the foregoing steps as the tilt coefficient corresponding to each of the tilt angles.
- Step 105 Perform horizontal trapezoidal correction on the projector according to the tilt direction and the tilt angle.
- the light machine in the projector is driven to perform horizontal trapezoidal correction.
- the trapezoidal correction method provided by the embodiment of the present invention acquires an image outputted by the projector when the solid color light is projected by the camera; and calculates a grayscale parameter of the N regions of the image in the horizontal direction; wherein the N regions are based on The preset rule is obtained by dividing the image in the horizontal direction, and N is a positive integer greater than or equal to 2; determining a tilt direction and a tilt coefficient corresponding to the image according to the gray parameter of the N regions; determining the according to the tilt coefficient and the correspondence data of the pre-stored tilt angle and the tilt coefficient The tilt angle corresponding to the tilt coefficient; the horizontal trapezoidal correction is performed on the projector according to the tilt direction and the tilt angle.
- the horizontal trapezoidal correction of the projector can be automatically realized without manual intervention.
- the embodiment of the invention further provides a computer readable storage medium storing computer executable instructions for performing the above method.
- Step 1 The projector projects white light and sets a fixed projection brightness L.
- the selection of white light in the above steps is only an exemplary selection.
- the projector only needs to project pure color light
- the projection brightness L may be a preset value, for example, 200 lumens. .
- Step 2 Drive the camera to take a picture of the projected image of the projector using the preset sensitivity value, shutter speed and aperture size value to obtain the desired image.
- Step 3 Calculate the gradation parameters of the N regions in the horizontal direction of the image obtained in step 2.
- X is the pixel width of the region
- Y is the pixel height of the region
- the color of each pixel is RGB each color 16bit value consists of a total of 48 bytes, the high 16 bytes represent R, the middle 16 bytes represent G, and the lower 16 bytes represent B.
- 0xFF0000 means red
- 0x00FF00 means green
- 0x0000FF means blue
- 0x333333 is gray
- the color component of each pixel is obtained by taking the upper, middle and lower 16 bytes, which is a value between 0 and 255. It is assumed that mR is the component value of a certain point red, mG is the component value of a certain point of green, mB is a certain a blue component value;
- Step 4 Determine the direction and tilt coefficient of the tilt according to the magnitudes of the two gray scale values A1 and A4.
- selection areas A1 and A4 are merely exemplified, and actually two areas can be arbitrarily selected among A1, A2, A3, and A4.
- the corresponding data of the inclination coefficient and the inclination angle are established in advance by calculating the inclination coefficient X at a different known inclination angle Y, and obtaining a inclination coefficient X inquiry table similar to the following.
- the technician can determine an tilt angle Y, and then calculate the tilt coefficient corresponding to the tilt angle Y by using the steps 101, 102, and 103 of the technical solution of the embodiment of the present invention.
- the above content can be referred to, and the details are not described here.
- Step 5 After querying the above table using the tilt coefficient X determined in step 4, the corresponding tilt angle Y can be determined according to the tilt coefficient X.
- the tilt coefficient is X
- angles and inclination coefficients of two adjacent Ids in the table can be fitted according to a straight line, and then the formula of the fitted straight line is re-fitted according to the inclination coefficient.
- Step 6 Drive the optomechanical and other modules in the projector to perform trapezoidal calibration according to the tilt angle Y obtained in step 5.
- the embodiment of the present invention further provides a projector 10. As shown in FIG. 2, the projector 10 includes:
- the obtaining unit 11 is configured to: acquire an image output by the projector through the camera;
- the calculating unit 12 is configured to: calculate a gray parameter of the N regions of the image in a horizontal direction; wherein the N regions are obtained by dividing the image in a horizontal direction according to a preset rule, where N is greater than or a positive integer equal to 2;
- the first determining unit 13 is configured to: determine a tilt direction and a tilt coefficient corresponding to the image according to the gray parameter of the N regions;
- the second determining unit 14 is configured to: determine the tilt angle corresponding to the tilt coefficient according to the tilt coefficient and the corresponding relationship data of the pre-stored tilt angle and the tilt coefficient;
- the correcting unit 15 is configured to: the projector according to the tilt direction and the tilt angle Perform horizontal keystone correction.
- the obtaining unit 11 is configured to:
- the camera outputs a picture when the projector projects the solid color light according to the preset sensitivity parameter, the shutter parameter and the aperture parameter to obtain the image.
- the grayscale parameter includes a grayscale value.
- the computing unit 12 is configured to:
- the average value corresponding to all the pixels in any of the regions is averaged and used as the grayscale value of any of the regions.
- the first determining unit 13 is configured to:
- the two regions are region A and region B;
- the tilt direction is a first tilt direction
- the tilt coefficient is a grayscale value of the area A and the area B
- the oblique direction is a second oblique direction
- the tilt coefficient is a grayscale value of the region B and the region A The ratio of the grayscale values.
- a projector provided by the embodiment of the present invention includes: an acquiring unit configured to: acquire an image output by the projector through a camera; and the calculating unit is configured to: calculate a gray parameter of the N regions in the horizontal direction of the image; The N areas are obtained by dividing the image in a horizontal direction according to a preset rule, where N is a positive integer greater than or equal to 2; the first determining unit is configured to: according to the gray scale of the N areas The parameter determining the tilt direction and the tilt coefficient corresponding to the image; the second determining unit is configured to: determine the tilt angle corresponding to the tilt coefficient according to the tilt coefficient and the corresponding relationship data of the pre-stored tilt angle and the tilt coefficient; And configured to: perform horizontal trapezoidal correction on the projector according to the tilt direction and the tilt angle. . Through this hair The technical solution of the embodiment can automatically realize the horizontal trapezoidal correction of the projector without manual intervention.
- all or part of the steps of the above embodiments may also be implemented by using an integrated circuit. These steps may be separately fabricated into individual integrated circuit modules, or multiple modules or steps may be fabricated into a single integrated circuit module. achieve.
- the devices/function modules/functional units in the above embodiments may be implemented by a general-purpose computing device, which may be centralized on a single computing device or distributed over a network of multiple computing devices.
- the device/function module/functional unit in the above embodiment When the device/function module/functional unit in the above embodiment is implemented in the form of a software function module and sold or used as a stand-alone product, it can be stored in a computer readable storage medium.
- the above mentioned computer readable storage medium may be a read only memory, a magnetic disk or an optical disk or the like.
- the horizontal trapezoidal correction of the projector can be automatically realized without manual intervention.
Landscapes
- Transforming Electric Information Into Light Information (AREA)
- Projection Apparatus (AREA)
- Video Image Reproduction Devices For Color Tv Systems (AREA)
- Control Of Indicators Other Than Cathode Ray Tubes (AREA)
Abstract
本文公布一种梯形校正方法和投影机,所述方法包括:通过摄像头获取投影机投射纯色光时输出的图像;计算所述图像在水平方向上N个区域的灰度参数;其中,所述N个区域是根据预设规则在水平方向上划分所述图像得到的,N为大于或等于2的正整数;根据所述N个区域的灰度参数确定所述图像对应的倾斜方向和倾斜系数;根据所述倾斜系数以及预存的倾斜角度与倾斜系数的对应关系数据确定所述倾斜系数对应的倾斜角度;根据所述倾斜方向和所述倾斜角度对所述投影机进行水平梯形校正。
Description
本申请涉及但不限于投影技术。
在投影机的日常使用中,投影机的位置尽可能要与投影屏幕成直角才能保证投影效果,如果无法保证二者的垂直,画面就会产生梯形。在这种情况下,用户需要使用“梯形校正功能”来校正梯形,保证画面成标准的矩形。相关技术的投影仪自动梯形校正一般采用加速度传感器来获取投影仪的倾斜角度,从而对投影仪进行垂直梯形校正。这种方式对投影仪的一致性要求非常高,而且要对每台机器进行校准。这种方式只能进行垂直梯形校正,无法进行水平梯形校正,并且水平梯形校正基本上是通过手动来调整实现的,但手动调整通常需要多次调整,较为耗费时间,且调整出的结果不尽如人意。
发明内容
以下是对本文详细描述的主题的概述。本概述并非是为了限制权利要求的保护范围。
本文提供了一种梯形校正方法和投影机,能够自动实现投影机的水平梯形校正,无需人工干预。
一种梯形校正方法,包括:
通过摄像头获取投影机投射纯色光时输出的图像;
计算所述图像在水平方向上N个区域的灰度参数;其中,所述N个区域是根据预设规则在水平方向上划分所述图像得到的,N为大于或等于2的正整数;
根据所述N个区域的灰度参数确定所述图像对应的倾斜方向和倾斜系数;
根据所述倾斜系数以及预存的倾斜角度与倾斜系数的对应关系数据确定
所述倾斜系数对应的倾斜角度;
根据所述倾斜方向和所述倾斜角度对所述投影机进行水平梯形校正。
可选的,所述通过摄像头获取投影机投射纯色光时输出的图像,包括:
利用摄像头按照预设的感光度参数、快门参数以及光圈参数对所述投影机投射纯色光时输出的画面进行拍照以获取所述图像。
可选的,所述灰度参数包括灰阶值。
可选的,所述计算所述图像在水平方向上N个区域的灰度参数,包括:
对于N个区域中的任一区域,计算所述任一区域内的每个像素的三原色对应的三个色彩分量值的平均值;
将所述任一区域内的所有的像素对应的平均值取平均后作为所述任一区域的灰阶值。
可选的,所述根据所述N个区域的灰度参数确定所述图像对应的倾斜方向和倾斜系数,包括:
选择所述N个区域中的两块区域,所述两块区域分别为区域A和区域B;
当所述区域A的灰阶值大于所述区域B的灰阶值时,确定所述倾斜方向为第一倾斜方向,且所述倾斜系数为所述区域A的灰阶值与所述区域B的灰阶值的比值;或,
当所述区域A的灰阶值小于所述区域B的灰阶值时,确定所述倾斜方向为第二倾斜方向,且所述倾斜系数为所述区域B的灰阶值与所述区域A的灰阶值的比值。
可选的,所述方法还包括:所述预存的倾斜角度与倾斜系数的对应关系数据是预先进行测定后储存在所述投影机中的;
相应的,所述测定的方法包括:
确定预设数量个倾斜角度,对于确定的每一个倾斜角度,执行所述通过摄像头获取投影机输出的图像的步骤、所述计算所述图像在水平方向上N个区域的灰度参数的步骤、以及所述根据所述N个区域的亮度参数计算所述图像对应的倾斜方向和倾斜系数的步骤,将经过前述步骤计算得到的倾斜系
数作为所述每一个倾斜角度对应的倾斜系数。
一种投影机,包括:
获取单元,设置为:通过摄像头获取投影机输出的图像;
计算单元,设置为:计算所述图像在水平方向上N个区域的灰度参数;其中,所述N个区域是根据预设规则在水平方向上划分所述图像得到的,N为大于或等于2的正整数;
第一确定单元,设置为:根据所述N个区域的灰度参数确定所述图像对应的倾斜方向和倾斜系数;
第二确定单元,设置为:根据所述倾斜系数以及预存的倾斜角度与倾斜系数的对应关系数据确定所述倾斜系数对应的倾斜角度;
校正单元,设置为:根据所述倾斜方向和所述倾斜角度对所述投影机进行水平梯形校正。
可选的,所述获取单元,是设置为:
利用摄像头按照预设的感光度参数、快门参数以及光圈参数对所述投影机投射纯色光时输出的画面进行拍照以获取所述图像。
可选的,所述灰度参数包括灰阶值。
可选的,所述计算单元,是设置为:
对于N个区域中的任一区域,计算所述任一区域内的每个像素的三原色对应的三个色彩分量值的平均值;
将所述任一区域内的所有的像素对应的平均值取平均后作为所述任一区域的灰阶值。
可选的,所述第一确定单元,是设置为:
选择所述N个区域中的两块区域,所述两块区域分别为区域A和区域B;
当所述区域A的灰阶值大于所述区域B的灰阶值时,确定所述倾斜方向为第一倾斜方向,且所述倾斜系数为所述区域A的灰阶值与所述区域B的灰阶值的比值;或,
当所述区域A的灰阶值小于所述区域B的灰阶值时,确定所述倾斜方向
为第二倾斜方向,且所述倾斜系数为所述区域B的灰阶值与所述区域A的灰阶值的比值。
一种计算机可读存储介质,存储有计算机可执行指令,所述计算机可执行指令用于执行上述任一项的方法。
本发明实施例提供的一种梯形校正方法和投影机,通过摄像头获取投影机投射纯色光时输出的图像;计算所述图像在水平方向上N个区域的灰度参数;其中,所述N个区域是根据预设规则在水平方向上划分所述图像得到的,N为大于或等于2的正整数;根据所述N个区域的灰度参数确定所述图像对应的倾斜方向和倾斜系数;根据所述倾斜系数以及预存的倾斜角度与倾斜系数的对应关系数据确定所述倾斜系数对应的倾斜角度;根据所述倾斜方向和所述倾斜角度对所述投影机进行水平梯形校正。通过本发明实施例提供的技术方案,能够自动实现投影机的水平梯形校正,无需人工干预。
在阅读并理解了附图和详细描述后,可以明白其他方面。
附图概述
图1为本发明实施例提供的一种梯形校正方法的流程示意图;
图2为本发明实施例提供的一种投影机的结构示意图。
下文中将结合附图对本发明的实施方式进行详细说明。需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互任意组合。
在附图的流程图示出的步骤可以在诸如一组计算机可执行指令的计算机系统中执行。并且,虽然在流程图中示出了逻辑顺序,但是在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤。
本发明实施例提供的技术方案应用于附带有摄像头的投影机上,一般情况下,目前带有自动对焦功能的投影机均是附带有摄像头的。另外,在介绍
技术方案之前,简单介绍下涉及到的相关原理:当投影机投影到预定的物体表面例如墙面上时,如果是垂直墙面的投射,获得的亮度是均匀的,墙面的漫反射在水平方向上是左右相当的,并以相同的角度被摄像头所接收,得到的光线左右相等,投影画面是亮度均匀的。如果不是垂直墙面的投射,画面左右早水平方向上漫反射面积不一样,当摄像头收到的光线减少,投影画面是亮度会出现不均匀的情况。本发明实施例中,通过对投影画面的捕捉并进行左右画面的亮度差异化比较,可以获得投影是否在水平方向上倾斜,并根据亮度差异化的大小获得倾斜的严重程度,从而根据倾斜的程度来进行水平梯形校正。
本发明实施例提供一种梯形校正方法,如图1所示,该方法包括:
步骤101、通过摄像头获取投影机投射纯色光时输出的图像。
步骤101,可以包括:
利用摄像头按照预设的感光度参数、快门参数以及光圈参数对所述投影机投射纯色光时输出的画面进行拍照以获取所述图像。
上述投影机投射时的纯色光可以是白色、红色、绿色、蓝色或黄色等颜色,本发明实施例中只要求是纯色即可,对采用何种颜色不具体限定。
步骤102、计算所述图像在水平方向上N个区域的灰度参数。
其中,所述N个区域是根据预设规则在水平方向上划分所述图像得到的,N为大于或等于2的正整数。
所述灰度参数包括灰阶值。
步骤102,可以包括:
对于N个区域中的任一区域,计算所述任一区域内的每个像素的三原色对应的三个色彩分量值的平均值;
将所述任一区域内的所有的像素对应的平均值取平均后作为所述任一区域的灰阶值。
上述用于对所述图像划分N个区域的预设规则是可以按照需要来定的,例如,可以定义为将所述图像在水平方向上均分为四个区域。
步骤103、根据所述N个区域的灰度参数确定所述图像对应的倾斜方向和倾斜系数。
步骤103,可以包括:
选择所述N个区域中的两块区域,所述两块区域分别为区域A和区域B;
当所述区域A的灰阶值大于所述区域B的灰阶值时,确定所述倾斜方向为第一倾斜方向,且所述倾斜系数为所述区域A的灰阶值与所述区域B的灰阶值的比值;或,
当所述区域A的灰阶值小于所述区域B的灰阶值时,确定所述倾斜方向为第二倾斜方向,且所述倾斜系数为所述区域B的灰阶值与所述区域A的灰阶值的比值。
步骤104、根据所述倾斜系数以及预存的倾斜角度与倾斜系数的对应关系数据确定所述倾斜系数对应的倾斜角度。
所述预存的倾斜角度与倾斜系数的对应关系数据是预先进行测定后储存在所述投影机中的;
相应的,所述测定的方法包括:
确定预设数量个倾斜角度,对于确定的每一个倾斜角度,执行所述通过摄像头获取投影机输出的图像的步骤、所述计算所述图像在水平方向上N个区域的灰度参数的步骤、以及所述根据所述N个区域的亮度参数计算所述图像对应的倾斜方向和倾斜系数的步骤,将经过前述步骤计算得到的倾斜系数作为所述每一个倾斜角度对应的倾斜系数。
步骤105、根据所述倾斜方向和所述倾斜角度对所述投影机进行水平梯形校正。
在已知倾斜方向和倾斜角度的情况下,驱动投影机中的光机进行水平梯形校正即可。
本发明实施例提供的一种梯形校正方法,通过摄像头获取投影机投射纯色光时输出的图像;计算所述图像在水平方向上N个区域的灰度参数;其中,所述N个区域是根据预设规则在水平方向上划分所述图像得到的,N为
大于或等于2的正整数;根据所述N个区域的灰度参数确定所述图像对应的倾斜方向和倾斜系数;根据所述倾斜系数以及预存的倾斜角度与倾斜系数的对应关系数据确定所述倾斜系数对应的倾斜角度;根据所述倾斜方向和所述倾斜角度对所述投影机进行水平梯形校正。通过本发明实施例的技术方案,能够自动实现投影机的水平梯形校正,无需人工干预。
本发明实施例还提供一种计算机可读存储介质,存储有计算机可执行指令,所述计算机可执行指令用于执行上述的方法。
下面通过实施示例,进行说明:
实施示例
步骤1:投影机投射白色光,设置一个固定的投影亮度L。
上述步骤中选择白色光仅为示例性选取,实际上,本发明实施例的技术方案中投影机只需投射纯色光即可,另外,投影亮度L可以是一个预先设定的值,例如200流明。
步骤2:驱动摄像头使用预设的感光值,快门速度以及光圈大小值对投影机投射的画面进行拍照得到所需的图像。
步骤3:计算步骤2获得的图像在水平方向的N个区域的灰度参数。
假设,N=4且该图像在水平方向上从左到右均分得到四个区域分别为:A1、A2、A3以及A4,并计算前述四个区域的灰阶值。
灰阶值的计算公式如下:
对于上述四个区域中的任一个,假设X为该区域的像素宽度,Y为该区域的像素高度,该区域总共有n=X*Y个像素;对于每一个像素,每个像素的颜色由RGB每种颜色16bit的值组成,一共48个字节,高16字节表示R,中间16字节表示G,低16个字节表示B。比如0xFF0000表示红色,0x00FF00表示绿色,0x0000FF表示蓝色,0x333333就是灰色;
每个像素的色彩分量通过取高中低位的16字节获得,是一个0-255之间的值,假设mR为某个点红色的分量值,mG为某个点绿色的分量值,mB为某个点蓝色的分量值;
将所有的点的分量值做平均。对于每个像素点的三个色彩分量值即mR、mG以及mB做平均,然后对区域内的所有像素点再做平均得到一个平均值作为该区域的灰阶值。
步骤4:根据A1和A4这两个灰阶值的大小来确定倾斜的方向和倾斜系数。
当A1>A4时,确定为右倾且倾斜系数=A1/A4;或,
当A4<A1时,确定为左倾且倾斜系数=A4/A1。
上述选择区域A1和A4仅是举例说明而已,实际上在A1、A2、A3以及A4中任意选择两个区域即可。
另外,预先建立倾斜系数和倾斜角度的对应数据,方法为,在不同的已知倾斜角度Y的情况下,计算倾斜系数X,得到类似如下的倾斜系数X查询表格。
编号(Id) | 倾斜角度Y | 倾斜系数X |
1 | 0 | 1 |
2 | 10 | 1.1 |
3 | 20 | 1.3 |
4 | 30 | 1.6 |
5 | 40 | 1.9 |
6 | 50 | 2.4 |
8 | 60 | 3.8 |
9 | 70 | 6.9 |
10 | 80 | 20 |
上述给定倾斜角度Y计算倾斜系数X时,可以是技术人员确定一个倾斜角度Y,然后通过本发明实施例技术方案的步骤101、102、103计算确定该倾斜角度Y对应的倾斜系数,其方法可以参考上述内容,在此不做赘述,另外,上述表格中的角度越详细越好,对于后续通过倾斜系数X反查倾斜角度越准确。
步骤5:使用步骤4确定的倾斜系数X查询上述表格后,可以根据倾斜系数X确定对应的倾斜角度Y。
示例性的,当倾斜系数为X的时候,找到最接近X倾斜系数对应的Id,如X=1.7,那么位于表格中的X4=1.6和X5=1.9之间,并且更接近于1.6,那么我们取1.6的表格Id=4作为我们选取最接近的角度值,表格中Id=4对应的倾斜角度是30度。
另外,为了简化计算方法,可以把表格中相邻的两个Id的角度和倾斜系数可以按照直线进行拟合,然后取拟合的直线的公式根据倾斜系数进行再拟合。
如上举例中所述,X=1.7位于X4=1.6和X5=1.9之间,我们要根据Y4和Y5计算最终的角度Y,根据斜线的斜率计算公式可知:
(Y-Y4)/(Y5-Y4)=(X-X4)/(X5-X4)
可以推导出:Y=(X-X4)*(Y5-Y4)/(X5-X4)+Y4,由此可以计算得到X=1.7对应的倾斜角度Y。
步骤6:根据步骤5得到的倾斜角度Y,驱动投影机中的光机和其他模块进行梯形校准。
本发明实施例还提供一种投影机10,如图2所示,该投影机10包括:
获取单元11,设置为:通过摄像头获取投影机输出的图像;
计算单元12,设置为:计算所述图像在水平方向上N个区域的灰度参数;其中,所述N个区域是根据预设规则在水平方向上划分所述图像得到的,N为大于或等于2的正整数;
第一确定单元13,设置为:根据所述N个区域的灰度参数确定所述图像对应的倾斜方向和倾斜系数;
第二确定单元14,设置为:根据所述倾斜系数以及预存的倾斜角度与倾斜系数的对应关系数据确定所述倾斜系数对应的倾斜角度;
校正单元15,设置为:根据所述倾斜方向和所述倾斜角度对所述投影机
进行水平梯形校正。
所述获取单元11,是设置为:
利用摄像头按照预设的感光度参数、快门参数以及光圈参数对所述投影机投射纯色光时输出的画面进行拍照以获取所述图像。
所述灰度参数包括灰阶值。
所述计算单元12,是设置为:
对于N个区域中的任一区域,计算所述任一区域内的每个像素的三原色对应的三个色彩分量值的平均值;
将所述任一区域内的所有的像素对应的平均值取平均后作为所述任一区域的灰阶值。
所述第一确定单元13,是设置为:
选择所述N个区域中的两块区域,所述两块区域分别为区域A和区域B;
当所述区域A的灰阶值大于所述区域B的灰阶值时,确定所述倾斜方向为第一倾斜方向,且所述倾斜系数为所述区域A的灰阶值与所述区域B的灰阶值的比值;或,
当所述区域A的灰阶值小于所述区域B的灰阶值时,确定所述倾斜方向为第二倾斜方向,且所述倾斜系数为所述区域B的灰阶值与所述区域A的灰阶值的比值。
本实施例用于实现上述方法实施例,本实施例中每个单元的工作流程和工作原理参见上述方法实施例中的描述,在此不再赘述。
本发明实施例提供的一种投影机,包括:获取单元,设置为:通过摄像头获取投影机输出的图像;计算单元,设置为:计算所述图像在水平方向上N个区域的灰度参数;其中,所述N个区域是根据预设规则在水平方向上划分所述图像得到的,N为大于或等于2的正整数;第一确定单元,设置为:根据所述N个区域的灰度参数确定所述图像对应的倾斜方向和倾斜系数;第二确定单元,设置为:根据所述倾斜系数以及预存的倾斜角度与倾斜系数的对应关系数据确定所述倾斜系数对应的倾斜角度;校正单元,设置为:根据所述倾斜方向和所述倾斜角度对所述投影机进行水平梯形校正。。通过本发
明实施例的技术方案,能够自动实现投影机的水平梯形校正,无需人工干预。
本领域普通技术人员可以理解上述实施例的全部或部分步骤可以使用计算机程序流程来实现,所述计算机程序可以存储于一计算机可读存储介质中,所述计算机程序在相应的硬件平台上(如系统、设备、装置、器件等)执行,在执行时,包括方法实施例的步骤之一或其组合。
可选地,上述实施例的全部或部分步骤也可以使用集成电路来实现,这些步骤可以被分别制作成一个个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。
上述实施例中的装置/功能模块/功能单元可以采用通用的计算装置来实现,它们可以集中在单个的计算装置上,也可以分布在多个计算装置所组成的网络上。
上述实施例中的装置/功能模块/功能单元以软件功能模块的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。上述提到的计算机可读取存储介质可以是只读存储器,磁盘或光盘等。
虽然本发明所揭露的实施方式如上,但所述的内容仅为便于理解本发明而采用的实施方式,并非用以限定本发明。任何本发明所属领域内的技术人员,在不脱离本发明所揭露的精神和范围的前提下,可以在实施的形式及细节上进行任何的修改与变化,但本发明的专利保护范围,仍须以所附的权利要求书所界定的范围为准。
通过本发明实施例,能够自动实现投影机的水平梯形校正,无需人工干预。
Claims (12)
- 一种梯形校正方法,包括:通过摄像头获取投影机投射纯色光时输出的图像;计算所述图像在水平方向上N个区域的灰度参数;其中,所述N个区域是根据预设规则在水平方向上划分所述图像得到的,N为大于或等于2的正整数;根据所述N个区域的灰度参数确定所述图像对应的倾斜方向和倾斜系数;根据所述倾斜系数以及预存的倾斜角度与倾斜系数的对应关系数据确定所述倾斜系数对应的倾斜角度;根据所述倾斜方向和所述倾斜角度对所述投影机进行水平梯形校正。
- 根据权利要求1所述的方法,其中,所述通过摄像头获取投影机投射纯色光时输出的图像,包括:利用摄像头按照预设的感光度参数、快门参数以及光圈参数对所述投影机投射纯色光时输出的画面进行拍照以获取所述图像。
- 根据权利要求2所述的方法,其中,所述灰度参数包括灰阶值。
- 根据权利要求3所述的方法,其中,所述计算所述图像在水平方向上N个区域的灰度参数,包括:对于N个区域中的任一区域,计算所述任一区域内的每个像素的三原色对应的三个色彩分量值的平均值;将所述任一区域内的所有的像素对应的平均值取平均后作为所述任一区域的灰阶值。
- 根据权利要求1所述的方法,其中,所述根据所述N个区域的灰度参数确定所述图像对应的倾斜方向和倾斜系数,包括:选择所述N个区域中的两块区域,所述两块区域分别为区域A和区域B;当所述区域A的灰阶值大于所述区域B的灰阶值时,确定所述倾斜方向 为第一倾斜方向,且所述倾斜系数为所述区域A的灰阶值与所述区域B的灰阶值的比值;或,当所述区域A的灰阶值小于所述区域B的灰阶值时,确定所述倾斜方向为第二倾斜方向,且所述倾斜系数为所述区域B的灰阶值与所述区域A的灰阶值的比值。
- 根据权利要求1所述的方法,还包括:所述预存的倾斜角度与倾斜系数的对应关系数据是预先进行测定后储存在所述投影机中的;相应的,所述测定的方法包括:确定预设数量个倾斜角度,对于确定的每一个倾斜角度,执行所述通过摄像头获取投影机输出的图像的步骤、所述计算所述图像在水平方向上N个区域的灰度参数的步骤、以及所述根据所述N个区域的亮度参数计算所述图像对应的倾斜方向和倾斜系数的步骤,将经过前述步骤计算得到的倾斜系数作为所述每一个倾斜角度对应的倾斜系数。
- 一种投影机,包括:获取单元,设置为:通过摄像头获取投影机输出的图像;计算单元,设置为:计算所述图像在水平方向上N个区域的灰度参数;其中,所述N个区域是根据预设规则在水平方向上划分所述图像得到的,N为大于或等于2的正整数;第一确定单元,设置为:根据所述N个区域的灰度参数确定所述图像对应的倾斜方向和倾斜系数;第二确定单元,设置为:根据所述倾斜系数以及预存的倾斜角度与倾斜系数的对应关系数据确定所述倾斜系数对应的倾斜角度;校正单元,设置为:根据所述倾斜方向和所述倾斜角度对所述投影机进行水平梯形校正。
- 根据权利要求7所述的投影机,其中,所述获取单元,是设置为:利用摄像头按照预设的感光度参数、快门参数以及光圈参数对所述投影机投射纯色光时输出的画面进行拍照以获取所述图像。
- 根据权利要求8所述的投影机,其中,所述灰度参数包括灰阶值。
- 根据权利要求9所述的投影机,其中,所述计算单元,是设置为:对于N个区域中的任一区域,计算所述任一区域内的每个像素的三原色对应的三个色彩分量值的平均值;将所述任一区域内的所有的像素对应的平均值取平均后作为所述任一区域的灰阶值。
- 根据权利要求7所述的投影机,其中,所述第一确定单元,是设置为:选择所述N个区域中的两块区域,所述两块区域分别为区域A和区域B;当所述区域A的灰阶值大于所述区域B的灰阶值时,确定所述倾斜方向为第一倾斜方向,且所述倾斜系数为所述区域A的灰阶值与所述区域B的灰阶值的比值;或,当所述区域A的灰阶值小于所述区域B的灰阶值时,确定所述倾斜方向为第二倾斜方向,且所述倾斜系数为所述区域B的灰阶值与所述区域A的灰阶值的比值。
- 一种计算机可读存储介质,存储有计算机可执行指令,所述计算机可执行指令用于执行权利要求1-6任一项的方法。
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510830311.5A CN106791736B (zh) | 2015-11-25 | 2015-11-25 | 一种梯形校正方法和投影机 |
CN201510830311.5 | 2015-11-25 |
Publications (2)
Publication Number | Publication Date |
---|---|
WO2016197670A2 true WO2016197670A2 (zh) | 2016-12-15 |
WO2016197670A3 WO2016197670A3 (zh) | 2017-02-09 |
Family
ID=57502940
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2016/077711 WO2016197670A2 (zh) | 2015-11-25 | 2016-03-29 | 一种梯形校正方法和投影机 |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN106791736B (zh) |
WO (1) | WO2016197670A2 (zh) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110769231B (zh) * | 2019-08-02 | 2021-10-22 | 成都极米科技股份有限公司 | 基于梯形矫正的投影画面光均匀度控制方法及控制系统 |
CN110769235B (zh) * | 2019-09-30 | 2021-02-05 | 深圳市火乐科技发展有限公司 | 一种梯形校正的方法及产品 |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP1391778A1 (en) * | 2002-08-08 | 2004-02-25 | Seiko Precision Inc. | Apparatus for detecting the inclination angle of a projection screen and projector comprising the same |
CN101923710A (zh) * | 2010-06-30 | 2010-12-22 | 青岛海信网络科技股份有限公司 | 图像倾斜校正方法及装置 |
CN102998885A (zh) * | 2012-11-20 | 2013-03-27 | 芜湖雅图数字视频技术有限公司 | 对投影仪投影图像失真校正的方法 |
-
2015
- 2015-11-25 CN CN201510830311.5A patent/CN106791736B/zh active Active
-
2016
- 2016-03-29 WO PCT/CN2016/077711 patent/WO2016197670A2/zh active Application Filing
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP1391778A1 (en) * | 2002-08-08 | 2004-02-25 | Seiko Precision Inc. | Apparatus for detecting the inclination angle of a projection screen and projector comprising the same |
CN101923710A (zh) * | 2010-06-30 | 2010-12-22 | 青岛海信网络科技股份有限公司 | 图像倾斜校正方法及装置 |
CN102998885A (zh) * | 2012-11-20 | 2013-03-27 | 芜湖雅图数字视频技术有限公司 | 对投影仪投影图像失真校正的方法 |
Also Published As
Publication number | Publication date |
---|---|
CN106791736A (zh) | 2017-05-31 |
WO2016197670A3 (zh) | 2017-02-09 |
CN106791736B (zh) | 2020-05-15 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
AU2016373981B2 (en) | Calibration of defective image sensor elements | |
TWI266224B (en) | Image processing system, projector, information memory media and image processing method | |
KR101640090B1 (ko) | 화상 처리 장치, 프로젝터 및, 프로젝터의 제어 방법 | |
CN106791737B (zh) | 投影画面的颜色校正方法及装置 | |
JP2018005018A5 (zh) | ||
WO2008148291A1 (fr) | Dispositif et procédé pour étalonner un mur à écrans multiples | |
US20150138222A1 (en) | Image processing device and multi-projection system | |
WO2010031252A1 (zh) | 一种电子显示屏的亮度校正方法 | |
JP2004304265A (ja) | 画像処理システム、プロジェクタ、プログラム、情報記憶媒体および画像処理方法 | |
KR20080006476A (ko) | 프로젝션 이전에 이미지를 자동적으로 변경하기 위한시스템 및 방법 | |
US9473709B2 (en) | Image blending system and method for image blending | |
CN112153357A (zh) | 投影系统及其投影方法 | |
JP2006067019A (ja) | 画像処理装置、撮影装置、画像処理方法、画像処理プログラムおよび記録媒体 | |
WO2016197802A1 (zh) | 一种投影修正的方法及系统和终端 | |
JP5119607B2 (ja) | プロジェクタ | |
WO2016197670A2 (zh) | 一种梯形校正方法和投影机 | |
JP2011176629A (ja) | 制御装置および投写型映像表示装置 | |
CN112189337B (zh) | 图像处理装置和图像处理方法 | |
JP5775414B2 (ja) | 投影輝度調整方法、投影輝度調整装置、コンピュータプログラム及び記録媒体 | |
US9088756B2 (en) | Systems and methods for camera image correction and white balancing | |
US20210195153A1 (en) | Image processing device and image processing method | |
US11223808B1 (en) | Device, system and method for generating a mapping of projector pixels to camera pixels and/or object positions using alternating patterns | |
JP2011135445A (ja) | 画像投射装置 | |
TWI682358B (zh) | 多維影像投射裝置及其多維影像校正方法 | |
TWI552603B (zh) | 影像校正系統以及方法 |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
NENP | Non-entry into the national phase in: |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 16806568 Country of ref document: EP Kind code of ref document: A2 |