Scale measurement method, device, electrical equipment and medium based on monocular vision

Through the scale measurement method based on monocular vision, the monocular vision sensor and motor encoder are used to adjust the inclination angle on the fixed equipment and calculate the target scale, which solves the problems of applicability and high cost of scale measurement and realizes simple and low-cost scale measurement.

CN116499354BActive Publication Date: 2025-09-16GD MIDEA AIR CONDITIONING EQUIP CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210061963.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-19
Publication Date
2025-09-16
Estimated Expiration
2042-01-19

AI Technical Summary

Technical Problem

In the existing technology, the scope of application of scale measurement is small and the measurement cost is high, making it difficult to improve applicability while reducing costs.

Method used

A scale measurement method based on monocular vision is adopted. The monocular vision sensor is used to collect images, adjust the position of the object to be measured and obtain the inclination angle, calculate the target scale based on the reference scale, and use the motor and encoder to drive the sensor to rotate to achieve scale measurement.

Benefits of technology

It realizes the dimensional measurement on fixed equipment, reduces the measurement cost, and the measurement method is simple and effective.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116499354B_ABST
    Figure CN116499354B_ABST
Patent Text Reader

Abstract

The present invention discloses a scale measurement method, device, electrical equipment, and medium based on monocular vision. The method includes: identifying an image captured by a monocular vision sensor to determine an object to be measured; adjusting a first position to be measured of the object to be measured in a target direction to a first image position in the image, and obtaining a first inclination angle of the monocular vision sensor; adjusting a second position to be measured of the object to be measured in the target direction to a second image position in the image, and obtaining a second inclination angle of the monocular vision sensor; and determining the target scale between the first and second positions to be measured based on the first and second inclination angles and a reference scale of the monocular vision sensor in the target direction. This solution can effectively achieve scale measurement, is simple to measure, and is low-cost.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of measurement, and in particular relates to a scale measurement method, device, electrical equipment and medium based on monocular vision. Background Art

[0002] With the continuous development of science and technology, the functions of electrical devices are becoming more and more abundant. Taking household appliances as an example, in order to realize services such as navigation or personalized function recommendations, it is necessary to estimate the scale of the target. In related technologies, scale estimation can be achieved in the following two ways:

[0003] The first approach uses monocular vision sensors, such as lidar and monocular cameras, mounted on a mobile device. The sensor extracts and measures features like edges and corners of the target through the movement of the device for scale estimation. The second approach uses binocular cameras, RGB-D cameras, and other methods for scale estimation.

[0004] However, the first method of scale measurement requires the sensor to be mounted on a mobile device, which has a smaller scope of application. The second method of scale measurement has a higher cost of the sensor. Therefore, how to improve the applicability of scale measurement while reducing the cost of scale measurement is an urgent problem to be solved. Summary of the Invention

[0005] The present invention aims to at least to some extent solve the technical problems of small application scope and high measurement cost of scale measurement in related technologies, and provides a scale measurement method, device, electrical equipment and medium based on monocular vision.

[0006] In a first aspect, an embodiment of this specification provides a scale measurement method based on monocular vision, which is applied to a scale measurement system, wherein the scale measurement system includes a monocular vision sensor, and the method includes:

[0007] Identify the image captured by the monocular vision sensor to determine the object to be measured;

[0008] Adjusting a first position of the object to be measured in the target direction to a first image position in the image, and obtaining a first inclination angle of the monocular vision sensor;

[0009] Adjusting a second position of the object to be measured in the target direction to a second image position in the image, and obtaining a second inclination angle of the monocular vision sensor;

[0010] A target scale between the first position to be measured and the second position to be measured is determined based on the first inclination angle, the second inclination angle, and a reference scale of the monocular vision sensor in the target direction.

[0011] In some embodiments, after determining the object to be detected, the method further includes: marking the object to be detected with an identification frame, wherein the object to be detected is located within the identification frame;

[0012] The adjusting the first position of the object to be measured in the target direction to the first image position in the image includes: adjusting the first edge of the identification frame in the target direction to the first image position;

[0013] The adjusting the second position of the object to be measured in the target direction to the second image position in the image includes: adjusting the second edge of the identification frame in the target direction to the second image position.

[0014] In some embodiments, the target direction is a height direction of the object to be measured, the first edge is an upper edge of the identification frame, and the second edge is a lower edge of the identification frame;

[0015] The adjusting the first edge of the identification frame in the target direction to the first image position includes: adjusting the upper edge to the horizontal center line in the image;

[0016] The adjusting the second position to be measured of the object to be measured in the target direction to the second image position in the image includes: adjusting the lower edge to the horizontal center line in the image.

[0017] In some embodiments, when the target direction is the height direction of the object to be measured, the reference scale is the height of the monocular vision sensor.

[0018] In some embodiments, determining the target scale between the first position to be measured and the second position to be measured based on the first inclination angle, the second inclination angle, and a reference scale of the monocular vision sensor in the target direction includes:

[0019] Determining a target scale calculation method based on the first inclination angle and the second inclination angle;

[0020] Based on the target scale calculation method, the first inclination angle, the second inclination angle, and the reference scale are processed to obtain the target scale.

[0021] In some embodiments, before identifying the image captured by the monocular vision sensor and determining the object to be measured, the method further includes:

[0022] Determining whether the position of the object to be measured changes within a preset time period;

[0023] If the position of the object to be measured does not change within the preset time period, the step of identifying the image captured by the monocular vision sensor to determine the object to be measured is performed.

[0024] In some embodiments, after determining the target dimension between the first position to be measured and the second position to be measured, the method further includes:

[0025] Obtaining identification information of the object to be measured and a historical scale corresponding to the identification information;

[0026] The target scale is compared with the historical scale, and based on the comparison result, the maximum scale is used as the final scale of the object to be measured.

[0027] In some embodiments, the scale measurement system includes an encoder and a motor, wherein the encoder is used to obtain a rotation angle of the motor, and the motor is used to drive the monocular vision sensor to rotate;

[0028] The method of adjusting a first position of the object to be measured in the target direction to a first image position in the image and obtaining a first inclination angle of the monocular vision sensor, and adjusting a second position of the object to be measured in the target direction to a second image position in the image and obtaining a second inclination angle of the monocular vision sensor, comprises:

[0029] driving the monocular vision sensor to rotate by the motor, adjusting the first position to be measured to a first image position in the image, and obtaining the angle recorded by the encoder at which the motor rotates from an initial position to a current position as the first inclination angle; and

[0030] The monocular vision sensor is driven to rotate by the motor, the second position to be measured is adjusted to the second image position in the image, and the angle recorded by the encoder where the motor rotates from the initial position to the current position is obtained as the second inclination angle.

[0031] In a second aspect, an embodiment of the present invention provides a scale measurement device based on monocular vision, which is applied to a scale measurement system. The scale measurement system includes a monocular vision sensor, and the device includes:

[0032] A recognition module is used to recognize the image collected by the monocular vision sensor and determine the object to be measured;

[0033] A first adjustment module is used to adjust a first position of the object to be measured in a target direction to a first image position in the image, and obtain a first inclination angle of the monocular vision sensor;

[0034] A second adjustment module is used to adjust a second position of the object to be measured in the target direction to a second image position in the image, and obtain a second inclination angle of the monocular vision sensor;

[0035] The scale determination module is configured to determine a target scale between the first position to be measured and the second position to be measured based on the first inclination angle, the second inclination angle, and a reference scale of the monocular vision sensor in the target direction.

[0036] In a third aspect, an embodiment of the present invention provides an electrical device, comprising: a monocular vision sensor for image acquisition; the electrical device also comprises: a memory, a processor, and a computer program stored in the memory and runnable on the processor, wherein when the processor executes the program, the method described in any embodiment of the first aspect is implemented.

[0037] In some embodiments, the electrical device further includes: an encoder and a motor, the encoder being used to obtain a rotation angle of the motor, the motor being used to drive the monocular vision sensor to rotate, and the computer program including instructions for performing the following operations:

[0038] driving the monocular vision sensor to rotate by the motor, adjusting the first position to be measured to a first image position in the image, and obtaining a first angle recorded by the encoder when the motor rotates from an initial position to a current position; determining the first inclination angle based on the first angle; and

[0039] The monocular vision sensor is driven to rotate by the motor, the second position to be measured is adjusted to the second image position in the image, and the second angle recorded by the encoder when the motor rotates from the initial position to the current position is obtained; based on the second angle, the second inclination angle is determined.

[0040] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, which implements the steps of the method provided in the first aspect when executed by a processor.

[0041] One or more technical solutions provided by the embodiments of the present invention achieve at least the following technical effects or advantages:

[0042] The scale measurement method based on monocular vision provided in the embodiment of this specification is applied to the scale measurement system, which includes a monocular vision sensor. When performing scale measurement, the image collected by the monocular vision sensor is identified to determine the object to be measured; the first position to be measured of the object to be measured in the target direction is adjusted to the first image position in the image, and the first inclination angle of the monocular vision sensor is obtained; the second position to be measured of the object to be measured in the target direction is adjusted to the image position, and the second inclination angle of the monocular vision sensor is obtained; based on the first inclination angle, the second inclination angle and the reference size of the monocular vision sensor in the target direction, the target scale between the first position to be measured and the second position to be measured is determined. The solution provided in the embodiment of this specification can calculate the target scale by adjusting the positions of the first position to be measured and the second position to be measured in the monocular vision sensor, and according to the adjusted first inclination angle, the second inclination angle and the reference scale of the monocular vision sensor. It can be seen that this solution can achieve scale measurement by simply adjusting the angle of the monocular vision sensor, without the assistance of other movable devices, and the scale measurement is simple and reduces the measurement cost. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following is a brief introduction to the drawings required for use in the description of the embodiments. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0044] Figure 1 A flow chart of a scale measurement method based on monocular vision in an embodiment of the present invention is shown;

[0045] Figure 2 A schematic diagram showing the height measurement of an object to be measured when the height of the object to be measured is lower than the height of the monocular vision sensor in an embodiment of the present invention is shown;

[0046] Figure 3 A schematic diagram showing the height measurement of an object to be measured when the height of the object to be measured is higher than the height of the monocular vision sensor in an embodiment of the present invention is shown;

[0047] Figure 4 A schematic diagram of a scale measurement device based on monocular vision in an embodiment of the present invention is shown;

[0048] Figure 5 A schematic diagram of an electrical device in an embodiment of the present invention is shown. DETAILED DESCRIPTION

[0049] In view of the limited applicability and high cost of scale measurement in related technologies, a monocular vision-based scale measurement method, apparatus, electrical device, and medium are provided. This method uses a monocular vision sensor to capture the object under measurement and adjusts the positions of the first and second measured locations of the object in the image to determine the target scale between the first and second measured locations. This method is simple and effectively controls measurement costs.

[0050] To make the objectives, technical solutions, and advantages of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of the present invention.

[0051] It should be noted that the terms "first", "second", etc. in the description and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0052] Hereinafter, the scale measurement method based on monocular vision provided by the embodiment of the present invention will be described in detail with reference to the accompanying drawings and specific embodiments.

[0053] like Figure 1 FIG. 1 is a flow chart of a scale measurement method based on monocular vision provided in an embodiment of this specification, and the method includes the following steps:

[0054] Step S101: identifying the image captured by the monocular vision sensor to determine the object to be measured;

[0055] Step S102: adjusting a first position of the object to be measured in a target direction to a first image position in the image, and obtaining a first inclination angle of the monocular vision sensor;

[0056] Step S103: adjusting a second position of the object to be measured in the target direction to a second image position in the image, and obtaining a second inclination angle of the monocular vision sensor;

[0057] Step S104: determining a target scale between the first position to be measured and the second position to be measured based on the first inclination angle, the second inclination angle, and a reference scale of the monocular vision sensor in the target direction.

[0058] The methods provided in the embodiments of this specification can be applied to a scale measurement system. The scale measurement system can be installed on fixed equipment such as air conditioners and remote controls to measure the scale information of various objects in the environment in which the equipment is located. The scale measurement system can include a monocular vision sensor. The monocular vision sensor can be selected based on actual needs, such as a monocular camera or an infrared camera, and is not limited here.

[0059] In step S101, a monocular vision sensor is rotatably mounted on a fixed device and captures images from various viewing angles in real time. The object to be measured can be set according to actual needs, for example, a pre-defined object or obstacle. For ease of explanation, the present invention uses the human body as an example.

[0060] Specifically, after the monocular vision sensor is activated, it collects image information of the environment in real time. During the image collection process, the monocular vision sensor can collect image information of the environment at a fixed angle or posture, or according to a preset rotation direction and preset rotation angle. The preset rotation direction and preset rotation angle can be set according to actual needs and are not limited here.

[0061] While capturing images, the real-time image can be recognized to determine whether a person is present in the image. The specific method of image recognition can be set according to actual needs, such as performing facial recognition or human posture recognition on the image. Furthermore, the object to be detected can be determined from the image by determining the entire outline of the object to be detected or by determining a local area of ​​the object to be detected, which is not limited here.

[0062] It should be noted that to ensure the accuracy of scale measurement, the object to be measured needs to be stationary. For example, if the human body is in motion, accurate scale measurement cannot be performed. Therefore, in the embodiments of this specification, before identifying the image captured by the monocular vision sensor and determining the object to be measured, the following steps can also be performed: determining whether the position of the object to be measured has changed within a preset time period; if the position of the object to be measured has not changed within the preset time period, performing the step of identifying the image captured by the monocular vision sensor and determining the object to be measured.

[0063] Specifically, the preset duration can be set according to actual needs, for example, the preset duration can be 3 seconds, 5 seconds, 6 seconds, etc. Whether the position of the object to be measured changes within the preset duration can be determined by comparing multiple frames of images collected within the preset duration, wherein the posture of the monocular vision sensor is fixed within the preset duration to ensure that the multiple frames of images are collected from the same viewing angle.

[0064] For each frame of image captured within a preset time period, the position and size of the object to be measured in each frame of image can be preliminarily determined, and then the position and size of the object to be measured in each frame of image can be compared. If the position error of the object to be measured between any two frames of image is less than a first threshold value, and the size difference is less than a second threshold value, it can be determined that the position of the object to be measured has not changed, otherwise it can be determined that the position of the object to be measured has changed. Among them, the first threshold value and the second threshold value can be set according to actual needs and are not limited here. If it is detected that the position of the object to be measured has not changed, it indicates that the scale measurement of the object to be measured can be performed. At this time, the captured image can be identified to determine the object to be measured.

[0065] For steps S102 and S103, the target direction may be the direction of the measurement scale. For example, if the object to be measured is a human body and the measurement scale is the height of the human body, then the target direction may be the height direction of the human body; if the measurement scale is the width of the human body, then the target direction may be the width direction of the human body. The first position to be measured and the second position to be measured may be two positions in the target direction, and the distance between the first position to be measured and the second position to be measured may represent the target scale to be measured.

[0066] To determine the target scale, the angle of the monocular vision sensor can be adjusted, and the first and second locations to be measured can be placed in the first and second image positions in the captured image, respectively, to obtain the corresponding first and second inclination angles. The first and second image positions in the image can be set as needed, and can be the same or different.

[0067] It should be noted that when the monocular vision sensor is fixed in position, the position of the object in the image can be used to represent the monocular vision sensor's shooting attitude. That is, each image position in the image corresponds to a fixed shooting attitude. Therefore, when adjusting the first position to be measured to the first image position and the second position to be measured to the second image position, the monocular vision sensor is actually adjusted to the shooting attitude corresponding to the first image position and the shooting attitude corresponding to the second image position, respectively.

[0068] At the same time, when the monocular vision sensor is adjusted to adjust the first position to be measured to the first image position, the first inclination angle of the corresponding monocular vision sensor is determined, and when the second position to be measured is adjusted to the second image position, the second inclination angle of the corresponding monocular vision sensor is determined. The inclination angle of the monocular sensor can be the angle between the plane where the monocular vision sensor lens is located (i.e., the plane perpendicular to the optical axis) and the reference direction, and the reference direction can be the target direction.

[0069] In an embodiment of the present specification, the scale measurement system may further include an encoder and a motor, the encoder being used to obtain the rotation angle of the motor, and the motor being used to drive the monocular vision sensor to rotate. Then, determining the inclination angle of the monocular vision sensor may be achieved in the following manner: driving the monocular vision sensor to rotate by the motor, adjusting the first position to be measured to the first image position in the image, and obtaining the first angle recorded by the encoder when the motor rotates from the initial position to the current position; determining the first inclination angle based on the first angle; and driving the monocular vision sensor to rotate by the motor, adjusting the second position to be measured to the second image position in the image, and obtaining the second angle recorded by the encoder when the motor rotates from the initial position to the current position, and determining the second inclination angle based on the second angle.

[0070] Specifically, the motor is connected to the monocular vision sensor, and the motor can drive the monocular vision sensor, wherein the rotation angles of the motor and the monocular vision sensor can be the same or different, and can be specifically determined according to the connection method between the motor and the monocular vision sensor. For the sake of convenience, here we take the case where the rotation angles of the motor and the monocular vision sensor are the same as an example. Then, when adjusting the first position to be measured, the motor drives the monocular vision sensor to rotate, and gradually moves the first position to be measured to the first image position in the image. During this process, the encoder records the first angle of the motor rotating from the initial position to the current position, wherein the initial position can be set according to actual needs, for example, the initial position is the position where the monocular vision sensor lens is in a vertical state, and then, the first inclination angle is determined based on the first angle. For example, if the first inclination angle is the angle between the plane where the monocular vision sensor lens is located and the horizontal direction, then the first inclination angle is the first angle. Further, the second inclination angle can be determined in the same way.

[0071] In step S104, since the posture of the monocular vision sensor is determined when the first position to be measured is located at the first image position, and the posture of the monocular vision sensor is also determined when the second position to be measured is located at the second image position, then, based on the first inclination angle, the second inclination angle, and the reference size, the target scale can be calculated through the relationship between the sides and angles of the triangle.

[0072] In the embodiments of this specification, when calculating the target scale, the positional relationship between the object to be measured and the monocular vision sensor is different, and the target scale calculation method may also be different. Therefore, in the specific implementation process, step S104 can be implemented by the following steps: determining the target scale calculation method based on the first inclination angle and the second inclination angle; and processing the first inclination angle, the second inclination angle, and the reference scale based on the target scale calculation method to obtain the target scale.

[0073] For example, when the target scale is the height of the object to be measured, the positional relationship between the object to be measured and the monocular vision sensor may include: the height of the object to be measured is higher than the height of the monocular vision sensor, and the height of the object to be measured is lower than the height of the monocular vision sensor. Different scale calculation methods can be used for the above different positional relationships. For another example, when the target scale is the width of the object to be measured, the positional relationship between the object to be measured and the monocular vision sensor may include: the first position to be measured and the second position to be measured of the object to be measured are located on the same side of the monocular vision sensor, and the second position to be measured and the second position to be measured of the object to be measured are located on both sides of the monocular vision sensor. Different scale calculation methods also need to be used for the above different positional relationships.

[0074] In a specific implementation, the first and second inclination angles can be used to determine the positional relationship between the object to be measured and the monocular vision sensor. For example, if the target scale is the height of the object to be measured, if the first inclination angle corresponds to the inclination angle of the highest point of the object to be measured, then the first inclination angle is an elevation angle, and the second inclination angle is a depression angle. If the object to be measured is lower than the monocular vision sensor, then the first and second inclination angles are both depression angles.

[0075] In the embodiments of this specification, corresponding scale calculation methods can be pre-configured for different positional relationships between the object to be measured and the monocular vision sensor. After the positional relationship between the object to be measured and the monocular vision sensor is determined based on the first inclination angle and the second inclination angle, the corresponding scale calculation method is obtained as the target scale calculation method. Furthermore, based on the first inclination angle, the second inclination angle and the reference scale, the target scale is determined by the target scale calculation method.

[0076] Optionally, in an embodiment of the present specification, in order to facilitate the scale measurement of the object to be measured, after the object to be measured is identified, the object to be measured can be identified with an identification frame, wherein the identification frame can be a rectangular frame, and the object to be measured is located within the identification frame. Since the identification frame determines the boundary of the object to be measured, the edge of the identification frame can be used as the position to be measured of the object to be measured. Specifically, the first position to be measured can be the first edge of the identification frame, then step S102 can be implemented in the following manner: adjusting the first edge of the identification frame in the target direction to the first image position. The second position to be measured can be the second edge of the identification frame, then step S103 can be implemented in the following manner: adjusting the second edge of the identification frame in the target direction to the second image position.

[0077] In one embodiment, the first edge and the second edge can be opposite to each other. When the target direction is the height direction of the object to be measured, if the height of the object to be measured needs to be measured, the first edge can be the upper edge of the identification frame, and the second edge can be the lower edge of the identification frame, and the target scale is the distance between the upper and lower edges. When the target direction is the width direction of the object to be measured, if the width of the object to be measured needs to be measured, the first edge can be the left edge of the identification frame, and the second edge can be the right edge of the identification frame, and the target scale is the distance between the left and right edges.

[0078] For ease of understanding, the following describes the target scale measurement method by taking the target scale as the height of the object to be measured (i.e., the distance between the upper edge and the bottom of the identification frame) and the reference scale as the height of the monocular vision sensor as an example.

[0079] In a specific implementation, after the object to be measured is identified and marked with an identification frame, the upper edge is adjusted to the horizontal centerline of the image, and the first tilt angle of the monocular vision sensor is determined. Then, the lower edge is adjusted to the horizontal centerline of the image, and the second tilt angle of the monocular vision sensor is determined. The first image position and the second image position are both the horizontal centerline of the image.

[0080] It should be noted that if Figure 2 As shown, the upper edge of the identification frame is used to define the highest point of the object to be measured. When the upper edge of the identification frame is located at the horizontal center line of the image, the shooting posture of the monocular vision sensor is that the center point of the monocular vision sensor lens is directly at the highest point of the object to be measured, that is, Figure 2 γ1 in the equation is a right angle. Similarly, the lower edge of the identification frame is used to define the lowest point of the object to be measured. When the lower edge of the identification frame is located at the horizontal centerline of the image, the shooting posture of the monocular vision sensor is that the center point of the monocular vision sensor lens is facing the lowest point of the object to be measured, that is, γ2 is a right angle.

[0081] like Figure 2 、 Figure 3 As shown, when the upper edge of the identification frame is located at the horizontal center of the image, the first inclination angle is determined to be α, that is, the angle between the plane where the monocular vision sensor lens is located and the height direction (that is, the vertical direction). When the lower edge of the identification frame is located at the horizontal center of the image, the second inclination angle is determined to be β.

[0082] When measuring the height of the object to be measured, the positional relationship between the object to be measured and the monocular vision sensor can be: the height of the object to be measured is lower than the height of the monocular vision sensor (such as Figure 2 As shown), and the height of the object to be measured is higher than the height of the monocular vision sensor (as shown Figure 3 shown).

[0083] Please refer to Figure 2 , for the object to be measured whose height is lower than that of the monocular vision sensor, the corresponding target scale calculation method is:

[0084] h=h1*(cotα-cotβ)÷cotα

[0085] Please refer to Figure 3 , for the object to be measured whose height is higher than that of the monocular vision sensor, the corresponding target scale calculation method is:

[0086] h=h1*(cotα+cotβ)÷cotα

[0087] Wherein, h is the target scale, that is, the height of the object to be measured, α is the first inclination angle, β is the second inclination angle, and h1 is the height of the object to be measured.

[0088] Furthermore, in an embodiment of this specification, after determining the target scale, the following steps may be performed: obtaining identification information of the object to be measured and a historical scale corresponding to the identification information; comparing the target scale with the historical scale, and taking the maximum scale as the final scale of the object to be measured based on the comparison result.

[0089] Specifically, the identification information of the object to be measured can be obtained in a variety of ways. For example, when the object to be measured is a person, the identity of the object to be measured can be determined through facial recognition, and the user identification of the object to be measured can be obtained. It should be noted that for the same object to be measured, the target scale of the object to be measured can be measured multiple times to ensure the accuracy of the target scale. For example, still taking the object to be measured as a person, when the person is in different postures, the results of the measured target scale are also different. For example, when the object to be measured is in a squatting posture, a sitting posture, or a standing posture, the height obtained by the above-described method is different. In order to obtain accurate height information, the height information of the object to be measured can be measured multiple times. Each time a new target scale is obtained by measurement, the new target scale can be compared with the historical scale. The historical scale can be the scale information that has been bound to the identification information, or it can be all scale information collected historically, which is not limited here. If the new target scale is larger than the historical scale, the new target scale is used as the final target scale and is bound to the identification information.

[0090] In addition, after obtaining the target scale, the target scale can also be sent to other devices. For example, when the scale measurement system is installed on an air conditioner, the target scale can be sent to the air conditioner controller so that the air conditioner determines the corresponding operating mode according to the target scale.

[0091] In summary, the solution of the embodiments of this specification uses a motor to drive the monocular vision sensor to rotate, adjust the first position to be measured to the first image position, and adjust the second position to be measured to the second image position. An encoder is used to obtain the corresponding inclination angle of the monocular vision sensor. Based on the inclination angle and a reference scale, the target scale can be measured. This solution has a simple measurement structure and does not require the assistance of other movable devices, effectively reducing measurement costs. Furthermore, this solution can also use the image centerline to match the edge of the identification frame, combined with the reference scale to estimate the target scale, making it easy to implement and highly robust.

[0092] Based on the same inventive concept, the embodiment of this specification provides a scale measurement device based on monocular vision, which is applied to a scale measurement system. The scale measurement system includes a monocular vision sensor, such as Figure 4 As shown, the device includes:

[0093] Identification module 401, used to identify the image collected by the monocular vision sensor and determine the object to be measured;

[0094] A first adjustment module 402 is configured to adjust a first position of the object to be measured in a target direction to a first image position in the image, and obtain a first inclination angle of the monocular vision sensor;

[0095] A second adjustment module 403 is configured to adjust a second position of the object to be measured in the target direction to a second image position in the image, and obtain a second inclination angle of the monocular vision sensor;

[0096] The scale determination module 404 is configured to determine a target scale between the first position to be measured and the second position to be measured based on the first inclination angle, the second inclination angle, and a reference scale of the monocular vision sensor in the target direction.

[0097] In some embodiments, the apparatus further comprises:

[0098] an identification module, configured to identify the object to be detected with an identification frame, wherein the object to be detected is located within the identification frame;

[0099] A first adjustment module 402 is configured to adjust a first edge of the identification frame in the target direction to a position of the first image;

[0100] The second adjustment module 403 is configured to adjust the second edge of the identification frame in the target direction to the second image position.

[0101] In some embodiments, the target direction is a height direction of the object to be measured, the first edge is an upper edge of the identification frame, and the second edge is a lower edge of the identification frame;

[0102] A first adjustment module 402 is configured to adjust the upper edge to a horizontal center line in the image;

[0103] The second adjustment module 403 is configured to adjust the lower edge to the horizontal center line of the image.

[0104] In some embodiments, when the target direction is the height direction of the object to be measured, the reference scale is the height of the monocular vision sensor.

[0105] In some embodiments, the scale determination module 404 is configured to:

[0106] Determining a target scale calculation method based on the first inclination angle and the second inclination angle;

[0107] Based on the target scale calculation method, the first inclination angle, the second inclination angle, and the reference scale are processed to obtain the target scale.

[0108] In some embodiments, the apparatus further comprises:

[0109] A position determination module is used to determine whether the position of the object to be measured changes within a preset time period;

[0110] An execution module is used to execute the step of identifying the image collected by the monocular vision sensor and determining the object to be measured if the position of the object to be measured does not change within the preset time period.

[0111] In some embodiments, the apparatus further comprises:

[0112] An acquisition module, configured to acquire identification information of the object to be measured and a historical scale corresponding to the identification information;

[0113] A comparison module is configured to compare the target scale with the historical scales, and based on the comparison result, use the maximum scale as the final scale of the object to be measured.

[0114] In some embodiments, the scale measurement system includes an encoder and a motor, wherein the encoder is used to obtain a rotation angle of the motor, and the motor is used to drive the monocular vision sensor to rotate;

[0115] a first adjustment module 402 configured to drive the monocular vision sensor to rotate via the motor, adjust the first position to be measured to a first image position in the image, and obtain a first angle recorded by the encoder when the motor rotates from an initial position to a current position; and determine the first inclination angle based on the first angle; and

[0116] The second adjustment module 403 is used to drive the monocular vision sensor to rotate through the motor, adjust the second position to be measured to the second image position in the image, and obtain the second angle recorded by the encoder when the motor rotates from the initial position to the current position; based on the second angle, determine the second inclination angle.

[0117] Regarding the above-mentioned device, the specific functions of each module therein have been described in detail in the embodiment of the scale measurement method based on monocular vision provided in the embodiment of this specification, and will not be elaborated here.

[0118] An embodiment of the present invention provides an electrical device including a monocular vision sensor for image acquisition, an encoder for acquiring a rotation angle of the motor, and a motor for driving the monocular vision sensor to rotate.

[0119] like Figure 5 As shown, the electrical device also includes a memory 1104, a processor 1102, and a computer program stored in the memory 1104 and executable on the processor 1102. When the processor 1102 executes the program, the aforementioned monocular vision dimension measurement method is implemented. The electrical device can be an air conditioning unit or other equipment equipped with a dimension measurement system.

[0120] Among them, Figure 5 In the embodiment of the present invention, a bus architecture (represented by bus 1100) is shown. Bus 1100 may include any number of interconnected buses and bridges, and bus 1100 links various circuits including one or more processors represented by processor 1102 and memory represented by memory 1104. Bus 1100 may also link various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art and therefore will not be described further herein. Bus interface 11011 provides an interface between bus 1100 and receiver 1101 and transmitter 1103. Receiver 1101 and transmitter 1103 may be the same component, namely a transceiver, which provides a unit for communicating with various other devices over a transmission medium. Processor 1102 is responsible for managing bus 1100 and general processing, while memory 1104 may be used to store data used by processor 1102 when performing operations.

[0121] The functions described herein may be implemented in hardware, software executed by a processor, firmware, or any combination thereof. If implemented in software executed by a processor, the functions may be stored as one or more instructions or codes on or transmitted via a computer-readable medium. Other examples and implementations are within the scope and spirit of the present invention and the appended claims. For example, due to the nature of software, the functions described above may be implemented using software executed by a processor, hardware, firmware, hardwiring, or a combination of any of these. Furthermore, each functional unit may be integrated into a single processing unit, each unit may exist physically separately, or two or more units may be integrated into a single unit.

[0122] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only exemplary. For example, the division of the units can be a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0123] The units described as separate components may or may not be physically separate, and the components of the control device may or may not be physical units, that is, they may be located in one place or distributed across multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0124] If 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 this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk, etc. Various media that can store program codes.

[0125] The foregoing description is merely an embodiment of the present invention and is not intended to limit the present invention. Those skilled in the art will readily appreciate that various modifications and variations of the present invention are possible. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present invention are intended to be within the scope of the claims.

Claims

1. A scale measurement method based on monocular vision, characterized in that: Applied to a scale measurement system including a monocular vision sensor, the method includes: Identify the image captured by the monocular vision sensor to determine the object to be measured; Adjusting a first position of the object to be measured in the target direction to a first image position in the image, and obtaining a first inclination angle of the monocular vision sensor; Adjusting a second position of the object to be measured in the target direction to a second image position in the image, and obtaining a second inclination angle of the monocular vision sensor; A target scale between the first position to be measured and the second position to be measured is determined based on the first inclination angle, the second inclination angle, and a reference scale of the monocular vision sensor in the target direction.

2. The method according to claim 1, wherein After the object to be measured is determined, the method further includes: marking the object to be measured with an identification frame, wherein the object to be measured is located within the identification frame; The adjusting the first position of the object to be measured in the target direction to the first image position in the image includes: adjusting the first edge of the identification frame in the target direction to the first image position; The adjusting the second position of the object to be measured in the target direction to the second image position in the image includes: adjusting the second edge of the identification frame in the target direction to the second image position.

3. The method according to claim 2, wherein The target direction is the height direction of the object to be measured, the first edge is the upper edge of the identification frame, and the second edge is the lower edge of the identification frame; The adjusting the first edge of the identification frame in the target direction to the first image position includes: adjusting the upper edge to the horizontal center line in the image; The adjusting the second position to be measured of the object to be measured in the target direction to the second image position in the image includes: adjusting the lower edge to the horizontal center line in the image.

4. The method according to claim 1, wherein When the target direction is the height direction of the object to be measured, the reference scale is the height of the monocular vision sensor.

5. The method according to claim 1, wherein The determining of the target scale between the first position to be measured and the second position to be measured based on the first inclination angle, the second inclination angle, and a reference scale of the monocular vision sensor in the target direction includes: Determining a target scale calculation method based on the first inclination angle and the second inclination angle; Based on the target scale calculation method, the first inclination angle, the second inclination angle, and the reference scale are processed to obtain the target scale.

6. The method according to claim 1, wherein Before identifying the image captured by the monocular vision sensor and determining the object to be measured, the method further includes: Determining whether the position of the object to be measured changes within a preset time period; If the position of the object to be measured does not change within the preset time period, the step of identifying the image captured by the monocular vision sensor to determine the object to be measured is performed.

7. The method according to claim 1, wherein After determining the target dimension between the first position to be measured and the second position to be measured, the method further includes: Obtaining identification information of the object to be measured and a historical scale corresponding to the identification information; The target scale is compared with the historical scale, and based on the comparison result, the maximum scale is used as the final scale of the object to be measured.

8. The method according to claim 1, wherein The scale measurement system includes an encoder and a motor, wherein the encoder is used to obtain the rotation angle of the motor, and the motor is used to drive the monocular vision sensor to rotate; The method of adjusting a first position of the object to be measured in the target direction to a first image position in the image and obtaining a first inclination angle of the monocular vision sensor, and adjusting a second position of the object to be measured in the target direction to a second image position in the image and obtaining a second inclination angle of the monocular vision sensor, comprises: driving the monocular vision sensor to rotate by the motor, adjusting the first position to be measured to a first image position in the image, and obtaining a first angle recorded by the encoder when the motor rotates from an initial position to a current position; determining the first inclination angle based on the first angle; and The monocular vision sensor is driven to rotate by the motor, the second position to be measured is adjusted to the second image position in the image, and the second angle recorded by the encoder when the motor rotates from the initial position to the current position is obtained; based on the second angle, the second inclination angle is determined.

9. A scale measurement device based on monocular vision, characterized in that: Applied to a scale measurement system, the scale measurement system includes a monocular vision sensor, and the device includes: A recognition module is used to recognize the image collected by the monocular vision sensor and determine the object to be measured; A first adjustment module is used to adjust a first position of the object to be measured in a target direction to a first image position in the image, and obtain a first inclination angle of the monocular vision sensor; A second adjustment module is used to adjust a second position of the object to be measured in the target direction to a second image position in the image, and obtain a second inclination angle of the monocular vision sensor; The scale determination module is configured to determine a target scale between the first position to be measured and the second position to be measured based on the first inclination angle, the second inclination angle, and a reference scale of the monocular vision sensor in the target direction.

10. An electrical device, characterized in that: include: Monocular vision sensor for image acquisition; The electrical device further comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method according to any one of claims 1 to 7 when executing the program.

11. The electrical device according to claim 10, wherein: The electrical device further includes: an encoder and a motor, wherein the encoder is used to obtain a rotation angle of the motor, and the motor is used to drive the monocular vision sensor to rotate, and the computer program includes instructions for performing the following operations: driving the monocular vision sensor to rotate by the motor, adjusting the first position to be measured to a first image position in the image, and obtaining a first angle recorded by the encoder when the motor rotates from an initial position to a current position; determining the first inclination angle based on the first angle; and The monocular vision sensor is driven to rotate by the motor, the second position to be measured is adjusted to the second image position in the image, and the second angle recorded by the encoder when the motor rotates from the initial position to the current position is obtained; based on the second angle, the second inclination angle is determined.

12. A computer-readable storage medium, characterized in that A computer program is stored thereon, and when the program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.

Citation Information

Patent Citations

  • A method for lane departure distance measurement and early warning based on monocular vision

    CN102288121A

  • Monocular vision measuring method for large parts

    CN103759669A