Height measurement method for target object and display device
The method uses two cameras on a display device to calculate the physical height of an object by determining proportional distances between feature points and reference lines, addressing inefficiencies in existing smart mirror height measurement methods and enhancing user experience.
Patent Information
- Application Number
- CN202210395845.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-14
- Publication Date
- 2025-07-15
- Estimated Expiration
- 2042-04-14
AI Technical Summary
The efficiency of obtaining user height in the prior art is low, resulting in less efficiency in building a mannequin model for smart mirrors.
Using a dual camera system, by obtaining images taken by the first camera and the second camera, the distance between the characteristic points of the target object and the reference line is determined, and the physical height of the target object is calculated based on the pixel density of the field angle of the camera.
It improves the physical efficiency of target objects, simplifies user operations, and improves user experience.
Smart Images

Figure CN114782351B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of smart home, and particularly to a method for measuring the height of an object and a display device. Background Art
[0002] A smart mirror includes a mirror display panel capable of displaying images. The smart mirror can establish a human body model of a user and can display images of the human body model wearing different clothes on the mirror display panel. Thus, the user can see the dressing effects of different clothes without changing clothes.
[0003] In related technologies, the user can input their height in the interaction interface of the smart mirror, and the smart mirror can establish a human body model of the user based on the height. However, the efficiency of obtaining the height and establishing the human body model in the above manner is relatively low. Summary of the Invention
[0004] This application provides a method for measuring the height of an object and a display device, which can solve the problem of relatively low efficiency of obtaining the height of a user in related technologies. The technical solutions are as follows:
[0005] On the one hand, a display device is provided. The display device includes: a display panel, a processor, and a first camera and a second camera sequentially arranged along the height direction of the display panel; the processor is configured to:
[0006] Obtain a first image of the object captured by the first camera and a second image of the object captured by the second camera, where the second image is an overall image of the object;
[0007] Determine a first distance between a target feature point of the object in the first image and a first reference line, and a second distance between the target feature point of the object in the second image and a second reference line, where the first reference line is a median line extending along the pixel row direction in the first image, and the second reference line is a median line extending along the pixel row direction in the second image;
[0008] Based on the first distance, the second distance, and a target distance between the first camera and the second camera in the height direction, determine a ratio of a physical distance to a pixel distance in the second image;
[0009] Based on the pixel height of the object in the second image and the ratio, obtain the physical height of the object.
[0010] On the other hand, a method for measuring the height of an object is provided, which is applied to a display device. The display device includes: a display panel, a processor, and a first camera and a second camera sequentially arranged along the height direction of the display panel; the method includes:
[0011] Obtain a first image of the object captured by the first camera and a second image of the object captured by the second camera, where the second image is an overall image of the object;
[0012] Determine a first distance between a target feature point of the object in the first image and a first reference line, and a second distance between the target feature point in the second image and a second reference line. The first reference line is a median line extending along the pixel row direction in the first image, and the second reference line is a median line extending along the pixel row direction in the second image;
[0013] Based on the first distance, the second distance, and a target distance between the first camera and the second camera in the height direction, determine a ratio of the physical distance to the pixel distance in the second image;
[0014] Based on the pixel height of the object in the second image and the ratio, obtain the physical height of the object.
[0015] Optionally, the pixel density of the field of view angle of the first camera is different from that of the second camera. The pixel density of the field of view angle refers to the number of pixel rows corresponding to a unit field of view angle of the camera in the height direction. The determining the ratio of the physical distance to the pixel distance in the second image based on the first distance, the second distance, and the target distance between the first camera and the second camera in the height direction includes:
[0016] Based on the pixel density of the field of view angle of the first camera, the pixel density of the field of view angle of the second camera, and the first distance, determine an equivalent distance of the first distance in the second image;
[0017] Based on the sum of the equivalent distance and the second distance, and the target distance, determine the ratio of the physical distance to the pixel distance in the second image.
[0018] Optionally, the equivalent distance Satisfies:
[0019] ;
[0020] Wherein, Is the first distance, Is the pixel density of the first camera, is the pixel density of the second camera.
[0021] Optionally, before determining the equivalent distance of the first distance in the second image based on the field-of-view pixel density of the first camera, the field-of-view pixel density of the second camera, and the first distance, the method further includes:
[0022] Obtaining a first field of view and a first resolution of the first camera, and a second field of view and a second resolution of the second camera;
[0023] Based on the first field of view and the first resolution, determining the field-of-view pixel density of the first camera, where the field-of-view pixel density of the first camera is positively correlated with the first field of view and negatively correlated with the first resolution;
[0024] Based on the second field of view and the second resolution, determining the field-of-view pixel density of the second camera, where the field-of-view pixel density of the second camera is positively correlated with the second field of view and negatively correlated with the second resolution.
[0025] Optionally, the first resolution is different from the second resolution; determining the field-of-view pixel density of the first camera based on the first field of view and the first resolution includes:
[0026] Adjusting the resolution of the first image so that the resolution of the adjusted first image is the same as the resolution of the second image;
[0027] Based on the first field of view and the resolution of the adjusted first image, determining the field-of-view pixel density of the first camera;
[0028] The first distance is the distance between the target feature point of the target object in the adjusted first image and the first reference line.
[0029] Optionally, the ratio r satisfies:
[0030] ;
[0031] The physical height of the target object satisfies:
[0032] ;
[0033] where is the second distance, is the equivalent distance, is the target distance, is the pixel height of the target object.
[0034] In another aspect, a display device is provided. The display device includes: a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the height measurement method of the target object as described in the above aspect is implemented.
[0035] In yet another aspect, a computer-readable storage medium is provided. A computer program is stored in the computer-readable storage medium, and the computer program is loaded and executed by a processor to implement the height measurement method of the target object as described in the above aspect.
[0036] In yet another aspect, a computer program product including instructions is provided. When the computer program product runs on the computer, the computer is caused to execute the height measurement method of the target object as described in the above aspect.
[0037] The beneficial effects brought by the technical solution provided in this application at least include:
[0038] This application provides a height measurement method for a target object and a display device. The processor can determine the pixel distance caused by the target distance based on the first distance between the target feature point in the first image and the first reference line and the second distance between the target feature point in the second image and the second reference line, and then can determine the ratio of the physical distance to the pixel distance in the second image, and based on this ratio and the pixel height of the target object in the second image, determine the physical height of the target object. Since there is no need to manually input the physical height of the target object, the acquisition efficiency of the physical height of the target object is effectively improved. Moreover, the operation of the user is simplified and the user experience is enhanced. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the technical solutions in the embodiments of this application, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of this application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0040] Figure 1 is a schematic structural diagram of a display device provided by an embodiment of this application;
[0041] Figure 2 is a schematic structural diagram of another display device provided by an embodiment of this application;
[0042] Figure 3 is a schematic diagram of a screen displayed by a mirror display in a display mode provided by an embodiment of this application;
[0043] Figure 4It is a schematic diagram of the picture displayed by a mirror display in the mirror mode provided by an embodiment of the present application;
[0044] Figure 5 It is a schematic diagram of the principle for determining the height of a target object provided by an embodiment of the present application;
[0045] Figure 6 It is a schematic diagram of the calculation of the distances of each point in an image provided by an embodiment of the present application;
[0046] Figure 7 It is a schematic diagram of a target object photographed by a first camera and a second camera provided by an embodiment of the present application;
[0047] Figure 8 It is a schematic diagram of a first image provided by an embodiment of the present application;
[0048] Figure 9 It is a schematic diagram of a second image provided by an embodiment of the present application;
[0049] Figure 10 It is a flowchart of a method for measuring the height of a target object provided by an embodiment of the present application;
[0050] Figure 11 It is a flowchart of another method for measuring the height of a target object provided by an embodiment of the present application. Detailed implementation manners
[0051] To make the objectives, technical solutions, and advantages of the present application clearer, the following will further describe the embodiments of the present application in detail with reference to the accompanying drawings.
[0052] A display device provided by an embodiment of the present application. Refer to Figure 1 and Figure 2 , the display device may include: a display panel 01, a processor ( Figure 1 and Figure 2 not shown in the figures), and a first camera 02 and a second camera 03 sequentially arranged along the height direction of the display panel 01. The processor is respectively connected to the first camera 02 and the second camera 03. For example, the processor may be connected to the first camera 02 and the second camera 03 respectively through a universal serial bus (USB).
[0053] Wherein, the target distance between the first camera 02 and the second camera 03 in the height direction of the display panel 01 is greater than a distance threshold. The height direction may be parallel to the pixel column direction of the display panel 01. The distance threshold is greater than or equal to 0.
[0054] Optionally, the display device may be Figure 1The television shown. Alternatively, the display device may be Figure 2 The mirror display shown (which may also be referred to as a smart mirror). Please continue to refer to Figure 2 , the mirror display may further include: a mirror reflection panel 04, and the mirror reflection panel 04 may display a mirror image. It can be understood that the display panel 01 included in the mirror display has two working modes: a mirror mode and a display mode. In the display mode, refer to Figure 3 , the display panel 01 can display images, controls, etc. (such as Figure 3 weather in Figure 4 , and hot news). In the mirror mode, refer to Figure 4 , the display panel 01 can display a mirror image. And it can be seen from
[0055] In the embodiments of the present application, both the first camera 02 and the second camera 03 can capture a target object, and can send the captured images to the processor. Correspondingly, the processor can obtain a first image captured by the first camera 02 of the target object, and a second image captured by the second camera 03 of the target object. Among them, the first image may be an overall image of the target object, or may be a partial image of the target object (such as a face image). The second image is an overall image of the target object. Moreover, both the first image and the second image include target feature points of the target object. In addition, the acquisition time of the first image and the acquisition time of the second image are the same. That is, the first camera 02 and the second camera 03 can capture the target object simultaneously.
[0056] In the embodiments of the present application, as Figure 5 shown, an object M has a feature point m. A camera 10 captures the object M to obtain an image 1 when in the initial position. Then, the object M remains in the original position unchanged, and the camera 10 moves along Figure 5When the camera 10 moves to the second position in the H direction shown, the object M is photographed to obtain Image 2. The camera 10 moves to the third position to photograph the object M to obtain Image 3. By comparing Image 1 to Image 3, it can be seen that the position of the feature point m is different in different images, which is caused by the change in the position of the camera 10. Moreover, when the feature points in Image 1 to Image 3 are all converted to Image 4 (in Image 4, m1 is converted from the feature point m in Image 1, m2 is converted from the feature point m in Image 2, and m3 is converted from the feature point m in Image 3), it can be seen that as the distance between the position of the camera 10 after movement and the initial position increases, the distance between the target feature point photographed by the camera 10 after the position movement and m1 in the pixel column direction also increases. That is, for the feature points in two images collected by the camera at two different positions, the distance in the same image coordinate system is related to the distance between these two different positions. Among them, Image 4 can be any one of Image 1 to Image 3. The image coordinate system can refer to: a coordinate system established with the upper left vertex of the image as the origin, the pixel row extension direction as the x-axis direction, and the pixel column extension direction as the y-axis direction.
[0057] The first camera 02 and the second camera 03 in the embodiments of the present application can be regarded as the above-mentioned camera 10 at different positions. However, since Figure 5 the position of the camera 10 in [description] only changes in the H direction and does not change in other directions, the feature point m in Image 1 to Image 3 is on the same straight line after being converted to Image 4. While there may be a distance between the first camera 02 and the second camera 03 in other directions (such as in the pixel row direction of the display panel) except for the height direction of the display panel 01, so the target feature point in the first image and the target feature point in the second image may not be on the same straight line in the same image coordinate system. If the proportional relationship between the physical distance and the pixel distance in the second image is directly determined based on the distance between the target feature point in the first image and the target feature point in the second image in the same image coordinate system, and the target distance between the first camera 02 and the second camera 03, there may be a problem of inaccurate determination of the proportional relationship.
[0058] Please continue to refer to Figure 5 and Figure 6, regardless of whether m1 to m3 are on the same straight line, the distance between m1 and m2 is equal to the difference obtained by subtracting the distance D2 between m2 and the reference line L from the distance D1 between m1 and the reference line L. The distance between m1 and m3 is equal to the sum obtained by adding the distance D3 between m3 and the reference line L to the distance D1 between m1 and the reference line L. Wherein, the reference line L is the median line extending along the pixel row direction of the image shown in Image 4. And when the resolutions of Image 1 to Image 3 are the same, when the orthographic projections of Image 1 to Image 3 on any image plane coincide, the orthographic projections of the reference lines of Image 1 to Image 3 on this plane also coincide.
[0059] Based on this, after the processor obtains the first image and the second image, it can determine the first distance between the target feature point of the target object in the first image and the first reference line, and the second distance between the target feature point in the second image and the second reference line, and determine the ratio of the physical distance to the pixel distance in the second image based on the first distance, the second distance, and the target distance. Then, the processor can determine the physical height of the target object based on the pixel height of the target object in the second image and this ratio.
[0060] Wherein, the physical height is positively correlated with both the pixel height of the target object in the second image and this ratio. The pixel height of the target object in the second image can be the distance between the two farthest pixel points included in the target object in the second image in the pixel column direction. This distance can be the length of the perpendicular line segment between the pixel rows where the two farthest pixel points are located, or can be the total number of pixel rows between the two farthest pixel points. The first reference line is the median line extending along the pixel row direction in the first image, and the second reference line is the median line extending along the pixel row direction in the second image.
[0061] In summary, the embodiment of the present application provides a method for measuring the height of a target object. The processor can determine the pixel distance generated due to the target distance based on the first distance between the target feature point in the first image and the first reference line, and the second distance from the target feature point in the second image to the second reference line, and then can determine the ratio of the physical distance to the pixel distance in the second image, and determine the physical height of the target object based on this ratio and the pixel height of the target object in the second image. Since there is no need to manually input the physical height of the target object, the acquisition efficiency of the physical height of the target object is effectively improved. And, it simplifies the operation of the user and enhances the user experience.
[0062] In the embodiment of the present application, the distance between the target feature point and the reference line (i.e., the above-mentioned first reference line or second reference line) can refer to: the total number of pixel rows between the target feature point and the reference line, or can refer to the length of the perpendicular line segment from the target feature point to the reference line.
[0063] Optionally, seeFigure 7 The target object A can be a human body. The target feature points can be the feature points on the face of the target object (such as the tip of the nose a, the corners of the eyes, etc.), or can be the limb feature points of the target object (such as the feature points at the wrist). Both the first camera 02 and the second camera 03 can be red (R), green (G), and blue (B) cameras. The first camera 02 can be located at a height of 165 centimeters (cm) of the smart mirror, and the second camera 03 can be located at a height of 100 cm of the smart mirror, that is, the target distance can be 65 cm.
[0064] In the embodiment of the present application, if the field of view angle pixel density of the first camera is the same as that of the second camera, the processor can directly determine the ratio of the physical distance to the pixel distance in the second image based on the sum of the first distance and the second distance, and the target distance. The field of view angle pixel density of the camera refers to the number of pixel rows corresponding to the unit field of view angle in the height direction of the camera.
[0065] For example, the ratio r can satisfy the following formula:
[0066] Formula (1)
[0067] Formula (1), is the first distance, is the second distance, is the target distance.
[0068] If the field of view angle pixel density of the first camera is different from that of the second camera, the processor can first determine the equivalent distance of the first distance in the second image based on the field of view angle pixel density of the first camera 02 and the field of view angle pixel density of the second camera 03. Then, the processor can determine the ratio of the physical distance to the pixel distance in the second image based on the sum of the second distance and the equivalent distance, and the target distance.
[0069] Optionally, the equivalent distance of the first distance between the target feature point of the target object in the first image and the first reference line in the second image can satisfy the following formula:
[0070] Formula (2)
[0071] In Formula (2), is the pixel density of the first camera 02, is the pixel density of the second camera 03.
[0072] The ratio r of the physical distance to the pixel distance in the second image can satisfy the following formula:
[0073] Formula (3)
[0074] The physical height of the target object can satisfy the following formula:
[0075] Formula (4)
[0076] In Formula (4), is the pixel height of the target object.
[0077] In an embodiment of the present application, the processor may obtain the first field of view angle and the first resolution of the first camera 02, and the second field of view angle and the second resolution of the second camera 03. Among them, the field of view angle of the camera refers to the diagonal field of view angle. Then, the processor determines the field of view angle pixel density of the first camera 02 based on the first field of view angle and the first resolution, and determines the field of view angle pixel density of the second camera 03 based on the second field of view angle and the second resolution. Among them, the field of view angle pixel density of the second camera is positively correlated with the second field of view angle and negatively correlated with the second resolution. The field of view angle pixel density of the first camera is positively correlated with the first field of view angle and negatively correlated with the first resolution.
[0078] For example, the processor may use the Pythagorean theorem to process the camera resolution to obtain the total number of pixels on the diagonal of the image captured by the camera, and then may determine the quotient of the total number and the field of view angle of the camera as the field of view angle pixel density of the camera. Among them, the resolution of the image captured by the camera is the same as the resolution of the camera.
[0079] For example, assume that the first field of view angle of the first camera 02 is 40 degrees (°), the second field of view angle of the second camera 03 is 110°, and the resolutions of the first camera 02 and the second camera 03 are both 1080*1920. Then the field of view angle pixel density of the first camera 02 satisfies: , and the field of view angle pixel density of the second camera 03 satisfies: .
[0080] Optionally, the field of view angle of the first camera 02 and the field of view angle of the second camera 03 may be the same or different. For example, referring to Figure 7 , the field of view angle α of the first camera 02 may be less than the field of view angle β of the second camera 03.
[0081] The first resolution of the first camera 02 and the second resolution of the second camera 03 may be the same or different. If the first resolution of the first camera 02 is different from the second resolution of the second camera 03, before determining the field-of-view angular pixel density of the first camera 02, the processor may first adjust the resolution of the first image so that the resolution of the adjusted first image is the same as that of the second image. After that, the processor may determine the field-of-view angular pixel density of the first camera based on the resolution of the adjusted first image, and determine the distance between the target feature point of the target object in the adjusted first image and the first reference line as the first distance.
[0082] In the embodiments of the present application, please continue to refer to Figure 5 and Figure 6 , m1 and m2 are on the same side of the reference line L, and the distance between m1 and m2 is equal to the difference obtained by subtracting D2 from D1. m1 and m3 are on different sides of the reference line L, and the distance between m1 and m3 is equal to the sum obtained by adding D3 to D1. Based on this, if the target feature point in the first image is on the first side of the first reference line and the target feature point in the second image is on the first side of the second reference line, or if the target feature point in the first image is on the second side of the first reference line and the target feature point in the second image is on the second side of the second reference line, the signs of the first distance (or equivalent distance) and the second distance may be opposite. Correspondingly, the sum of the first distance (or equivalent distance) and the second distance refers to the absolute value of the difference obtained by subtracting the absolute value of the second distance from the absolute value of the first distance (or equivalent distance).
[0083] If the target feature point in the first image is on the first side of the first reference line and the target feature point in the second image is on the second side of the second reference line, or if the target feature point in the first image is on the second side of the first reference line and the target feature point in the second image is on the first side of the second reference line, the signs of the first distance (or equivalent distance) and the second distance may be the same. Correspondingly, the sum of the first distance (or equivalent distance) and the second distance refers to the sum of the absolute value of the first distance (or equivalent distance) and the absolute value of the second distance.
[0084] Wherein, the first side of the reference line in each of the first image and the second image may be the upper half of the image, and the second side of the reference line may be the lower half of the image. Or, the first side of the reference line in each of the first image and the second image may be the lower half of the image, and the second side of the reference line may be the upper half of the image.
[0085] For example, assume that the first side of the reference line in each of the first image and the second image is the upper half of the image, the second side of the reference line is the lower half of the image, and the target feature point of the target object is the tip of the nose of the target object. Please continue to refer toFigure 7 , within the field of view of the first camera 02, the tip of the nose a is located on the side of the optical axis g1 of the first camera 02 closer to the second camera 03. Correspondingly, referring to Figure 8 , the tip of the nose in the first image captured by the first camera 02 is located in the lower half of the first reference line L1.
[0086] As Figure 7 shown, within the field of view of the second camera 03, the tip of the nose a is located on the side of the optical axis g2 of the second camera 03 closer to the first camera 02. Correspondingly, referring to Figure 9 , the tip of the nose in the second image captured by the second camera 03 is located in the upper half of the second reference line L2.
[0087] Since the tip of the nose of the object in the first image is located in the lower half of the first reference line L1, and the tip of the nose of the object in the second image is located in the upper half of the second reference line L2, the processor can determine that the first distance d1 between the tip of the nose in the first image and the first reference line L1 and the first distance d2 between the tip of the nose in the second image and the second reference line L2 have opposite signs.
[0088] In the embodiment of the present application, as Figure 1 and Figure 2 shown, the straight line where the first camera 02 and the second camera 03 are located can extend along the height direction of the display panel 01. That is to say, the first camera 02 and the second camera 03 can be located on the same side of the display panel. Or, the extension direction of the straight line where the first camera 02 and the second camera 03 are located can intersect with the height direction of the display panel 01 of the display device. That is to say, the first camera 02 and the second camera 03 can be distributed on both sides of the display panel. Both the first camera 02 and the second camera 03 can include lenses, and the planes where the lenses of the first camera 02 and the lenses of the second camera 03 are located can be parallel to the display panel 01.
[0089] In summary, the embodiment of the present application provides a method for measuring the height of an object. The processor can determine the pixel distance caused by the object distance based on the first distance between the target feature point in the first image and the first reference line, the second distance from the target feature point in the second image to the second reference line, the pixel density of the field of view angle of the first camera, and the pixel density of the field of view angle of the second camera. Then, it can determine the ratio of the physical distance to the pixel distance in the second image, and based on this ratio and the pixel height of the object in the second image, determine the physical height of the object. Since there is no need to manually input the physical height of the object, the acquisition efficiency of the physical height of the object is effectively improved. Moreover, the operation of the user is simplified, and the user experience is enhanced.
[0090] An embodiment of the present application provides a method for measuring the height of an object, which can be applied to a display device (such as a processor of the display device). The display device includes: a display panel, a processor, and a first camera and a second camera sequentially arranged along the height direction of the display panel. For example, Figure 1 or Figure 2 the display device shown. Refer to Figure 10 , the method includes:
[0091] Step 101, obtain a first image of the object captured by the first camera and a second image of the object captured by the second camera.
[0092] Wherein, the second image is an overall image of the object.
[0093] Step 102, determine a first distance between a target feature point of the object in the first image and a first reference line, and a second distance between the target feature point of the object in the second image and a second reference line.
[0094] Wherein, the first reference line is a midline extending along the pixel row direction in the first image, and the second reference line is a midline extending along the pixel row direction in the second image.
[0095] Step 103, based on the first distance, the second distance, and the target distance between the first camera and the second camera in the height direction, determine the ratio of the physical distance to the pixel distance in the second image.
[0096] Optionally, if the field-of-view pixel density of the first camera is equal to the field-of-view pixel density of the second camera, the display device can directly determine the ratio of the physical distance to the pixel distance in the second image based on the sum of the first distance and the second distance and the target distance.
[0097] Step 104, based on the pixel height of the object in the second image and the ratio, obtain the physical height of the object.
[0098] Wherein, the physical height of the object is positively correlated with both the pixel height of the object in the second image and the ratio.
[0099] In summary, the embodiment of the present application provides a method for measuring the height of an object. The display device can determine the pixel distance caused by the object distance based on the first distance between the target feature point in the first image and the first reference line, the second distance between the target feature point in the second image and the second reference line, the field of view pixel density of the first camera, and the field of view pixel density of the second camera. Then, the ratio of the physical distance to the pixel distance in the second image can be determined, and based on this ratio and the pixel height of the object in the second image, the physical height of the object can be determined. Since there is no need to manually input the physical height of the object, the acquisition efficiency of the physical height of the object is effectively improved. Moreover, the operation of the user is simplified and the user experience is enhanced.
[0100] Figure 11 FIG. is a flowchart of another method for measuring the height of an object provided by an embodiment of the present application. This method can be applied to the processor of a display device. Refer to Figure 11 , this method may include:
[0101] Step 201, obtain a first image of the object captured by a first camera and a second image of the object captured by a second camera.
[0102] Wherein, the second image is an overall image of the object;
[0103] Step 202, determine a first distance between a target feature point of the object in the first image and a first reference line, and a second distance between the target feature point of the object in the second image and a second reference line.
[0104] Wherein, the first reference line is a midline extending along the pixel row direction in the first image, and the second reference line is a midline extending along the pixel row direction in the second image.
[0105] Optionally, if the resolution of the first image is different from the resolution of the second image, the first distance is the distance between the target feature point of the object in the adjusted first image and the first reference line. The resolution of the adjusted first image is the same as the resolution of the second image.
[0106] Step 203, obtain a first field of view angle and a first resolution of the first camera, and a second field of view angle and a second resolution of the second camera.
[0107] Step 204, determine the field of view pixel density of the first camera based on the first field of view angle and the first resolution.
[0108] Optionally, if the resolution of the first image is different from that of the second image, the display device may first adjust the resolution of the first image so that the adjusted resolution of the first image is the same as that of the second image. Thereafter, the display device may determine the field-of-view pixel density of the first camera based on the first field of view and the adjusted resolution of the first image.
[0109] Step 205: Determine the field-of-view pixel density of the second camera based on the second field of view and the second resolution.
[0110] Step 206: Detect whether the field-of-view pixel density of the first camera is the same as that of the second camera.
[0111] If the display device determines that the field-of-view pixel density of the first camera is the same as that of the second camera, then step 207 is executed. If the display device determines that the field-of-view pixel density of the first camera is different from that of the second camera, then step 208 may be executed.
[0112] Step 207: Determine the ratio of the physical distance to the pixel distance in the second image based on the sum of the first distance and the second distance, and the target distance.
[0113] If the display device determines that the field-of-view pixel density of the first camera is the same as that of the second camera, then it may determine the ratio of the physical distance to the pixel distance in the second image based on the sum of the first distance and the second distance, and the target distance.
[0114] Step 208: Determine the equivalent distance of the first distance in the second image based on the field-of-view pixel density of the first camera, the field-of-view pixel density of the second camera, and the first distance.
[0115] If the display device determines that the field-of-view pixel density of the first camera is the same as that of the second camera, then it may determine the equivalent distance of the first distance in the second image based on the field-of-view pixel density of the first camera, the field-of-view pixel density of the second camera, and the first distance.
[0116] Optionally, this equivalent distance may satisfy: .
[0117] Step 209: Determine the ratio of the physical distance to the pixel distance in the second image based on the sum of the equivalent distance and the second distance, and the target distance.
[0118] After the display device determines the equivalent distance, it can determine the ratio of the physical distance to the pixel distance in the second image based on the sum of the equivalent distance and the second distance, and the target distance.
[0119] Optionally, the ratio r may satisfy: .
[0120] Step 210: Obtain the physical height of the target object based on the pixel height and ratio of the target object in the second image.
[0121] Wherein, the physical height of the target object is positively correlated with both the pixel height of the target object in the second image and the ratio.
[0122] It should be noted that the order of the steps of the target object height measurement method provided in the embodiments of the present application can be appropriately adjusted, and the steps can also be increased or decreased accordingly based on the situation. Any person skilled in the art can easily think of a changed method within the technical scope disclosed in the present application, which should be covered within the protection scope of the present application, so it will not be elaborated here.
[0123] In summary, the embodiments of the present application provide a method for measuring the height of a target object. The display device can determine the pixel distance caused by the target distance based on the first distance between the target feature point and the first reference line in the first image, the second distance between the target feature point and the second reference line in the second image, the field of view angle pixel density of the first camera, and the field of view angle pixel density of the second camera. Then, it can determine the ratio of the physical distance to the pixel distance in the second image, and based on this ratio and the pixel height of the target object in the second image, determine the physical height of the target object. Since there is no need to manually input the physical height of the target object, the acquisition efficiency of the physical height of the target object is effectively improved. Moreover, the operation of the user is simplified, and the user experience is enhanced.
[0124] The embodiments of the present application provide a display device, which may include a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, it implements the method for measuring the height of a target object provided in the above embodiments, such as Figure 10 or Figure 11 the method shown.
[0125] The embodiments of the present application provide a computer-readable storage medium, in which a computer program is stored. The computer program is loaded and executed by the processor to implement the method for measuring the height of a target object provided in the above embodiments, such as Figure 10 or Figure 11 the method shown.
[0126] The embodiments of the present application further provide a computer program product containing instructions. When the computer program product runs on a computer, it causes the computer to execute the method for measuring the height of a target object provided in the above method embodiments, such as Figure 10 or Figure 11 the method shown.
[0127] Those of ordinary skill in the art can understand that all or part of the steps to implement the above embodiments can be completed by hardware, or can be completed by instructing relevant hardware through a program. The program can be stored in a computer-readable storage medium. The storage medium mentioned above can be a read-only memory, a magnetic disk, an optical disc, or the like.
[0128] It should be understood that the "and / or" mentioned in this article represents three relationships that can exist. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. The character " / " generally represents an "or" relationship between the associated objects before and after. Also, the meaning of the term "at least one" in this application is one or more, and the meaning of the term "a plurality" in this application is two or more.
[0129] The terms "first", "second", etc. in this application are used to distinguish between identical or similar items with basically the same functions. It should be understood that there is no logical or temporal dependency between "first", "second", and "nth", nor are the quantity and execution order limited. For example, without departing from the scope of various examples, the first camera can be called the second camera, and similarly, the second camera can be called the first camera.
[0130] The above are only exemplary embodiments of this application and are not intended to limit this application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of this application shall be included within the protection scope of this application.
Claims
1. A display device, characterized in that, The display device includes: a display panel, a processor, and a first camera and a second camera sequentially arranged along the height direction of the display panel; the processor is configured to: Obtain a first image captured by the first camera of the target object and a second image captured by the second camera of the target object, where the second image is an overall image of the target object; Determine a first distance between a target feature point of the target object in the first image and a first reference line, and a second distance between the target feature point in the second image and a second reference line, where the first reference line is a median line extending along the pixel row direction in the first image, and the second reference line is a median line extending along the pixel row direction in the second image; Based on the first distance, the second distance, and a target distance between the first camera and the second camera in the height direction, determine a ratio of the physical distance to the pixel distance in the second image; Based on the pixel height of the target object in the second image and the ratio, obtain the physical height of the target object; Wherein, the pixel density of the field of view angle of the first camera is different from that of the second camera, and the pixel density of the field of view angle refers to the number of pixel rows corresponding to a unit field of view angle of the camera in the height direction; the processor is configured to: Based on the pixel density of the field of view angle of the first camera, the pixel density of the field of view angle of the second camera, and the first distance, determine an equivalent distance of the first distance in the second image; Based on the sum of the equivalent distance and the second distance, and the target distance, determine a ratio of the physical distance to the pixel distance in the second image.
2. The display device according to claim 1, wherein The equivalent distance d3 satisfies: Where d1 is the first distance, m1 is the pixel density of the first camera, and m2 is the pixel density of the second camera.
3. The display device according to claim 1, wherein The processor is further configured to: Obtain a first field of view angle and a first resolution of the first camera, and a second field of view angle and a second resolution of the second camera; Based on the first field of view angle and the first resolution, determine the pixel density of the field of view angle of the first camera, where the pixel density of the field of view angle of the first camera is positively correlated with the first field of view angle and negatively correlated with the first resolution; Based on the second field of view angle and the second resolution, determine the pixel density of the field of view angle of the second camera, where the pixel density of the field of view angle of the second camera is positively correlated with the second field of view angle and negatively correlated with the second resolution.
4. The display device according to claim 3, wherein, The first resolution is different from the second resolution; the processor is further configured to: Adjust the resolution of the first image, and the resolution of the adjusted first image is the same as that of the second image; Based on the first field of view angle and the resolution of the adjusted first image, determine the pixel density of the field of view angle of the first camera; The first distance is the distance between the target feature point of the target object in the adjusted first image and the first reference line.
5. The display device according to claim 1, wherein The ratio r satisfies: The physical height h of the target object w Satisfies: h w = h x × r; Wherein, d2 is the second distance, d3 is the equivalent distance, d4 is the target distance, and h x is the pixel height of the target object.
6. The display device according to any one of claims 1 to 5, characterized in that, The straight line where the first camera and the second camera are located extends along the height direction.
7. The display device according to any one of claims 1 to 5, characterized in that The field of view angle of the first camera is smaller than that of the second camera.
8. A method for measuring the height of an object, characterized in that, Applied to a display device, the display device includes: a display panel, a processor, and a first camera and a second camera sequentially arranged along the height direction of the display panel; the method includes: Obtain a first image obtained by the first camera photographing a target object and a second image obtained by the second camera photographing the target object, where the second image is an overall image of the target object; Determine a first distance between a target feature point of the target object in the first image and a first reference line, and a second distance between the target feature point in the second image and a second reference line, where the first reference line is a midline extending along the pixel row direction in the first image, and the second reference line is a midline extending along the pixel row direction in the second image; Based on the first distance, the second distance, and a target distance between the first camera and the second camera in the height direction, determine a ratio of the physical distance to the pixel distance in the second image; Based on the pixel height of the target object in the second image and the ratio, obtain the physical height of the target object; Wherein, the field of view angle pixel density of the first camera is different from that of the second camera, and the field of view angle pixel density refers to the number of pixel rows corresponding to a unit field of view angle of the camera in the height direction; the determining the ratio of the physical distance to the pixel distance in the second image based on the first distance, the second distance, and the target distance between the first camera and the second camera in the height direction includes: Based on the field of view angle pixel density of the first camera, the field of view angle pixel density of the second camera, and the first distance, determine an equivalent distance of the first distance in the second image; Based on the sum of the equivalent distance and the second distance, and the target distance, determine the ratio of the physical distance to the pixel distance in the second image.
Citation Information
Patent Citations
Scientific and technological detection method based on medical robot
CN113873119A