Disclosure of Invention
The application aims to provide a curtain area positioning method, a curtain area positioning device, a projection device and a computer readable storage medium, which can position a curtain under the condition of insufficient light and improve the positioning accuracy and stability. The specific scheme is as follows:
the application provides a curtain area positioning method, which comprises the following steps:
when the infrared equipment arranged on the curtain is closed, a first image is collected by using a camera;
when at least four infrared devices are turned on, acquiring a second image by using the camera;
performing image difference processing on the first image and the second image to obtain position information of each infrared device;
and determining the curtain position according to all the position information.
Optionally, the determining the curtain position according to all the position information includes:
obtaining a transformation matrix according to the actual position information of all the infrared devices and the corresponding transformation relation, wherein the transformation relation is a transformation factor of the actual position information and the curtain corner position information;
and obtaining the curtain position by utilizing the corresponding transformation matrix according to all the position information.
Therefore, a transformation matrix is obtained according to the actual position information of the infrared equipment and the position information of the corner points of the curtain, the position of the curtain can be determined according to the position information of the infrared equipment in the image by using the transformation matrix, the method is simple, the calculation efficiency is high, and the positioning efficiency of the position of the curtain can be improved.
Optionally, the obtaining a transformation matrix according to the actual position information of all the infrared devices and the corresponding transformation relation includes:
obtaining the transformation matrix according to the actual position information of all the infrared devices and the corresponding transformation relation by using a preset formula;
wherein the preset formula is
u1 is an x coordinate value of the curtain corner point position information, v1 is a y coordinate value of the curtain corner point position information, u2 is an x coordinate value of the actual position information, v2 is a y coordinate value of the actual position information, S is a transformation relation, and H1 is a transformation matrix.
Optionally, the number of the infrared devices is four, and the infrared devices are respectively arranged at four corner points of the curtain.
Therefore, the cost can be reduced by utilizing the four infrared devices, and meanwhile, the infrared devices are arranged on the four corner points of the curtain, so that the operation can be simplified, and the curtain position positioning efficiency is improved.
Optionally, the infrared device is an infrared lamp.
The infrared lamp has the advantage of energy saving, and is small in size, so that the screen can be positioned under the condition that the projection of the screen is not influenced, and the projection effect is improved.
Optionally, the performing image difference processing on the first image and the second image to obtain the position information of each infrared device includes:
performing image difference processing on the first image and the second image to obtain initial position information of all the infrared devices;
and performing noise filtration on all the initial position information to obtain the position information corresponding to each infrared device.
Therefore, after the initial position information is processed, the obtained position information is more accurate, and the accuracy of positioning the curtain position is further improved.
The application provides a regional positioner of curtain includes:
the first image acquisition module is used for acquiring a first image by using a camera when the infrared equipment arranged on the curtain is closed;
the second image acquisition module is used for acquiring a second image by utilizing the camera when at least four infrared devices are turned on;
the position information obtaining module is used for carrying out image difference processing on the first image and the second image to obtain position information of each infrared device;
and the curtain position determining module is used for determining the curtain position according to all the position information.
Optionally, the curtain position determining module includes:
the transformation matrix calculation unit is used for obtaining a transformation matrix according to the actual position information of all the infrared devices and the corresponding transformation relation, wherein the transformation relation is a transformation factor of the actual position information and the curtain corner position information;
and the curtain position determining unit is used for obtaining the curtain position by utilizing the corresponding transformation matrix according to all the position information.
Optionally, the transformation matrix calculating unit includes:
the transformation matrix calculation subunit is used for obtaining the transformation matrix according to the actual position information of all the infrared devices and the corresponding transformation relation by using a preset formula;
wherein the preset formula is
u1 is an x coordinate value of the curtain corner point position information, v1 is a y coordinate value of the curtain corner point position information, u2 is an x coordinate value of the actual position information, v2 is a y coordinate value of the actual position information, S is a transformation relation, and H1 is a transformation matrix.
Optionally, the location information obtaining module includes:
an initial position information obtaining unit, configured to perform image difference processing on the first image and the second image to obtain initial position information of all the infrared devices;
and the position information obtaining unit is used for carrying out noise filtering on all the initial position information to obtain the position information corresponding to each infrared device.
The application provides a projection device, including:
the device comprises a curtain, a projector, a memory, a processor and four infrared devices arranged on the curtain;
wherein the memory is used for storing a computer program;
the processor is configured to implement the steps of the curtain area positioning method when executing the computer program.
The present application provides a computer readable storage medium having stored thereon a computer program which, when being executed by a processor, carries out the steps of the above-mentioned curtain region positioning method.
The application provides a curtain area positioning method, which comprises the following steps: when the infrared equipment arranged on the curtain is closed, a first image is collected by using a camera; when at least four infrared devices are turned on, acquiring a second image by using the camera; performing image difference processing on the first image and the second image to obtain position information of each infrared device; and determining the curtain position according to all the position information.
It is thus clear that this application is through installing four at least infrared equipment on the curtain, and the image that gathers when utilizing infrared lamp to close and four at least infrared equipment to open makes the difference, obtains infrared equipment's positional information, and the curtain location is carried out to the assistance according to this positional information, can fix a position the curtain under the not enough condition of light, and the effectual poor problem of positioning effect who causes by environmental disturbance of having overcome has improved the accuracy and the stability of location. This application still provides a curtain regional positioner, a projection equipment and computer readable storage medium simultaneously, all has above-mentioned beneficial effect, and it is no longer repeated here.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The existing common method is based on image processing of a pure camera, and a curtain area is positioned by means of image recognition, but the method cannot control the use environment, for example, under the conditions of insufficient light in a darkroom, light turning off and the like, the curtain positioning accuracy and stability can be greatly interfered, and even the curtain cannot work at all. Based on the above technical problem, the present embodiment provides a method for positioning a curtain area, which can position a curtain under the condition of insufficient light, so as to improve the accuracy and stability of positioning, specifically referring to fig. 1, where fig. 1 is a flowchart of a method for positioning a curtain area provided in the present embodiment, and specifically includes:
s101, when the infrared equipment arranged on the curtain is closed, a first image is collected by using a camera.
In this application, be provided with infrared equipment on the curtain, wherein, infrared equipment's quantity is four at least, can be six, five or four. It can be understood that under the condition that the camera is far away from the curtain, single-point infrared equipment power is little, and difficult stable positioning, consequently, penetrate the fixed setting of multipoint infrared equipment on the curtain in this application, optimize to can realize stable positioning according to the means of multipoint composition line characteristic. The projector can be a standard projector or an ultra-short-focus projector. In this application, the camera is infrared visible light camera, can satisfy different use scenes. The infrared device includes, but is not limited to, an infrared transmitting tube, an infrared lamp such as a patch type infrared lamp. The infrared lamp has the advantage of energy saving, and is small in size, so that the screen can be positioned under the condition that the projection of the screen is not influenced, and the projection effect is improved.
In a preferred embodiment, the number of infrared devices is four, and the infrared devices are respectively arranged at four corner points of the curtain. Therefore, the cost can be reduced by utilizing the four infrared devices, and meanwhile, the infrared devices are arranged on the four corner points of the curtain, so that the operation can be simplified, and the curtain position positioning efficiency is improved.
The active curtain area positioning method based on the infrared lamp can effectively overcome the characteristic of serious environmental interference, stably position the curtain area, and is suitable for different types of projection such as long-focus/short-focus projection.
And S102, when at least four infrared devices are turned on, acquiring a second image by utilizing the camera.
S103, performing image difference processing on the first image and the second image to obtain position information of each infrared device.
It can be understood that when the four infrared devices are turned on, the four infrared devices only need to form a quadrangle, which is not described again in this embodiment, and after performing image difference processing on the first image and the second image, position information of the first infrared device, position information of the second infrared device, position information of the third infrared device, and position information of the fourth infrared device are obtained; when the five infrared devices are opened, the five infrared devices may form a quadrangle, which is not described again in this embodiment, and after performing image difference processing on the first image and the second image, the position information of the first infrared device, the position information of the second infrared device, the position information of the third infrared device, the position information of the fourth infrared device, and the position information of the fifth infrared device are obtained.
Further, the image difference processing is performed on the first image and the second image to obtain the position information of each infrared device, and the method comprises the following steps: performing image difference processing on the first image and the second image to obtain initial position information of all infrared devices; and carrying out noise filtration on all the initial position information to obtain the position information corresponding to each infrared device. Therefore, after all the initial positions are subjected to noise filtering, the obtained position information is more accurate.
And S104, determining the position of the curtain according to all the position information.
Further, determining the curtain position according to all the position information includes:
s1041, obtaining a transformation matrix according to the actual position information of all infrared devices and corresponding transformation relations, wherein the transformation relations are transformation factors of the actual position information and the curtain corner position information;
in an implementation mode, a transformation matrix is obtained according to the actual position information of all the infrared devices and the corresponding transformation relation by using a preset formula;
wherein the preset formula is
u1 is an x coordinate value of the curtain corner point position information, v1 is a y coordinate value of the curtain corner point position information, u2 is an x coordinate value of the actual position information, v2 is a y coordinate value of the actual position information, S is a transformation relation, and H1 is a transformation matrix.
And S1042, obtaining the curtain position by using the corresponding transformation matrix according to all the position information.
It can be understood that under special use scenes such as ultra-short focus projection, the infrared camera has an excessively large elevation angle, so that nearby points can be effectively collected, but a point deviation angle at a far distance is excessively large, infrared light cannot effectively enter the visual angle range of the infrared camera, and the positioning difficulty is large. Aiming at the situation, the method for calculating the whole curtain can be calculated by utilizing the small scale chart formed by the four infrared positioning basic points.
In an implementation manner, the number of the infrared devices is four, please refer to fig. 2, fig. 2 is a schematic diagram of a position of another infrared device on a curtain provided in this embodiment, and the positions of the infrared device a, the infrared device B, the infrared device C, and the infrared device D are as shown in fig. 2, where a rectangular ABCD of an infrared device composition area 2-1 may be similar to or dissimilar to a rectangular efhg of the curtain 1-1, and after obtaining A, B, C, D position information, a transformation matrix is obtained according to a preset formula and corresponding transformation relations of actual position information of all the infrared devices, and then the position information of A, B, C, D is known, and an x coordinate value and a y coordinate value corresponding to the position information are substituted into U2 and V2 in sequence, and the position information is utilized to substitute the x coordinate value and the y coordinate value into U2 and V2And obtaining U1 and V1 corresponding to the points, and obtaining information of four corner points of the curtain so as to obtain the position of the curtain. Wherein the curtain position comprises the positions of four corner points.
In another implementation, the number of the infrared devices is four, please refer to fig. 3, fig. 3 is a schematic diagram of a position of another infrared device provided in this embodiment of the present application, where the positions of the infrared device a, the infrared device b, the infrared device c, and the infrared device d are shown in fig. 3, where a rectangular abcd of an infrared device composition area 2-2 may be similar to or dissimilar to a rectangular efhg of the curtain 1-2, and after the position information of a, b, c, and d is obtained, a transformation matrix is obtained according to a preset formula and corresponding transformation relations of all the actual position information of the infrared devices, and then the position information of a, b, c, and d is known, and an x coordinate value and a y coordinate value corresponding to the position information are sequentially substituted into U2 and V2, and the x coordinate value and the y coordinate value corresponding to the position information are utilized to generate a transformation matrix
And obtaining U1 and V1 corresponding to the points, and obtaining information of four corner points of the curtain so as to obtain the position of the curtain. Wherein the curtain position comprises the positions of four corner points.
Based on above-mentioned technical scheme, this embodiment is through installing four at least infrared equipment on the curtain, and the image that gathers when utilizing infrared lamp to close and four at least infrared equipment to open does the difference, obtains the positional information of infrared equipment, and the curtain location is carried out to the assistance according to this positional information, can fix a position the curtain under the not enough condition of light, and the effectual poor problem of positioning effect who causes by environmental disturbance of having overcome has improved the accuracy and the stability of location.
Referring to fig. 4, fig. 4 is a schematic structural diagram of a curtain area positioning device provided in an embodiment of the present application, which includes:
the firstimage obtaining module 410 is configured to acquire a first image by using a camera when the infrared device disposed on the curtain is turned off;
the secondimage obtaining module 420 is configured to acquire a second image by using the camera when at least four infrared devices are turned on;
the positioninformation obtaining module 430 is configured to perform image difference processing on the first image and the second image to obtain position information of each infrared device;
and a curtainposition determining module 440, configured to determine a curtain position according to all the position information.
Optionally, the curtainposition determining module 440 includes:
the transformation matrix calculation unit is used for obtaining a transformation matrix according to the actual position information of all the infrared devices and the corresponding transformation relation, wherein the transformation relation is a transformation factor of the actual position information and the curtain corner position information;
and the curtain position determining unit is used for obtaining the curtain position by utilizing the corresponding transformation matrix according to all the position information.
Optionally, the transformation matrix calculating unit includes:
the transformation matrix calculation subunit is used for obtaining a transformation matrix according to the actual position information of all the infrared devices and the corresponding transformation relation by using a preset formula;
wherein the preset formula is
u1 is an x coordinate value of the curtain corner point position information, v1 is a y coordinate value of the curtain corner point position information, u2 is an x coordinate value of the actual position information, v2 is a y coordinate value of the actual position information, S is a transformation relation, and H1 is a transformation matrix.
Optionally, the locationinformation obtaining module 430 includes:
the initial position information obtaining unit is used for carrying out image difference processing on the first image and the second image to obtain initial position information of all infrared devices;
and the position information obtaining unit is used for carrying out noise filtration on all the initial position information to obtain the position information corresponding to each infrared device.
Since the embodiment of the curtain region positioning apparatus portion and the embodiment of the curtain region positioning method portion correspond to each other, please refer to the description of the embodiment of the curtain region positioning method portion for the embodiment of the curtain region positioning apparatus portion, which will not be described herein again.
In the following, a projection apparatus provided by an embodiment of the present application is described, and the projection apparatus described below and the curtain area positioning method described above may be referred to correspondingly.
The application provides a projection device, including:
the device comprises a curtain, a projector, a memory, a processor and four infrared devices arranged on the curtain;
wherein the memory is used for storing the computer program;
and the processor is used for realizing the steps of the curtain area positioning method when executing the computer program.
Since the embodiment of the projection device part corresponds to the embodiment of the curtain region positioning method part, please refer to the description of the embodiment of the curtain region positioning method part for the embodiment of the projection device part, which is not repeated here.
In the following, a computer-readable storage medium provided by an embodiment of the present application is described, and the computer-readable storage medium described below and the curtain area positioning method described above may be referred to correspondingly.
The present application provides a computer readable storage medium, on which a computer program is stored, which, when being executed by a processor, realizes the steps of the above curtain region positioning method.
Since the embodiment of the computer-readable storage medium portion corresponds to the embodiment of the curtain region positioning method portion, please refer to the description of the embodiment of the curtain region positioning method portion for the embodiment of the computer-readable storage medium portion, which is not repeated here.
The embodiments are described in a progressive manner in the specification, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
The above description provides a curtain area positioning method, a curtain area positioning device, a projection apparatus, and a computer readable storage medium. The principles and embodiments of the present application are explained herein using specific examples, which are provided only to help understand the method and the core idea of the present application. It should be noted that, for those skilled in the art, it is possible to make several improvements and modifications to the present application without departing from the principle of the present application, and such improvements and modifications also fall within the scope of the claims of the present application.