Camera visual field adjustment method and device, wearable equipment and storage medium
By automatically adjusting the field of view in the built-in camera of the neurosurgery navigation helmet, the problem of the inability to adjust the field of view of traditional devices is solved, and the practicality and user experience of the device are improved.
Patent Information
- Application Number
- CN202311790948.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-22
- Publication Date
- 2025-06-24
AI Technical Summary
The traditional neurosurgery navigation helmets cannot adaptively adjust the field of view due to the fixed position of the external camera, which reduces the practicality of the device. Due to the sterile requirements, wearers need to adjust their head posture to adapt to the field of view, reducing the user experience.
By detecting the field of view adjustment instructions in the wearable device with a built-in camera, the spatial position information of the target and the image captured by the camera are obtained, the actual and desired areas of the target in the image are determined, and the field of view of the camera is automatically adjusted.
It improves the accuracy of camera field of view adjustment, enhances the practicality of wearable devices, and does not require wearers to adjust their head posture, improving user experience.
Smart Images

Figure CN120201305A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of medical technology, and particularly relates to a method and device for adjusting the camera field of view, a wearable device, and a storage medium. Background Art
[0002] A neurosurgical navigation helmet is a wearable device used to assist in neurosurgery. The navigation helmet generally consists of a helmet with a display module and a related navigation system, and can provide real-time anatomical structure images and navigation information for the wearer to guide surgical procedures and decisions. Traditional navigation helmets usually obtain images within the camera shooting range in real time through an externally placed camera at a fixed position. However, since the position of the externally placed camera is usually fixed, the field of view of the navigation helmet is also fixed and cannot be adjusted adaptively, thus reducing the practicality of the wearable device; in addition, since the navigation helmet is an item in a sterile environment, to strictly ensure the aseptic requirements during the operation, the wearer can only adjust their own head posture to fit the appropriate field of view, thereby reducing the user experience. Summary of the Invention
[0003] Embodiments of this application provide a method and device for adjusting the camera field of view, a wearable device, and a storage medium, which improve the accuracy of adjusting the camera field of view and also improve the practicality of the wearable device. At the same time, there is no need for the wearer to adjust their own head posture, thus improving the user experience.
[0004] In a first aspect, embodiments of this application provide a method for adjusting the camera field of view, including:
[0005] When a wearable device with a built-in camera detects a field of view adjustment instruction, obtain the spatial position information of the target and the first image obtained by shooting with the camera;
[0006] Determine the actual area of the target in the first image according to the spatial position information;
[0007] Determine the expected area of the target in the target image according to the spatial position information; where the target image is the first image or the second image obtained by processing the first image;
[0008] Adjust the field of view of the camera according to the actual area and the expected area.
[0009] A method for adjusting the camera field of view provided by an embodiment of the present application. When a wearable device with a built-in camera detects a field of view adjustment instruction, it obtains the spatial position information of the target and the first image captured by the camera; determines the actual area of the target in the first image according to the spatial position information; determines the expected area of the target in the target image according to the spatial position information; and adjusts the field of view of the camera according to the actual area and the expected area. Compared with the prior art, the wearable device of this method can accurately determine the actual area of the target in the first image according to the spatial position information of the target, and accurately determine the expected area of the target in the target image according to the spatial position information of the target, so as to adjust the field of view of the built-in camera of the wearable device in real time, which not only improves the accuracy of adjusting the field of view of the camera, but also improves the practicality of the wearable device. At the same time, this method does not require the wearer to adjust their own head posture, improving the user experience.
[0010] In a possible implementation manner of the first aspect, determining the actual area of the target in the first image according to the spatial position information includes:
[0011] Determine the pixel coordinates of each corner point of the target according to the spatial position information, the structural parameters of the target, and the camera parameters of the camera;
[0012] Determine the actual area of the target in the first image according to the pixel coordinates of each corner point.
[0013] In the above implementation manner, by performing coordinate transformation on the corner point coordinates (i.e., structural parameters) of each corner point of the target in the target coordinate system, the actual area of the target in the first image, that is, the actual coordinate range of the target in the first image, can be accurately obtained.
[0014] In an implementation manner of the first aspect, determining the expected area of the target in the target image according to the spatial position information includes:
[0015] Determine the distance between the target and the camera according to the spatial position information;
[0016] Determine the target diameter of the ideal contour in the target image according to the distance between the target and the camera; where the ideal contour refers to the ideal area of the target in the target image when the target is directly in front of the camera;
[0017] Calculate the first size of the inner boundary of the expected area and the second size of the outer boundary of the expected area according to the target diameter and the pixel coordinates of each corner point;
[0018] Determine the expected area according to the first size and the second size.
[0019] In the above embodiments, the wearable device can combine the spatial position information of the target and the pixel coordinates of each corner point to accurately determine the size and position of the desired area that matches it, improving the accuracy of determining the desired area.
[0020] In an embodiment of the first aspect, the first size includes a first axis length in the horizontal axis direction and a second axis length in the vertical axis direction of the inner boundary, and the second size includes a third axis length in the horizontal axis direction and a fourth axis length in the vertical axis direction of the outer boundary; calculating the first size of the inner boundary of the desired area and the second size of the outer boundary of the desired area according to the target diameter and the pixel coordinates of each corner point includes:
[0021] Determine the maximum horizontal axis coordinate, minimum horizontal axis coordinate, maximum vertical axis coordinate, and minimum vertical axis coordinate among the pixel coordinates of each corner point;
[0022] Calculate the first axis length and the third axis length according to the maximum horizontal axis coordinate, minimum horizontal axis coordinate, and the target diameter;
[0023] Calculate the second axis length and the fourth axis length according to the maximum vertical axis coordinate, minimum vertical axis coordinate, and the target diameter.
[0024] In the above embodiments, by combining the pixel coordinates of each corner point, the size of the inner boundary and the size of the outer boundary of the desired area that matches the target can be accurately determined.
[0025] In an embodiment of the first aspect, before the wearable device with a built-in camera detects a field of view adjustment instruction and obtains the spatial position information of the target and the first image captured by the camera, it further includes:
[0026] If a touch operation on the camera is detected, determine that the field of view adjustment instruction is detected and determine that the field of view adjustment method of the camera is manual adjustment;
[0027] Control the camera to be in a touch control mode; wherein, the touch control mode is a working mode in which the camera is controlled by manually touching the camera.
[0028] In the above embodiments, the wearable device provides a way to manually adjust the field of view of the camera so that the user can adjust the field of view of the camera according to their own needs, enhancing the user experience.
[0029] In an embodiment of the first aspect, before the wearable device with a built-in camera detects a field of view adjustment instruction and obtains the spatial position information of the target and the first image captured by the camera, it further includes:
[0030] If other specified operations other than the touch operation are detected, determine that the field of view adjustment instruction is detected and determine that the field of view adjustment method of the camera is automatic adjustment;
[0031] Correspondingly, according to the actual area and the desired area, the field of view of the camera is adjusted, including:
[0032] Determine the standard range of the target in the desired area according to the desired area;
[0033] Adjust the field of view of the camera according to the actual area and the standard range.
[0034] In the above implementation manner, by combining the standard range of the target in the desired area, the accuracy of adjusting the field of view of the camera can be further improved.
[0035] In an implementation manner of the first aspect, the desired area includes an inner boundary and an outer boundary. The first dimension of the inner boundary includes a first axis length in the horizontal axis direction and a second axis length in the vertical axis direction. The second dimension of the outer boundary includes a third axis length in the horizontal axis direction and a fourth axis length in the vertical axis direction. Determining the standard range of the target in the desired area according to the desired area includes:
[0036] Calculate a fifth axis length of the standard range in the horizontal axis direction according to the first axis length and the third axis length;
[0037] Calculate a sixth axis length of the standard range in the vertical axis direction according to the second axis length and the fourth axis length;
[0038] Construct the standard range according to the fifth axis length and the sixth axis length.
[0039] In the above implementation manner, by combining the dimensions of the inner boundary and the outer boundary, the size of the standard range can be accurately determined.
[0040] In an implementation manner of the first aspect, adjusting the field of view of the camera according to the actual area and the standard range includes:
[0041] Determine the desired coordinate position of the target in the standard range according to the actual area and the standard range;
[0042] Perform coordinate conversion processing on the desired coordinate position to obtain the desired spatial position of the target in the camera coordinate system;
[0043] Adjust the field of view of the camera according to the desired spatial position and the spatial position information.
[0044] In the above implementation manner, when the field of view adjustment method of the camera is automatic adjustment, the wearable device can combine the actual area and the desired area to determine the desired spatial position of the target, so as to improve the accuracy of adjusting the field of view of the camera.
[0045] In an implementation manner of the first aspect, adjusting the field of view of the camera according to the desired spatial position and the spatial position information includes:
[0046] Determine the distance between the target and the camera according to the spatial position information;
[0047] Determine the movement information of the target moving from the initial spatial position corresponding to the spatial position information to the desired spatial position;
[0048] Calculate the field of view adjustment angle of the camera based on the distance between the target and the camera and the movement information;
[0049] Adjust the field of view of the camera according to the field of view adjustment angle.
[0050] In the above embodiment, the wearable device can accurately determine the movement information of the target according to the spatial position information and the desired spatial position of the target, and then can accurately determine the field of view adjustment angle of the camera according to the movement information, thereby improving the adjustment accuracy of the field of view of the camera.
[0051] In an embodiment of the first aspect, adjusting the field of view of the camera according to the field of view adjustment angle includes:
[0052] Plan the initial operation instruction stream of the motor that controls the rotation of the camera lens according to the field of view adjustment angle;
[0053] If the initial operation instruction stream is successfully planned, control the motor according to the initial operation instruction stream to adjust the field of view of the camera.
[0054] In the above embodiment, when the initial operation instruction is successfully planned, the wearable device can directly control the motor according to the initial operation instruction stream to adjust the field of view of the camera, improving the adjustment efficiency of the field of view of the camera.
[0055] In an embodiment of the first aspect, after planning the initial operation instruction stream of the motor that controls the rotation of the camera lens according to the field of view adjustment angle, it further includes:
[0056] If the initial operation instruction stream planning fails, divide the standard range based on the set conditions to obtain multiple alternative position points;
[0057] Calculate the distance between each alternative position point and the actual area respectively;
[0058] Plan the standby operation instruction stream of the motor according to the alternative position point with the smallest distance from the actual area and the actual area;
[0059] If the standby operation instruction stream is successfully planned, control the motor according to the standby operation instruction stream to adjust the field of view of the camera.
[0060] In the above embodiments, when the wearable device fails to plan the initial operation instruction, it can determine alternative position points in the desired area based on set conditions, and plan the standby operation instruction stream in combination with the alternative position points to improve the success rate of adjusting the field of view of the camera.
[0061] In an embodiment of the first aspect, after planning the standby operation instruction stream of the motor according to the alternative position point with the smallest distance from the actual area and the actual area, it further includes:
[0062] If the planning of the standby operation instruction stream fails, it is determined whether there are unplanned position points among the multiple alternative position points;
[0063] If there are unplanned position points among the multiple alternative position points, select the alternative position point with the smallest distance from the actual area from the unplanned position points, and return to execute the steps of planning the standby operation instruction stream of the motor according to the alternative position point with the smallest distance from the actual area and the actual area and the subsequent steps until all unplanned position points have been planned;
[0064] If there are no unplanned position points among the multiple alternative position points, output a prompt message for prompting the failure of the camera field of view adjustment.
[0065] In the above embodiments, when the wearable device detects that the planning of the standby operation instruction stream fails and all multiple alternative position points have been planned, it means that the wearable device cannot achieve the adjustment of the field of view of the camera, that is, it cannot make the target in the desired area. Therefore, the wearable device can output a prompt message for prompting the failure of the camera field of view adjustment to avoid the wearable device from continuing to plan, thereby improving the working efficiency of the wearable device.
[0066] In a second aspect, an embodiment of the present application provides a camera field of view adjustment device, including:
[0067] An acquisition unit, configured to acquire the spatial position information of the target and the first image obtained by photographing with the camera when the wearable device with the built-in camera detects a field of view adjustment instruction;
[0068] A first area determination unit, configured to determine the actual area of the target in the first image according to the spatial position information;
[0069] A second area determination unit, configured to determine the desired area of the target in the target image according to the spatial position information; where the target image is the first image or the second image obtained by processing the first image;
[0070] A first adjustment unit, configured to adjust the field of view of the camera according to the actual area and the desired area.
[0071] In an embodiment of the second aspect, the first area determination unit specifically includes:
[0072] A first coordinate determination unit, configured to determine the pixel coordinates of each corner point of the target according to the spatial position information, the structural parameters of the target, and the camera parameters of the camera;
[0073] A first region determination subunit, configured to determine the actual region of the target in the first image according to the pixel coordinates of each corner point.
[0074] In an implementation manner of the second aspect, the second region determination unit specifically includes:
[0075] A first distance determination unit, configured to determine the distance between the target and the camera according to the spatial position information;
[0076] A diameter determination unit, configured to determine the target diameter of the ideal contour in the target image according to the distance between the target and the camera; wherein, the ideal contour refers to the ideal region of the target in the target image when the target is directly in front of the camera;
[0077] A size calculation unit, configured to calculate a first size of the inner boundary of the expected region and a second size of the outer boundary of the expected region according to the target diameter and the pixel coordinates of each corner point;
[0078] A second region determination subunit, configured to determine the expected region according to the first size and the second size.
[0079] In an implementation manner of the second aspect, the first size includes a first axis length in the horizontal axis direction and a second axis length in the vertical axis direction of the inner boundary, and the second size includes a third axis length in the horizontal axis direction and a fourth axis length in the vertical axis direction of the outer boundary; the size calculation unit specifically includes:
[0080] A second coordinate determination unit, configured to determine the maximum horizontal axis coordinate, the minimum horizontal axis coordinate, the maximum vertical axis coordinate, and the minimum vertical axis coordinate in the pixel coordinates of each corner point;
[0081] A first axis length calculation unit, configured to calculate the first axis length and the third axis length according to the maximum horizontal axis coordinate, the minimum horizontal axis coordinate, and the target diameter;
[0082] A second axis length calculation unit, configured to calculate the second axis length and the fourth axis length according to the maximum vertical axis coordinate, the minimum vertical axis coordinate, and the target diameter.
[0083] In an implementation manner of the second aspect, the camera field of view adjustment device further includes:
[0084] A first mode determination unit, configured to determine that a field of view adjustment instruction is detected and determine that the field of view adjustment mode of the camera is manual adjustment if a touch operation on the camera is detected;
[0085] A first control unit for controlling the camera to be in a touch control mode; wherein, the touch control mode is an operating mode for controlling the camera by manually touching the camera.
[0086] In an implementation manner of the second aspect, the camera field of view adjustment device further includes:
[0087] A second method determination unit for determining that the field of view adjustment instruction is detected and determining that the field of view adjustment method of the camera is automatic adjustment if other specified operations except touch operations are detected;
[0088] Correspondingly, the first adjustment unit specifically includes:
[0089] A range determination unit for determining a standard range of the target in the desired area according to the desired area;
[0090] A second adjustment unit for adjusting the field of view of the camera according to the actual area and the standard range.
[0091] In an implementation manner of the second aspect, the desired area includes an inner boundary and an outer boundary. The first dimension of the inner boundary includes a first axis length in the horizontal axis direction and a second axis length in the vertical axis direction. The second dimension of the outer boundary includes a third axis length in the horizontal axis direction and a fourth axis length in the vertical axis direction; the range determination unit specifically includes:
[0092] A third axis length calculation unit for calculating a fifth axis length of the standard range in the horizontal axis direction according to the first axis length and the third axis length;
[0093] A fourth axis length calculation unit for calculating a sixth axis length of the standard range in the vertical axis direction according to the second axis length and the fourth axis length;
[0094] A construction unit for constructing the standard range according to the fifth axis length and the sixth axis length.
[0095] In an implementation manner of the second aspect, the second adjustment unit specifically includes:
[0096] A third coordinate determination unit for determining the desired coordinate position of the target in the standard range according to the actual area and the standard range;
[0097] A processing unit for performing coordinate conversion processing on the desired coordinate position to obtain the desired spatial position of the target in the camera coordinate system;
[0098] A third adjustment unit for adjusting the field of view of the camera according to the desired spatial position and the spatial position information.
[0099] In an implementation manner of the second aspect, the third adjustment unit specifically includes:
[0100] A second distance determination unit, configured to determine the distance between the target and the camera according to the spatial position information;
[0101] An information determination unit, configured to determine the movement information of the target moving from the initial spatial position corresponding to the spatial position information to the desired spatial position;
[0102] An angle calculation unit, configured to calculate the field of view adjustment angle of the camera according to the distance between the target and the camera and the movement information;
[0103] A fourth adjustment unit, configured to adjust the field of view of the camera according to the field of view adjustment angle.
[0104] In an implementation manner of the second aspect, the third adjustment unit specifically includes:
[0105] A first planning unit, configured to plan an initial operation instruction stream for controlling the rotation of the camera lens motor according to the field of view adjustment angle;
[0106] A second control unit, configured to, if the initial operation instruction stream is successfully planned, control the motor according to the initial operation instruction stream to adjust the field of view of the camera.
[0107] In an implementation manner of the second aspect, the camera field of view adjustment device further includes:
[0108] A second planning unit, configured to, if the initial operation instruction stream planning fails, divide the standard range based on set conditions to obtain multiple alternative position points;
[0109] A distance calculation unit, configured to calculate the distance between each alternative position point and the actual area respectively;
[0110] A third planning unit, configured to plan a standby operation instruction stream for the motor according to the alternative position point with the smallest distance from the actual area and the actual area;
[0111] A fifth adjustment unit, configured to, if the standby operation instruction stream is successfully planned, control the motor according to the standby operation instruction stream to adjust the field of view of the camera.
[0112] In an implementation manner of the second aspect, the camera field of view adjustment device further includes:
[0113] A position point determination unit, configured to, if the standby operation instruction stream planning fails, determine whether there are unplanned position points among the multiple alternative position points;
[0114] An execution unit, configured to, if there is an unplanned location point among multiple alternative location points, select from the unplanned location points the alternative location point with the smallest distance from the actual area, and return to execute the step of planning a standby operation instruction stream of the motor according to the alternative location point with the smallest distance from the actual area and the actual area, and subsequent steps until all unplanned location points have been planned;
[0115] An output unit, configured to, if there is no unplanned location point among multiple alternative location points, output a prompt message for prompting the failure of camera field of view adjustment.
[0116] In a third aspect, an embodiment of the present application provides a wearable device, including: a camera and a control unit for executing the camera field of view adjustment method according to any one of the first aspects.
[0117] In an implementation manner of the third aspect, the wearable device may further include a display module.
[0118] In a fourth aspect, an embodiment of the present application provides a wearable device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the camera field of view adjustment method according to any one of the first aspects is implemented.
[0119] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the camera field of view adjustment method according to any one of the first aspects is implemented.
[0120] In a sixth aspect, an embodiment of the present application provides a computer program product, which, when running on a wearable device, enables the wearable device to execute the camera field of view adjustment method according to any one of the first aspects. Description of the Drawings
[0121] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0122] Figure 1 is a schematic structural diagram of a wearable device provided by an embodiment of the present application;
[0123] Figure 2 is an implementation flowchart of a camera field of view adjustment method provided by an embodiment of the present application;
[0124] Figure 3It is a flowchart showing the implementation of a camera field of view adjustment method provided by another embodiment of the present application;
[0125] Figure 4 It is a schematic diagram of the actual area of a target provided by an embodiment of the present application;
[0126] Figure 5 It is a flowchart showing the implementation of a camera field of view adjustment method provided by yet another embodiment of the present application;
[0127] Figure 6 It is a flowchart showing the implementation of a camera field of view adjustment method provided by another embodiment of the present application;
[0128] Figure 7 It is a schematic diagram of an expected area provided by an embodiment of the present application;
[0129] Figure 8 It is a schematic diagram of the position of a target in a third image provided by an embodiment of the present application;
[0130] Figure 9 It is a flowchart showing the implementation of a camera field of view adjustment method provided by another embodiment of the present application;
[0131] Figure 10 It is a general flowchart of manual adjustment provided by an embodiment of the present application;
[0132] Figure 11 It is a flowchart showing the implementation of a camera field of view adjustment method provided by another embodiment of the present application;
[0133] Figure 12 It is a flowchart showing the implementation of a camera field of view adjustment method provided by another embodiment of the present application;
[0134] Figure 13 It is a schematic diagram of an expected coordinate position and alternative positions provided by an embodiment of the present application;
[0135] Figure 14 It is a general flowchart of automatic adjustment provided by an embodiment of the present application;
[0136] Figure 15 It is a schematic diagram of the structure of a camera field of view adjustment device provided by an embodiment of the present application;
[0137] Figure 16 It is a schematic diagram of the structure of a wearable device provided by another embodiment of the present application. Detailed implementation manners
[0138] In the following description, specific details such as specific system architectures and technologies are presented for purposes of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, those skilled in the art should understand that the present application can also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to avoid unnecessary details from obscuring the description of the present application.
[0139] It should be understood that when used in the specification of the present application and the appended claims, the term "comprising" indicates the presence of the described features, wholes, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components, and / or their combinations.
[0140] It should also be understood that the term "and / or" as used in the specification of the present application and the appended claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0141] As used in the specification of the present application and the appended claims, the term "if" can be interpreted as "when" or "once" or "in response to determining" or "in response to detecting" depending on the context. Similarly, the phrase "if determined" or "if detected [the described condition or event]" can be interpreted as meaning "once determined" or "in response to determining" or "once detected [the described condition or event]" or "in response to detecting [the described condition or event]" depending on the context.
[0142] In addition, in the description of the specification of the present application and the appended claims, the terms "first", "second", "third", etc. are only used for distinguishing descriptions and should not be construed as indicating or implying relative importance.
[0143] The reference to "one embodiment" or "some embodiments" etc. described in the specification of the present application means that a specific feature, structure, or characteristic described in connection with that embodiment is included in one or more embodiments of the present application. Thus, statements such as "in one embodiment", "in some embodiments", "in other some embodiments", "in still other embodiments", etc. that appear in different places in this specification are not necessarily all referring to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in another way. The terms "comprising", "including", "having", and their variants all mean "including but not limited to", unless otherwise specifically emphasized in another way.
[0144] Please refer to Figure 1 , Figure 1 which is a schematic structural diagram of a wearable device provided by an embodiment of the present application. As Figure 1As shown in the figure, the wearable device 1 includes: a camera 10, a control unit 20, and a display module 30. Among them, the camera 10 and the display module 30 are respectively communicatively connected to the control unit 20. Among them, the communication connection method includes but is not limited to wired communication connection and wireless communication connection.
[0145] It should be noted that in all embodiments of this application, the wearable device 1 can be a surgical navigation helmet.
[0146] In an embodiment of this application, when the control unit 20 detects a field of view adjustment instruction, it can determine the best field of view range prompt area, that is, the expected area, of the target in the target image through the spatial position information of the target at the target object and the first image obtained by shooting with the camera 10, and display a field of view adjustment prompt screen in the display module 30, so that the user can know in real time whether the field of view of the camera 10 is adjusted successfully. Among them, the target image can be the first image or the second image obtained after processing the first image.
[0147] It should be noted that the second image specifically refers to an image with a structural outline prompt screen of the target added to the first image.
[0148] Among them, the specific process of how the control unit 20 adjusts the field of view of the camera 10 through the spatial position information of the target at the target object and the first image obtained by shooting with the camera 10 can be found in the detailed description of the corresponding embodiment in the following figure, and will not be elaborated here.
[0149] It should be noted that the target object refers to the patient who needs to undergo surgery.
[0150] In an embodiment of this application, please continue to refer to Figure 1 , the camera 10 includes: a touch sensor 11 and a motor 12.
[0151] Among them, the touch sensor 11 is connected to the control unit 20 and is used to send a touch signal to the control unit 20 when detecting a touch operation.
[0152] The control unit 20 is further used to determine that the field of view adjustment method of the camera 10 is manual adjustment when detecting the touch signal.
[0153] The motor 12 is connected to the control unit 20 and is used to work according to the operation instruction stream sent by the control unit 20 to realize the adjustment of the field of view of the camera 10. Among them, the operation instruction stream is used to control the movement trajectory of the motor 12.
[0154] Please refer to Figure 2 , Figure 2 is the implementation flowchart of the camera field of view adjustment method provided by an embodiment of this application. In an embodiment of this application, the execution subject of this camera field of view adjustment method is the wearable device.
[0155] As Figure 2 shown, the camera field of view adjustment method provided by an embodiment of the present application may include S101 to S104, which are described in detail as follows:
[0156] In S101, when the wearable device with a built-in camera detects a field of view adjustment instruction, obtain the spatial position information of the target and the first image obtained by shooting with the camera.
[0157] In practical applications, after the user wears the wearable device, when the user finds through the built-in camera of the wearable device that the target at the target object is not in the ideal area within the visible range of the camera, in order to increase the convenience of user interaction and improve the accuracy of target recognition, so as to display the best surgical field of view in real time through the wearable device, the user can trigger a field of view adjustment instruction for the camera of the wearable device. Herein, the user refers to a person wearing the wearable device, such as a doctor.
[0158] In an implementation manner of the embodiment of the present application, the camera is provided with a touch sensor. Therefore, when the wearable device obtains the touch signal collected by the touch sensor, it can determine that a touch operation of the user is detected, that is, a field of view adjustment instruction is detected.
[0159] In another implementation manner of the embodiment of the present application, the wearable device is provided with a preset control (such as a button). Therefore, if the wearable device detects that its preset control is clicked, it can determine that a field of view adjustment instruction is detected.
[0160] In still another implementation manner of the embodiment of the present application, the wearable device is provided with a voice receiving unit. Therefore, when the wearable device detects the set voice information, it can determine that a field of view adjustment instruction is detected. The set voice information can be set according to actual needs and is not limited herein. Exemplarily, the set voice information may be voice information including keywords such as "camera", "field of view", and "adjustment".
[0161] In still another implementation manner of the embodiment of the present application, the wearable device has a camera device. Therefore, when the wearable device detects a specified gesture operation through the camera device, it can determine that a field of view adjustment instruction is detected. The specified gesture operation can be set according to actual needs and is not limited herein. Exemplarily, the specified gesture operation may be a gesture of multiple fingers from closed to open, or a gesture of multiple fingers from open to closed.
[0162] In the embodiment of the present application, after the wearable device detects a field of view adjustment instruction, it can obtain the spatial position information of the target at the target object and the first image obtained by shooting with the camera.
[0163] Among them, the target includes a plurality of target points and a bar-shaped border that can be recognized by the camera, and the plurality of target points are located within the bar-shaped border.
[0164] The first image includes the above-mentioned target, specifically including the plurality of target points and the bar-shaped border in the target.
[0165] It should be noted that the spatial position information of the target specifically refers to the pose matrix of the target in the camera coordinate system.
[0166] It can be understood that the pose matrix of the target in the camera coordinate system specifically refers to the pose matrix of the center point of the target in the camera coordinate system, and this pose matrix includes the three-dimensional coordinates of the center point of the target in the camera coordinate system.
[0167] In an embodiment of the present application, the wearable device can detect the target through an existing target detection method, and then determine the spatial position information of the target.
[0168] The structural parameters of the target include, but are not limited to, the corner coordinates of the multiple corner points of the target in the target coordinate system. It should be noted that the target also has a structural outer frame, and the structural outer frame refers to the outer contour of the target structure. The bar-shaped border is located within the structural outer frame. The corner points of the target refer to the points on the outer contour of the target structure. Specifically, the target is usually a polygonal structure, such as a square structure. The outer contour of the square structure includes four right-angled sides, and the intersection points between adjacent right-angled sides are the corner points. In this case, the target includes a total of four corner points.
[0169] In S102, according to the spatial position information, determine the actual area of the target in the first image.
[0170] In the embodiment of the present application, since the first image is obtained by camera shooting, and the spatial position information of the target is the three-dimensional coordinates of the center point of the target in the camera coordinate system, the wearable device can determine the position information of the target in the first image, that is, the actual area where the first image is located, according to the obtained spatial position information.
[0171] It should be noted that the actual area of the target in the first image specifically refers to the position of the structural outer frame of the target in the pixel coordinate system.
[0172] In an embodiment of the present application, in order to accurately determine the actual area of the target in the first image, the wearable device can specifically obtain the actual area of the target in the first image through steps S201 to S202 as shown in Figure 3 The details are as follows:
[0173] In S201, according to the spatial position information, the structural parameters of the target, and the camera parameters of the camera, determine the pixel coordinates of each corner point of the target.
[0174] In S202, according to the pixel coordinates of each corner point, determine the actual area of the target in the first image.
[0175] In this embodiment, in order to accurately determine the actual area of the target in the first image, the wearable device can determine the corner point coordinates of each corner point of the target in the target coordinate system according to the structural parameters of the target.
[0176] After that, for any corner point, the pixel coordinate of this corner point = camera parameter * pose matrix (i.e., spatial position information) of the target center point in the camera coordinate system * corner point coordinate of this corner point. Among them, the camera parameter is the camera internal parameter.
[0177] Based on this, the wearable device can obtain the pixel coordinates of each corner point.
[0178] After that, the wearable device can determine the actual area of the target in the first image according to the pixel coordinates of each corner point.
[0179] Exemplarily, please refer to Figure 4 , Figure 4 which is a schematic diagram of the actual area of the target provided by an embodiment of the present application. As Figure 4 shown, points A, B, C, and D are all corner points of the target, point P is the target point included in the target, T is the bar-shaped border included in the target, and H is the structural outer frame of the target, that is, the actual area of the target.
[0180] In S103, according to the spatial position information, determine the expected area of the target in the target image; where the target image is the first image or the second image obtained after processing the first image.
[0181] In the embodiment of the present application, the wearable device can determine the center of the expected area as the center position of the first image. After that, the wearable device can determine the distance between the target and the camera according to the spatial position information of the target, and then determine the size of the expected area according to this distance, so as to obtain the expected area of the target in the target image.
[0182] Among them, the target image can be the first image or the second image obtained after processing the first image.
[0183] It should be noted that processing the first image can be an operation of adding a prompt screen of the structural outer frame of the target (such as the actual area of the target in the first image) to the first image.
[0184] Based on this, in an implementation manner of the embodiment of the present application, the wearable device can determine the expected area of the target in the first image according to the spatial position information.
[0185] In another implementation of the embodiment of the present application, the wearable device may determine the desired region of the target in the second image according to the spatial position information, that is, determine the desired region of the target in the second image of the structural outer frame prompt screen with the target (i.e., the actual region of the target).
[0186] In an embodiment of the present application, in order to accurately determine the size and position of the desired region matching the target and improve the determination accuracy of the desired region, the wearable device may specifically determine the desired region of the target in the target image through steps S301 to S304 as shown below, which are described in detail as follows: Figure 5 As shown, the desired region of the target in the target image is determined through steps S301 to S304, which are described in detail as follows:
[0187] In S301, according to the spatial position information, determine the distance between the target and the camera.
[0188] In this embodiment, the wearable device may specifically calculate the distance between the target and the camera through the following formula:
[0189]
[0190] where d represents the distance between the target and the camera, and t x represents the first length between the abscissa of the center point of the target and the coordinate origin in the camera coordinate system, and t y represents the second length between the ordinate of the center point of the target and the coordinate origin in the camera coordinate system, and t z represents the third length between the vertical coordinate of the center point of the target and the coordinate origin in the camera coordinate system.
[0191] In this embodiment, the distance between the target and the camera determines the size of the desired region.
[0192] In S302, according to the distance between the target and the camera, determine the target diameter of the ideal contour in the target image; where the ideal contour refers to the ideal region of the target in the target image when the target is directly in front of the camera.
[0193] In this embodiment, in order to accurately determine the size and position of the desired region, the wearable device may determine the target diameter of the ideal contour in the target image according to the distance between the target and the camera. Where the ideal contour specifically refers to the ideal region of the target in the target image when the target is directly in front of the camera.
[0194] It should be noted that when the target is directly in front of the camera, the ideal region of the target in the target image is a circular region, that is, the ideal contour is a circular contour.
[0195] Therefore, in combination with the distance between the target and the camera, the target diameter of the ideal contour has the following constraint conditions:
[0196] The starting condition for the target diameter of the ideal contour is that when d = d1, the ideal diameter of the desired region is approximately dia = dia1; the ending condition for the target diameter of the ideal contour is that when d = d2, the ideal diameter of the inner frame contour is approximately dia = dia2.
[0197] Among them, d1, d2, dia1, and dia2 can all be determined according to actual needs and are not limited here.
[0198] The starting condition specifically refers to the condition that needs to be satisfied when the target diameter of the ideal contour is the minimum ideal value, and the ending condition specifically refers to the condition that needs to be satisfied when the target diameter of the ideal contour is the maximum ideal value.
[0199] In this embodiment, according to the single-hole camera imaging model, it can be known that the size of the image formed on the pixel plane is inversely proportional to the distance. The wearable device can construct an equation for the distance between the target and the camera and the target diameter:
[0200]
[0201] where dia in represents the target diameter, both k and l represent coefficients, and d represents the distance between the target and the camera.
[0202] Substituting the above starting condition and ending condition into the above equation, k and l can be solved, and then the target diameter of the ideal contour in the target image can be calculated.
[0203] In S303, according to the target diameter and the pixel coordinates of each corner point, the first size of the inner boundary of the desired region and the second size of the outer boundary of the desired region are calculated.
[0204] In an embodiment of the present application, since the target is usually not directly in front of the camera, that is to say, there is an offset angle between the target and the camera, which causes the above ideal contour to deform under this offset angle. Therefore, when the ideal contour is circular, its deformation is an ellipse. At the same time, since the target is not a point but a region composed of a structural outer frame, in order to ensure that the target is within the ideal range, the desired region can be an annular region composed of an inner boundary and an outer boundary. Both the inner boundary and the outer boundary are ellipses.
[0205] In this embodiment, since the desired region is on the target image and the desired region is composed of an inner boundary and an outer boundary, the first size includes the first axis length of the inner boundary in the horizontal axis direction of the pixel coordinate system and the second axis length in the vertical axis direction, and the second size includes the third axis length of the outer boundary in the horizontal axis direction of the pixel coordinate system and the fourth axis length in the vertical axis direction. Therefore, the wearable device can specifically pass through such as Figure 6The first dimension and the second dimension are calculated through the steps S401 to S403 shown as follows:
[0206] In S401, the maximum horizontal axis coordinate, the minimum horizontal axis coordinate, the maximum vertical axis coordinate, and the minimum vertical axis coordinate among the pixel coordinates of each corner point are determined.
[0207] It should be noted that the maximum horizontal axis coordinate, the minimum horizontal axis coordinate, the maximum vertical axis coordinate, and the minimum vertical axis coordinate among the pixel coordinates of each corner point refer to the maximum horizontal axis coordinate, the minimum horizontal axis coordinate, the maximum vertical axis coordinate, and the minimum vertical axis coordinate of each corner point in the pixel coordinate system.
[0208] In this embodiment, the wearable device can compare all the horizontal axis coordinates in the pixel coordinates of each corner point one by one to obtain the maximum horizontal axis coordinate and the minimum horizontal axis coordinate; the wearable device can also compare all the vertical axis coordinates in the pixel coordinates of each corner point one by one to obtain the maximum vertical axis coordinate and the minimum vertical axis coordinate.
[0209] In S402, the first axis length and the third axis length are calculated according to the maximum horizontal axis coordinate, the minimum horizontal axis coordinate, and the target diameter.
[0210] In this embodiment, the wearable device can specifically calculate the first axis length of the inner boundary and the third axis length of the outer boundary according to the following formula:
[0211]
[0212]
[0213] Among them, represents the first axis length of the inner boundary, represents the third axis length of the outer boundary, dia in represents the target diameter, u a represents the abscissa of corner point A, u b represents the abscissa of corner point B, u c represents the abscissa of corner point C, u d represents the abscissa of corner point D, max(u a , u b , u c , u d ) represents the maximum horizontal axis coordinate, min(u a , u b , u c , u d ) represents the minimum horizontal axis coordinate.
[0214] It should be noted that in order to ensure that the length of the target in the horizontal axis direction in the pixel coordinate system can be completely within the desired region, the wearable device needs to calculate the maximum horizontal distance between the corner points of the target in the horizontal axis direction (i.e., max(u a ,u b ,u c ,u d ) - min(u a ,u b ,u c ,u d )) in the above formula), and based on this maximum horizontal distance, calculate the first axis length of the inner boundary in the horizontal axis direction in the pixel coordinate system and the third axis length of the outer boundary in the horizontal axis direction in the pixel coordinate system.
[0215] In S403, according to the maximum vertical coordinate, the minimum vertical coordinate, and the target diameter, the second axis length and the fourth axis length are calculated.
[0216] In this embodiment, the wearable device can specifically calculate the second axis length of the inner boundary and the fourth axis length of the outer boundary according to the following formula:
[0217]
[0218]
[0219] Wherein, represents the second axis length of the inner boundary, represents the fourth axis length of the outer boundary, dia in represents the target diameter, v a represents the vertical coordinate of corner point A, v b represents the vertical coordinate of corner point B, v c represents the vertical coordinate of corner point C, v d represents the vertical coordinate of corner point D, max(v a ,v b ,v c ,v d ) represents the maximum vertical coordinate, min(v a ,v b ,v c ,v d ) represents the minimum vertical coordinate.
[0220] It should be noted that in order to ensure that the length of the target in the vertical axis direction in the pixel coordinate system can be completely within the desired region, the wearable device needs to calculate the maximum vertical distance between the corner points of the target in the vertical axis direction (i.e., max(v a ,v b ,v c ,v d ) - min(va ,v b ,v c ,v d )) and in combination with this maximum longitudinal distance, obtain the second axis length of the inner boundary in the longitudinal axis direction in the pixel coordinate system and the fourth axis length of the outer boundary in the longitudinal axis direction in the pixel coordinate system.
[0221] In S304, determine the desired region according to the first dimension and the second dimension.
[0222] In this embodiment, the wearable device can determine the size of the desired region and thus obtain the desired region when calculating the first dimension of the inner boundary of the desired region and the second dimension of the outer boundary of the desired region.
[0223] Exemplarily, please refer to Figure 7 , Figure 7 which is a schematic diagram of the desired region provided by an embodiment of the present application. As Figure 7 shown, the coil L1 is the outer boundary of the desired region, the coil L2 is the inner boundary of the desired region, and the region Q formed by the coil L1 and L2 is the desired region.
[0224] In S104, adjust the field of view of the camera according to the actual region and the desired region.
[0225] In the embodiment of the present application, after the wearable device determines the actual region of the target in the first image and the desired region in the target image, it can display the actual region and the desired region in the display module of the wearable device so that the user and the wearable device can know in real time whether the target is in the desired region.
[0226] In an implementation manner of the embodiment of the present application, in order to accurately determine whether the target is in the desired region and facilitate the user to quickly determine whether the target is in the desired region, when the wearable device detects that the actual region of the target is in the desired region, it can display the actual region of the target and the desired region in green. When the wearable device detects that the actual region of the target is not in the desired region, it can display the outer boundary of the actual region of the target and the desired region in red.
[0227] Exemplarily, please refer to Figure 8 , Figure 8 which is a schematic diagram of the position of the target in the third image provided by an embodiment of the present application. It should be noted that the third image specifically refers to an image including the actual region and the desired region of the target.
[0228] As Figure 8 shown in (a) of Figure 8As shown in (b) therein, when the actual area S of the target is not within the desired area Q, the outer boundaries L1 of the actual area S and the desired area Q are both represented by dashed lines (the dashed lines are used to indicate red highlighting).
[0229] In some possible embodiments, when the wearable device detects that the center point of the target is within the desired area, it may determine that the target is within the desired area.
[0230] In some other possible embodiments, when the wearable device detects that the entire actual area of the target is within the desired area, it may determine that the target is within the desired area.
[0231] In still some other possible embodiments, when the ratio between the number of target points within the desired area detected by the wearable device and the total number of target points included in the target is greater than or equal to a set ratio, it may be determined that the target is within the desired area. Wherein, the set ratio is greater than one half.
[0232] It should be noted that in the embodiments of the present application, when the wearable device determines the desired area of the target in the target image and at the same time the wearable device detects that the actual area of the target at this time is already within the above-mentioned desired area, it means that the target is already in the ideal position, that is to say, the field of view of the camera is accurate. Therefore, the wearable device does not need to adjust the field of view of the camera.
[0233] As can be seen from the above, a method for adjusting the camera field of view provided by the embodiments of the present application, when the wearable device with a built-in camera detects a field of view adjustment instruction, obtains the spatial position information of the target and the first image obtained by shooting with the camera; determines the actual area of the target in the first image according to the spatial position information; determines the desired area of the target in the target image according to the spatial position information; adjusts the field of view of the camera according to the actual area and the desired area. Compared with the prior art, the wearable device of the present method can accurately determine the actual area of the target in the first image according to the spatial position information of the target, and accurately determine the desired area of the target in the target image according to the spatial position information of the target, so as to adjust the field of view of the built-in camera of the wearable device in real time, which not only improves the accuracy of adjusting the field of view of the camera, but also improves the practicability of the wearable device. At the same time, there is no need for the wearer to adjust their own head posture, improving the user experience.
[0234] In an embodiment of the present application, in order to improve the user experience, the way to adjust the field of view of the camera may include manual adjustment. Therefore, please refer to Figure 9 , Figure 9 is the implementation flowchart of the method for adjusting the camera field of view provided by another embodiment of the present application.
[0235] Relative to Figure 1For the corresponding embodiment, before S101, S501 to S502 may further be included, which are described in detail as follows:
[0236] In S501, if a touch operation on the camera is detected, it is determined that a field of view adjustment instruction is detected, and the field of view adjustment method of the camera is determined to be manual adjustment.
[0237] In S502, the camera is controlled to be in the touch control mode; wherein, the touch control mode is a working mode in which the camera is controlled by manually touching the camera.
[0238] In this embodiment, when the wearable device detects a touch operation on the camera, it can determine that a field of view adjustment instruction is detected. At the same time, the wearable device can determine that the field of view adjustment method of the camera is manual adjustment. Therefore, the wearable device can control the camera to be in the touch control mode.
[0239] Based on this, after the wearable device determines the actual area of the target in the first image and the desired area in the target image, the actual area and the desired area can be displayed in the display module of the wearable device, so that the user can adjust the field of view of the camera according to the above displayed picture.
[0240] In one implementation manner of this embodiment, the user can adjust the field of view of the camera by adjusting the angle of the camera.
[0241] It should be noted that when the camera is in the touch control mode, the user needs to keep the touch operation on the camera. When the wearable device does not detect the touch operation, it means that the user's adjustment of the field of view of the camera has ended. Therefore, when the user briefly stops the touch operation on the camera due to other situations and the user's adjustment of the field of view of the camera is not completed at this time, the wearable device needs to return to execute step S501 and all subsequent steps.
[0242] In this embodiment, when the user stops the touch operation on the camera, the wearable device can turn off the above picture displayed on the display module and resume the image display of the target object.
[0243] As can be seen from the above, the camera field of view adjustment method provided in this embodiment provides a way to manually adjust the field of view of the camera, so that the user can adjust the field of view of the camera according to their own needs, enhancing the user experience.
[0244] Please refer to Figure 10 , Figure 10 the overall flowchart of the manual adjustment provided by an embodiment of this application. As Figure 10As shown, when the wearable device detects a touch operation on the camera, it can execute step S601, that is, determine that a field of view adjustment instruction is detected and determine that the field of view adjustment method of the camera is manual adjustment; then, the wearable device can continue to execute step S602, that is, control the camera to be in the touch control mode; then, the wearable device can execute step S603, that is, obtain the spatial position information of the target and the first image obtained by shooting with the camera; then, the wearable device can execute step S604, that is, determine the actual area of the target in the first image according to the spatial position information; then, the wearable device can execute step S605, that is, determine the desired area of the target in the target image according to the spatial position information. Among them, the wearable can specifically determine the actual area through an embodiment such as Figure 3 as shown, and determine the desired area through an embodiment such as Figure 5 and an embodiment such as Figure 6 as shown. Then, the wearable device can execute step S606, that is, display the actual area and the desired area in its own display module.
[0245] Based on this, the user can execute step S607, that is, the user adjusts the angle of the camera according to the displayed actual area and desired area to achieve the adjustment of the field of view of the camera. After the user determines that the adjustment of the field of view of the camera is completed, the user can execute step S608, that is, stop touching the camera.
[0246] Finally, after the wearable device detects that the user stops touching the camera, it can execute step S609, that is, control the camera to exit the touch control mode, control the display module to exit the display of the actual area and the desired area, and display the image corresponding to the target area of the target object, so as to completely complete the adjustment of the field of view of the camera.
[0247] In another embodiment of the present application, in order to improve the adjustment speed and accuracy, the field of view adjustment method of the camera may include automatic adjustment. Therefore, please refer to Figure 11 , Figure 11 is the implementation flowchart of the camera field of view adjustment method provided by another embodiment of the present application. Compared with the Figure 1 corresponding embodiment, in this embodiment, before S101, it may further include S701. Correspondingly, step S103 may specifically include S702 to S703, which are described in detail as follows:
[0248] In S701, if other specified operations other than the touch operation are detected, it is determined that a field of view adjustment instruction is detected and the field of view adjustment method of the camera is determined to be automatic adjustment.
[0249] In this embodiment, other specified operations other than the touch operation include but are not limited to: receiving set language information, clicking on a preset control, or a specified gesture operation.
[0250] Based on this, in one implementation manner of this embodiment, when the wearable device receives the set voice information, it can determine that a field of view adjustment instruction is detected. At the same time, the wearable device can determine that the field of view adjustment method of the camera is automatic adjustment.
[0251] In another implementation manner of this embodiment, when the wearable device detects that a preset control of itself is clicked, it can also determine that the field of view adjustment method of the camera is automatic adjustment.
[0252] In yet another implementation manner of this embodiment, when the wearable device detects a specified gesture operation, it can also determine that the field of view adjustment method of the camera is automatic adjustment.
[0253] In S702, according to the desired area, determine the standard range of the target in the desired area.
[0254] In this embodiment, in order to ensure that the target is in the best field of view range of the desired area, the wearable device can determine the coil formed by the midpoints of the line segments between any two points with the closest distance between multiple inner boundaries and outer boundaries in the desired area as the standard range in the desired area, so that the center point position of the target can be on this coil.
[0255] In one embodiment of the present application, since the desired area includes an inner boundary and an outer boundary, the first dimension of the inner boundary includes a first axis length in the horizontal axis direction and a second axis length in the vertical axis direction, and the second dimension of the outer boundary includes a third axis length in the horizontal axis direction and a fourth axis length in the vertical axis direction. Therefore, the wearable device can specifically obtain the standard range according to the following steps, which are described in detail as follows:
[0256] Calculate the fifth axis length of the standard range in the horizontal axis direction according to the first axis length and the third axis length;
[0257] Calculate the sixth axis length of the standard range in the vertical axis direction according to the second axis length and the fourth axis length;
[0258] Construct the standard range according to the fifth axis length and the sixth axis length.
[0259] It should be noted that the above horizontal axis direction specifically refers to the horizontal axis direction in the pixel coordinate system, and the vertical axis direction specifically refers to the vertical axis direction in the pixel coordinate system. The above first axis length, second axis length, third axis length, fourth axis length, fifth axis length, and sixth axis length all refer to the axis lengths in the pixel coordinate system.
[0260] In this embodiment, the wearable device can specifically calculate the fifth axis length and the sixth axis length of the desired area according to the following formula:
[0261]
[0262]
[0263] Among them, represents the fifth axis length of the standard range, represents the sixth axis length of the standard range, represents the first axis length of the inner boundary, represents the second axis length of the inner boundary, represents the third axis length of the outer boundary, represents the fourth axis length of the outer boundary.
[0264] It should be noted that since the midpoints of the line segments between any two closest points between the inner boundary and the outer boundary form a coil, which is the best viewing position of the center point of the target, therefore, the wearable device can determine half of the sum of the first axis length of the inner boundary and the second axis length of the outer boundary as the fifth axis length in the horizontal axis direction of the standard range in the pixel coordinate system, and the wearable device can determine half of the sum of the second axis length of the inner boundary and the fourth axis length of the outer boundary as the sixth axis length in the vertical axis direction of the standard range in the pixel coordinate system.
[0265] Exemplarily, please continue to refer to Figure 7 , such as Figure 7 shown, the coil L3 is the standard range of the target in the desired area.
[0266] In S703, the viewing field of the camera is adjusted according to the actual area and the standard range.
[0267] In this embodiment, the wearable device can adjust the viewing field of the camera according to the actual area and the standard range of the target, so that the center point of the target moves to the standard range.
[0268] In an embodiment of the present application, in order to improve the adjustment accuracy of the viewing field of the camera, the wearable device can specifically adjust the viewing field of the camera according to the following steps, which are described in detail as follows:
[0269] Determine the expected coordinate position of the target in the standard range according to the actual area and the standard range;
[0270] Perform coordinate transformation processing on the expected coordinate position to obtain the expected spatial position of the target in the camera coordinate system;
[0271] Adjust the viewing field of the camera according to the expected spatial position and the spatial position information.
[0272] In this embodiment, since the target includes multiple target points, in order to improve the adjustment accuracy of the target, the wearable device can determine the expected coordinate position of the center of the target in the standard range according to the center of the actual area (i.e., the center of the target) and the standard range.
[0273] In one implementation of this embodiment, in order to improve the adjustment rate of the camera's field of view, the wearable device may determine the expected coordinate position of the center of the target in the pixel coordinate system as the point in the standard range that is closest to the center of the actual area.
[0274] Based on this, in an embodiment of the present application, in combination with the ellipse equation, the wearable device can specifically calculate the distances between the center of the actual area and each point in the standard range according to the following formula:
[0275]
[0276] where distance represents the distance between the center of the actual area and a certain point in the standard range, x0 represents the abscissa of the center of the actual area in the pixel coordinate system, y0 represents the ordinate of the center of the actual area in the pixel coordinate system, represents the fifth axis length of the standard range, represents the sixth axis length of the standard range, and θ represents the angle between the line segment formed by a certain point in the standard range and the center of the standard range and the positive half-axis of the abscissa of the standard range in the pixel coordinate system.
[0277] Based on this, the wearable device can calculate the coordinates of the point in the standard range that is closest to the center of the actual area according to the above formula, so as to determine the expected coordinate position of the center of the target in the pixel coordinate system.
[0278] After that, the wearable device can perform coordinate conversion processing on the expected coordinate position of the target in the pixel coordinate system to obtain the expected spatial position of the target in the camera coordinate system.
[0279] In this embodiment, after obtaining the expected spatial position of the target, the wearable device can calculate the change amplitude of the target according to the expected spatial position and the initial spatial position corresponding to the spatial position information of the target. After that, the wearable device can determine the adjustment amplitude of the camera's angle according to the change amplitude. Finally, the wearable device can adjust the angle of the camera based on the adjustment amplitude, so as to realize the adjustment of the camera's field of view.
[0280] In an embodiment of the present application, the wearable device can specifically adjust the camera's field of view through steps S801 to S804 as shown in Figure 12 as follows:
[0281] In S801, according to the spatial position information, determine the distance between the target and the camera.
[0282] In S802, determine the movement information of the target moving from the initial spatial position corresponding to the spatial position information to the expected spatial position.
[0283] In S803, according to the distance and movement information between the target and the camera, the field of view adjustment angle of the camera is calculated.
[0284] In S804, the field of view of the camera is adjusted according to the field of view adjustment angle.
[0285] In this embodiment, the wearable device can specifically calculate the distance between the target and the camera through the following formula:
[0286]
[0287] where d represents the distance between the target and the camera, and t x represents the first length between the abscissa of the center point of the target and the coordinate origin in the camera coordinate system, and t y represents the second length between the ordinate of the center point of the target and the coordinate origin in the camera coordinate system, and t z represents the third length between the vertical coordinate of the center point of the target and the coordinate origin in the camera coordinate system.
[0288] In this embodiment, the wearable device can determine the actual center coordinates of the target in the camera coordinate system from the initial spatial position corresponding to the spatial position information of the target. After that, the wearable device can calculate the movement distance of the center of the target from the actual center coordinates to the expected spatial position according to the actual center coordinates and the expected spatial position, that is, the movement information. Among them, the movement information includes the first movement distance in the vertical axis direction in the camera coordinate system when the target moves from the initial spatial position corresponding to the spatial position information to the expected spatial position, and the second movement distance in the horizontal axis direction in the camera coordinate system when the target moves from the initial spatial position corresponding to the spatial position information to the expected spatial position.
[0289] After that, the wearable device can calculate the field of view adjustment angle of the camera through the distance between the target and the camera and the movement information. Among them, the field of view adjustment angle of the camera includes a horizontal angle and a vertical angle.
[0290] Specifically, in combination with the inverse trigonometric function, the wearable device can calculate the field of view adjustment angle according to the following formula:
[0291] θ v = 2 * asin(Yd / 2 / d);
[0292] θ h = 2 * asin(Xd / 2 / d);
[0293] where θ v represents the horizontal angle in the field of view adjustment angle, and θ hrepresents the vertical angle in the field of view adjustment angle, Yd represents the first moving distance in the longitudinal axis direction of the camera coordinate system when the target moves from the spatial position information to the expected spatial position in the movement information, Xd represents the second moving distance in the horizontal axis direction of the camera coordinate system when the target moves from the initial spatial position corresponding to the spatial position information to the expected spatial position, and d represents the distance between the target and the camera.
[0294] Based on this, the wearable device can adjust the angle of the camera according to the calculated horizontal angle and vertical angle above to achieve the adjustment of the field of view of the camera.
[0295] Exemplarily, please refer to Figure 13 , Figure 13 is a schematic diagram of the expected coordinate position and alternative positions provided by an embodiment of the present application. As Figure 13 shown, point Pb is the center of the actual area of the target in the pixel coordinate system, and point P0 is the expected coordinate position of the center of the target in the pixel coordinate system.
[0296] In another embodiment of the present application, the wearable device can specifically execute step S804 through the following steps, which are described in detail as follows:
[0297] According to the field of view adjustment angle, plan the initial operation instruction stream for controlling the rotation of the motor of the camera lens;
[0298] If the initial operation instruction stream is successfully planned, control the motor according to the initial operation instruction stream to adjust the field of view of the camera;
[0299] In this embodiment, the wearable device can plan the movement trajectory of the motor according to the field of view adjustment angle, so as to generate the initial operation instruction stream for controlling the motor.
[0300] In an embodiment of the present application, when the wearable device detects that the initial operation instruction stream is successfully planned, that is, when the movement trajectory of the motor is successfully planned, the wearable device can directly control the motor according to the initial operation instruction stream to adjust the field of view of the camera.
[0301] In another embodiment of the present application, when the wearable device detects that the initial operation instruction stream planning fails, it can perform the following steps, which are described in detail as follows:
[0302] If the initial operation instruction stream planning fails, divide the standard range based on the set conditions to obtain multiple alternative position points;
[0303] Calculate the distance between each alternative position point and the actual area respectively;
[0304] According to the alternative position point with the smallest distance from the actual area and the actual area, plan the backup operation instruction stream of the motor;
[0305] If the backup operation instruction stream planning is successful, the motor is controlled according to the backup operation instruction stream to adjust the field of view of the camera.
[0306] In this embodiment, when the wearable device detects that the initial operation instruction stream planning fails, it indicates that the motion trajectory planning of the motor fails. Therefore, in order to improve the success rate of adjusting the field of view of the camera, the wearable device can divide the standard range based on set conditions to obtain multiple alternative position points. The set conditions can be determined according to actual needs and are not limited here. Exemplarily, the set conditions can be to divide the standard range at a set angle. The set angle can be 45 degrees.
[0307] Exemplarily, please continue to refer to Figure 13 , L3 is the standard range, and point P2, point P3, point P4, point P5, point P6, point P7, and point P8 are all alternative position points.
[0308] After that, the wearable device can calculate the distance between each alternative position point and the actual area respectively, and compare the distances between each alternative position point and the actual area one by one to determine the minimum distance among the multiple distances.
[0309] Based on this, the wearable device can determine the backup adjustment angle of the camera according to the alternative position point with the minimum distance from the actual area and the actual area, and plan the backup operation instruction stream of the motor according to the backup adjustment angle.
[0310] In an embodiment of the present application, when the wearable device detects that the above-mentioned backup operation instruction stream planning is successful, the wearable device can control the motor according to the backup operation instruction stream to adjust the field of view of the camera.
[0311] In another embodiment of the present application, when the wearable device detects that the above-mentioned backup operation instruction stream planning fails, the following steps can be executed, which are described in detail as follows:
[0312] If the backup operation instruction stream planning fails, it is determined whether there are unplanned position points among the multiple alternative position points;
[0313] If there are unplanned position points among the multiple alternative position points, select the alternative position point with the minimum distance from the actual area from the unplanned position points, and return to execute the steps of planning the backup operation instruction stream of the motor according to the alternative position point with the minimum distance from the actual area and the actual area and subsequent steps until all unplanned position points have been planned;
[0314] If there are no unplanned position points among the multiple alternative position points, output a prompt message for prompting the failure of the camera field of view adjustment.
[0315] In this embodiment, when the wearable device detects that the above-mentioned backup operation instruction stream planning fails, the wearable device can determine whether there are unplanned position points among multiple alternative position points, that is, detect whether each alternative position point has been planned.
[0316] In this embodiment, when the wearable device detects that there are no unplanned position points, that is, each alternative position point has been planned, it means that the wearable device cannot adjust the field of view of the camera, that is, cannot move the target from the actual area to the desired area. Therefore, the wearable device can output a prompt message for prompting the failure of camera field of view adjustment.
[0317] In this embodiment, when the wearable device detects that there are unplanned position points among multiple alternative position points, that is, there are unplanned alternative position points, the wearable device can select the alternative position point with the smallest distance from the actual area from the multiple unplanned alternative position points, and determine the backup adjustment angle of the camera again according to the selected alternative position point and the actual area, and plan the backup operation instruction stream of the motor again according to the backup adjustment angle.
[0318] As can be seen from the above, in the camera field of view adjustment method provided in this embodiment, the wearable device can accurately determine the movement information of the target according to the spatial position information of the target and the desired spatial position, and then can accurately determine the field of view adjustment angle of the camera according to the movement information, thereby improving the adjustment accuracy of the field of view of the camera.
[0319] Please refer to Figure 14 , Figure 14 the overall flowchart of automatic adjustment provided by an embodiment of the present application. As Figure 14 shown, when the wearable device detects other specified operations except touch operations, it can execute step S901, that is, determine that a field of view adjustment instruction is detected, and determine that the field of view adjustment method of the camera is automatic adjustment; then, the wearable device can continue to execute step S902, that is, obtain the spatial position information of the target and the first image obtained by shooting with the camera; then, the wearable device can execute step S903, that is, determine the actual area of the target in the first image according to the spatial position information; then, the wearable device can execute step S904, that is, determine the desired area in the target image according to the spatial position information. Among them, the wearable can specifically determine the actual area through the embodiment as Figure 3 shown, and determine the desired area through the embodiments as Figure 5 and as Figure 6 shown.
[0320] Based on this, the wearable device can continue to execute step S905, that is, determine the standard range of the target in the desired area according to the desired area; then, the wearable device can continue to execute step S906, that is, determine the desired coordinate position of the target in the standard range according to the actual area and the standard range; then, the wearable device can execute step S907, that is, perform coordinate conversion processing on the desired coordinate position to obtain the desired spatial position of the target in the camera coordinate system; then, the wearable device can execute step S908, that is, determine the distance between the target and the camera according to the spatial position information; then, the wearable device can execute step S909, that is, determine the movement information of the target moving from the initial spatial position corresponding to the spatial position information to the desired spatial position; then, the wearable device can execute step S9010, that is, calculate the field of view adjustment angle of the camera based on the distance between the target and the camera and the movement information; then, the wearable device can execute step S9011, that is, plan the initial operation instruction stream of the motor that controls the rotation of the camera lens according to the field of view adjustment angle; then, the wearable device can execute step S9012, that is, detect whether the initial operation instruction stream planning is successful.
[0321] On the one hand, when the wearable device detects that the initial operation instruction planning is successful, it can execute step S9013, that is, control the motor according to the initial operation instruction stream to adjust the field of view of the camera, thereby completing the adjustment operation of the field of view of the camera.
[0322] On the other hand, when the wearable device detects that the initial operation instruction planning fails, it can execute step S9014, that is, divide the standard range based on the set conditions to obtain multiple alternative position points; then, the wearable device can execute step SS9015, that is, calculate the distance between each alternative position point and the actual area respectively; then, the wearable device can execute step S9016, that is, plan the standby operation instruction stream of the motor according to the alternative position point with the smallest distance from the actual area and the actual area; then, the wearable device can execute step S9017, that is, detect whether the standby operation instruction is planned successfully.
[0323] On the one hand, when the wearable device detects that the standby operation instruction stream planning is successful, it can execute step S9018, that is, control the motor according to the standby operation instruction stream to adjust the field of view of the camera to complete the adjustment operation of the field of view of the camera.
[0324] On the other hand, when the wearable device detects that the standby operation instruction stream planning fails, it can execute step S9019, that is, determine whether there are unplanned position points among the multiple alternative position points;
[0325] Among them, when the wearable device detects that there are no unplanned position points, the wearable device can end the adjustment operation of the field of view of the camera.
[0326] When the wearable device detects an unplanned position point among multiple alternative position points, the wearable device may execute step S9020, that is, select the alternative position point with the smallest distance from the actual area among the multiple unplanned alternative position points. After that, the wearable device may return to execute steps S9016 - S9020 until each alternative position point has been planned or a certain standby operation instruction stream planning is successful.
[0327] It should be understood that the magnitudes of the sequence numbers of the steps in the above embodiments do not mean the order of execution. The order of execution of each process should be determined according to its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
[0328] Corresponding to a camera field of view adjustment method described in the above embodiments, Figure 15 FIG. shows a schematic structural diagram of a camera field of view adjustment device provided by an embodiment of the present application. For the sake of illustration, only the parts related to the embodiments of the present application are shown. Refer to Figure 15 The camera field of view adjustment device 300 includes: an acquisition unit 31, a first area determination unit 32, a second area determination unit 33, and a first adjustment unit 34. Among them:
[0329] The acquisition unit 31 is configured to acquire the spatial position information of the target and the first image obtained by photographing with the camera when the wearable device with a built-in camera detects a field of view adjustment instruction.
[0330] The first area determination unit 32 is configured to determine the actual area of the target in the first image according to the spatial position information.
[0331] The second area determination unit 33 is configured to determine the desired area of the target in the target image according to the spatial position information; wherein, the target image is the first image or the second image obtained by processing the first image.
[0332] The first adjustment unit 34 is configured to adjust the field of view of the camera according to the actual area and the desired area.
[0333] In an embodiment of the present application, the first area determination unit 32 specifically includes: a first coordinate determination unit and a first area determination subunit. Among them:
[0334] The first coordinate determination unit is configured to determine the pixel coordinates of each corner point of the target according to the spatial position information, the structural parameters of the target, and the camera parameters of the camera.
[0335] The first area determination subunit is configured to determine the actual area of the target in the first image according to the pixel coordinates of each corner point.
[0336] In an embodiment of the present application, the second region determination unit 33 specifically includes: a first distance determination unit, a diameter determination unit, a size calculation unit, and a second region determination subunit. Among them:
[0337] The first distance determination unit is configured to determine the distance between the target and the camera according to the spatial position information.
[0338] The diameter determination unit is configured to determine the target diameter of the ideal contour in the target image according to the distance between the target and the camera; wherein, the ideal contour refers to the ideal area of the target in the target image when the target is directly in front of the camera.
[0339] The size calculation unit is configured to calculate the first size of the inner boundary of the desired region and the second size of the outer boundary of the desired region according to the target diameter and the pixel coordinates of each corner point.
[0340] The second region determination subunit is configured to determine the desired region according to the first size and the second size.
[0341] In an embodiment of the present application, the first size includes a first axis length in the horizontal axis direction and a second axis length in the vertical axis direction of the inner boundary, and the second size includes a third axis length in the horizontal axis direction and a fourth axis length in the vertical axis direction of the outer boundary; the size calculation unit specifically includes: a second coordinate determination unit, a first axis length calculation unit, and a second axis length calculation unit. Among them:
[0342] The second coordinate determination unit is configured to determine the maximum horizontal axis coordinate, the minimum horizontal axis coordinate, the maximum vertical axis coordinate, and the minimum vertical axis coordinate in the pixel coordinates of each corner point.
[0343] The first axis length calculation unit is configured to calculate the first axis length and the third axis length according to the maximum horizontal axis coordinate, the minimum horizontal axis coordinate, and the target diameter.
[0344] The second axis length calculation unit is configured to calculate the second axis length and the fourth axis length according to the maximum vertical axis coordinate, the minimum vertical axis coordinate, and the target diameter.
[0345] In an embodiment of the present application, the camera field of view adjustment device 300 further includes: a first mode determination unit and a first control unit. Among them:
[0346] The first mode determination unit is configured to determine that a field of view adjustment instruction is detected and determine that the field of view adjustment mode of the camera is manual adjustment if a touch operation on the camera is detected.
[0347] The first control unit is configured to control the camera to be in a touch control mode; wherein, the touch control mode is a working mode in which the camera is controlled by manually touching the camera.
[0348] In an embodiment of the present application, the camera field of view adjustment device 300 further includes: a second method determination unit; correspondingly, the first adjustment unit 33 specifically includes: a range determination unit and a second adjustment unit. Wherein:
[0349] The second method determination unit is configured to determine that the field of view adjustment instruction is detected and determine that the field of view adjustment method of the camera is automatic adjustment if other specified operations except touch operations are detected.
[0350] The range determination unit is configured to determine a standard range of the target in the desired area according to the desired area.
[0351] The second adjustment unit is configured to adjust the field of view of the camera according to the actual area and the standard range.
[0352] In an embodiment of the present application, the desired area includes an inner boundary and an outer boundary. The first dimension of the inner boundary includes a first axis length in the horizontal axis direction and a second axis length in the vertical axis direction. The second dimension of the outer boundary includes a third axis length in the horizontal axis direction and a fourth axis length in the vertical axis direction; the range determination unit specifically includes: a third axis length calculation unit, a fourth axis length calculation unit, and a construction unit. Wherein:
[0353] The third axis length calculation unit is configured to calculate a fifth axis length of the standard range in the horizontal axis direction according to the first axis length and the third axis length.
[0354] The fourth axis length calculation unit is configured to calculate a sixth axis length of the standard range in the vertical axis direction according to the second axis length and the fourth axis length.
[0355] The construction unit is configured to construct the standard range according to the fifth axis length and the sixth axis length.
[0356] In an embodiment of the present application, the second adjustment unit specifically includes:
[0357] The third coordinate determination unit is configured to determine an expected coordinate position of the target in the standard range according to the actual area and the standard range.
[0358] The processing unit is configured to perform coordinate conversion processing on the expected coordinate position to obtain an expected spatial position of the target in the camera coordinate system.
[0359] The third adjustment unit is configured to adjust the field of view of the camera according to the expected spatial position and the spatial position information.
[0360] In an embodiment of the present application, the third adjustment unit specifically includes: a second distance determination unit, an information determination unit, an angle calculation unit, and a fourth adjustment unit. Wherein:
[0361] The second distance determination unit is configured to determine the distance between the target and the camera according to the spatial position information.
[0362] The information determination unit is used to determine the movement information of the target moving from the initial spatial position corresponding to the spatial position information to the desired spatial position.
[0363] The angle calculation unit is used to calculate the field of view adjustment angle of the camera according to the distance between the target and the camera and the movement information.
[0364] The fourth adjustment unit is used to adjust the field of view of the camera according to the field of view adjustment angle.
[0365] In an embodiment of the present application, the third adjustment unit specifically includes: a first planning unit, a second control unit, and a second planning unit. Among them:
[0366] The first planning unit is used to plan the initial operation instruction stream of the motor that controls the rotation of the camera lens according to the field of view adjustment angle.
[0367] The second control unit is used to control the motor to adjust the field of view of the camera according to the initial operation instruction stream if the initial operation instruction stream is successfully planned.
[0368] In an embodiment of the present application, the camera field of view adjustment device 300 further includes: a second planning unit, a distance calculation unit, a third planning unit, and a fifth adjustment unit. Among them:
[0369] The second planning unit is used to divide the standard range based on set conditions to obtain multiple alternative position points if the initial operation instruction stream planning fails.
[0370] The distance calculation unit is used to calculate the distance between each alternative position point and the actual area respectively.
[0371] The third planning unit is used to plan the backup operation instruction stream of the motor according to the alternative position point with the smallest distance from the actual area and the actual area.
[0372] The fifth adjustment unit is used to control the motor to adjust the field of view of the camera according to the backup operation instruction stream if the backup operation instruction stream is successfully planned.
[0373] In an embodiment of the present application, the camera field of view adjustment device 300 further includes: a position point determination unit, an execution unit, and an output unit. Among them:
[0374] The position point determination unit is used to determine whether there are unplanned position points among the multiple alternative position points if the backup operation instruction stream planning fails.
[0375] The execution unit is used to, if there are unplanned position points among multiple alternative position points, select from the unplanned position points the alternative position point with the smallest distance from the actual area, and return to execute the steps of planning the standby operation instruction stream of the motor according to the alternative position point with the smallest distance from the actual area and the actual area, and subsequent steps until all unplanned position points have been planned.
[0376] The output unit is used to, if there are no unplanned position points among multiple alternative position points, output a prompt message for prompting the failure of camera field of view adjustment.
[0377] It should be noted that for the information interaction, execution process, etc. between the above-mentioned devices / units, since they are based on the same concept as the method embodiments of the present application, their specific functions and the technical effects brought, specifically, reference can be made to the method embodiment part, and details will not be repeated here.
[0378] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the above-mentioned division of each functional unit and module is used as an example. In practical applications, the above-mentioned functions can be allocated to different functional units and modules according to needs, that is, the internal structure of the device is divided into different functional units or modules to complete all or part of the functions described above. Each functional unit and module in the embodiment can be integrated into a processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of a software functional unit. In addition, the specific names of each functional unit and module are only for the convenience of mutual distinction and do not limit the protection scope of the present application. The specific working process of the units and modules in the above system can refer to the corresponding process in the foregoing method embodiments, and details will not be repeated here.
[0379] Figure 16 It is a schematic structural diagram of a wearable device provided by an embodiment of the present application. As Figure 16 shown, the wearable device 4 of this embodiment includes: at least one processor 40 ( Figure 16 only one is shown in the figure), a processor, a memory 41, and a computer program 42 stored in the memory 41 and executable on the at least one processor 40. When the processor 40 executes the computer program 42, the steps in any of the foregoing method embodiments of the camera field of view adjustment are implemented.
[0380] The wearable device may include, but is not limited to, a processor 40 and a memory 41. Those skilled in the art can understand, Figure 16This is only an example of the wearable device 4, and does not constitute a limitation on the wearable device 4. It may include more or fewer components than those shown in the figure, or combine certain components, or different components. For example, it may also include input / output devices, network access devices, etc.
[0381] The so-called processor 40 may be a central processing unit (CPU), and this processor 40 may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or this processor may also be any conventional processor, etc.
[0382] In some embodiments, the memory 41 may be an internal storage unit of the wearable device 4, such as the memory of the wearable device 4. In other embodiments, the memory 41 may also be an external storage device of the wearable device 4, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the wearable device 4. Further, the memory 41 may also include both the internal storage unit and the external storage device of the wearable device 4. The memory 41 is used to store an operating system, application programs, a boot loader, data, and other programs, such as the program code of the computer program. The memory 41 may also be used to temporarily store data that has been output or will be output.
[0383] The embodiment of the present application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned various method embodiments can be implemented.
[0384] The embodiment of the present application provides a computer program product. When the computer program product runs on a wearable device, the wearable device is enabled to implement the steps in the above-mentioned various method embodiments when executed.
[0385] When the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such understanding, to implement all or part of the processes in the above-mentioned embodiment methods of this application, a computer program can be used to instruct relevant hardware to complete. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by a processor, the steps of the above-mentioned various method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in the form of source code, object code, executable file or some intermediate form, etc. The computer-readable medium can at least include: any entity or device that can carry the computer program code to the wearable device, recording medium, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electrical carrier signal, telecommunication signal, and software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disc, etc. In some jurisdictions, according to legislation and patent practice, the computer-readable medium cannot be an electrical carrier signal and a telecommunication signal.
[0386] In the above embodiments, the descriptions of the various embodiments have their own emphases. For the parts not detailed or recorded in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0387] The above-mentioned embodiments are only used to illustrate the technical solutions of this application, rather than to limit it; although this application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the various embodiments of this application, and should all be included in the protection scope of this application.
Claims
1. A method for adjusting the camera's field of view, characterized in that, Including: When a wearable device with a built-in camera detects a field of view adjustment instruction, obtain the spatial position information of the target and the first image captured by the camera; Determine the actual area of the target in the first image according to the spatial position information; Determine the expected area of the target in the target image according to the spatial position information; wherein, the target image is the first image or the second image obtained by processing the first image; Adjust the field of view of the camera according to the actual area and the expected area.
2. The camera field of view adjustment method according to claim 1, wherein, The determining the actual area of the target in the first image according to the spatial position information includes: Determine the pixel coordinates of each corner point of the target according to the spatial position information, the structural parameters of the target, and the camera parameters of the camera; Determine the actual area of the target in the first image according to the pixel coordinates of each corner point.
3. The camera field of view adjustment method according to claim 2, characterized in that, The determining the expected area of the target in the target image according to the spatial position information includes: Determine the distance between the target and the camera according to the spatial position information; Determine the target diameter of the ideal contour in the target image according to the distance between the target and the camera; wherein, the ideal contour refers to the ideal area of the target in the target image when the target is directly in front of the camera; Calculate the first dimension of the inner boundary of the expected area and the second dimension of the outer boundary of the expected area according to the target diameter and the pixel coordinates of each corner point; Determine the expected area according to the first dimension and the second dimension.
4. The camera field of view adjustment method according to claim 3, wherein, The first dimension includes the first axis length in the horizontal axis direction and the second axis length in the vertical axis direction of the inner boundary, and the second dimension includes the third axis length in the horizontal axis direction and the fourth axis length in the vertical axis direction of the outer boundary; the calculating the first dimension of the inner boundary of the expected area and the second dimension of the outer boundary of the expected area according to the target diameter and the pixel coordinates of each corner point includes: Determine the maximum horizontal axis coordinate, the minimum horizontal axis coordinate, the maximum vertical axis coordinate, and the minimum vertical axis coordinate among the pixel coordinates of each corner point; Calculate the first axis length and the third axis length according to the maximum horizontal axis coordinate, the minimum horizontal axis coordinate, and the target diameter; Calculate the second axis length and the fourth axis length according to the maximum vertical axis coordinate, the minimum vertical axis coordinate, and the target diameter.
5. The camera field of view adjustment method according to claim 1, wherein, Before the step of when a wearable device with a built-in camera detects a field of view adjustment instruction, obtain the spatial position information of the target and the first image captured by the camera, it further includes: If a touch operation on the camera is detected, determine that the field of view adjustment instruction is detected, and determine that the field of view adjustment method of the camera is manual adjustment; Control the camera to be in a touch control mode; wherein, the touch control mode is a working mode in which the camera is controlled by manually touching the camera.
6. The camera field of view adjustment method according to claim 1, wherein, Before obtaining the spatial position information of the target and the first image captured by the camera when the wearable device with a built-in camera detects a field of view adjustment instruction, the following steps are also included: If other specified operations except touch operations are detected, it is determined that the field of view adjustment instruction is detected, and the field of view adjustment method of the camera is determined to be automatic adjustment; Correspondingly, the adjustment of the field of view of the camera according to the actual area and the desired area includes: Determining the standard range of the target in the desired area according to the desired area; Adjusting the field of view of the camera according to the actual area and the standard range.
7. The camera field of view adjustment method according to claim 6, wherein, The desired area includes an inner boundary and an outer boundary. The first dimension of the inner boundary includes a first axis length in the horizontal axis direction and a second axis length in the vertical axis direction. The second dimension of the outer boundary includes a third axis length in the horizontal axis direction and a fourth axis length in the vertical axis direction; The determination of the standard range of the target in the desired area according to the desired area includes: Calculating the fifth axis length of the standard range in the horizontal axis direction according to the first axis length and the third axis length; Calculating the sixth axis length of the standard range in the vertical axis direction according to the second axis length and the fourth axis length; Constructing the standard range according to the fifth axis length and the sixth axis length.
8. The camera field of view adjustment method according to claim 6, characterized in that, The adjustment of the field of view of the camera according to the actual area and the standard range includes: Determining the desired coordinate position of the target in the standard range according to the actual area and the standard range; Performing coordinate conversion processing on the desired coordinate position to obtain the desired spatial position of the target in the camera coordinate system; Adjusting the field of view of the camera according to the desired spatial position and the spatial position information.
9. The camera field of view adjustment method according to claim 8, characterized in that, The adjustment of the field of view of the camera according to the desired spatial position and the spatial position information includes: Determining the distance between the target and the camera according to the spatial position information; Determining the movement information of the target moving from the initial spatial position corresponding to the spatial position information to the desired spatial position; Calculating the field of view adjustment angle of the camera according to the distance between the target and the camera and the movement information; Adjusting the field of view of the camera according to the field of view adjustment angle.
10. The camera field of view adjustment method according to claim 9, wherein, The adjustment of the field of view of the camera according to the field of view adjustment angle includes: Planning and controlling the initial operation instruction stream of the motor for rotating the camera lens according to the field of view adjustment angle; If the initial operation instruction stream is successfully planned, controlling the motor according to the initial operation instruction stream to adjust the field of view of the camera.
11. The camera field of view adjustment method according to claim 10, characterized in that, After planning and controlling the initial operation instruction stream of the motor for rotating the camera lens according to the field of view adjustment angle, the following steps are also included: If the initial operation instruction stream planning fails, dividing the standard range based on set conditions to obtain multiple alternative position points; Calculating the distance between each alternative position point and the actual area respectively; Plan a standby operation instruction stream for the motor according to the alternative position point with the minimum distance from the actual area and the actual area; If the standby operation instruction stream is successfully planned, control the motor according to the standby operation instruction stream to adjust the field of view of the camera.
12. The camera field of view adjustment method according to claim 11, characterized in that, After planning the standby operation instruction stream for the motor according to the alternative position point with the minimum distance from the actual area and the actual area, it further includes: If the standby operation instruction stream planning fails, determine whether there are unplanned position points among the multiple alternative position points; If there are unplanned position points among the multiple alternative position points, select the alternative position point with the minimum distance from the actual area from the unplanned position points, and return to execute the step of planning the standby operation instruction stream for the motor according to the alternative position point with the minimum distance from the actual area and the actual area and subsequent steps until all the unplanned position points have been planned; If there are no unplanned position points among the multiple alternative position points, output a prompt message for prompting the failure of the camera field of view adjustment.
13. A camera field of view adjustment device, characterized in that, It includes: An acquisition unit, configured to obtain the spatial position information of the target and the first image captured by the camera when the wearable device with a built-in camera detects a field of view adjustment instruction; A first area determination unit, configured to determine the actual area of the target in the first image according to the spatial position information; A second area determination unit, configured to determine the desired area of the target in the target image according to the spatial position information; wherein, the target image is the first image or the second image obtained by processing the first image; A first adjustment unit, configured to adjust the field of view of the camera according to the actual area and the desired area.
14. A wearable device, including a camera and a control unit for executing the camera field of view adjustment method according to any one of claims 1-12.
15. The wearable device according to claim 14, wherein The wearable device further includes: a display module.
16. A wearable device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the camera field of view adjustment method according to any one of claims 1-12.
17. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the camera field of view adjustment method according to any one of claims 1 to 12.