WO2022267219A1 - Automatic focusing method and apparatus, and storage medium - Google Patents

Automatic focusing method and apparatus, and storage medium Download PDF

Info

Publication number
WO2022267219A1
WO2022267219A1 PCT/CN2021/115364 CN2021115364W WO2022267219A1 WO 2022267219 A1 WO2022267219 A1 WO 2022267219A1 CN 2021115364 W CN2021115364 W CN 2021115364W WO 2022267219 A1 WO2022267219 A1 WO 2022267219A1
Authority
WO
WIPO (PCT)
Prior art keywords
projection
unit
projection unit
rotation angle
distance
Prior art date
Application number
PCT/CN2021/115364
Other languages
French (fr)
Chinese (zh)
Inventor
李祥
丁明内
杨伟樑
高志强
Original Assignee
广景视睿科技(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 广景视睿科技(深圳)有限公司 filed Critical 广景视睿科技(深圳)有限公司
Publication of WO2022267219A1 publication Critical patent/WO2022267219A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N9/00Details of colour television systems
    • H04N9/12Picture reproducers
    • H04N9/31Projection devices for colour picture display, e.g. using electronic spatial light modulators [ESLM]
    • H04N9/3179Video signal processing therefor
    • H04N9/3185Geometric adjustment, e.g. keystone or convergence

Definitions

  • the present application relates to the technical field of digital projection display, in particular to an autofocus method, device and storage medium.
  • the projection device is a common display device, while the traditional projection device usually projects at a fixed position. Since the projection device projects the display screen Therefore, it is very important whether the projection device is successfully focused on the screen so that the user can see a clear display image.
  • dynamic projection is required, such as large-scale stages, security alarms, and smart transportation, etc., to meet the specific needs of different scenarios by moving the projection screen in space. Since the projection position of the dynamic projection system is constantly changing, the projection distance will also be constantly changing. If a fixed-focus solution is adopted, the projection screen will inevitably appear blurred. Therefore, in the dynamic projection system, real-time auto-focus technology is required .
  • the main technical problem to be solved by the embodiments of the present application is to realize automatic focusing in the dynamic projection system to ensure the clarity of the projected image.
  • a technical solution adopted in the implementation mode of the present application is to provide an automatic focusing method, including:
  • the acquiring the vertical projection distance between the projection unit and the projection area includes:
  • the optical axis of the projection unit is perpendicular to the projection area.
  • the calculating the actual distance between the current projection position and the projection unit includes:
  • the motor is a stepper motor
  • the acquiring the motor rotation data, and calculating the horizontal rotation angle and pitch rotation angle of the projection unit according to the motor rotation data includes:
  • the horizontal rotation angle and the pitch rotation angle of the projection unit are calculated according to the rotation direction of the motor, the step angle and the number of rotation steps.
  • the adjusting the focal length of the projection unit according to the actual distance includes:
  • an autofocus device including:
  • a projection unit configured to project an image to the projection area
  • a data input unit configured to acquire the vertical projection distance between the projection unit and the projection area
  • the pan-tilt unit is connected with the projection unit in transmission, and is used to adjust the horizontal rotation angle and pitch rotation angle of the projection unit;
  • An intelligent computing unit connected to the data input unit and the pan-tilt unit, is used to calculate the actual distance between the current projection position and the projection unit according to the vertical projection distance, the horizontal rotation angle and the pitch rotation angle ;
  • An auto-focus unit connected to the intelligent calculation unit, the auto-focus unit is used to adjust the focal length of the projection unit according to the actual distance.
  • the pan/tilt unit includes a platform, a panning mechanism and a tilting mechanism
  • the projection unit is fixedly connected to the platform;
  • the horizontal rotation mechanism includes a first stepping motor and a horizontal gear, and the platform is connected to the first stepping motor through a horizontal gear;
  • the tilting mechanism includes a second stepping motor and a vertical gear, and the platform is connected to the second stepping motor through a vertical gear.
  • the projection unit includes:
  • the focusing mechanism is connected to the projection lens in transmission and connected to the intelligent computing unit, and the intelligent computing unit is used to control the focusing mechanism to adjust the position of the projection lens in the direction of the optical axis.
  • another technical solution adopted in the embodiments of the present application is to provide a computer-readable storage medium, the computer-readable storage medium stores computer-executable instructions, and the computer-executable The instructions are used to make the computer execute the above-mentioned autofocus method.
  • a technical solution adopted in the implementation mode of the present application is to provide an electronic device, including:
  • the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor, so that the at least one processor can execute the above-mentioned autofocus method.
  • a technical solution adopted in the embodiments of the present application is to provide a computer program product, where the computer program product includes a computer program stored on a non-volatile computer-readable storage medium,
  • the computer program includes program instructions, and when the program instructions are executed by the electronic device, the electronic device is made to execute the above auto-focus method.
  • the automatic focusing method provided by the present application obtains the vertical projection distance between the projection unit and the projection area, and obtains the motor rotation data, and then according to the vertical projection distance,
  • the horizontal rotation angle and pitch rotation angle of the motor calculate the actual distance between the current projection position and the projection unit, and finally adjust the focal length of the projection unit through the actual distance to ensure that different projection positions correspond to different focal lengths, thereby realizing automatic projection in dynamic projection. Focus function.
  • FIG. 1 is a schematic structural block diagram of an autofocus device provided in an embodiment of the present application
  • Fig. 2 is a schematic structural block diagram of an intelligent computing unit provided by an embodiment of the present application.
  • FIG. 3 is a schematic diagram of an optical path of an autofocus device provided in an embodiment of the present application.
  • FIG. 4 is a schematic flowchart of an autofocus method provided in an embodiment of the present application.
  • FIG. 5 is a schematic diagram of a hardware structure of an electronic device provided by an embodiment of the present application.
  • the embodiment of the present application provides an autofocus device 100 , as shown in FIG. 1 , including a projection unit 10 , a data input unit 20 , a pan/tilt unit 30 , an intelligent computing unit 40 and an autofocus unit 50 .
  • the projection unit 10 is used to project the image to be projected to the projection area.
  • the projected content of the projection unit 10 includes images or various videos, etc.;
  • the autofocus unit 50 includes a focusing mechanism, and the projection unit 10 includes a projection lens, which can The optical axis of the projection unit 10 moves, the focus adjustment mechanism is connected with the projection lens and the focus adjustment mechanism is connected with the intelligent computing unit 40, and the intelligent calculation unit 40 is used to control the focus adjustment mechanism to adjust the position of the projection lens in the direction of the optical axis, in real time The focal length of the projection unit 10 is changed.
  • the data input unit 20 is configured to acquire the vertical projection distance between the projection unit 10 and the projection area.
  • a projection space can be set, and the projection unit 10 can be installed at any position in the projection space, and an appropriate space coordinate system can also be established in the space, and the first initial position parameter of the projection unit 10 in the space is preset, and the preset projection The second initial position parameter of the area in the space, and then calculate the vertical projection distance between the projection unit 10 and the projection area according to the first initial position parameter and the second initial position parameter.
  • the projection area is perpendicular to the optical axis of the projection unit 10, and the projection area is usually projected on the projection wall 60, that is, when the projection unit 10 is located at the first initial position, the projection The optical axis of the unit 10 is perpendicular to the projection wall 60 .
  • the vertical distance between the projection unit 10 and the projection area can be measured by manual measurement; the projection unit 10 is set at any position in the space, and parameters such as the length, width, and height of the projection area are preset. 60 is usually set vertically, the projection unit 10 is set horizontally, the optical axis of the projection unit 10 is perpendicular to the projection wall 60, and then the distance between the projection unit 10 and the projection wall 60 is measured by manual measurement, and The manually measured distance data is input to the intelligent computing unit 40 through the data input unit 20 . In order to improve the measurement accuracy, multiple tests can also be performed, and the average value of multiple tests can be used as the vertical projection distance from the projection unit 10 to the projection area.
  • the projection unit 10 can also be set at the first initial position in the space, and the first initial position parameter of the projection unit 10 can be input to the data input unit 20; Two initial position parameters, and input the second initial position parameters of the projection area to the data input unit 20, the data input unit 20 then transmits the information of the two initial position parameters to the intelligent computing unit 40, and the projection unit is calculated by the intelligent computing unit 40 10 The vertical projection distance from the projection area.
  • a distance measuring unit may also be provided to measure the vertical projection distance between the projection unit 10 and the projection area through the distance measuring unit.
  • the distance measuring unit can be arranged on the projection unit 10, and the distance measuring unit can be a camera, a sensor, or the like.
  • the distance measuring unit acquires the position of the projection area, and calculates and measures the vertical projection distance between the projection unit 10 and the projection area.
  • multiple distance measuring units can be set, and the average value of multiple two-sentence units can be taken as the vertical projection distance from the projection unit 10 to the projection area.
  • the pan-tilt unit 30 is in transmission connection with the projection unit 10 and is used to adjust the horizontal rotation angle and the pitch rotation angle of the projection unit 10 in space.
  • the pan-tilt unit 30 includes a platform, a panning mechanism and a tilting mechanism.
  • the projection unit 10 is arranged on the upper surface of the platform and fixedly connected with the platform.
  • the horizontal rotation mechanism includes a first stepping motor and a horizontal gear.
  • the platform is connected to the first stepping motor through a horizontal gear.
  • the axis of the horizontal gear is parallel to the platform. Driven by the first stepping motor, the platform can rotate horizontally.
  • the axis is parallel to the axis of the platform, so that the projection unit 10 can change the horizontal rotation angle in real time.
  • the pitch rotation mechanism includes a second stepping motor and a vertical gear.
  • the platform is connected to the second stepping motor through the vertical gear.
  • the axis of the vertical gear is perpendicular to the platform.
  • the vertical gear Driven by the second stepping motor, the vertical gear The rotation drives the platform to rotate, and the rotation axis is perpendicular to the axis of the platform, so that the projection unit 10 can change the pitching angle in real time.
  • the intelligent calculation unit 40 is connected with the data input unit 20 and the pan-tilt unit 30, and is used to calculate the actual distance between the current projection position and the projection unit 10 according to the above-mentioned vertical projection distance, the above-mentioned horizontal rotation angle and the above-mentioned pitch rotation angle, and the projection area has a length parameters such as width and height, and the projection position refers to the center position of the projection area.
  • the data input unit 20 can transmit the information of the vertical projection distance between the acquired projection unit 10 and the projection area to the intelligent computing unit 40;
  • the information is transmitted to the intelligent computing unit 40, and the intelligent computing unit 40 calculates the rotation angle of the two motors according to the step angle and the number of rotation steps of the two motors, so as to obtain the horizontal rotation angle and the pitch rotation angle of the projection unit 10.
  • a stepper motor is an open-loop control element that converts electrical pulse signals into angular displacement or linear displacement. In the case of non-overload, the speed and stop position of the motor only depend on the frequency and number of pulses of the pulse signal, and are not affected by the load change.
  • stepper driver When the stepper driver receives a pulse signal, it drives the stepper motor to press
  • the set direction turns a fixed angle, which is called “step angle", and its rotation runs step by step at a fixed angle.
  • the angular displacement can be controlled by controlling the number of pulses, so as to achieve the purpose of accurate positioning, and at the same time, the speed and acceleration of motor rotation can be controlled by controlling the pulse frequency, so as to achieve the purpose of speed regulation.
  • the horizontal rotation angle ⁇ ⁇ 1 *N 1 of the projection unit 10, wherein ⁇ is the horizontal rotation angle of the first stepping motor, ⁇ 1 is the step angle of the first stepping motor, and N 1 is the first The number of pulses of the stepper motor;
  • the pitch rotation angle ⁇ ⁇ 2 *N 2 of the projection unit 10, wherein ⁇ is the pitch rotation angle of the second stepper motor, and ⁇ 2 is the step angle of the second stepper motor, N 2 is the number of pulses of the second stepping motor.
  • the intelligent calculation unit 40 calculates the actual distance between the current projection position and the projection unit 10 according to the vertical projection distance, the horizontal rotation angle and the pitch rotation angle.
  • the projection unit 10 is set in the space through the pan-tilt unit 30, the first projection position is (0,0), the vertical distance between the projection unit 10 and the first projection position is Z, and the projection area is transferred to the second projection position.
  • the projection position is (x, y 0 )
  • the intelligent computing unit 40 includes at least one processor 42 and a memory 41 communicatively connected to the at least one processor 42 .
  • the processor 42 and the memory 41 may be connected through a bus or in other ways.
  • the processor 42 as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computing executable programs and modules.
  • the processor 42 executes various functional applications and data processing of the controller by running non-volatile software programs, instructions and modules stored in the memory 41 , that is, implements the autofocus method in any of the following method embodiments.
  • the memory 41 may include a program storage area and a data storage area.
  • the program storage area may store an operating system and an application program required by at least one function; the data storage area may store data created according to the application of the automatic corresponding device.
  • the memory 41 may include a high-speed random access memory 41 , and may also include a non-volatile memory 41 , such as at least one disk memory 41 , flash memory, or other non-volatile solid-state memory 41 .
  • the memory 41 may optionally include memory 41 remotely located relative to the processor 42, and these remote memories 41 may be connected to the processor 42 through a network.
  • the intelligent computing unit 40 also includes a display screen 43 , the vertical projection distance can be measured by setting a distance measuring unit, the measurement result is transmitted to the intelligent computing unit 40 , and finally displayed on the display screen 43 .
  • the cost of setting up the distance measuring unit is relatively high, and the method of manual measurement can also be used, and then the manual measurement is input to the intelligent calculation unit 40 through the data input unit, and the intelligent calculation unit 40 displays the measurement result through the display screen 43 .
  • the auto-focus unit 50 is connected with the intelligent computing unit 40, and is used to adjust the focal length of the projection unit 10 according to the actual distance D.
  • the auto-focus unit 50 includes a focus adjustment mechanism, which is connected to the lens of the projection unit 10 through transmission.
  • the focus adjustment mechanism is composed of The intelligent computing unit 40 is controlled, and the intelligent computing unit 40 controls the focusing mechanism to adjust the position of the projection lens on the optical axis of the projection unit 10 according to the calculated actual distance D between the projection unit 10 and the current projection position, so as to change the projection unit 10 in real time.
  • the focal length ensures clear imaging in the projection area.
  • the present application also provides an embodiment of an auto-focus method, which is applied to the above-mentioned auto-focus device 100.
  • FIG. 4 it is a schematic flow chart of an auto-focus method provided by the embodiment of the present application. The method includes but is not limited to the following step:
  • a projection space can be set in advance, and the projection unit can be installed at any position in the projection space, or an appropriate space coordinate system can be established in the space, and the first initial position parameter of the projection unit in the space can be preset.
  • the second initial position parameter of the projection area in space is set, and the vertical projection distance between the projection unit and the projection area is calculated according to the first initial position parameter and the second initial position parameter.
  • the focal length of the projection lens of the projection unit can be adjusted between the minimum focal length and the maximum focal length, within the focus range of the projection lens, the focal length of the projection unit has a one-to-one correspondence with the projection distance, and the minimum focal length should correspond to The minimum projection distance, the maximum focal length should correspond to the maximum projection distance, the distance between the first initial position and the second initial position should be within the minimum projection distance and maximum projection distance, and the length, width and height of the projection area can be set in advance Parameters, the distance between the projection area and the projection unit must be within the adjustable range of the focal length of the projection unit, so as to facilitate clear imaging.
  • the projection area is perpendicular to the optical axis of the projection unit, and the projection area is usually projected on the projection wall, that is, when the projection unit is in the first initial position, the optical axis of the projection unit perpendicular to the projection wall.
  • the vertical projection distance can also be measured by setting the distance measuring unit, and the measurement result is transmitted to the intelligent calculation unit, and finally displayed on the display screen.
  • the vertical projection distance between the projection unit and the projection area can be measured by setting a ranging unit.
  • the ranging unit can choose a camera, sensor, microwave radar, etc. The cost of setting the ranging unit is relatively high, so manual measurement can also be used.
  • the intelligent computing unit is connected to the display screen, and the vertical projection distance between the projection unit and the projection area can be directly input manually , the data of the vertical projection distance can be displayed on the display.
  • the projection unit can be set at any position in the space through the pan-tilt unit.
  • the projection unit is fixedly installed on the upper surface of the platform of the pan-tilt unit and can rotate with the platform unit.
  • the pan-tilt unit can drive the projection unit to rotate horizontally or pitch.
  • the pan/tilt unit includes two motors, both of which are stepping motors, namely the first stepping motor and the second stepping motor.
  • the motor rotation data includes the step angle of the motor rotation, the direction of the motor rotation and the step of the motor rotation.
  • the number of motor rotation steps can be judged by the number of pulses of the stepping motor.
  • the step angle of the motor indicates the angle at which the motor rotates every time a pulse signal is sent by the control system, or in other words, the gear rotates every time a pulse signal is input.
  • the angle is called the step angle.
  • the first initial position parameter of the preset projection unit is (0, Z)
  • the first initial position parameter of the projection position of the projection area is (0, 0)
  • the vertical projection of the projection unit and the projection area The distance is Z.
  • the vertical distance between the projection unit and the projection area can also be obtained through various other methods, such as manual measurement input, or distance measurement by setting the distance measurement unit; the measurement accuracy can also be improved by performing multiple measurements and averaging.
  • the pan-tilt unit can drive the projection unit to rotate horizontally to change the projection position of the projection unit on the same horizontal line.
  • the pan-tilt unit can also drive the projection unit to tilt and rotate to change the pitch projection angle of the projection unit.
  • the projection unit is horizontally clockwise Rotation or counterclockwise horizontal rotation, the rotation angle is always a positive value; similarly, the projection unit is rotated upwards or downwards, and its rotation angle is always a positive value.
  • the focal length of the projection lens of the projection unit can be adjusted between the minimum focal length and the maximum focal length, within the focusing range of the projection lens, the focal length of the projection unit has a one-to-one correspondence with the projection distance, and the minimum focal length should correspond to the minimum projection Distance, the maximum focal length should correspond to the maximum projection distance, according to the minimum focal length and maximum focal length of the projection unit to determine the projection distance range of the projection unit [D 0 , D 1 ], that is, at the projection distance [D 0 , D 1 ],
  • the focus adjustment operation can be performed on the projection lens that can move along the optical axis through the focus adjustment mechanism, so as to make the projection picture clearer.
  • the actual distance between the projection unit and the projection area is usually controlled by the pan-tilt unit, which controls the rotation of the projection unit.
  • the maximum rotation angle of the round table unit can be preset, and the maximum rotation angle of the pan/tilt unit corresponds to the maximum projection distance.
  • the maximum rotation angle of the pan/tilt unit is the same when it rotates forward or backward.
  • the focus adjustment mechanism can obtain the target position of the projection lens according to the actual distance, which can be pre-established within the focus range of the projection lens, the corresponding relationship table between the position of the projection lens and the projection distance, and the corresponding relationship table shows each projection distance, that is, the actual distance; Corresponding to the position of the projection lens, when the projection unit is rotating horizontally or vertically, the actual distance between the projection unit and the projection area will change. Within the focusing range of the projection unit, the projection of the projection unit can be constructed first. The corresponding relationship between the position of the lens and the actual projection distance, and then construct a corresponding relationship table according to the corresponding relationship.
  • the focus adjustment mechanism adjusts the projection lens to the target position, so as to realize the automatic focus in the dynamic projection, so as to ensure the clear projection picture.
  • An autofocus method obtained by the embodiment of the present application obtains the vertical projection distance between the projection unit and the projection area, and obtains the motor rotation data, and then calculates the current projection position according to the vertical projection distance, the horizontal rotation angle and the pitch rotation angle of the motor The actual distance from the projection unit, and finally adjust the focal length of the projection unit through the actual distance to ensure that different projection positions correspond to different focal lengths, thereby realizing the auto-focus function in dynamic projection.
  • Embodiments of the present application also provide a computer-readable storage medium
  • the computer-readable storage medium may be a non-volatile computer storage medium
  • the computer storage medium stores computer-executable instructions
  • the computer-executable instructions are stored by one or more Execution by a processor, such as a processor in FIG. 2 , may enable the one or more processors to execute the auto-focus projection method in any of the above-mentioned method embodiments, for example, execute the auto-focus method in any of the above-mentioned method embodiments,
  • the steps shown in FIG. 4 described above are executed; the functions of the units of the device shown in FIG. 1 can also be realized.
  • FIG. 5 is a schematic diagram of the hardware structure of the electronic device 70 of the autofocus method provided by the embodiment of the present application. As shown in FIG. 5 , the electronic device 70 includes:
  • One or more processors 72 and memory 71, one processor 72 is taken as an example in FIG. 5 .
  • the processor 72 and the memory 71 may be connected through a bus or in other ways.
  • connection through a bus is taken as an example.
  • the memory 71 as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs and module units, such as the program corresponding to the autofocus method in the embodiment of the present application instruction/unit.
  • the processor 72 executes various functional applications and data processing of the electronic device by running the non-volatile software programs, instructions and units stored in the memory 71 , that is, implements the autofocus method in the foregoing method embodiment.
  • the memory 71 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and at least one application required by a function;
  • the memory 71 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid-state storage devices.
  • the memory 71 may optionally include a memory that is remotely located relative to the processor 72 , and these remote memories may be connected to the autofocus device 100 through a network. Examples of the aforementioned networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
  • the one or more modules are stored in the memory 71, and when executed by the one or more processors 72, execute the auto-focus method in any of the above method embodiments, for example, execute the above-described FIG. 4 Steps S10 to S40 of the method realize the functions of units 10-50 in FIG. 1 .
  • the electronic equipment of the embodiment of the present application exists in various forms, including but not limited to:
  • Ultra-mobile personal computer equipment This type of equipment belongs to the category of personal computers, has computing and processing functions, and generally has the characteristics of mobile Internet access.
  • Such terminals include: PDA, MID and UMPC equipment, etc.
  • Server A device that provides computing services.
  • the composition of a server includes a processor, hard disk, memory, system bus, etc.
  • the server is similar to a general-purpose computer architecture, but due to the need to provide high-reliability services, it is important in terms of processing power and stability. , Reliability, security, scalability, manageability and other aspects have high requirements.
  • An embodiment of the present application provides a computer program product, the computer program product includes a computer program stored on a non-volatile computer-readable storage medium, the computer program includes program instructions, and when the program instructions are executed by the When executed by the terminal, the terminal is enabled to execute the autofocus method of the terminal in any of the above method embodiments, for example, execute steps S10 to S40 of the method in FIG. 4 described above to implement the unit 10-50 in FIG. 1 Function.
  • the device embodiments described above are only illustrative, and the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in One place, or it can be distributed to multiple network elements. Part or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
  • each embodiment can be implemented by means of software plus a general hardware platform, and of course also by hardware.
  • all or part of the processes in the methods of the above embodiments can be completed by instructing related hardware through computer programs, and the programs can be stored in a computer-readable storage medium. During execution, it may include the processes of the embodiments of the above-mentioned methods.
  • the storage medium may be a magnetic disk, an optical disk, a read-only memory (Read-Only Memory, ROM) or a random access memory (Random Access Memory, RAM), etc.

Landscapes

  • Physics & Mathematics (AREA)
  • Geometry (AREA)
  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Projection Apparatus (AREA)

Abstract

An automatic focusing method, comprising the following steps: obtaining a vertical projection distance between a projection unit and a projection area; obtaining rotation data of a motor, and calculating a horizontal rotation angle and a pitch rotation angle of the projection unit according to the rotation data of the motor; calculating an actual distance between the current projection position and the projection unit according to the vertical projection distance, the horizontal rotation angle and the pitch rotation angle; and adjusting the focal length of the projection unit according to the actual distance. By obtaining the vertical projection distance between the projection unit and the projection area, obtaining the rotation data of the motor, then calculating the actual distance between the current projection position and the projection unit according to the vertical projection distance and the horizontal rotation angle and the pitch rotation angle of the motor, and finally adjusting the focal length of the projection unit according to the actual distance, it is ensured that different projection positions correspond to different focal lengths, thereby achieving an automatic focusing function in dynamic projection.

Description

一种自动对焦方法、装置及存储介质An automatic focusing method, device and storage medium
相关申请的交叉参考Cross References to Related Applications
本申请要求于2021年6月21日提交中国专利局,申请号为2021106873571,申请名称为“一种自动对焦方法、装置及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application with the application number 2021106873571 and the application title "An autofocus method, device and storage medium" submitted to the China Patent Office on June 21, 2021, the entire contents of which are incorporated by reference in In this application.
技术领域technical field
本申请涉及数字投影显示技术领域,特别涉及一种自动对焦方法、装置及存储介质。The present application relates to the technical field of digital projection display, in particular to an autofocus method, device and storage medium.
背景技术Background technique
随着半导体技术的快速发展,市场上出现了各种各样的投影装置,投影装置是一种常见的显示装置,而传统的投影设备,通常为固定位置投影,由于投影装置是将显示画面投影到屏幕上,以供使用者观赏,因此投影装置是否有成功对焦到屏幕上而让使用者看到清晰的显示画面是一件十分重要的事。With the rapid development of semiconductor technology, various projection devices have appeared on the market. The projection device is a common display device, while the traditional projection device usually projects at a fixed position. Since the projection device projects the display screen Therefore, it is very important whether the projection device is successfully focused on the screen so that the user can see a clear display image.
而某些特定的应用场景内,需要用到动向投影,例如大型舞台、安防警报及智慧交通等,通过投影画面在空间中的移动来满足不同场景的具体需求。由于动向投影系统的投影位置会不断变化,因此投影距离也会不断变化,如果采用定焦方案,则投影画面将难以避免地出现模糊现象,因此,在动向投影系统中,需要采用实时自动对焦技术。In some specific application scenarios, dynamic projection is required, such as large-scale stages, security alarms, and smart transportation, etc., to meet the specific needs of different scenarios by moving the projection screen in space. Since the projection position of the dynamic projection system is constantly changing, the projection distance will also be constantly changing. If a fixed-focus solution is adopted, the projection screen will inevitably appear blurred. Therefore, in the dynamic projection system, real-time auto-focus technology is required .
发明内容Contents of the invention
本申请实施方式主要解决的技术问题是,在动向投影系统中,实现自动对焦,以保证投影图像清晰。The main technical problem to be solved by the embodiments of the present application is to realize automatic focusing in the dynamic projection system to ensure the clarity of the projected image.
为解决上述技术问题,第一方面,本申请实施方式采用的一个技术方案是:提供一种自动对焦方法,包括:In order to solve the above technical problems, in the first aspect, a technical solution adopted in the implementation mode of the present application is to provide an automatic focusing method, including:
获取投影单元与投影区域的垂直投影距离;Obtain the vertical projection distance between the projection unit and the projection area;
获取马达转动数据,并根据所述马达转动数据计算所述投影单元的水平转动角度和俯仰转动角度;Acquiring motor rotation data, and calculating a horizontal rotation angle and a pitch rotation angle of the projection unit according to the motor rotation data;
根据所述垂直投影距离、所述水平转动角度以及所述俯仰转动角度计算当前投影位置与所述投影单元的实际距离;calculating the actual distance between the current projection position and the projection unit according to the vertical projection distance, the horizontal rotation angle and the pitch rotation angle;
根据所述实际距离调整所述投影单元的焦距。adjusting the focal length of the projection unit according to the actual distance.
在一些实施例中,所述获取投影单元与投影区域的垂直投影距离,包括:In some embodiments, the acquiring the vertical projection distance between the projection unit and the projection area includes:
预设所述投影单元在空间内的第一初始位置参数;Preset a first initial position parameter of the projection unit in space;
预设所述投影区域在所述空间内的第二初始位置参数;Presetting a second initial position parameter of the projection area in the space;
根据所述第一初始位置参数及所述第二初始位置参数计算所述投影单元与投影区域的垂直投影距离。Calculate the vertical projection distance between the projection unit and the projection area according to the first initial position parameter and the second initial position parameter.
在以上技术方案的基础上,优选的,在所述投影单元位于第一初始位置时,所述投影单元的光轴与所述投影区域垂直。On the basis of the above technical solution, preferably, when the projection unit is located at the first initial position, the optical axis of the projection unit is perpendicular to the projection area.
在一些实施例中,所述计算当前投影位置与所述投影单元的实际距离,包括:In some embodiments, the calculating the actual distance between the current projection position and the projection unit includes:
根据公式D=Z/(cosβ*cosα)计算所述当前投影位置与所述投影单元的实际距离;其中,Z为所述投影单元与所述投影区域的垂直投影距离,α为所述投影单元的水平转动角度,β为所述投影单元的俯仰转动角度。Calculate the actual distance between the current projection position and the projection unit according to the formula D=Z/(cosβ*cosα); wherein, Z is the vertical projection distance between the projection unit and the projection area, and α is the projection unit The horizontal rotation angle of , β is the pitch rotation angle of the projection unit.
在一些实施例中,所述马达为步进马达;In some embodiments, the motor is a stepper motor;
所述获取马达转动数据,并根据所述马达转动数据计算所述投影单元水平转动角度以及俯仰转动角度,包括:The acquiring the motor rotation data, and calculating the horizontal rotation angle and pitch rotation angle of the projection unit according to the motor rotation data includes:
获取马达转动方向;Obtain the motor rotation direction;
获取所述马达的步距角和所述马达的转动步数;Obtain the step angle of the motor and the number of rotation steps of the motor;
根据所述马达转动方向、所述步距角及所述转动步数计算所述投影单元的水平转动角度和俯仰转动角度。The horizontal rotation angle and the pitch rotation angle of the projection unit are calculated according to the rotation direction of the motor, the step angle and the number of rotation steps.
在一些实施例中,所述根据所述实际距离调整所述投影单元的焦距,包括:In some embodiments, the adjusting the focal length of the projection unit according to the actual distance includes:
根据所述实际距离获取投影镜头的目标位置;Acquiring the target position of the projection lens according to the actual distance;
根据所述目标位置,调整所述投影镜头至所述目标位置。Adjusting the projection lens to the target position according to the target position.
为解决上述技术问题,第二方面,本申请实施方式采用的另一个技术方案是:提供一种自动对焦装置,包括:In order to solve the above technical problems, in the second aspect, another technical solution adopted in the embodiment of the present application is to provide an autofocus device, including:
投影单元,用于将图像投射至投影区域;a projection unit, configured to project an image to the projection area;
数据输入单元,用于获取所述投影单元与所述投影区域的垂直投影距离;a data input unit, configured to acquire the vertical projection distance between the projection unit and the projection area;
云台单元,与所述投影单元传动连接,用于调整所述投影单元的水平转动角度和俯仰转动角度;The pan-tilt unit is connected with the projection unit in transmission, and is used to adjust the horizontal rotation angle and pitch rotation angle of the projection unit;
智能计算单元,与所述数据输入单元和所述云台单元连接,用于根据所述垂直投影距离、所述水平转动角度以及所述俯仰转动角度计算当前投影位置与所述投影单元的实际距离;An intelligent computing unit, connected to the data input unit and the pan-tilt unit, is used to calculate the actual distance between the current projection position and the projection unit according to the vertical projection distance, the horizontal rotation angle and the pitch rotation angle ;
自动对焦单元,与所述智能计算单元连接,所述自动对焦单元用于根据所述实际距离调整所述投影单元的焦距。An auto-focus unit connected to the intelligent calculation unit, the auto-focus unit is used to adjust the focal length of the projection unit according to the actual distance.
在一些实施例中,所述云台单元包括平台、水平转动机构和俯仰转动机构;In some embodiments, the pan/tilt unit includes a platform, a panning mechanism and a tilting mechanism;
平台,所述投影单元固定连接于所述平台;a platform, the projection unit is fixedly connected to the platform;
水平转动机构,包括第一步进马达和水平齿轮,所述平台通过水平齿轮与所述第一步进马达传动连接;The horizontal rotation mechanism includes a first stepping motor and a horizontal gear, and the platform is connected to the first stepping motor through a horizontal gear;
俯仰转动机构,包括第二步进马达和竖直齿轮,所述平台通过竖直齿轮与所述第二步进马达传动连接。The tilting mechanism includes a second stepping motor and a vertical gear, and the platform is connected to the second stepping motor through a vertical gear.
在一些实施例中,所述投影单元包括:In some embodiments, the projection unit includes:
投影镜头,可沿所述投影单元的光轴移动;a projection lens movable along the optical axis of the projection unit;
调焦机构,与所述投影镜头传动连接且与所述智能计算单元连接,所述智能计算单元用于控制所述调焦机构调整所述投影镜头在所述光轴方向上的位置。The focusing mechanism is connected to the projection lens in transmission and connected to the intelligent computing unit, and the intelligent computing unit is used to control the focusing mechanism to adjust the position of the projection lens in the direction of the optical axis.
为解决上述技术问题,第三方面,本申请实施方式采用的又一个技术方案是:提供一种计算机可读存储介质,所述计算机可读存储介质存储有计算机可执行指令,所述计算机可执行指令用于使计算机执行如上所述的自动对焦方法。In order to solve the above technical problems, in the third aspect, another technical solution adopted in the embodiments of the present application is to provide a computer-readable storage medium, the computer-readable storage medium stores computer-executable instructions, and the computer-executable The instructions are used to make the computer execute the above-mentioned autofocus method.
为解决上述技术问题,第四方面,本申请实施方式采用的一个技术方案是: 提供一种电子设备,包括:In order to solve the above technical problems, in the fourth aspect, a technical solution adopted in the implementation mode of the present application is to provide an electronic device, including:
至少一个处理器;以及,at least one processor; and,
与所述至少一个处理器通信连接的存储器;其中,a memory communicatively coupled to the at least one processor; wherein,
所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行上述的自动对焦方法。The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor, so that the at least one processor can execute the above-mentioned autofocus method.
为解决上述技术问题,第五方面,本申请实施方式采用的一个技术方案是:提供一种计算机程序产品,所述计算机程序产品包括存储在非易失性计算机可读存储介质上的计算机程序,所述计算机程序包括程序指令,当所述程序指令被电子设备执行时,使所述电子设备执行上述的自动对焦方法。In order to solve the above-mentioned technical problems, in the fifth aspect, a technical solution adopted in the embodiments of the present application is to provide a computer program product, where the computer program product includes a computer program stored on a non-volatile computer-readable storage medium, The computer program includes program instructions, and when the program instructions are executed by the electronic device, the electronic device is made to execute the above auto-focus method.
本申请实施方式的有益效果是:区别于相关技术的情况,本申请提供的一种自动对焦方法,通过获取投影单元与投影区域的垂直投影距离,并获取马达转动数据,再根据垂直投影距离、马达的水平转动角度和俯仰转动角度计算出当前投影位置与投影单元的实际距离,最后通过实际距离调整投影单元的焦距,以保证不同的投影位置对应不同的焦距,从而实现在动向投影中的自动对焦功能。The beneficial effects of the embodiments of the present application are: different from the situation of the related art, the automatic focusing method provided by the present application obtains the vertical projection distance between the projection unit and the projection area, and obtains the motor rotation data, and then according to the vertical projection distance, The horizontal rotation angle and pitch rotation angle of the motor calculate the actual distance between the current projection position and the projection unit, and finally adjust the focal length of the projection unit through the actual distance to ensure that different projection positions correspond to different focal lengths, thereby realizing automatic projection in dynamic projection. Focus function.
附图说明Description of drawings
一个或多个实施例通过与之对应的附图进行示例性说明,这些示例性说明并不构成对实施例的限定,附图中具有相同参考数字标号的元件表示为类似的元件,除非有特别申明,附图中的图不构成比例限制。One or more embodiments are exemplified by the corresponding drawings, and these exemplifications are not construed as limiting the embodiments. Elements with the same reference numerals in the drawings represent similar elements, unless otherwise specified Note that the drawings in the drawings are not limited to scale.
图1是本申请实施例提供的一种自动对焦装置的结构框图示意图;FIG. 1 is a schematic structural block diagram of an autofocus device provided in an embodiment of the present application;
图2是本申请实施例提供的一种智能计算单元的结构框图示意图;Fig. 2 is a schematic structural block diagram of an intelligent computing unit provided by an embodiment of the present application;
图3是本申请实施例提供的一种自动对焦装置的光路示意图;FIG. 3 is a schematic diagram of an optical path of an autofocus device provided in an embodiment of the present application;
图4是本申请实施例提供的一种自动对焦方法的流程示意图;FIG. 4 is a schematic flowchart of an autofocus method provided in an embodiment of the present application;
图5是本申请实施例提供的一种电子设备的硬件结构示意图。FIG. 5 is a schematic diagram of a hardware structure of an electronic device provided by an embodiment of the present application.
具体实施方式detailed description
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处所描述的具体实施例仅用以解释本申请,并不用于限定本申请。In order to make the purpose, technical solution and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the present application, not to limit the present application.
需要说明的是,如果不冲突,本申请实施例中的各个特征可以相互组合,均在本申请的保护范围之内。另外,虽然在装置示意图中进行了功能模块的划分,在流程图中示出了逻辑顺序,但是在某些情况下,可以以不同于装置示意图中的模块划分,或流程图中的顺序执行所示出或描述的步骤。It should be noted that, if there is no conflict, various features in the embodiments of the present application can be combined with each other, and all of them are within the protection scope of the present application. In addition, although the functional modules are divided into the schematic diagram of the device, and the logical order is shown in the flowchart, in some cases, the division of modules in the schematic diagram of the device, or the sequence in the flowchart may be executed. steps shown or described.
除非另有定义,本说明书所使用的所有的技术和科学术语与属于本申请的技术领域的技术人员通常理解的含义相同。在本申请的说明书中所使用的术语只是为了描述具体的实施方式的目的,不是用于限制本申请。本说明书所使用的术语“和/或”包括一个或多个相关的所列项目的任意的和所有的组合。Unless otherwise defined, all technical and scientific terms used in this specification have the same meaning as commonly understood by one of ordinary skill in the technical field of this application. The terms used in the description of the present application are only for the purpose of describing specific embodiments, and are not used to limit the present application. The term "and/or" used in this specification includes any and all combinations of one or more of the associated listed items.
本申请的实施例提供了一种自动对焦装置100,如图1所示,包括投影单元10、数据输入单元20、云台单元30、智能计算单元40和自动对焦单元50。The embodiment of the present application provides an autofocus device 100 , as shown in FIG. 1 , including a projection unit 10 , a data input unit 20 , a pan/tilt unit 30 , an intelligent computing unit 40 and an autofocus unit 50 .
投影单元10,用于将需要投影的图像投射至投影区域,投影单元10的投影内容包括图像或各类视频等;自动对焦单元50包括调焦机构,投影单元10包括投影镜头,投影镜头可沿投影单元10的光轴移动,调焦机构与投影镜头传动连接并且调焦机构与智能计算单元40连接,智能计算单元40用于控制调焦机构调整投影镜头在光轴方向上的位置,以实时改变投影单元10的焦距。The projection unit 10 is used to project the image to be projected to the projection area. The projected content of the projection unit 10 includes images or various videos, etc.; the autofocus unit 50 includes a focusing mechanism, and the projection unit 10 includes a projection lens, which can The optical axis of the projection unit 10 moves, the focus adjustment mechanism is connected with the projection lens and the focus adjustment mechanism is connected with the intelligent computing unit 40, and the intelligent calculation unit 40 is used to control the focus adjustment mechanism to adjust the position of the projection lens in the direction of the optical axis, in real time The focal length of the projection unit 10 is changed.
数据输入单元20,用于获取投影单元10与投影区域的垂直投影距离。可设置一个投影空间,投影单元10可安装在投影空间内的任一位置,也可在空间内建立适当的空间坐标系,预设投影单元10在空间内的第一初始位置参数,预设投影区域在空间内的第二初始位置参数,再根据第一初始位置参数及第二初始位置参数计算投影单元10与投影区域的垂直投影距离。为了便于获取投影单元10与投影区域的垂直投影距离,投影区域与投影单元10的光轴垂直,投影区域通常是投影在投影墙面60上,即当投影单元10位于第一初始位置时,投影单元10的光轴与投影墙面60垂直。The data input unit 20 is configured to acquire the vertical projection distance between the projection unit 10 and the projection area. A projection space can be set, and the projection unit 10 can be installed at any position in the projection space, and an appropriate space coordinate system can also be established in the space, and the first initial position parameter of the projection unit 10 in the space is preset, and the preset projection The second initial position parameter of the area in the space, and then calculate the vertical projection distance between the projection unit 10 and the projection area according to the first initial position parameter and the second initial position parameter. In order to facilitate the acquisition of the vertical projection distance between the projection unit 10 and the projection area, the projection area is perpendicular to the optical axis of the projection unit 10, and the projection area is usually projected on the projection wall 60, that is, when the projection unit 10 is located at the first initial position, the projection The optical axis of the unit 10 is perpendicular to the projection wall 60 .
在一个实施例中,可通过人工测量的方式测量投影单元10与投影区域的垂直距离;将投影单元10设置在空间内的任一位置,预设投影区域的长宽高等参 数,由于投影墙面60通常是竖直设置,投影单元10则水平设置,投影单元10的光轴则与投影墙面60垂直,再通过人工测量的方式测量投影单元10与投影墙面60之间的距离,并将人工测量的距离数据通过数据输入单元20输入至智能计算单元40。为提高测量精度,也可进行多次测试,将多次测试的平均值作为投影单元10至投影区域的垂直投影距离。In one embodiment, the vertical distance between the projection unit 10 and the projection area can be measured by manual measurement; the projection unit 10 is set at any position in the space, and parameters such as the length, width, and height of the projection area are preset. 60 is usually set vertically, the projection unit 10 is set horizontally, the optical axis of the projection unit 10 is perpendicular to the projection wall 60, and then the distance between the projection unit 10 and the projection wall 60 is measured by manual measurement, and The manually measured distance data is input to the intelligent computing unit 40 through the data input unit 20 . In order to improve the measurement accuracy, multiple tests can also be performed, and the average value of multiple tests can be used as the vertical projection distance from the projection unit 10 to the projection area.
在一个实施例中,也可将投影单元10设置在空间内的第一初始位置,并将该投影单元10的第一初始位置参数输入至数据输入单元20;预设投影区域在空间内的第二初始位置参数,并将投影区域的第二初始位置参数输入至数据输入单元20,数据输入单元20则将两个初始位置参数的信息传递至智能计算单元40,通过智能计算单元40计算投影单元10与投影区域的垂直投影距离。In one embodiment, the projection unit 10 can also be set at the first initial position in the space, and the first initial position parameter of the projection unit 10 can be input to the data input unit 20; Two initial position parameters, and input the second initial position parameters of the projection area to the data input unit 20, the data input unit 20 then transmits the information of the two initial position parameters to the intelligent computing unit 40, and the projection unit is calculated by the intelligent computing unit 40 10 The vertical projection distance from the projection area.
在一个实施例中,还可设置一个测距单元,通过测距单元测量投影单元10与投影区域的垂直投影距离。测距单元可设置在投影单元10上,测距单元可选用摄像头、传感器等。测距单元获取投影区域的位置,并计算测量得出投影单元10与投影区域的垂直投影距离。为提高精度,可设置多个测距单元,取多个两句单元的平均值作为投影单元10至投影区域的垂直投影距离。In one embodiment, a distance measuring unit may also be provided to measure the vertical projection distance between the projection unit 10 and the projection area through the distance measuring unit. The distance measuring unit can be arranged on the projection unit 10, and the distance measuring unit can be a camera, a sensor, or the like. The distance measuring unit acquires the position of the projection area, and calculates and measures the vertical projection distance between the projection unit 10 and the projection area. In order to improve the accuracy, multiple distance measuring units can be set, and the average value of multiple two-sentence units can be taken as the vertical projection distance from the projection unit 10 to the projection area.
云台单元30,与投影单元10传动连接,用于调整投影单元10在空间内的水平转动角度和俯仰转动角度。The pan-tilt unit 30 is in transmission connection with the projection unit 10 and is used to adjust the horizontal rotation angle and the pitch rotation angle of the projection unit 10 in space.
云台单元30包括平台、水平转动机构和俯仰转动机构。投影单元10设置在平台的上端面,并与平台固定连接。水平转动机构包括第一步进马达和水平齿轮,平台通过水平齿轮与第一步进马达传动连接,水平齿轮的轴线与平台平行,在第一步进马达的驱动下,平台可水平旋转,旋转轴线与平台轴线平行,使得投影单元10单元可实时改变水平转动角度。The pan-tilt unit 30 includes a platform, a panning mechanism and a tilting mechanism. The projection unit 10 is arranged on the upper surface of the platform and fixedly connected with the platform. The horizontal rotation mechanism includes a first stepping motor and a horizontal gear. The platform is connected to the first stepping motor through a horizontal gear. The axis of the horizontal gear is parallel to the platform. Driven by the first stepping motor, the platform can rotate horizontally. The axis is parallel to the axis of the platform, so that the projection unit 10 can change the horizontal rotation angle in real time.
俯仰转动机构包括第二步进马达和竖直齿轮,平台通过竖直齿轮与第二步进马达传动连接,竖直齿轮的轴线与平台垂直,在第二步进马达的驱动下,竖直齿轮旋转并带动平台旋转,旋转轴线垂直于平台的轴线,使得投影单元10可实时改变俯仰转动角度。The pitch rotation mechanism includes a second stepping motor and a vertical gear. The platform is connected to the second stepping motor through the vertical gear. The axis of the vertical gear is perpendicular to the platform. Driven by the second stepping motor, the vertical gear The rotation drives the platform to rotate, and the rotation axis is perpendicular to the axis of the platform, so that the projection unit 10 can change the pitching angle in real time.
智能计算单元40,与数据输入单元20和云台单元30连接,用于根据上述垂直投影距离、上述水平转动角度以及上述俯仰转动角度计算当前投影位置与 投影单元10的实际距离,投影区域具有长宽高等参数,而投影位置指的是投影区域的中心位置。数据输入单元20可将获取的投影单元10与投影区域的垂直投影距离的信息传递至智能计算单元40;云台单元30可将第一步进马达和第二步进步进马达的转动步数的信息传递至智能计算单元40,智能计算单元40根据两个马达的步进角和转动步数计算得出两个马达的转动角度,以此获得投影单元10的水平转动角度和俯仰转动角度。步进马达是将电脉冲信号转变为角位移或线位移的开环控制元件。在非超载的情况下,马达的转速、停止的位置只取决于脉冲信号的频率和脉冲数,而不受负载变化的影响,当步进驱动器接收到一个脉冲信号,它就驱动步进马达按设定的方向转动一个固定的角度,称为"步距角",它的旋转是以固定的角度一步一步运行的。可以通过控制脉冲个数来控制角位移量,从而达到准确定位的目的,同时可以通过控制脉冲频率来控制马达转动的速度和加速度,从而达到调速的目的。The intelligent calculation unit 40 is connected with the data input unit 20 and the pan-tilt unit 30, and is used to calculate the actual distance between the current projection position and the projection unit 10 according to the above-mentioned vertical projection distance, the above-mentioned horizontal rotation angle and the above-mentioned pitch rotation angle, and the projection area has a length parameters such as width and height, and the projection position refers to the center position of the projection area. The data input unit 20 can transmit the information of the vertical projection distance between the acquired projection unit 10 and the projection area to the intelligent computing unit 40; The information is transmitted to the intelligent computing unit 40, and the intelligent computing unit 40 calculates the rotation angle of the two motors according to the step angle and the number of rotation steps of the two motors, so as to obtain the horizontal rotation angle and the pitch rotation angle of the projection unit 10. A stepper motor is an open-loop control element that converts electrical pulse signals into angular displacement or linear displacement. In the case of non-overload, the speed and stop position of the motor only depend on the frequency and number of pulses of the pulse signal, and are not affected by the load change. When the stepper driver receives a pulse signal, it drives the stepper motor to press The set direction turns a fixed angle, which is called "step angle", and its rotation runs step by step at a fixed angle. The angular displacement can be controlled by controlling the number of pulses, so as to achieve the purpose of accurate positioning, and at the same time, the speed and acceleration of motor rotation can be controlled by controlling the pulse frequency, so as to achieve the purpose of speed regulation.
智能计算单元40可获取上述各步进马达的脉冲个数,并根据该脉冲个数获取步进马达的步数,由于各步进马达的步距角是固定的,步进马达的步距角θ=360/(M*Y),其中θ为步进马达的步距角,M为齿轮齿数,Y为运行拍数;以四相马达、齿轮齿数为五十为例,四相四拍的运行方式,即步距角θ=360/(50*4)=1.8度。 Intelligent calculation unit 40 can obtain the pulse number of each stepping motor mentioned above, and obtain the step number of stepping motor according to this pulse number, because the step angle of each stepping motor is fixed, the step angle of stepping motor θ=360/(M*Y), where θ is the step angle of the stepping motor, M is the number of gear teeth, and Y is the number of running beats; taking a four-phase motor with fifty gear teeth as an example, a four-phase four-beat The running mode, that is, the step angle θ=360/(50*4)=1.8 degrees.
由此可知,投影单元10的水平转动角度α=θ 1*N 1,其中α为第一步进马达的水平转动角度,θ 1的第一步进马达的步距角,N 1为第一步进马达的脉冲个数;投影单元10的俯仰转动角度β=θ 2*N 2,其中β为第二步进马达的俯仰转动角度,θ 2为第二步进马达的步距角,N 2为第二步进马达的脉冲个数。 It can be seen that the horizontal rotation angle α=θ 1 *N 1 of the projection unit 10, wherein α is the horizontal rotation angle of the first stepping motor, θ 1 is the step angle of the first stepping motor, and N 1 is the first The number of pulses of the stepper motor; the pitch rotation angle β=θ 2 *N 2 of the projection unit 10, wherein β is the pitch rotation angle of the second stepper motor, and θ 2 is the step angle of the second stepper motor, N 2 is the number of pulses of the second stepping motor.
智能计算单元40再根据上述垂直投影距离、上述水平转动角度以及上述俯仰转动角度计算当前投影位置与投影单元10的实际距离。如图3所示,投影单元10通过云台单元30设置在空间内,第一投影位置为(0,0),投影单元10与第一投影位置的垂直距离为Z,投影区域转移到第二投影位置(x,y 0)时,投影单元10需要转向右水平旋转α角度,再向上转动β角度,再根据公式D=Z/(cosβ*cosα)计算当前投影位置与投影单元10的实际距离;其中D为第二投影位置(即当前投影位置)与投影单元10的实际距离,Z为投影单元10与投影区域的垂直投影距离,α为投影单元10的水平转动角度,β为投影单元10的 俯仰转动角度。 The intelligent calculation unit 40 calculates the actual distance between the current projection position and the projection unit 10 according to the vertical projection distance, the horizontal rotation angle and the pitch rotation angle. As shown in Figure 3, the projection unit 10 is set in the space through the pan-tilt unit 30, the first projection position is (0,0), the vertical distance between the projection unit 10 and the first projection position is Z, and the projection area is transferred to the second projection position. When the projection position is (x, y 0 ), the projection unit 10 needs to turn to the right and rotate the angle α horizontally, and then rotate upwards the angle β, and then calculate the actual distance between the current projection position and the projection unit 10 according to the formula D=Z/(cosβ*cosα) ; wherein D is the actual distance between the second projection position (i.e. the current projection position) and the projection unit 10, Z is the vertical projection distance between the projection unit 10 and the projection area, α is the horizontal rotation angle of the projection unit 10, and β is the projection unit 10 pitch rotation angle of .
请参阅图2,智能计算单元40包括至少一个处理器42,以及与至少一个处理器42通信连接的存储器41,处理器42和存储器41可以通过总线或者其他方式连接。Referring to FIG. 2 , the intelligent computing unit 40 includes at least one processor 42 and a memory 41 communicatively connected to the at least one processor 42 . The processor 42 and the memory 41 may be connected through a bus or in other ways.
处理器42作为一种非易失性计算机可读存储介质,可用于存储非易失性软件程序、非易失性计算可执行程序以及模块。处理器42通过运行存储在存储器41中的非易失性软件程序、指令以及模块,从而执行控制器的各种功能应用以及数据处理,即实现下述任一方法实施例中的自动对焦方法。The processor 42, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computing executable programs and modules. The processor 42 executes various functional applications and data processing of the controller by running non-volatile software programs, instructions and modules stored in the memory 41 , that is, implements the autofocus method in any of the following method embodiments.
存储器41可以包括存储程序区和存储数据区,存储程序去可存储操作系统、至少一个功能所需要的应用程序;存储数据区可存储根据自动对应装置的适用所创建的数据等。此外,存储器41可以包括高速随机存取存储器41,还可以包括非易失性存储器41,例如至少一个磁盘存储器41件、闪存期间、或其他非易失性固态存储器41件。在一些实施例中,存储器41可选包括相对于处理器42远程设置的存储器41,这些远程存储器41可以通过网络连接至处理器42。The memory 41 may include a program storage area and a data storage area. The program storage area may store an operating system and an application program required by at least one function; the data storage area may store data created according to the application of the automatic corresponding device. In addition, the memory 41 may include a high-speed random access memory 41 , and may also include a non-volatile memory 41 , such as at least one disk memory 41 , flash memory, or other non-volatile solid-state memory 41 . In some embodiments, the memory 41 may optionally include memory 41 remotely located relative to the processor 42, and these remote memories 41 may be connected to the processor 42 through a network.
智能计算单元40还包括显示屏43,垂直投影距离可通过设置测距单元进行测量,测量结果传递至智能计算单元40,并最终通过显示屏43显示。设置测距单元成本较高,也可采用人工测量的方法,人工测量后再通过数据输入单元输入至智能计算单元40,智能计算单元40将测量结果通过显示屏43显示。The intelligent computing unit 40 also includes a display screen 43 , the vertical projection distance can be measured by setting a distance measuring unit, the measurement result is transmitted to the intelligent computing unit 40 , and finally displayed on the display screen 43 . The cost of setting up the distance measuring unit is relatively high, and the method of manual measurement can also be used, and then the manual measurement is input to the intelligent calculation unit 40 through the data input unit, and the intelligent calculation unit 40 displays the measurement result through the display screen 43 .
自动对焦单元50,与智能计算单元40连接,用于根据实际距离D调整投影单元10的焦距,自动对焦单元50包括调焦机构,调焦机构与投影单元10的镜头传动连接,调焦机构由智能计算单元40控制,智能计算单元40根据计算得出的投影单元10与当前投影位置的实际距离D,控制调焦机构调整投影镜头在投影单元10光轴上的位置,以实时改变投影单元10的焦距,保证在投影区域能够清晰成像。The auto-focus unit 50 is connected with the intelligent computing unit 40, and is used to adjust the focal length of the projection unit 10 according to the actual distance D. The auto-focus unit 50 includes a focus adjustment mechanism, which is connected to the lens of the projection unit 10 through transmission. The focus adjustment mechanism is composed of The intelligent computing unit 40 is controlled, and the intelligent computing unit 40 controls the focusing mechanism to adjust the position of the projection lens on the optical axis of the projection unit 10 according to the calculated actual distance D between the projection unit 10 and the current projection position, so as to change the projection unit 10 in real time. The focal length ensures clear imaging in the projection area.
本申请还提供了一种自动对焦方法的实施例,应用于上述的自动对焦装置100,参见图4,为本申请实施例提供的一种自动对焦方法的流程示意图,该方法包括但不限于以下步骤:The present application also provides an embodiment of an auto-focus method, which is applied to the above-mentioned auto-focus device 100. Referring to FIG. 4, it is a schematic flow chart of an auto-focus method provided by the embodiment of the present application. The method includes but is not limited to the following step:
S10,获取投影单元与投影区域的垂直投影距离;S10, acquiring the vertical projection distance between the projection unit and the projection area;
具体的,可事先设置一个投影空间,投影单元可安装在投影空间内的任一位置,也可在空间内建立适当的空间坐标系,预设投影单元在空间内的第一初始位置参数,预设投影区域在空间内的第二初始位置参数,再根据第一初始位置参数及第二初始位置参数计算投影单元与投影区域的垂直投影距离。需要注意,由于投影单元的投影镜头的焦距可以在最小焦距和最大焦距之间调整,在投影镜头的调焦范围内,投影单元的焦距与投影距离具有一一对应的关系,最小的焦距应对应最小的投影距离,最大的焦距应对应最大的投影距离,第一初始位置与第二初始位置的距离应满足在最小投影距离和最大投影距离之内,可事先设置投影区域的长、宽、高等参数,投影区域与投影单元之间的距离需满足在投影单元的焦距可调整的范围内,以便于清晰成像。Specifically, a projection space can be set in advance, and the projection unit can be installed at any position in the projection space, or an appropriate space coordinate system can be established in the space, and the first initial position parameter of the projection unit in the space can be preset. The second initial position parameter of the projection area in space is set, and the vertical projection distance between the projection unit and the projection area is calculated according to the first initial position parameter and the second initial position parameter. It should be noted that since the focal length of the projection lens of the projection unit can be adjusted between the minimum focal length and the maximum focal length, within the focus range of the projection lens, the focal length of the projection unit has a one-to-one correspondence with the projection distance, and the minimum focal length should correspond to The minimum projection distance, the maximum focal length should correspond to the maximum projection distance, the distance between the first initial position and the second initial position should be within the minimum projection distance and maximum projection distance, and the length, width and height of the projection area can be set in advance Parameters, the distance between the projection area and the projection unit must be within the adjustable range of the focal length of the projection unit, so as to facilitate clear imaging.
为了便于获取投影单元与投影区域的垂直投影距离,投影区域与投影单元的光轴垂直,投影区域通常是投影在投影墙面上,即当投影单元位于第一初始位置时,投影单元的光轴与投影墙面垂直。垂直投影距离也可通过设置测距单元进行测量,测量结果传递至智能计算单元,并最终通过显示屏显示。投影单元与投影区域之间的垂直投影距离可通过设置一个测距单元进行测量,测距单元可选择摄像头、传感器、微波雷达等,设置测距单元成本较高,因此也可采用人工测量的方法,人工测量投影单元与投影区域之间的垂直投影距离,人工测量后再通过数据输入单元输入至智能计算单元,智能计算单元连接显示屏,可直接通过人工输入投影单元与投影区域的垂直投影距离,垂直投影距离的数据可通过显示屏显示。In order to facilitate the acquisition of the vertical projection distance between the projection unit and the projection area, the projection area is perpendicular to the optical axis of the projection unit, and the projection area is usually projected on the projection wall, that is, when the projection unit is in the first initial position, the optical axis of the projection unit perpendicular to the projection wall. The vertical projection distance can also be measured by setting the distance measuring unit, and the measurement result is transmitted to the intelligent calculation unit, and finally displayed on the display screen. The vertical projection distance between the projection unit and the projection area can be measured by setting a ranging unit. The ranging unit can choose a camera, sensor, microwave radar, etc. The cost of setting the ranging unit is relatively high, so manual measurement can also be used. , manually measure the vertical projection distance between the projection unit and the projection area, and then input it to the intelligent computing unit through the data input unit after manual measurement. The intelligent computing unit is connected to the display screen, and the vertical projection distance between the projection unit and the projection area can be directly input manually , the data of the vertical projection distance can be displayed on the display.
S20,获取马达转动数据,并根据所述马达转动数据计算所述投影单元的水平转动角度和俯仰转动角度。S20. Acquire motor rotation data, and calculate a horizontal rotation angle and a pitch rotation angle of the projection unit according to the motor rotation data.
投影单元可通过云台单元设置在空间内的任一位置,投影单元固定安装在云台单元的平台的上端面,可跟随平台单元转动,云台单元可驱动投影单元水平或俯仰转动。云台单元包括两个马达,且两个马达均为步进马达,分别为第一步进马达和第二步进马达,马达转动数据包括马达转动的步距角、马达转动方向以及马达转动步数,马达转动步数可通过步进马达的脉冲个数来判断,马达的步距角表示控制系统每发送一个脉冲信号,马达所转动的角度,或者说,每输入一个脉冲电信号齿轮转过的角度称为步距角。第一步进马达可驱动投影 单元水平转动,水平转动角度的计算公式为α=θ 1*N 1,其中α为第一步进马达的水平转动角度,θ 1的第一步进马达的步距角,N 1为第一步进马达的脉冲个数,即第一步进马达的转动步数;俯仰转动角度β=θ 2*N 2,其中β为第二步进马达的俯仰转动角度,θ 2为第二步进马达的步距角,N 2为第二步进马达的脉冲个数,即第二步进马达的转动步数。 The projection unit can be set at any position in the space through the pan-tilt unit. The projection unit is fixedly installed on the upper surface of the platform of the pan-tilt unit and can rotate with the platform unit. The pan-tilt unit can drive the projection unit to rotate horizontally or pitch. The pan/tilt unit includes two motors, both of which are stepping motors, namely the first stepping motor and the second stepping motor. The motor rotation data includes the step angle of the motor rotation, the direction of the motor rotation and the step of the motor rotation. The number of motor rotation steps can be judged by the number of pulses of the stepping motor. The step angle of the motor indicates the angle at which the motor rotates every time a pulse signal is sent by the control system, or in other words, the gear rotates every time a pulse signal is input. The angle is called the step angle. The first stepping motor can drive the projection unit to rotate horizontally, and the calculation formula of the horizontal rotation angle is α=θ 1 *N 1 , where α is the horizontal rotation angle of the first stepping motor, and the step of the first stepping motor of θ 1 Distance angle, N 1 is the number of pulses of the first stepping motor, that is, the number of rotation steps of the first stepping motor; pitch rotation angle β=θ 2 *N 2 , where β is the pitch rotation angle of the second stepping motor , θ 2 is the step angle of the second stepping motor, N 2 is the number of pulses of the second stepping motor, that is, the number of rotation steps of the second stepping motor.
如图3所示,预设投影单元的第一初始位置参数为(0,Z),投影区域的投影位置的第一初始位置参数为(0,0),则投影单元与投影区域的垂直投影距离为Z。投影单元与投影区域的垂直距离也可通过其他的多种方式得出,例如人工测量输入,或者通过设置测距单元进行测距;也可通过进行多次测量求平均值的方式提高测量精度。As shown in Figure 3, the first initial position parameter of the preset projection unit is (0, Z), and the first initial position parameter of the projection position of the projection area is (0, 0), then the vertical projection of the projection unit and the projection area The distance is Z. The vertical distance between the projection unit and the projection area can also be obtained through various other methods, such as manual measurement input, or distance measurement by setting the distance measurement unit; the measurement accuracy can also be improved by performing multiple measurements and averaging.
S30,根据垂直投影距离、水平转动角度以及俯仰转动角度计算当前投影位置与投影单元的实际距离;可根据公式D=Z/(cosβ*cosα)计算当前投影位置与投影单元的实际距离;其中,Z为投影单元与投影区域的垂直投影距离,α为投影单元的水平转动角度,β为投影单元的俯仰转动角度。云台单元可驱动投影单元水平转动以改变投影单元在同一水平线上的投影位置,云台单元还可驱动投影单元俯仰转动,以改变投影单元的俯仰投影角度,为便于计算,投影单元顺时针水平旋转或者逆时针水平旋转,其旋转角度始终为正值;同理,投影单元向上旋转或者向下旋转,其旋转角度也始终为正值。S30, calculate the actual distance between the current projection position and the projection unit according to the vertical projection distance, the horizontal rotation angle and the pitch rotation angle; the actual distance between the current projection position and the projection unit can be calculated according to the formula D=Z/(cosβ*cosα); wherein, Z is the vertical projection distance between the projection unit and the projection area, α is the horizontal rotation angle of the projection unit, and β is the pitch rotation angle of the projection unit. The pan-tilt unit can drive the projection unit to rotate horizontally to change the projection position of the projection unit on the same horizontal line. The pan-tilt unit can also drive the projection unit to tilt and rotate to change the pitch projection angle of the projection unit. For the convenience of calculation, the projection unit is horizontally clockwise Rotation or counterclockwise horizontal rotation, the rotation angle is always a positive value; similarly, the projection unit is rotated upwards or downwards, and its rotation angle is always a positive value.
S40,根据实际距离调整所述投影单元的焦距。S40. Adjust the focal length of the projection unit according to the actual distance.
由于投影单元的投影镜头的焦距可以在最小焦距和最大焦距之间调整,在投影镜头的调焦范围内,投影单元的焦距与投影距离具有一一对应的关系,最小的焦距应对应最小的投影距离,最大的焦距应对应最大的投影距离,根据投影单元的最小焦距和最大焦距来确定投影单元的投影距离的范围[D 0,D 1],即在投影距离[D 0,D 1],可以通过调焦机构对可沿光轴移动的投影镜头进行调焦操作,以使投影画面更为清晰。投影单元与投影区域之间的实际距离通常有云台单元来控制,云台单元控制投影单元旋转,旋转角度越大,则投影单元的转动角度越大,投影单元与投影区域的实际距离就越远,为了保证投影单元与投影区域的实际距离均在最小投影距离和最大投影距离之内,可预先设置圆台单元的转动最大角,云台单元转动地最大角则对应最大投影距离。当投影单元和投影区 域均在初始位置时,投影单元的光轴是与投影区域垂直的,因此,云台单元正转,或是反转,其最大转动角是相同的。当投影单元的调焦范围足够大,其最大投影距离超过了投影墙面上任一位置的距离,则可以不用设置云台单元的最大转动角度,保证投影单元能在投影墙面上进行投影即可。 Since the focal length of the projection lens of the projection unit can be adjusted between the minimum focal length and the maximum focal length, within the focusing range of the projection lens, the focal length of the projection unit has a one-to-one correspondence with the projection distance, and the minimum focal length should correspond to the minimum projection Distance, the maximum focal length should correspond to the maximum projection distance, according to the minimum focal length and maximum focal length of the projection unit to determine the projection distance range of the projection unit [D 0 , D 1 ], that is, at the projection distance [D 0 , D 1 ], The focus adjustment operation can be performed on the projection lens that can move along the optical axis through the focus adjustment mechanism, so as to make the projection picture clearer. The actual distance between the projection unit and the projection area is usually controlled by the pan-tilt unit, which controls the rotation of the projection unit. The larger the rotation angle, the larger the rotation angle of the projection unit, and the greater the actual distance between the projection unit and the projection area. Far, in order to ensure that the actual distance between the projection unit and the projection area is within the minimum projection distance and the maximum projection distance, the maximum rotation angle of the round table unit can be preset, and the maximum rotation angle of the pan/tilt unit corresponds to the maximum projection distance. When both the projection unit and the projection area are at the initial position, the optical axis of the projection unit is perpendicular to the projection area, therefore, the maximum rotation angle of the pan/tilt unit is the same when it rotates forward or backward. When the focusing range of the projection unit is large enough and its maximum projection distance exceeds the distance of any position on the projection wall, it is not necessary to set the maximum rotation angle of the pan/tilt unit to ensure that the projection unit can project on the projection wall. .
调焦机构可根据实际距离获取投影镜头的目标位置,可预先建立在投影镜头的调焦范围内,投影镜头的位置与投影距离的对应关系表,对应关系表显示各投影距离,即实际距离;与投影镜头的位置对应关系,投影单元在水平转动或是竖直转动过程中,投影单元与投影区域的实际距离会发生改变,在投影单元的调焦范围内,可先构建出投影单元的投影镜头的位置与实际投影距离之间的对应关系,再根据该对应关系构建对应关系表。在获取投影单元与投影位置的实际距离后,通过对应关系表,找到与实际距离相对应的投影镜头的目标位置,在目标位置,投影单元可在投影位置清晰成像;然后,通过智能计算单元控制调焦机构将投影镜头调整到目标位置,从而实现在动向投影中的自动对焦,以保证投影画面清晰。The focus adjustment mechanism can obtain the target position of the projection lens according to the actual distance, which can be pre-established within the focus range of the projection lens, the corresponding relationship table between the position of the projection lens and the projection distance, and the corresponding relationship table shows each projection distance, that is, the actual distance; Corresponding to the position of the projection lens, when the projection unit is rotating horizontally or vertically, the actual distance between the projection unit and the projection area will change. Within the focusing range of the projection unit, the projection of the projection unit can be constructed first. The corresponding relationship between the position of the lens and the actual projection distance, and then construct a corresponding relationship table according to the corresponding relationship. After obtaining the actual distance between the projection unit and the projection position, find the target position of the projection lens corresponding to the actual distance through the correspondence table, at the target position, the projection unit can clearly image at the projection position; then, through the intelligent calculation unit control The focus adjustment mechanism adjusts the projection lens to the target position, so as to realize the automatic focus in the dynamic projection, so as to ensure the clear projection picture.
本申请实施例提供的一种自动对焦方法,通过获取投影单元与投影区域的垂直投影距离,并获取马达转动数据,再根据垂直投影距离、马达的水平转动角度和俯仰转动角度计算出当前投影位置与投影单元的实际距离,最后通过实际距离调整投影单元的焦距,以保证不同的投影位置对应不同的焦距,从而实现在动向投影中的自动对焦功能。An autofocus method provided by the embodiment of the present application obtains the vertical projection distance between the projection unit and the projection area, and obtains the motor rotation data, and then calculates the current projection position according to the vertical projection distance, the horizontal rotation angle and the pitch rotation angle of the motor The actual distance from the projection unit, and finally adjust the focal length of the projection unit through the actual distance to ensure that different projection positions correspond to different focal lengths, thereby realizing the auto-focus function in dynamic projection.
本申请的实施例还提供了计算机可读存储介质,所述计算机可读存储介质可以是非易失性计算机存储介质,计算机存储介质存储有计算机可执行指令,该计算机可执行指令被一个或多个处理器执行,例如图2中的一个处理器,可使得上述一个或多个处理器可执行上述任意方法实施例中的自动对焦投影方法,例如,执行上述任意方法实施例中的自动对焦方法,例如,执行以上描述的图4所示的各个步骤;也可实现图1所述的装置的各个单元的功能。Embodiments of the present application also provide a computer-readable storage medium, the computer-readable storage medium may be a non-volatile computer storage medium, the computer storage medium stores computer-executable instructions, and the computer-executable instructions are stored by one or more Execution by a processor, such as a processor in FIG. 2 , may enable the one or more processors to execute the auto-focus projection method in any of the above-mentioned method embodiments, for example, execute the auto-focus method in any of the above-mentioned method embodiments, For example, the steps shown in FIG. 4 described above are executed; the functions of the units of the device shown in FIG. 1 can also be realized.
图5是本申请实施例提供的自动对焦方法的电子设备70的硬件结构示意图,如图5所示,该电子设备70包括:FIG. 5 is a schematic diagram of the hardware structure of the electronic device 70 of the autofocus method provided by the embodiment of the present application. As shown in FIG. 5 , the electronic device 70 includes:
一个或多个处理器72以及存储器71,图5中以一个处理器72为例。One or more processors 72 and memory 71, one processor 72 is taken as an example in FIG. 5 .
处理器72和存储器71可以通过总线或者其他方式连接,图5中以通过总线连接为例。The processor 72 and the memory 71 may be connected through a bus or in other ways. In FIG. 5 , connection through a bus is taken as an example.
存储器71作为一种非易失性计算机可读存储介质,可用于存储非易失性软件程序、非易失性计算机可执行程序以及模块单元,如本申请实施例中的自动对焦方法对应的程序指令/单元。处理器72通过运行存储在存储器71中的非易失性软件程序、指令以及单元,从而执行电子设备的各种功能应用以及数据处理,即实现上述方法实施例自动对焦方法。The memory 71, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs and module units, such as the program corresponding to the autofocus method in the embodiment of the present application instruction/unit. The processor 72 executes various functional applications and data processing of the electronic device by running the non-volatile software programs, instructions and units stored in the memory 71 , that is, implements the autofocus method in the foregoing method embodiment.
存储器71可以包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需要的应用程序;存储数据区可存储根据自动对焦装置100的使用所创建的数据等。此外,存储器71可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他非易失性固态存储器件。在一些实施例中,存储器71可选包括相对于处理器72远程设置的存储器,这些远程存储器可以通过网络连接至自动对焦装置100。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。The memory 71 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and at least one application required by a function; In addition, the memory 71 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid-state storage devices. In some embodiments, the memory 71 may optionally include a memory that is remotely located relative to the processor 72 , and these remote memories may be connected to the autofocus device 100 through a network. Examples of the aforementioned networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
所述一个或者多个模块存储在所述存储器71中,当被所述一个或者多个处理器72执行时,执行上述任意方法实施例中的自动对焦方法,例如,执行以上描述的图4中的方法步骤S10至步骤S40,实现图1中的单元10-50的功能。The one or more modules are stored in the memory 71, and when executed by the one or more processors 72, execute the auto-focus method in any of the above method embodiments, for example, execute the above-described FIG. 4 Steps S10 to S40 of the method realize the functions of units 10-50 in FIG. 1 .
上述产品可执行本申请实施例所提供的方法,具备执行方法相应的功能模块和有益效果。未在本实施例中详尽描述的技术细节,可参见本申请实施例所提供的方法。The above-mentioned products can execute the method provided by the embodiment of the present application, and have corresponding functional modules and beneficial effects for executing the method. For technical details not described in detail in this embodiment, refer to the method provided in the embodiment of this application.
本申请实施例的电子设备以多种形式存在,包括但不限于:The electronic equipment of the embodiment of the present application exists in various forms, including but not limited to:
(1)上述实施例的智能计算单元。(1) The intelligent computing unit of the above-mentioned embodiment.
(2)超移动个人计算机设备:这类设备属于个人计算机的范畴,有计算和处理功能,一般也具备移动上网特性。这类终端包括:PDA、MID和UMPC设备等。(2) Ultra-mobile personal computer equipment: This type of equipment belongs to the category of personal computers, has computing and processing functions, and generally has the characteristics of mobile Internet access. Such terminals include: PDA, MID and UMPC equipment, etc.
(3)服务器:提供计算服务的设备,服务器的构成包括处理器、硬盘、内存、系统总线等,服务器和通用的计算机架构类似,但是由于需要提供高可靠的服务,因此在处理能力、稳定性、可靠性、安全性、可扩展性、可管理性等方面 要求较高。(3) Server: A device that provides computing services. The composition of a server includes a processor, hard disk, memory, system bus, etc. The server is similar to a general-purpose computer architecture, but due to the need to provide high-reliability services, it is important in terms of processing power and stability. , Reliability, security, scalability, manageability and other aspects have high requirements.
本申请实施例提供了一种计算机程序产品,所述计算机程序产品包括存储在非易失性计算机可读存储介质上的计算机程序,所述计算机程序包括程序指令,当所述程序指令被所述终端执行时,使所述终端能够执行上述任意方法实施例中的终端的自动对焦方法,例如,执行以上描述的图4中的方法步骤S10至步骤S40,实现图1中的单元10-50的功能。An embodiment of the present application provides a computer program product, the computer program product includes a computer program stored on a non-volatile computer-readable storage medium, the computer program includes program instructions, and when the program instructions are executed by the When executed by the terminal, the terminal is enabled to execute the autofocus method of the terminal in any of the above method embodiments, for example, execute steps S10 to S40 of the method in FIG. 4 described above to implement the unit 10-50 in FIG. 1 Function.
以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。The device embodiments described above are only illustrative, and the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in One place, or it can be distributed to multiple network elements. Part or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
通过以上的实施方式的描述,本领域普通技术人员可以清楚地了解到各实施方式可借助软件加通用硬件平台的方式来实现,当然也可以通过硬件。本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程是可以通过计算机程序来指令相关的硬件来完成,所述的程序可存储于一计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,所述的存储介质可为磁碟、光盘、只读存储记忆体(Read-Only Memory,ROM)或随机存储记忆体(Random Access Memory,RAM)等。Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a general hardware platform, and of course also by hardware. Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing related hardware through computer programs, and the programs can be stored in a computer-readable storage medium. During execution, it may include the processes of the embodiments of the above-mentioned methods. Wherein, the storage medium may be a magnetic disk, an optical disk, a read-only memory (Read-Only Memory, ROM) or a random access memory (Random Access Memory, RAM), etc.
最后应说明的是:以上实施例仅用以说明本申请的技术方案,而非对其限制;在本申请的思路下,以上实施例或者不同实施例中的技术特征之间也可以进行组合,步骤可以以任意顺序实现,并存在如上所述的本申请的不同方面的许多其它变化,为了简明,它们没有在细节中提供;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的范围。Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, but not to limit them; under the thinking of the present application, the above embodiments or technical features in different embodiments can also be combined, The steps can be performed in any order, and there are many other variations of the different aspects of the application as described above, which have not been presented in detail for the sake of brevity; although the application has been described in detail with reference to the preceding examples, those of ordinary skill in the art The skilled person should understand that: it is still possible to modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the implementation of the present application. The scope of technical solutions.

Claims (12)

  1. 一种自动对焦方法,其特征在于,包括:An automatic focusing method is characterized in that, comprising:
    获取投影单元与投影区域的垂直投影距离;Obtain the vertical projection distance between the projection unit and the projection area;
    获取马达转动数据,并根据所述马达转动数据计算所述投影单元的水平转动角度和俯仰转动角度;Acquiring motor rotation data, and calculating a horizontal rotation angle and a pitch rotation angle of the projection unit according to the motor rotation data;
    根据所述垂直投影距离、所述水平转动角度以及所述俯仰转动角度计算当前投影位置与所述投影单元的实际距离;calculating the actual distance between the current projection position and the projection unit according to the vertical projection distance, the horizontal rotation angle and the pitch rotation angle;
    根据所述实际距离调整所述投影单元的焦距。adjusting the focal length of the projection unit according to the actual distance.
  2. 根据权利要求1所述的自动对焦方法,其特征在于,所述获取投影单元与投影区域的垂直投影距离,包括:The autofocus method according to claim 1, wherein said acquiring the vertical projection distance between the projection unit and the projection area comprises:
    预设所述投影单元在空间内的第一初始位置参数;Preset a first initial position parameter of the projection unit in space;
    预设所述投影区域在所述空间内的第二初始位置参数;Presetting a second initial position parameter of the projection area in the space;
    根据所述第一初始位置参数及所述第二初始位置参数计算所述投影单元与投影区域的垂直投影距离。Calculate the vertical projection distance between the projection unit and the projection area according to the first initial position parameter and the second initial position parameter.
  3. 根据权利要求2所述的自动对焦方法,其特征在于,在所述投影单元位于第一初始位置时,所述投影单元的光轴与所述投影区域垂直。The autofocus method according to claim 2, wherein when the projection unit is located at the first initial position, the optical axis of the projection unit is perpendicular to the projection area.
  4. 根据权利要求1至3任一项所述的自动对焦方法,其特征在于,所述计算当前投影位置与所述投影单元的实际距离,包括:The autofocus method according to any one of claims 1 to 3, wherein the calculating the actual distance between the current projection position and the projection unit comprises:
    根据公式D=Z/(cosβ*cosα)计算所述当前投影位置与所述投影单元的实际距离;其中,Z为所述投影单元与所述投影区域的垂直投影距离,α为所述投影单元的水平转动角度,β为所述投影单元的俯仰转动角度。Calculate the actual distance between the current projection position and the projection unit according to the formula D=Z/(cosβ*cosα); wherein, Z is the vertical projection distance between the projection unit and the projection area, and α is the projection unit The horizontal rotation angle of , β is the pitch rotation angle of the projection unit.
  5. 根据权利要求4所述的自动对焦方法,其特征在于,所述马达为步进马达;The autofocus method according to claim 4, wherein the motor is a stepping motor;
    所述获取马达转动数据,并根据所述马达转动数据计算所述投影单元水平转动角度以及俯仰转动角度,包括:The acquiring the motor rotation data, and calculating the horizontal rotation angle and pitch rotation angle of the projection unit according to the motor rotation data includes:
    获取马达转动方向;Obtain the motor rotation direction;
    获取所述马达的步距角和所述马达的转动步数;Obtain the step angle of the motor and the number of rotation steps of the motor;
    根据所述马达转动方向、所述步距角及所述转动步数计算所述投影单元的水平转动角度和俯仰转动角度。The horizontal rotation angle and the pitch rotation angle of the projection unit are calculated according to the rotation direction of the motor, the step angle and the number of rotation steps.
  6. 根据权利要求4所述的自动对焦方法,其特征在于,所述根据所述实际距离调整所述投影单元的焦距,包括:The autofocus method according to claim 4, wherein the adjusting the focal length of the projection unit according to the actual distance comprises:
    根据所述实际距离获取投影镜头的目标位置;Acquiring the target position of the projection lens according to the actual distance;
    根据所述目标位置,调整所述投影镜头至所述目标位置。Adjusting the projection lens to the target position according to the target position.
  7. 一种自动对焦装置,其特征在于,包括:An autofocus device, characterized in that it comprises:
    投影单元,用于将图像投射至投影区域;a projection unit, configured to project an image to the projection area;
    数据输入单元,用于获取所述投影单元与所述投影区域的垂直投影距离;a data input unit, configured to acquire the vertical projection distance between the projection unit and the projection area;
    云台单元,与所述投影单元传动连接,用于调整所述投影单元的水平转动角度和俯仰转动角度;The pan-tilt unit is connected with the projection unit in transmission, and is used to adjust the horizontal rotation angle and pitch rotation angle of the projection unit;
    智能计算单元,与所述数据输入单元和所述云台单元连接,用于根据所述垂直投影距离、所述水平转动角度以及所述俯仰转动角度计算当前投影位置与所述投影单元的实际距离;An intelligent computing unit, connected to the data input unit and the pan-tilt unit, is used to calculate the actual distance between the current projection position and the projection unit according to the vertical projection distance, the horizontal rotation angle and the pitch rotation angle ;
    自动对焦单元,与所述智能计算单元连接,所述自动对焦单元用于根据所述实际距离调整所述投影单元的焦距。An auto-focus unit connected to the intelligent calculation unit, the auto-focus unit is used to adjust the focal length of the projection unit according to the actual distance.
  8. 根据权利要求7所述的自动对焦装置,其特征在于,所述云台单元包括平台、水平转动机构和俯仰转动机构;The autofocus device according to claim 7, wherein the pan-tilt unit comprises a platform, a horizontal rotation mechanism and a pitch rotation mechanism;
    平台,所述投影单元固定连接于所述平台;a platform, the projection unit is fixedly connected to the platform;
    水平转动机构,包括第一步进马达和水平齿轮,所述平台通过水平齿轮与所述第一步进马达传动连接;The horizontal rotation mechanism includes a first stepping motor and a horizontal gear, and the platform is connected to the first stepping motor through a horizontal gear;
    俯仰转动机构,包括第二步进马达和竖直齿轮,所述平台通过竖直齿轮与所述第二步进马达传动连接。The tilting mechanism includes a second stepping motor and a vertical gear, and the platform is connected to the second stepping motor through a vertical gear.
  9. 根据权利要求7所述的自动对焦装置,其特征在于,所述投影单元包括:The autofocus device according to claim 7, wherein the projection unit comprises:
    投影镜头,可沿所述投影单元的光轴移动;a projection lens movable along the optical axis of the projection unit;
    调焦机构,与所述投影镜头传动连接且与所述智能计算单元连接,所述智能计算单元用于控制所述调焦机构调整所述投影镜头在所述光轴方向上的位置。The focusing mechanism is connected to the projection lens in transmission and connected to the intelligent computing unit, and the intelligent computing unit is used to control the focusing mechanism to adjust the position of the projection lens in the direction of the optical axis.
  10. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有计算机可执行指令,所述计算机可执行指令用于使计算机执行如权利要求1-6任一项所述的自动对焦方法。A computer-readable storage medium, characterized in that the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to perform the automatic operation according to any one of claims 1-6 Focus method.
  11. 一种电子设备,其特征在于,包括:An electronic device, characterized in that it comprises:
    至少一个处理器;以及,at least one processor; and,
    与所述至少一个处理器通信连接的存储器;其中,a memory communicatively coupled to the at least one processor; wherein,
    所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行权利要求1-6任一项所述的自动对焦方法。The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor, so that the at least one processor can perform the method described in any one of claims 1-6. Autofocus method.
  12. 一种计算机程序产品,其特征在于,所述计算机程序产品包括存储在非易失性计算机可读存储介质上的计算机程序,所述计算机程序包括程序指令,当所述程序指令被电子设备执行时,使所述电子设备执行权利要求1-6任一项所述的自动对焦方法。A computer program product, characterized in that the computer program product includes a computer program stored on a non-volatile computer-readable storage medium, the computer program includes program instructions, and when the program instructions are executed by an electronic device , causing the electronic device to execute the autofocus method according to any one of claims 1-6.
PCT/CN2021/115364 2021-06-21 2021-08-30 Automatic focusing method and apparatus, and storage medium WO2022267219A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110687357.1A CN113596417A (en) 2021-06-21 2021-06-21 Automatic focusing method and device and storage medium
CN202110687357.1 2021-06-21

Publications (1)

Publication Number Publication Date
WO2022267219A1 true WO2022267219A1 (en) 2022-12-29

Family

ID=78244188

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/115364 WO2022267219A1 (en) 2021-06-21 2021-08-30 Automatic focusing method and apparatus, and storage medium

Country Status (2)

Country Link
CN (1) CN113596417A (en)
WO (1) WO2022267219A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114173063B (en) * 2022-02-11 2022-05-20 杭州灵西机器人智能科技有限公司 Focusing method of structure light camera based on variable-focus lens and structure light camera
CN115103169B (en) * 2022-06-10 2024-02-09 深圳市火乐科技发展有限公司 Projection picture correction method, projection picture correction device, storage medium and projection device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108307164A (en) * 2017-12-30 2018-07-20 神画科技(深圳)有限公司 A kind of control method and control system of projecting apparatus
CN111351468A (en) * 2018-12-24 2020-06-30 纬创资通股份有限公司 Electronic device and image ranging method thereof
CN111610688A (en) * 2020-05-26 2020-09-01 广景视睿科技(深圳)有限公司 Automatic adjust projection arrangement
CN112822469A (en) * 2020-12-31 2021-05-18 广景视睿科技(深圳)有限公司 Automatic focusing projection method and system

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH068925B2 (en) * 1988-12-26 1994-02-02 株式会社トプコン Auto focus projector
CN110719451A (en) * 2019-09-30 2020-01-21 深圳市火乐科技发展有限公司 Projection adjusting method and related product

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108307164A (en) * 2017-12-30 2018-07-20 神画科技(深圳)有限公司 A kind of control method and control system of projecting apparatus
CN111351468A (en) * 2018-12-24 2020-06-30 纬创资通股份有限公司 Electronic device and image ranging method thereof
CN111610688A (en) * 2020-05-26 2020-09-01 广景视睿科技(深圳)有限公司 Automatic adjust projection arrangement
CN112822469A (en) * 2020-12-31 2021-05-18 广景视睿科技(深圳)有限公司 Automatic focusing projection method and system

Also Published As

Publication number Publication date
CN113596417A (en) 2021-11-02

Similar Documents

Publication Publication Date Title
WO2022267219A1 (en) Automatic focusing method and apparatus, and storage medium
TWI281593B (en) Projector with automatic focus adjustment
US20070165103A1 (en) Terminal apparatus, method and computer readable recording medium
US8861948B2 (en) Image pickup apparatus
US11849263B2 (en) Projection focusing method, projection focusing apparatus, projector, and readable storage medium
JP5926462B2 (en) Method and system for automatically adjusting optical seismic camera module
CN107135349A (en) Picture pick-up device, lens unit, camera system and its control method
WO2020042581A1 (en) Focusing method and device for image acquisition apparatus
WO2022199539A1 (en) Photographing assistance device, image pair acquisition calibration method, and electronic device
CN104361599A (en) Pan-tilt camera calibrating and photographing method
US20220180484A1 (en) Image processing method, electronic device, and computer-readable storage medium
WO2022151473A1 (en) Photographing control method, photographing control apparatus and gimbal assembly
WO2022199542A1 (en) Photography auxiliary device, calibration method for image pair acquisition, and electronic device
WO2017117749A1 (en) Follow focus system and method based on multiple ranging approaches, and photographing system
JP2015532446A5 (en)
CN113301314A (en) Focusing method, projector, imaging apparatus, and storage medium
JP2015155988A (en) Optical instrument and control method
WO2021184239A1 (en) Exposure method and apparatus, photographing device, movable platform, and storage medium
US10880536B2 (en) Three-dimensional image capturing device and method
JPH10164420A (en) Camera control system and device therefor
CN107368104B (en) Random point positioning method based on mobile phone APP and household intelligent pan-tilt camera
CN112822469A (en) Automatic focusing projection method and system
JP5656507B2 (en) Shooting system
WO2021035704A1 (en) Focusing method and assembly for imaging apparatus, imaging apparatus and movable object
CN114071097B (en) Projection device control method, projection device and computer storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21946703

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21946703

Country of ref document: EP

Kind code of ref document: A1