A projection correction method for a projector, a projector, and a storage medium.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- APPOTRONICS CORP LTD
- Filing Date
- 2022-04-20
- Publication Date
- 2026-06-30
Smart Images

Figure CN116962653B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of projection technology, and in particular to a projection correction method for a projector, a projector, and a storage medium. Background Technology
[0002] In traditional projectors, the projector needs to be placed directly facing the projection plane to ensure that the projected image is a normal rectangle. If the projector's projection direction deviates from the projection plane, the projected image will be distorted, forming an irregular quadrilateral.
[0003] In existing technologies, side projection can project a rectangular shape onto the projection plane, but it usually involves directly selecting the four vertices of the rectangle to determine its position and size. This method not only makes it difficult to find the rectangle with the optimal area, but also fails to consider factors other than the size of the rectangle's area. Summary of the Invention
[0004] In order to solve the above-mentioned technical problems in the prior art, this application provides a projection correction method for a projector, a projector, and a storage medium.
[0005] To address the aforementioned problems, this application provides a projection correction method for a projector. The method includes: acquiring the projection area projected by the projector onto a projection plane; determining the position parameter of the midpoint of a target rectangle within the projection area based on a preset scoring type; determining the position of the target rectangle within the projection area using the position parameter and the edge line of the projection area, and calculating the rectangle parameters of the vertices of the target rectangle; and correcting the parameters of the displayed image of the projector based on the rectangle parameters.
[0006] To address the aforementioned problems, this application also provides a projector, which includes a processor and a memory, wherein the memory stores a computer program, and the processor executes the computer program to implement the aforementioned method.
[0007] To address the aforementioned problems, this application also provides a computer-readable storage medium having program instructions stored thereon, which, when executed by a processor, implement the aforementioned method.
[0008] Compared with existing technologies, the projection correction method for a projector in this application includes obtaining the projection area projected by the projector on the projection plane; determining the position parameter of the midpoint of a target rectangle within the projection area based on a preset scoring type; determining the position of the target rectangle within the projection area using the position parameter and the edge of the projection area, and calculating the rectangle parameters of the vertices of the target rectangle; and correcting the parameters of the displayed image of the projector based on the rectangle parameters. Through the above implementation, the projection correction method of this application considers at least one scoring type to determine the midpoint position parameter of the target rectangle, and determines the position of the target rectangle centered on the position parameter, thereby effectively improving the flexibility and projection effect of the projector during projection and improving the operating efficiency of the product.
[0009] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this application. Attached Figure Description
[0010] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0011] Figure 1 This is a schematic flowchart of an embodiment of the projection correction method for the projector provided in this application;
[0012] Figure 2 This is a schematic diagram of an embodiment of the projector that projects images onto a projection plane according to this application;
[0013] Figure 3 This is a flowchart illustrating an embodiment for determining the position parameters of the midpoint of a target rectangle;
[0014] Figure 4 yes Figure 3 A schematic flowchart of an embodiment of step S301;
[0015] Figure 5 yes Figure 4 A schematic flowchart of an embodiment of step S402;
[0016] Figure 6 yes Figure 3 A schematic flowchart of an embodiment of step S302;
[0017] Figure 7 yes Figure 1 A schematic flowchart of an embodiment of step S103;
[0018] Figure 8 yes Figure 1 A schematic flowchart of an embodiment of step S101;
[0019] Figure 9 This is a schematic diagram of an embodiment of the projector provided in this application;
[0020] Figure 10 This is a schematic diagram of the structure of an embodiment of the computer storage medium of this application. Detailed Implementation
[0021] The present application will now be described in further detail with reference to the accompanying drawings and embodiments. It should be particularly noted that the following embodiments are for illustrative purposes only and do not limit the scope of the application. Similarly, the following embodiments are only some, not all, embodiments of the present application, and all other embodiments obtained by those skilled in the art without inventive effort are within the scope of protection of the present application.
[0022] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a mutually exclusive, independent, or alternative embodiment. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0023] In the description of this application, it is necessary to specify that, unless otherwise expressly stated and limited, the terms "installation," "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or a connection through an intermediate medium. Those skilled in the art will understand the specific meanings of the above terms within the context of this application.
[0024] This application provides a projection calibration method for a projector, see details below. Figure 1 , Figure 1 This is a schematic flowchart of an embodiment of the projection correction method for a projector provided in this application. Specifically, the method includes the following steps S101 to S104.
[0025] Step S101: Obtain the projection area projected by the projector on the projection plane.
[0026] The projection plane can be a wall or a screen, etc. In this embodiment, there is a non-perpendicular angle between the projector and the projection plane, such as... Figure 2 As shown, Figure 2This is a schematic diagram of an embodiment of the projector that projects an image onto a projection plane, as provided in this application. In this embodiment, there is a non-perpendicular angle between the projection plane and the output axis of the projector's optical engine; that is, the projector side-projects the display image onto the projection plane. Before data processing, the projection area of the side-projected image on the projection plane is a non-rectangular quadrilateral, which can affect the user's viewing experience.
[0027] The projection area may include data such as the shape of the projection area and the direction of the horizontal and vertical coordinates of the projection area.
[0028] In one embodiment, the determined projection area data can be transmitted to the projector via other devices. For example, the projection area can be determined by directly measuring with tools such as a ruler or protractor; or by capturing images with a 3D camera; or by photographing the projection plane with a camera. In another embodiment, the projection area can be obtained directly through devices inside the projector. For example, the projection area can be determined by photographing the projection plane and specific reference objects on the projection plane using a sensor; or the relative angle between the projector and the projection plane can be measured, and the projection area can be determined by establishing geometric relationships using the projector's internal parameters.
[0029] Step S102: Based on the preset scoring type, determine the position parameters of the midpoint of the target rectangle within the projection area.
[0030] The preset scoring types include a function from a rectangular area to a score. For example, when the goal is to maximize the area of the projected image, the score is calculated by finding the area of the target rectangle; when the goal is to improve the display quality of the projected image, the score is calculated by finding the area of the target rectangle on the projector's display panel; when the goal is to improve the brightness of the projected image, the score is calculated by finding the total brightness of the target rectangle; when two or more of the above situations need to be considered simultaneously, the score is calculated by finding a weighted combination of the score values of the selected target.
[0031] Once the preset scoring type is determined, the position parameters of the midpoint of the target rectangle can be determined according to the optimization method. For example, the optimization method may include the ternary method, gradient optimization method, genetic algorithm, etc. Different scoring types or optimization methods will result in different position parameters of the midpoint of the target rectangle.
[0032] The midpoint of the target rectangle is the intersection of its diagonals, and the position parameter of the midpoint of the target rectangle is the coordinate value of the target rectangle in the coordinate system of the projection plane.
[0033] Step S103: Using the position parameters and the edge of the projection area, determine the position of the target rectangle within the projection area, and calculate the rectangle parameters of the vertices of the target rectangle.
[0034] The rectangle parameter of the vertices of the target rectangle is the coordinate value of the vertex of the target rectangle in the coordinate system of the projection plane. For example... Figure 2 As shown, in this embodiment, the direction of the diagonal of the target rectangle can be determined according to the projection parameters of the projector, and the intersection of the diagonal and the edge of the projection area is taken as a vertex of the target rectangle. The intersection point that serves as a vertex of the target rectangle is the one among the four intersection points that is closest to the midpoint of the target rectangle. Therefore, knowing the direction of the diagonal, a vertex of the target rectangle, and the midpoint of the target rectangle, the position of the target rectangle within the projection area can be determined. Furthermore, knowing the position parameters of the midpoint, the rectangle parameters of the vertices of the target rectangle can be calculated.
[0035] Step S104: Correct the parameters of the projector's displayed image based on the rectangle parameters.
[0036] The displayed image is generated by the image signal source of the projector. After obtaining the coordinates of the vertices of the target rectangle on the projection plane, matrix transformations (such as homography matrices) can be used to make the rectangle parameters correspond to the position of the displayed image, thereby correcting the shape and size of the displayed image. The corrected displayed image is then projected onto the projection plane to project the target rectangle.
[0037] Through the above implementation method, at least one scoring type is considered to determine the midpoint position parameter of the target rectangle, and the target rectangle with the optimal area is determined with the position parameter as the center, thereby effectively improving the flexibility and projection effect of the projector and improving the operating efficiency of the product.
[0038] See Figure 3 , Figure 3 This is a flowchart illustrating an embodiment for determining the positional parameters of the midpoint of a target rectangle. Specifically, it may include the following steps S301 to S302.
[0039] Step S301: Search for target lines that meet the first accuracy requirement from the displayed image.
[0040] The first precision requirement can be the width of the target line. For example, the first precision requirement can be one pixel, two pixels, or other numbers of pixels. That is, the number of pixels can be used as the standard for determining the width of the target line. In this embodiment, the displayed image is a two-dimensional image, and the target line that meets the conditions is searched in the two-dimensional displayed image using an optimization method.
[0041] Step S302: Search for the midpoint of the target on the target line and map the midpoint of the target to the projection area to obtain the position parameters.
[0042] The search involves finding the target midpoint along the target lines, which means searching for a target midpoint that meets certain conditions from the one-dimensional target lines. The target midpoint can be one or more pixels in the displayed image. In this embodiment, the target lines that meet the conditions are first searched from the two-dimensional displayed image using an optimization method. Then, the target midpoint that meets the conditions is searched from the target lines using an optimization method. Finally, the points located on the displayed image are mapped to the projection area through matrix transformation (e.g., homography matrix), thereby determining the position parameters of the midpoint of the target rectangle.
[0043] In one embodiment, the projection correction method may further include: obtaining the coordinate values of the vertices of the projection area in the coordinate system of the projection plane, and establishing a homography matrix with the coordinates of the two-dimensional imaging vertices of the displayed image; and using the homography matrix to map the midpoint of the target to the projection area to obtain position parameters.
[0044] The two-dimensional imaging vertex coordinates of a displayed image refer to the coordinates of the two-dimensional vertices of the displayed image on the normalized plane. These coordinates can be determined based on the resolution or aspect ratio of the displayed image. After obtaining the projection area on the projection plane, the specific positions of the vertices of the graphic within the projection area can be determined. There are four vertices, each with a coordinate value in the coordinate system of the projection plane. After determining this information, a corresponding homography matrix can be established.
[0045] The homography matrix is a concept in projective geometry, also known as projective transformation. It maps points (3D homogeneous vectors) on one projective plane to another. Assuming the homography matrix between two images is known, an image from one plane can be transformed to another. Through this transformation, projection correction can be performed on the same plane.
[0046] Homography matrices can be used to map points in a projection region onto a display image, or vice versa. For example, after determining the target midpoint on the display image, the target midpoint can be mapped onto the projection region using a homography matrix.
[0047] See Figure 4 , Figure 4 yes Figure 3 A schematic diagram of an embodiment of step S301 is shown. Specifically, it may include the following steps S401 to S405.
[0048] Step S401: Divide the displayed image into a first sub-region, a second sub-region, and a third sub-region that are adjacent to each other in sequence, wherein the line connecting the first sub-region and the second sub-region is the first line, and the line connecting the second sub-region and the third sub-region is the second line.
[0049] In this embodiment, the rule of thirds is used as an optimization method. The displayed image is divided into three regions along a certain direction, including a first sub-region, a second sub-region, and a third sub-region. The areas of the three sub-regions can be the same or different. The width of the first and second connecting lines can be one pixel.
[0050] Step S402: Calculate the optimization score of the first connection and the optimization score of the second connection respectively.
[0051] The optimization score for the first connection is the optimization score of the pixels on the first connection, and the optimization score for the second connection is the optimization score of the pixels on the second connection. The optimization score types include the aforementioned preset score types; the same pixel will have different score results for different score types. In this embodiment, the first and second connections have the same score type.
[0052] Step S403: Retain the two sub-regions adjacent to the one with the larger optimization score of the first and second connecting lines.
[0053] Under the same scoring type, the optimized score values of the pixels of the first and second connecting lines are calculated separately. The largest optimized score value of the pixels of the first and second connecting lines is selected and compared. Based on the comparison result, two sub-regions adjacent to the one with the larger optimized score value of the first and second connecting lines are retained. For example, the first connecting line is located between the first and second sub-regions, and the second connecting line is located between the second and third sub-regions. When the largest optimized score value of the first connecting line is greater than the largest optimized score value of the second connecting line, the third sub-region is cropped, and the first and second sub-regions are retained; when the largest optimized score value of the second connecting line is greater than the largest optimized score value of the first connecting line, the first sub-region is cropped, and the second and third sub-regions are retained.
[0054] Step S404: Determine whether two adjacent sub-regions meet the first precision requirement.
[0055] After performing a three-part optimization on the displayed image using the above method, determine whether the two remaining sub-regions meet the first precision requirement. If so, proceed to step S405.
[0056] Step S405: Connect two adjacent sub-regions as targets.
[0057] If not, the two adjacent sub-regions that are retained will be used as the display image, and the process will return to step S401.
[0058] If the two remaining sub-regions do not meet the first precision requirement after the third division optimization is applied to the displayed image once, the third division optimization is applied again to the remaining sub-regions. This process is repeated until the final remaining region meets the first precision requirement.
[0059] See Figure 5 , Figure 5 yes Figure 4 A schematic diagram of an embodiment of step S402, specifically, may include the following steps S501 to S504.
[0060] Step S501: Divide the first line into a first sub-line, a second sub-line, and a third sub-line that are adjacent to each other in sequence. The point between the first sub-line and the second sub-line is the first pixel point, and the point between the second sub-line and the third sub-line is the second pixel point.
[0061] The optimization score of the first connection can also be obtained using the three-part method. In this embodiment, the first connection is divided into three line segments and two pixels along its length, including a first pixel, a second pixel, a first sub-connection, a second sub-connection, and a third sub-connection. The lengths of the three sub-connections can be the same or different.
[0062] Step S502: Calculate the optimization score value of the first pixel and the optimization score value of the second pixel respectively, and retain the two sub-connections adjacent to the one with the larger optimization score value of the first pixel and the second pixel.
[0063] The optimized scoring types include the aforementioned preset scoring types. The same pixel will have different scoring results for different scoring types. For example, when the scoring objective is to maximize the area of the projected image, the scoring value of the second pixel is greater than that of the first pixel; when the scoring objective is a weighted combination of multiple cases, the scoring value of the first pixel is greater than that of the second pixel. In this embodiment, the scoring types of the first and second pixels are the same.
[0064] When the score value of the first pixel is greater than the score value of the second pixel, the third sub-segment is clipped, and the first and second sub-segments are retained; when the score value of the second pixel is greater than the score value of the first pixel, the first sub-segment is clipped, and the second and third sub-segments are retained.
[0065] Step S503: Determine whether two adjacent sub-connections meet the second precision requirement.
[0066] The second precision requirement may include two pixels or other numbers of pixels.
[0067] After performing a three-part optimization on the first connection using the above method, determine whether the two remaining sub-segments meet the second precision requirement. If so, proceed to step S504.
[0068] Step S504: Use the optimized score value of the pixel points between two adjacent sub-connections as the optimized score value of the first connection.
[0069] If not, then the two adjacent sub-regions are used as the first connection, and the process returns to step S501.
[0070] If the first connection is optimized using the three-part method once, and the two remaining connections do not meet the second precision requirement, then the remaining sub-connections are optimized again using the three-part method as described above. This process is repeated until the two remaining sub-connections finally meet the second precision requirement.
[0071] The method for calculating the optimization score of the second connection is the same as the method for calculating the optimization score of the first connection.
[0072] The second optimization score is calculated in the same way as the first optimization score, to obtain the second optimization score.
[0073] See Figure 6 , Figure 6 yes Figure 3 A schematic diagram of an embodiment of step S302, specifically, may include the following steps S601 to S604.
[0074] Step S601: Divide the target line into a first sub-target line, a second sub-target line, and a third sub-target line that are adjacent to each other in sequence. The point between the first sub-target line and the second sub-target line is the first position, and the point between the second sub-target line and the third sub-target line is the second position.
[0075] The optimization score of the target connection can also be obtained using the three-part method. In this embodiment, the target connection is divided into three line segments and two pixels along its length direction, including a first position, a second position, a first sub-target line, a second sub-target line, and a third sub-target line. The lengths of the three sub-target lines can be the same or different.
[0076] Step S602: Calculate the optimization score value of the first position and the optimization score value of the second position respectively, and retain the two sub-target lines adjacent to the one with the larger optimization score value of the first position and the second position.
[0077] The first and second positions refer to one or more pixels. The optimized scoring types include the aforementioned preset scoring types; the same pixel will have different scoring results for different scoring types. For example, when the scoring objective is to maximize the area of the projected image, the scoring value of the second position is greater than the scoring value of the first position; when the scoring objective is a weighted combination of multiple cases, the scoring value of the first position is greater than the scoring value of the second position. In this embodiment, the scoring types of the first and second positions are the same.
[0078] When the score value of the first position is greater than the score value of the second position, the third sub-target line is clipped, and the first and second target lines are retained; when the score value of the second position is greater than the score value of the first target line, the first target line is clipped, and the second and target lines are retained.
[0079] Step S603: Determine whether two adjacent sub-target lines meet the third precision requirement.
[0080] The third precision requirement can include two pixels or other numbers of pixels.
[0081] After performing a three-part optimization on the target connection using the above method, determine whether the two remaining sub-target lines meet the third precision requirement. If so, proceed to step S604.
[0082] Step S604: Take the position point between two adjacent sub-target lines as the target midpoint.
[0083] If not, then the two adjacent sub-target lines are used as target lines, and the process returns to step S601.
[0084] If the two remaining lines do not meet the third precision requirement after the target line is optimized using the three-part method once, the remaining sub-target lines are optimized again using the three-part method. This process is repeated until the two remaining sub-target lines meet the third precision requirement.
[0085] See Figure 7 , Figure 7 yes Figure 1 A schematic diagram of an embodiment of step S103, specifically, may include the following steps S701 to S703.
[0086] Step S701: Based on the parameters of the projector, determine the extension direction of the diagonal of the target rectangle.
[0087] The projector's parameters include its aspect ratio; for example, the aspect ratio is 16:9. The direction of the diagonal extension of the target rectangle can be determined based on the projector's aspect ratio, such as... Figure 2 As shown, the two intersecting dashed lines are the diagonals of the target rectangle.
[0088] Step S702: Among the four intersection points of the diagonal of the target rectangle and the edge of the projection area, select the intersection point that is closest to the midpoint of the target rectangle as a vertex of the target rectangle.
[0089] In this embodiment, the midpoint of the target rectangle lies within the projection area, and the diagonal of the target rectangle intersects the edge of the projection area at four points. For example... Figure 2 As shown, the intersection point in the lower left corner is closer to the midpoint than the other three intersection points. Therefore, choosing it as a vertex of the target rectangle ensures that the final target rectangle is entirely within the projection area.
[0090] Step S703: Based on a vertex of the determined target rectangle and the midpoint of the target rectangle, obtain the position of the target rectangle.
[0091] In this embodiment, the position of the diagonal can be determined based on the aspect ratio of the projector. All vertices of the target rectangle are located on the diagonal. After knowing one vertex of the target rectangle, the relative positions of the other vertices of the target rectangle with respect to the midpoint of the target rectangle can be determined. Thus, the coordinate values of each vertex of the target rectangle can be calculated, thereby determining the position of the target rectangle within the projection area.
[0092] See Figure 8 , Figure 8 yes Figure 1 A schematic diagram of an embodiment of step S101, specifically, may include the following steps S801 to S803.
[0093] Step S801: Obtain the relative pose relationship between the projector and the projection plane.
[0094] In this embodiment, the method of obtaining the relative pose relationship may include using a camera to capture a test image projected onto a projection plane by a projector to obtain the initial pose; or using a 3D camera to detect the normal vector of the projection plane to obtain the initial pose.
[0095] It should be noted that pose usually refers to position and orientation. In this embodiment, since the main focus is on the relative angles between different devices, the pose here specifically refers to the rotational relationship between different coordinate systems. The rotational relationship can be described using mathematical tools such as rotation matrix, rotation vector, Euler angles (pitch angle, yaw angle, rotation angle).
[0096] Step S802: Based on the machine parameters of the projector, determine the direction of the ray that forms the vertex of the projection area in the coordinate system of the projector's optical engine.
[0097] The projector's machine parameters include the throw ratio and offset parameters, which are stored in the projector's storage module. The throw ratio is the ratio of the projection distance to the width of the projected image when projecting directly onto the screen. For example, when the throw ratio is 1.2, the projection distance can be 1.2 meters, and the width of the projected image can be 1 meter. The offset includes both the x-axis and y-axis throw ratios. It determines the position of the intersection of the lens's principal optical axis and the screen on the displayed image when projecting directly onto the screen. An offset of 0 means the principal optical axis is at the center of the displayed image, and a Y-axis offset of 100% means the principal optical axis is at the midpoint of the bottom edge of the displayed image.
[0098] After determining the projector's machine parameters, the directions of the rays at the four vertices of the displayed image projected by the projector's optical engine in the optical engine's coordinate system can be determined.
[0099] Step S803: Determine the coordinates of the intersection point between the ray and the projection plane using the relative pose relationship, and obtain the projection area based on the coordinates.
[0100] By utilizing the relative pose relationship between the projection plane and the projector, the transformation relationship between the three-dimensional coordinate system of the projection plane and the coordinate system of the optomechanical system can be determined. Thus, the rays in the coordinate system of the optomechanical system can be transformed to the three-dimensional coordinate system of the projection plane. Then, the intersection points of the four rays with the projection plane can be determined, and the coordinate values of the four intersection points in the three-dimensional coordinate system of the projection plane can be determined. The area formed by connecting the four intersection points in sequence is the projection area. After determining the coordinate values of the four intersection points, the shape and size of the projection area can be determined.
[0101] To implement the projection correction method of the projector in the above embodiments, this application provides a projector. See also... Figure 9 , Figure 9 This is a schematic diagram of an embodiment of the projector provided in this application.
[0102] The projector 90 in this embodiment includes a processor 91 and a memory 92. The memory 92 stores a computer program, and the processor 91 executes the computer program to implement the projection correction method of the projector described above.
[0103] The processor 91 can be an integrated circuit chip with signal processing capabilities. The processor 91 can also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. The general-purpose processor can be a microprocessor or any conventional processor.
[0104] The projector may include: a display area measurement module, an optimization module, a rectangle calculation module, a geometric transformation module, an image correction module, an image signal source, and a projection display module.
[0105] In one embodiment of this application, the aforementioned modules can be individually or entirely combined into one or more units, or some of these units can be further divided into multiple functionally smaller sub-units to achieve the same operation without affecting the technical effects of the embodiments of this application. The above modules are based on logical functional division; in practical applications, the function of one module can be implemented by multiple units, or the functions of multiple modules can be implemented by one unit. In other embodiments of this application, the projector may also include other units; in practical applications, these functions can also be implemented with the assistance of other units, and can be implemented collaboratively by multiple units.
[0106] for Figures 1-8 The projection correction method of the projector shown in the embodiment can be presented in the form of a computer program. This application proposes a computer storage medium carrying the computer program. Please refer to [link to relevant documentation]. Figure 10 , Figure 10 This is a schematic diagram of the structure of a computer storage medium according to an embodiment of the present application. The computer storage medium 100 in this embodiment includes a computer program 110, which can be executed to implement the projection correction method of the projector described above.
[0107] In this embodiment, the computer storage medium 100 can be a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, or a medium that can store program instructions. Alternatively, it can be a server that stores the program instructions. The server can send the stored program instructions to other devices for execution, or it can execute the stored program instructions itself.
[0108] Furthermore, if the aforementioned functions are implemented as software functions and sold or used as independent products, they can be stored in a mobile terminal-readable storage medium. That is, this application also provides a storage device storing program data, which can be executed to implement the methods of the above embodiments. This storage device can be, for example, a USB flash drive, an optical disc, or a server. In other words, this application can be embodied in the form of a software product, which includes several instructions to cause a smart terminal to execute all or part of the steps of the methods described in the various embodiments.
[0109] In the description of this application, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.
[0110] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, "multiple" means at least two, such as two, three, etc., unless otherwise explicitly specified.
[0111] Any process or method described in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more executable instructions for implementing a particular logical function or process, and the scope of the preferred embodiments of this application includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the function involved, as will be understood by those skilled in the art to which embodiments of this application pertain.
[0112] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (which may be a personal computer, server, network device, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of computer-readable media include: an electrical connection having one or more wires (electronic device), a portable computer disk drive (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Alternatively, the computer-readable medium may be paper or other suitable media on which the program can be printed, since the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in a computer memory.
[0113] The above description is merely an embodiment of this application and does not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.
Claims
1. A projection correction method for a projector, characterized in that, include: Obtain the projection area projected by the projector onto the projection plane; Based on the preset scoring type, the position parameters of the midpoint of the target rectangle are determined within the projection area; Using the position parameters and the edge lines of the projection area, the position of the target rectangle within the projection area is determined, and the rectangle parameters of the vertices of the target rectangle are calculated. The parameters of the projector's displayed image are corrected based on the rectangular parameters; The step of determining the position parameters of the midpoint of the target rectangle within the projection area includes: Search the displayed image for target lines that meet the first precision requirement; The midpoint of the target is searched along the target line, and the midpoint of the target is mapped onto the projection area to obtain the position parameters.
2. The method according to claim 1, characterized in that, The step of searching for target lines that meet the first accuracy requirement from the displayed image includes: The displayed image is divided into a first sub-region, a second sub-region, and a third sub-region that are adjacent to each other in sequence. The line connecting the first sub-region and the second sub-region is the first line, and the line connecting the second sub-region and the third sub-region is the second line. Calculate the optimization score value of the first connection and the optimization score value of the second connection respectively; Retain the two sub-regions adjacent to the one with the larger optimization score value between the first and second connecting lines; Determine whether the two adjacent sub-regions meet the first precision requirement; if so, use the two adjacent sub-regions as the target line. If not, then the two adjacent sub-regions are used as the display image, and the process returns to the step of dividing the display image into a first sub-region, a second sub-region, and a third sub-region that are sequentially adjacent.
3. The method according to claim 2, characterized in that, The steps of calculating the optimization score values of the first connection and the second connection respectively include: The first connecting line is divided into a first sub-connecting line, a second sub-connecting line, and a third sub-connecting line that are adjacent to each other in sequence. The point between the first sub-connecting line and the second sub-connecting line is the first pixel point, and the point between the second sub-connecting line and the third sub-connecting line is the second pixel point. Calculate the optimization score of the first pixel and the optimization score of the second pixel respectively, and retain the two sub-connections adjacent to the one with the larger optimization score of the first pixel and the second pixel; Determine whether the two adjacent sub-connections meet the second precision requirement. If so, use the optimized score value of the pixel between the two adjacent sub-connections as the optimized score value of the first connection. If not, then take the two adjacent sub-regions as the first line and return to the step of dividing the first line into a first sub-line, a second sub-line and a third sub-line that are adjacent in sequence; The method for calculating the optimization score of the second connection is the same as the method for calculating the optimization score of the first connection.
4. The method according to claim 1, characterized in that, The step of searching for the midpoint of the target along the target line includes: The target line is divided into a first sub-target line, a second sub-target line, and a third sub-target line that are adjacent to each other in sequence. The point between the first sub-target line and the second sub-target line is the first position, and the point between the second sub-target line and the third sub-target line is the second position. Calculate the optimization score value for the first position and the optimization score value for the second position respectively, and retain the two sub-target lines adjacent to the one with the larger optimization score value of the first position and the second position. Determine whether the two adjacent sub-target lines meet the third precision requirement. If so, take the position point between the two adjacent sub-target lines as the midpoint of the target. If not, then the two adjacent sub-target lines are taken as target lines, and the process returns to the step of dividing the target lines into sequentially adjacent first sub-target lines, second sub-target lines, and third sub-target lines.
5. The method according to claim 1, characterized in that, The step of determining the position of the target rectangle within the projection area using the position parameters and the edge of the projection area includes: Based on the parameters of the projector, determine the extension direction of the diagonal of the target rectangle; Among the four intersection points of the diagonal of the target rectangle and the edge of the projection area, the intersection point closest to the midpoint of the target rectangle is selected as a vertex of the target rectangle; The position of the target rectangle is obtained based on a vertex and the midpoint of the target rectangle.
6. The method according to claim 1, characterized in that, The method includes: Obtain the coordinate values of the vertices of the projection area in the coordinate system of the projection plane, and establish a homography matrix using the coordinates of the two-dimensional imaging vertices of the displayed image; The position parameters are obtained by mapping the midpoint of the target onto the projection region using the homography matrix.
7. The method according to claim 1, characterized in that, The step of obtaining the projection area projected by the projector on the projection plane includes: Obtain the relative pose relationship between the projector and the projection plane; Based on the machine parameters of the projector, determine the direction of the ray that forms the vertex of the projection area in the coordinate system of the projector's optical engine; The coordinates of the intersection point between the ray and the projection plane are determined using the relative pose relationship, and the projection area is obtained based on the coordinates.
8. A projector, characterized in that, include: A processor and a memory, wherein the memory stores a computer program, and the processor is configured to execute the computer program to implement the method of any one of claims 1 to 7.
9. A computer-readable storage medium having program instructions stored thereon, characterized in that, When the program instructions are executed by the processor, they implement the method described in any one of claims 1 to 7.