To-be-measured index calculation method and device, electronic equipment and storage medium
The method uses image processing to calculate body dimensions by correlating pixel counts with physical measurements, improving efficiency and accuracy in orthopedic clinical assessments.
Patent Information
- Application Number
- CN202510462446.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-11
- Publication Date
- 2025-07-15
AI Technical Summary
In orthopedic clinical body measurement, there is a problem that manual measurement is time-consuming, labor-intensive, low efficiency, and large subjective deviations, making it difficult to meet unified standards.
The number of pixels of the reference object to be measured and the reference object of the known physical size in the image is determined through image processing technology, and the distance from the reference object to be measured and the distance from the lens to be measured is calculated, and the correspondence between the unit pixel of the index to be measured and the physical size is realized to realize contactless measurement.
Improve measurement efficiency, reduce labor costs, ensure the accuracy and consistency of measurement results, and provide more comprehensive data support for orthopedic diagnosis.
Smart Images

Figure CN120304814A_ABST
Abstract
Description
Technical Field
[0001] One or more embodiments of the present disclosure relate to the technical field of dimension calculation, and in particular, to a method, device, electronic device, and storage medium for calculating an index to be measured. Background Art
[0002] In orthopedic clinical postural measurement, it mainly relies on medical service personnel to manually measure each item of human body indexes (such as shoulder height, shoulder width, leg length, cervical curvature depth, etc.) through traditional measuring tools (such as soft rulers, calipers, etc.).
[0003] In the above method, medical service personnel need to have close contact with the measured person and manually determine and mark the measurement point data one by one. It can be seen that this method is time-consuming and laborious, and each medical staff can only serve one patient at the same time, with low efficiency; especially when measurements need to be taken from multiple angles (such as standing position, sitting position, front and side), the whole process becomes more complex and time-consuming, increasing the time cost; in addition, the manual measurement results are easily affected by the subjective judgment of the operator, resulting in positioning deviation, and the differences in the operation habits and experience of different medical staff make it difficult to reach a unified standard for measurement data, thus affecting the accuracy and consistency of the measurement results. Summary of the Invention
[0004] In order to solve the technical problems of high labor cost, low efficiency and subjective deviation in orthopedic clinical postural measurement, the present disclosure provides a method for calculating an index to be measured, and the method includes:
[0005] Determine the number of pixels corresponding to the index to be measured and the reference object with a known physical size in the collected image respectively, wherein the index to be measured and the reference object are in the same or different images, and the different images are obtained by cameras with the same focal length;
[0006] Determine the corresponding relationship between the unit pixel of the reference object and the physical size according to the physical size of the reference object and the number of pixels corresponding to the reference object;
[0007] Collect the distances from the focal planes of the reference object and the index to be measured to the lens respectively, so as to determine the corresponding relationship between the unit pixel of the index to be measured and the physical size according to the distances from the focal planes of the two to the lens and the corresponding relationship between the unit pixel of the reference object and the physical size;
[0008] Calculate the index to be measured according to the corresponding relationship between the unit pixel of the index to be measured and the physical size and the number of pixels corresponding to the index to be measured.
[0009] Optionally, the determining the number of pixels corresponding to the index to be measured and the reference object with a known physical size in the collected image respectively includes:
[0010] Determine the two end measurement points corresponding to the to-be-measured index and the reference object with known physical dimensions in the acquired image respectively;
[0011] Based on the distance between the two end measurement points corresponding to the to-be-measured index in the acquired image, obtain the number of pixels corresponding to the to-be-measured index in the acquired image;
[0012] Based on the distance between the two end measurement points corresponding to the reference object in the acquired image, obtain the number of pixels corresponding to the reference object in its image.
[0013] Optionally, when the to-be-measured index is in a human body image, determining the two end measurement points corresponding to the to-be-measured index in the acquired image includes:
[0014] Collect the feature points of the human body included in the human body image, where the feature points include the joint points and facial feature points of the human body;
[0015] If the to-be-measured index is a physical dimension corresponding to the distance between two end feature points, determine the two end feature points related to the to-be-measured index among the feature points of the human body included in the acquired human body image;
[0016] Determine the two end feature points related to the to-be-measured index as the two end measurement points corresponding to the to-be-measured index in the human body image.
[0017] Optionally, when the to-be-measured index is in a human body image, determining the two end measurement points corresponding to the to-be-measured index in the acquired image includes:
[0018] Collect the contour map of the human body image and the feature points of the human body included in the human body image, where the feature points include the joint points and facial feature points of the human body, and the contour map is used to determine the contour edge points of the human body included in the human body image;
[0019] Based on whether the to-be-measured index involves the contour edge points of the human body, determine at least one contour edge point among the contour edge points of the human body as the measurement point corresponding to the to-be-measured index in the human body image.
[0020] Optionally, the step of determining at least one contour edge point among the contour edge points of the human body as the measurement point corresponding to the to-be-measured index in the human body image based on whether the to-be-measured index involves the contour edge points of the human body includes:
[0021] If the to-be-measured index is a physical dimension corresponding to the distance between one end feature point and a contour edge point of the human body, use this feature point as one end measurement point corresponding to the to-be-measured index in the human body image;
[0022] Starting from the end measurement point, perform pixel-by-pixel scanning in the measurement direction corresponding to the measurement index to be measured, and then use the obtained human body contour edge points as the other end measurement point corresponding to the measurement index to be measured in the human body image.
[0023] Optionally, determining at least one contour edge point as the measurement point corresponding to the measurement index to be measured in the human body image according to whether the measurement index to be measured involves the contour edge points of the human body includes:
[0024] If the measurement index to be measured is a physical dimension corresponding to the distance between two contour edge points of the human body, determine the scanning range corresponding to the measurement index to be measured according to the contour map of the human body image and the feature points, and perform row-by-row scanning within the scanning range to obtain a number of human body contour edge points;
[0025] According to the measurement position of the human body by the measurement index to be measured, the scanning direction of row-by-row scanning, and the numerical sizes of the number of human body contour edge points in a specific direction, determine the two end measurement points corresponding to the measurement index to be measured among the number of human body contour edge points.
[0026] Optionally, determining at least one contour edge point as the measurement point corresponding to the measurement index to be measured in the human body image according to whether the measurement index to be measured involves the contour edge points of the human body includes:
[0027] If the measurement index to be measured needs to be measured between two contour edge points of the human body, select a target feature point from the feature points according to the measurement position of the human body by the measurement index to be measured;
[0028] Starting from the target feature point, perform pixel-by-pixel scanning in the two measurement directions corresponding to the measurement index to be measured respectively, and then use the two obtained human body contour edge points as the two end measurement points corresponding to the measurement index to be measured in the human body image.
[0029] The present disclosure also provides a device for calculating a measurement index to be measured, and the device includes:
[0030] A first determination unit, configured to determine the number of pixels corresponding to the measurement index to be measured and a reference object with a known physical dimension in the acquired image respectively, where the measurement index to be measured and the reference object are in the same or different images, and the different images are obtained by cameras with the same focal length;
[0031] A second determination unit, configured to determine the correspondence between the unit pixel of the reference object and the physical dimension according to the physical dimension of the reference object and the number of pixels corresponding to the reference object;
[0032] A third determination unit, configured to collect the distances from the focal planes of the reference object and the to-be-measured index to the lens respectively, and determine the corresponding relationship between the unit pixel and the physical size of the to-be-measured index according to the distances from the focal planes of the two to the lens and the corresponding relationship between the unit pixel and the physical size of the reference object;
[0033] A calculation unit, configured to calculate the to-be-measured index according to the corresponding relationship between the unit pixel and the physical size of the to-be-measured index and the number of pixels corresponding to the to-be-measured index.
[0034] The present disclosure further provides an electronic device, including a communication interface, a processor, a memory, and a bus, where the communication interface, the processor, and the memory are interconnected with each other through the bus;
[0035] Machine-readable instructions are stored in the memory, and the processor executes the above method by calling the machine-readable instructions.
[0036] The present disclosure further provides a machine-readable storage medium, where machine-readable instructions are stored in the machine-readable storage medium, and when the machine-readable instructions are called and executed by a processor, the above method is implemented.
[0037] In the above manner, the technical solution of the present disclosure calculates the corresponding relationship between the unit pixel and the physical size of the reference object by determining the number of pixels corresponding to the to-be-measured index and the reference object with a known physical size in the collected image respectively, and then combines the distances from the focal planes of the reference object and the to-be-measured index to the lens to determine the corresponding relationship between the unit pixel and the physical size of the to-be-measured index, and finally calculates the to-be-measured index. This process can not only quickly and efficiently complete the size calculation in a standardized manner, improve the measurement efficiency, reduce the labor cost, but also accurately measure the values of multiple to-be-measured indicators, provide more comprehensive data support for orthopedic clinical diagnosis, and improve the scientificity and accuracy of the diagnosis. Description of the Drawings
[0038] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the drawings in the following description are only some embodiments recorded in the present disclosure. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0039] Figure 1 is a flowchart of a method for calculating a to-be-measured index shown in an exemplary embodiment;
[0040] Figure 2 is a schematic diagram of a human feature point shown in an exemplary embodiment;
[0041] Figure 3 It is a schematic diagram showing a method for determining anthropometric points in an exemplary embodiment;
[0042] Figure 4 It is a schematic diagram showing an outline of a human body image in an exemplary embodiment;
[0043] Figure 5 It is a schematic diagram showing another method for determining anthropometric points in an exemplary embodiment;
[0044] Figure 6 It is a schematic diagram showing yet another method for determining anthropometric points in an exemplary embodiment;
[0045] Figure 7 It is a schematic diagram showing an example of obtaining contour edge points by scanning in an exemplary embodiment;
[0046] Figure 8 It is a schematic diagram showing another example of obtaining contour edge points by scanning in an exemplary embodiment;
[0047] Figure 9 It is a flowchart showing another method for calculating a measurement index to be measured in an exemplary embodiment;
[0048] Figure 10 It is a hardware structure diagram of an electronic device shown in an exemplary embodiment;
[0049] Figure 11 It is a block diagram of a device for calculating a measurement index to be measured shown in an exemplary embodiment. Detailed implementation manners
[0050] In order to enable those skilled in the art to better understand the technical solutions in this disclosure, the following will clearly and completely describe the technical solutions in the embodiments of this disclosure with reference to the accompanying drawings in the embodiments of this disclosure. Obviously, the described embodiments are only a part of the embodiments of this disclosure, rather than all of the embodiments. Based on the embodiments in this disclosure, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the scope of protection of this disclosure.
[0051] It should be noted that: in other embodiments, the steps of the corresponding methods are not necessarily executed in the order shown and described in this disclosure. In some other embodiments, the steps included in the method may be more or less than those described in this disclosure. In addition, a single step described in this disclosure may be decomposed into multiple steps for description in other embodiments; and multiple steps described in this disclosure may also be combined into a single step for description in other embodiments.
[0052] In orthopedic clinical postural measurement, it mainly relies on medical staff to manually measure each human body index (such as shoulder height, shoulder width, leg length, neck curve depth, etc.) item by item through traditional measuring tools (such as soft rulers, calipers, etc.).
[0053] In the above method, medical staff need to have close contact with the measured person and manually determine and mark the measurement point data one by one. It can be seen that this method is time-consuming and laborious, and each medical staff can only serve one patient at a time, with low efficiency; especially when measurements need to be taken from multiple angles (such as standing position, sitting position, front and side), the whole process becomes more complex and time-consuming, increasing the time cost; in addition, the manual measurement results are easily affected by the subjective judgment of the operator, resulting in positioning deviation, and the differences in the operating habits and experience of different medical staff make it difficult for the measurement data to reach a unified standard, thus affecting the accuracy and consistency of the measurement results.
[0054] In view of this, the present disclosure aims to propose a technical solution for quickly and accurately measuring each index to be measured according to an image.
[0055] Through the embodiments of the present disclosure, first, determine the number of pixels corresponding to the index to be measured and the reference object with a known physical size in the acquired image respectively, where the index to be measured and the reference object are in the same or different images, and the different images are taken by cameras with the same focal length; then, according to the physical size of the reference object and the number of pixels corresponding to the reference object, determine the corresponding relationship between the unit pixel of the reference object and the physical size; further, collect the distances from the focal planes of the reference object and the index to be measured to the lens respectively, so as to determine the corresponding relationship between the unit pixel of the index to be measured and the physical size according to the distances from the focal planes of the two to the lens and the corresponding relationship between the unit pixel of the reference object and the physical size; finally, calculate the index to be measured according to the corresponding relationship between the unit pixel of the index to be measured and the physical size, and the number of pixels corresponding to the index to be measured.
[0056] For example, to measure a person's arm length, it is known that the person's height is 1.7 meters. First, the processor obtains a clear photo of the person standing, ensuring that their body and arms are fully presented in the photo. Through image processing technology, it is determined that the number of pixels corresponding to the person's height in the photo is 600 pixels, and at the same time, the number of pixels corresponding to their arm length in the photo is 200 pixels. Then, according to the person's height of 1.7 meters (i.e., 1700 millimeters) and the 600 pixels corresponding to the height, the corresponding relationship between the unit pixel of the person's height and the physical size can be calculated as: 1 pixel = 1700 millimeters / 600 pixels ≈ 2.83 millimeters / pixel. This means that every 1 pixel of the person's height in the photo corresponds to an actual physical size of 2.83 millimeters in reality.
[0057] Then, through depth estimation technology, the distances from the focal planes of the person's body (height part) and arm (arm length part) to the lens are collected. The distance from the focal plane of the body part to the lens is 1 meter, and the distance from the focal plane of the arm part to the lens is 1.02 meters. Since the distances from the focal planes of the body part and the arm part to the lens are different, it is necessary to determine the correspondence between the unit pixels of the arm part and the physical size based on this distance difference. According to the camera imaging principle, the size of the image of an object is linearly inversely proportional to the distance from the object to the lens, and the corresponding value between the unit pixels of an object and the physical size is linearly directly proportional to the distance from the object to the lens. Therefore, the correspondence between the unit pixels of the arm part and the physical size is: 1 pixel = 2.83 mm × (1.02 m / 1 m) ≈ 2.89 mm.
[0058] Finally, according to the correspondence between the unit pixels of the arm part and the physical size (1 pixel = 2.89 mm / pixel), and the number of pixels corresponding to the arm, which is 200 pixels, the arm length of the person is calculated as: 200 pixels × 2.89 mm / pixel = 578 mm.
[0059] In the above manner, the technical solution of the present disclosure determines the number of pixels corresponding to the measurement index to be measured and the reference object with a known physical size in the collected image respectively, calculates the correspondence between the unit pixels of the reference object and the physical size, and then combines the distances from the focal planes of the reference object and the measurement index to be measured to the lens to determine the correspondence between the unit pixels of the measurement index to be measured and the physical size, and finally calculates the measurement index to be measured. This process can not only quickly and efficiently complete the size calculation in a standardized manner, improve the measurement efficiency, reduce the labor cost, but also accurately measure the values of multiple measurement indexes to be measured, provide more comprehensive data support for orthopedic clinical diagnosis, and improve the scientificity and accuracy of diagnosis.
[0060] The following describes the present disclosure through specific embodiments in combination with specific application scenarios.
[0061] Please refer to Figure 1 , Figure 1 which is a flowchart of a method for calculating a measurement index to be measured shown in an exemplary embodiment. The method may perform the following steps:
[0062] Step 102: Determine the number of pixels corresponding to the measurement index to be measured and the reference object with a known physical size in the collected image respectively, where the measurement index to be measured and the reference object are in the same or different images, and the different images are taken by cameras with the same focal length.
[0063] For example, to measure a person's arm length, given that the person's height is 1.7 meters. First, the processor obtains a clear photo of the person standing, ensuring that their body and arms are fully presented in the photo. Through image processing techniques, it is determined that the number of pixels corresponding to the person's height in the photo is 600 pixels, and at the same time, the number of pixels corresponding to their arm length in the photo is 200 pixels.
[0064] For example, to measure a person's sitting height, only knowing that the person's height is 1.7 meters. First, the processor obtains a clear photo of the person standing and a clear photo of the person sitting, ensuring that their body is fully presented in the photos. Through image processing techniques, it is determined that the number of pixels corresponding to the person's height in the standing photo is 600 pixels, and at the same time, the number of pixels corresponding to the sitting height in the photo is 380 pixels. The standing photo and the sitting photo of the person are taken by the same camera with the same focal length.
[0065] Among them, in order to improve the quality of the image for subsequent processing, some preprocessing operations may be required on the original image. For example, adjusting brightness and contrast, removing noise, cropping, scaling, etc., to ensure the photo is clear. In addition, it is also crucial that the part to be measured and the reference object are fully displayed and there is not too much background interference. If the image quality is poor, the subsequent calculation process can be skipped to save computing resources. To determine the position of the measurement index (arm length in this embodiment) in the image, a specific algorithm can be used to identify and locate it, for example, through edge detection, template matching, or more advanced artificial intelligence methods (such as convolutional neural networks). The reference object refers to an object with a known physical size. In this embodiment, the person's height is the reference object, and its known physical size is 1.7 meters. Physical size refers to the actual human body size (such as length, width, etc.) measured through the image.
[0066] Among them, the focal length of the camera lens refers to the distance from the optical center of the lens to the position where a clear image is formed on the image sensor (or film). The focal length is a basic property of the camera lens. The focal length can be divided into a fixed-focus lens (with only one fixed focal length) and a zoom lens (which can adjust the focal length within a certain range). The focal length of the camera lens determines the camera's viewing angle and magnification. In this embodiment, to ensure the consistency and accuracy of the measurement, it is necessary to keep the focal length of the camera lens unchanged. If the focal length of the camera lens changes during multiple shootings, it is necessary to re-measure the distance from the reference object to the lens and re-calibrate the physical size corresponding to the unit pixel of the reference object according to the new settings.
[0067] Step 104: Determine the correspondence between the unit pixel of the reference object and the physical size according to the physical size of the reference object and the number of pixels corresponding to the reference object.
[0068] For example, based on the person's height of 1.7 meters (i.e., 1700 millimeters) and the corresponding 600 pixels, the corresponding relationship between the unit pixel of the person's height and the physical size can be calculated as: 1 pixel = 1700 millimeters / 600 pixels ≈ 2.83 millimeters. This means that each 1 pixel of the person's height in the photo corresponds to an actual physical size of 2.83 millimeters in reality.
[0069] Among them, the corresponding relationship between the unit pixel and the physical size: This refers to the actual physical distance represented by each unit pixel in the real world. By dividing the actual physical size of the reference object by the number of pixels it occupies in the image, this proportional relationship can be obtained. A person's height is usually known to oneself. If not, tools such as a ruler or a laser rangefinder can be used to obtain the actual size, and then image processing software or algorithms can be used to count the number of pixels corresponding to the person's height. The number of pixels corresponding to a person's height means that the person's height corresponds to a certain distance in the image, and this distance is composed of a column of pixel points, and the number of pixel points in this column is the number of pixels corresponding to the person's height in the image.
[0070] In some embodiments, before image processing and calculation, advanced image processing techniques such as lens distortion correction may also need to be considered to improve the measurement accuracy.
[0071] Step 106: Collect the distances from the focal planes of the reference object and the measurement index to the lens respectively, so as to determine the corresponding relationship between the unit pixel and the physical size of the measurement index according to the distances from the focal planes of the two to the lens and the corresponding relationship between the unit pixel and the physical size of the reference object.
[0072] For example, through depth estimation technology, collect the distances from the focal planes of the person's body (height part) and arm (arm length part) to the lens respectively, and obtain that the distance from the focal plane of the body part to the lens is 1 meter, and the distance from the focal plane of the arm part to the lens is 1.02 meters. Since the distances from the focal planes of the body part and the arm part to the lens are different, it is necessary to determine the corresponding relationship between the unit pixel and the physical size of the arm part according to this distance difference. According to the camera imaging principle, the size of the object's image is linearly inversely proportional to the distance from the object to the lens, and the corresponding value between the unit pixel of the object and the physical size is linearly directly proportional to the distance from the object to the lens. Therefore, the corresponding relationship between the unit pixel and the physical size of the arm part is: 1 pixel = 2.83 millimeters × (1.02 meters / 1 meter) ≈ 2.89 millimeters.
[0073] Among them, the distance from the focal plane of the object to the lens is the distance between the focal plane where the object is located (i.e., the position where the object is clearly imaged) and the camera lens. Depth estimation technology is a computer vision technology aimed at estimating the depth information of each pixel point in the scene from a single image or multiple images, that is, the distance of this pixel point from the camera lens.
[0074] Step 108: Calculate the to-be-measured index based on the correspondence between the unit pixel and the physical size of the to-be-measured index and the number of pixels corresponding to the to-be-measured index.
[0075] For example, based on the correspondence between the unit pixel and the physical size of the arm part (1 pixel = 2.89 mm / pixel) and the number of pixels corresponding to the arm, which is 200 pixels, the arm length of this person is calculated as: 200 pixels × 2.89 mm / pixel = 578 mm.
[0076] Among them, the number of pixels corresponding to the to-be-measured index refers to the number of pixels occupied by the to-be-measured object (the arm length in this embodiment) in the image determined by image processing technology. This usually involves techniques such as image segmentation and edge detection to accurately identify and quantify the part to be measured. For example, in this embodiment, the arm occupies 200 pixels in the image.
[0077] In this embodiment, by determining the correspondence between the unit pixel and the physical size of the to-be-measured index and combining image processing technology to accurately measure the number of pixels corresponding to the to-be-measured object in the image, the physical size information in the three-dimensional space can be effectively inferred from the two-dimensional image. This method can be applied to various fields, including but not limited to medical image analysis, engineering design, security monitoring, etc., providing a non-contact and efficient measurement solution.
[0078] In an illustrated implementation manner, determining the number of pixels corresponding to the to-be-measured index and the reference object with a known physical size in the acquired image respectively includes: determining the two end measurement points corresponding to the to-be-measured index and the reference object with a known physical size in the acquired image respectively; obtaining the number of pixels corresponding to the to-be-measured index in the acquired image according to the distance between the two end measurement points corresponding to the to-be-measured index in the acquired image; and obtaining the number of pixels corresponding to the reference object in its image according to the distance between the two end measurement points corresponding to the reference object in the acquired image.
[0079] For example, to measure a person's arm length, given that the person's height is 1.7 meters. First, obtain a clear photo of the person standing upright, ensuring that their body and arms are fully presented in the photo. For the arm length, a point at the shoulder joint and a point at the wrist can be selected as the two measurement points at both ends. For the height, the two points at the top of the head and the soles of the feet can be selected as the two measurement points at both ends. Then, through image processing technology, the pixel distance corresponding to the height between the two measurement points at the top of the head and the soles of the feet in the collected image is calculated (i.e., how many pixels are spanned between the two points), and then it is determined that the number of pixels corresponding to the height in the collected image is 600 pixels, and the pixel distance corresponding to the arm length between the two measurement points at the wrist and the shoulder joint in the collected image is calculated, and then it is determined that the number of pixels corresponding to the arm length in the collected image is 200 pixels.
[0080] Among them, in order to accurately identify and locate the measurement points in the image, feature detection technology is usually required. For example, key parts are identified through methods such as corner detection and edge detection. For example, in this embodiment, a human pose estimation algorithm may be used to automatically identify the positions of the shoulder joint, wrist, top of the head, and soles of the feet. Once the positions of the measurement points are determined, the next step is to calculate the pixel distance between the two measurement points, which can be completed through simple geometric calculations, such as the Euclidean distance formula. The number of pixels refers to the number of pixels spanned by the distance between the two measurement points.
[0081] In an illustrated implementation, for the measurement index in the human body image, determining the two measurement points corresponding to the measurement index in the collected image includes: collecting the feature points of the human body included in the human body image, where the feature points include the joint points and facial feature points of the human body; if the measurement index is a physical dimension corresponding to the distance between two feature points, then determine the two feature points related to the measurement index among the feature points of the human body included in the collected human body image; and determine the two determined feature points related to the measurement index as the two measurement points corresponding to the measurement index in the human body image.
[0082] For example, the processor collects the human feature points included in the human body image through a feature point acquisition tool. These feature points include the joint points of the human body (such as the shoulder joint, elbow joint, wrist joint, etc.) and the facial feature points (such as eyes, nose, ears, etc.). If the measurement index to be measured is the physical size corresponding to the distance between the two end feature points, then the two end feature points related to the measurement index to be measured are determined among the various human feature points included in the collected human body image. Specifically, for arm length measurement, the distance between the shoulder joint and the wrist needs to be measured, so the shoulder joint and the wrist are determined as the two end measurement points corresponding to the arm length of the measurement index to be measured in the human body image; for calf height measurement, the distance between the knee joint and the ankle joint needs to be measured, so the knee joint and the ankle joint are determined as the two end measurement points corresponding to the calf height of the measurement index to be measured in the human body image.
[0083] Among them, the human feature points can be collected through the multi-modal pose estimation toolbox MMpose. In addition, other tools can also be used for collecting human feature points, such as OpenPose, MediaPipe, etc. Which tool to choose specifically depends on actual needs, such as whether real-time processing is required, the requirements for accuracy, the deployment environment (such as server-side or mobile-side), etc. Human pose estimation is a technology that uses computer vision and machine learning techniques to identify and locate human poses. By inputting one or more human body images, the pose estimation model can output the position coordinates of each joint point of the human body.
[0084] For example, please refer to Figure 2 , Figure 2 is a schematic diagram of a human feature point shown in an exemplary embodiment. As Figure 2 shown, a total of joint points such as the shoulder joint, elbow joint, wrist joint, hip joint, knee joint, and ankle joint in the human body image, as well as facial feature points such as eyes, ears, and nose, are collected, and the coordinates of the above joint points and facial feature points in the image are determined to mark the positions of each human feature point in the human body.
[0085] For example, please refer to Figure 3 , Figure 3 is a schematic diagram of a method for determining human measurement points shown in an exemplary embodiment. As Figure 3 shown, if the measurement index to be measured is the arm length, then for the measurement of the arm length, the distance between the shoulder joint and the wrist needs to be measured, so the shoulder joint and the wrist are determined as the two end measurement points corresponding to the arm length of the measurement index to be measured in the human body image.
[0086] In an illustrated embodiment, the index to be measured is in a human body image. Determining the two end measurement points corresponding to the index to be measured in the acquired image includes: acquiring a contour map of the human body image and feature points of the human body included in the human body image, where the feature points include joint points and facial feature points of the human body, and the contour map is used to determine the contour edge points of the human body included in the human body image; and determining at least one contour edge point as the measurement point corresponding to the index to be measured in the human body image according to whether the index to be measured involves the contour edge points of the human body.
[0087] For example, obtain a clear photo of a human body in a front standing posture, ensuring that its body contour and key parts (such as shoulders, head, etc.) are fully presented in the photo. The processor uses a feature point acquisition tool (such as MMpose) to identify and extract the feature points in the human body image, and these feature points include joint points of the human body (such as shoulder joints, elbows, wrists, etc.) and facial feature points (such as eyes, nose, ears, etc.). At the same time, a contour map of the human body image is generated to determine the contour edge points of the human body. If the index to be measured involves the contour edge points of the human body, for example, when measuring shoulder width, two contour edge points on the outermost sides of the two shoulders need to be found as the two end measurement points, then two pixel points on the outer contour of the human shoulders are selected as the measurement points corresponding to shoulder width in the contour edge points of the human body.
[0088] For example, please refer to Figure 4 , Figure 4 is a schematic diagram of a contour map of a human body image shown in an exemplary embodiment. As Figure 4 shown, the contour map of the human body image is a binary image, where the pixels in the area where the human body is located are the first value, such as 1, and the pixels in the area where the human body is not located are the second value, such as 2. When scanning pixel points in the contour map of the human body image, according to the change of the pixel value of the pixel point, it can be determined whether the current position is inside or outside the human body contour. When the pixel value undergoes a critical change, it indicates that it is at a contour edge point of the human body.
[0089] For example, please refer to Figure 5 , Figure 5 is a schematic diagram of another method for determining human measurement points shown in an exemplary embodiment. As Figure 5As shown, if the measurement index to be measured is shoulder width, then for the measurement of shoulder width, it is necessary to determine the two outermost contour edge points of the two shoulders as the two end measurement points. Then, two pixel points (measurement point 3 and measurement point 4) on the outer contour of the human shoulder are selected from the contour edge points of the human body as the measurement points corresponding to the shoulder width. If the measurement index to be measured is shoulder height, then for the measurement of shoulder height, it is necessary to use the contour edge point at the highest point of one shoulder as one end measurement point. Then, one pixel point (measurement point 5) at the highest point on the outer contour of one side of the human shoulder is selected from the contour edge points of the human body as the measurement point corresponding to the shoulder height. And the other end measurement point needs to be selected from the feature points. For the measurement index of shoulder height, the other end measurement point is selected as the ankle joint feature point.
[0090] Among them, the contour map refers to the human body contour boundary extracted from the human body image through image processing technology. The process of generating the contour map usually involves edge detection algorithms or deep learning-based segmentation models. The contour map helps to determine the contour edge points of the human body, which is very important for some tasks that need to measure based on the human body shape, such as shoulder width, chest circumference, etc. The contour edge points of the human body refer to the specific pixel points that outline the boundary of the human body shape in the image. These points represent the boundary line between the human body and the background and can clearly depict the overall shape and posture of the human body. The edge points are usually distributed along the outer edge of the human body, including but not limited to the boundaries of parts such as the head, shoulders, arms, torso, legs, etc.
[0091] In an illustrated embodiment, the determining at least one contour edge point as the measurement point corresponding to the measurement index in the human body image according to whether the measurement index to be measured involves the contour edge points of the human body includes: if the measurement index is the physical dimension corresponding to the distance between one end feature point and a contour edge point of the human body, then use this feature point as one end measurement point corresponding to the measurement index in the human body image; according to the measurement position of the measurement index on the human body, select a target feature point from the feature points, starting from the target feature point, perform pixel-by-pixel scanning in the measurement direction corresponding to the measurement index, and then use the scanned human body contour edge point as the other end measurement point corresponding to the measurement index in the human body image.
[0092] For example, to measure a person's shoulder height, first obtain a clear photo of the person standing in a front-facing pose, ensuring that their body outline and key parts are fully presented in the photo. The processor generates a contour map of the human body through an image segmentation tool (such as U-Net or DeepLab) and uses a feature point detection tool (such as MMpose) to identify and extract the feature points in the human body image. These feature points include the joint points of the human body (such as the shoulder joint, elbow, wrist, etc.) and the facial feature points (such as eyes, nose, ears, etc.). If the measurement index to be measured involves the distance between one end of the feature point and the contour edge point of the human body, for example, the shoulder height involves the distance from the ankle joint to the shoulder edge point of the human body, then the ankle joint is used as the corresponding one-end measurement point of the shoulder height measurement index in the human body image. Since the shoulder edge point is relatively close to the shoulder joint, the shoulder joint is selected as the starting position, and a pixel-by-pixel scan is performed in the vertical upward measurement direction corresponding to the shoulder height index. When the shoulder edge position of the human body contour is scanned, the scanned human shoulder edge point is used as the corresponding other-end measurement point of the shoulder height measurement index in the human body image.
[0093] For example, please refer to Figure 6 , Figure 6 which is a schematic diagram showing another way to determine the human body measurement points shown in an exemplary embodiment. As Figure 6 shown, since the shoulder height involves the distance from the ankle joint to the shoulder edge point of the human body, the ankle joint is used as the corresponding one-end measurement point of the shoulder height measurement index in the human body image (the coordinates of the ankle joint feature point have been obtained during the feature point acquisition stage). Starting from the shoulder joint (the coordinates of the shoulder joint feature point have been obtained during the feature point acquisition stage), a pixel-by-pixel scan is performed on the contour map of the human body in the vertical upward measurement direction corresponding to the shoulder height index. When the shoulder edge position of the human body contour is scanned, the scanned human shoulder edge point (measurement point 7) is used as the corresponding other-end measurement point of the shoulder height measurement index in the human body image.
[0094] Among them, during the pixel-by-pixel scan in the scan direction corresponding to the measurement index to be measured, the value of each pixel is checked. If the value of the current pixel is 1 (indicating that the current pixel is part of the human body) and the value of the next pixel is 0 (indicating that the current pixel is part of the background outside the human body), it means that the human body contour edge point has been reached. Record the coordinates of this point as the corresponding one-end measurement point of the measurement index in the human body image.
[0095] In one of the illustrated embodiments, determining at least one contour edge point among the contour edge points of the human body as the measurement point corresponding to the measurement index in the human body image according to whether the measurement index to be measured involves the contour edge points of the human body includes: If the measurement index to be measured is a physical dimension corresponding to the distance between two contour edge points of the human body, determine a scanning range corresponding to the measurement index according to the contour map of the human body image and the feature points, perform a line-by-line scan in the scanning range to obtain a number of human body contour edge points; determine the two end measurement points corresponding to the measurement index in the human body image among the number of human body contour edge points according to the measurement position of the measurement index on the human body, the scanning direction of the line-by-line scan, and the numerical magnitudes of the number of human body contour edge points in a specific direction.
[0096] For example, when measuring the neck curve depth index in a side view of the human body, determine the head and neck as the scanning range according to the neck feature points and the contour map of the human body image. Perform a line-by-line scan in the head and neck scanning range to obtain a number of human body contour edge points. Since the specific measurement position of the neck curve depth index is the back of the head, if scanning line by line from left to right in the head and neck scanning range, then combine the X coordinate extreme value determination algorithm of the edge points to screen out the edge point that first enters the human body from the outside of the human body (because this edge point is located at the back side of the head). Then, among the screened edge points, select the edge point with the smallest numerical value in the X axis of the coordinate system (this edge point is the last position of the back of the head) and the edge point with the largest numerical value in the X axis of the coordinate system (the foremost position behind the neck) as the two end measurement points corresponding to the neck curve depth of the measurement index in the human body image.
[0097] For example, when measuring the head width index in a front view of the human body, determine the head as the scanning range according to the neck feature points and the contour map of the human body image. Perform a line-by-line scan in the head scanning range to obtain a number of human body contour edge points. Since the specific measurement position of the head width index is on both sides of the head, if scanning line by line from left to right in the head and neck scanning range, then combine the X coordinate extreme value determination algorithm of the edge points to screen out the edge point with the smallest numerical value in the X axis of the coordinate system among the scanned edge points (this edge point is the position of the left side of the head) and the edge point with the largest numerical value in the X axis of the coordinate system (this edge point is the position of the right side of the head) as the two end measurement points corresponding to the head width index in the human body image.
[0098] For example, please refer to Figure 7 , Figure 7 is a schematic diagram showing a scanning to obtain contour edge points shown in an exemplary embodiment. As Figure 7 shown, it shows the head scanning range. Perform a line-by-line scan from left to right in the head scanning range to obtain a number of human body contour edge points, which are edge point 1, edge point 2, edge point 3, edge point 4, edge point 5, and edge point 6 respectively. (Actually, the line-by-line scan will be moreFigure 7 The displayed effect is denser. Figure 7 (Only a schematic diagram) According to the X - coordinate extreme value determination algorithm, among these 6 edge points, the edge point with the smallest value on the X - axis of the coordinate system is edge point 3, and the edge point with the largest value on the X - axis of the coordinate system is edge point 4. Therefore, edge point 3 and edge point 4 are selected as the two end measurement points corresponding to the head width index in the human body image. That is, the head width index needs to measure the actual physical size between edge point 3 and edge point 4.
[0099] Among them, the measurement index to be measured refers to the specific physical size or characteristic that needs to be obtained from the human body image, such as the neck curve depth, head width, shoulder height, calf length, thigh length, etc. The feature point refers to the position with significant features on the human body image, such as the positions of eyes, nose, ears, shoulders, etc. Feature points are usually automatically detected by the pose estimation algorithm and are used to assist in positioning and determining the scanning range. The scanning range is a specific human body area determined according to the measurement index to be measured and the feature points. In this specific human body area, line - by - line scanning is performed to identify the edge points of the human body contour. Line - by - line scanning is a method of processing images. By checking the pixel values of each pixel point in the image row by row, the edge points of the contour that meet the conditions are found.
[0100] In an illustrated embodiment, according to whether the measurement index to be measured involves the edge points of the human body contour, determining at least one edge point of the human body contour as the measurement point corresponding to the measurement index to be measured in the human body image includes: If the measurement index to be measured needs to be measured between two edge points of the human body contour, then select a target feature point from the feature points according to the measurement position of the human body by the measurement index to be measured; starting from the target feature point, perform pixel - by - pixel scanning in the two measurement directions corresponding to the measurement index to be measured, and then use the two edge points of the human body contour obtained by scanning as the two end measurement points corresponding to the measurement index to be measured in the human body image.
[0101] For example, when measuring the head width index in the front view of the human body, since the specific measurement position of the head width index is on both sides of the head, select the target feature point as the eyes or nose. Starting from the selected eyes or nose, perform pixel - by - pixel scanning in the measurement directions corresponding to the head width index, namely, horizontally to the left and horizontally to the right. When scanning horizontally to the left to the edge point of the human body contour, record the scanned edge point of the human body contour (the left - side position of the head). When scanning horizontally to the right to the edge point of the human body contour, record the scanned edge point of the human body contour (the right - side position of the head). Finally, use the two recorded edge points of the human body contour as the two end measurement points corresponding to the head width in the human body image.
[0102] For example, please refer to Figure 8 , Figure 8Another schematic diagram of obtaining contour edge points by scanning shown in an exemplary embodiment. As Figure 8 shown, the target feature point is selected as the nose. Taking the selected nose feature point as the starting position, scanning is performed respectively in the horizontal left and horizontal right directions corresponding to the head width index, and the edge points a and edge points b obtained by scanning in the two directions are obtained. Among them, the edge point a is the leftmost position of the head with the nose as the starting position; the edge point b is the rightmost position of the head with the nose as the starting position. Therefore, the edge points a and b are selected as the two end measurement points corresponding to the head width index in the human body image, that is, the head width index needs to measure the actual physical size between the edge point a and the edge point b.
[0103] In some embodiments, since different people have different head shapes, some are wider at the top and narrower at the bottom, and some are relatively square. In this embodiment, in order to improve the measurement accuracy, the eyes can be used as the starting position for scanning to obtain the two end measurement points corresponding to the head width in the human body image, and then the nose can be used as the starting position for scanning to obtain the two end measurement points corresponding to the head width in the human body image. Finally, only the group with a longer distance between the two end measurement points is retained from the two groups of two end measurement points.
[0104] Among them, taking the eyes or the nose as the starting position, pixel-by-pixel scanning is performed respectively in the horizontal left and horizontal right directions. During the horizontal left scanning process, when encountering a pixel point that changes from the human body part (pixel value is 1) to the background part (pixel value is 2), record the coordinates (x1, y0) of this point. During the horizontal right scanning process, when encountering a pixel point that changes from the human body part (pixel value is 1) to the background part (pixel value is 2), record the coordinates (x2, y0) of this point. The pixel distance corresponding to the head width is d = |x2 - x1|. Again, starting from the nose, the same steps of scanning are performed to obtain another group of pixel distances corresponding to the head width. Compare the two groups of measurement results and retain the group with a longer distance as the final pixel distance corresponding to the head width.
[0105] To facilitate those skilled in the art to better understand the embodiments of the present disclosure as a whole, the following combines Figure 9 to illustrate the embodiments of the present disclosure.
[0106] Please refer to Figure 9 , Figure 9 Another flowchart of a method for calculating an index to be measured shown in an exemplary embodiment. As Figure 9As shown, first, obtain a plurality of images of the subject. These images are all taken by cameras with the same focal length. The measurement index to be measured and the reference object with a known physical size can be in the same image or different images. Collect the feature points of the human body included in the human body image and the contour map of the human body image. Based on the feature points and the contour map, determine the two measurement points corresponding to the measurement index to be measured in the image, and then obtain the number of pixels corresponding to the measurement index to be measured and the number of pixels corresponding to the reference object. According to the number of pixels corresponding to the reference object and the physical size of the reference object, obtain the physical size corresponding to each pixel of the reference object. Then, according to the depth maps of the plurality of subject images, the distance from each pixel point in the image to the lens can be determined, and then the distances from the focal planes of the reference object and the measurement index to be measured to the lens can be obtained. Finally, according to the distances from the focal planes of the reference object and the measurement index to be measured to the lens obtained, and the physical size corresponding to each pixel of the reference object, obtain the physical size corresponding to each pixel of the measurement index to be measured, and then multiply it by the number of pixels corresponding to the measurement index to be measured to obtain the measurement index to be measured.
[0107] Corresponding to the embodiment of the method for calculating the measurement index described above, the present disclosure also provides an embodiment of a device for calculating the measurement index.
[0108] Please refer to Figure 10 , Figure 10 is a hardware structure diagram of an electronic device shown in an exemplary embodiment. At the hardware level, the device includes a processor 1002, an internal bus 1004, a network interface 1006, a memory 1008, and a non-volatile memory 1010. Of course, other required hardware may also be included. One or more embodiments of the present disclosure can be implemented in a software manner. For example, the processor 1002 reads the corresponding computer program from the non-volatile memory 1010 into the memory 1008 and then runs it. Of course, in addition to the software implementation manner, one or more embodiments of the present disclosure do not exclude other implementation manners, such as logical devices or a combination of software and hardware. That is to say, the execution subject of the following processing flow is not limited to each logical unit, and can also be hardware or a logical device.
[0109] Please refer to Figure 11 , Figure 11 is a block diagram of a device for calculating a measurement index shown in an exemplary embodiment. The device 1100 for calculating the measurement index can be applied to an electronic device as shown in Figure 10 to implement the technical solution of the present disclosure.
[0110] The device includes:
[0111] A first determination unit 1102, configured to determine the number of pixels corresponding to the to-be-measured index and the reference object with a known physical size in the collected image respectively, where the to-be-measured index and the reference object are in the same or different images, and the different images are captured by cameras with the same focal length;
[0112] A second determination unit 1104, configured to determine the correspondence between the unit pixel of the reference object and the physical size according to the physical size of the reference object and the number of pixels corresponding to the reference object;
[0113] A third determination unit 1106, configured to collect the distances from the focal planes of the reference object and the to-be-measured index to the lens respectively, so as to determine the correspondence between the unit pixel of the to-be-measured index and the physical size according to the distances from the focal planes of the two to the lens and the correspondence between the unit pixel of the reference object and the physical size;
[0114] A calculation unit 1108, configured to calculate the to-be-measured index according to the correspondence between the unit pixel of the to-be-measured index and the physical size and the number of pixels corresponding to the to-be-measured index.
[0115] In some embodiments, the first determination unit includes:
[0116] A first determination subunit, configured to determine the two measurement points corresponding to the to-be-measured index and the reference object with a known physical size in the collected image respectively;
[0117] A first calculation subunit, configured to obtain the number of pixels corresponding to the to-be-measured index in the collected image according to the distance between the two measurement points corresponding to the to-be-measured index in the collected image;
[0118] A second calculation subunit, configured to obtain the number of pixels corresponding to the to-be-measured index in the collected image according to the distance between the two measurement points corresponding to the to-be-measured index in the collected image.
[0119] In some embodiments, when the to-be-measured index is in a human body image, the first determination unit includes:
[0120] A first acquisition subunit, configured to acquire the feature points of the human body included in the human body image, where the feature points include the joint points and facial feature points of the human body;
[0121] A second determination subunit, configured to determine the two feature points related to the to-be-measured index among the feature points of the human body included in the collected human body image if the to-be-measured index is the physical size corresponding to the distance between two feature points;
[0122] A third determination subunit, configured to determine the two end feature points related to the to-be-measured index as the two end measurement points corresponding to the to-be-measured index in the human body image.
[0123] In some embodiments, for the to-be-measured index in the human body image, the first determination unit includes:
[0124] A second acquisition subunit, configured to acquire a contour map of the human body image and feature points of the human body included in the human body image, where the feature points include joint points and facial feature points of the human body, and the contour map is used to determine the contour edge points of the human body included in the human body image;
[0125] A fourth determination subunit, configured to determine at least one contour edge point as the measurement point corresponding to the to-be-measured index in the human body image from the contour edge points of the human body according to whether the to-be-measured index involves the contour edge points of the human body.
[0126] In some embodiments, the fourth determination subunit is specifically configured to:
[0127] If the to-be-measured index is a physical dimension corresponding to the distance between one end feature point and a contour edge point of a human body, use this feature point as one end measurement point corresponding to the to-be-measured index in the human body image;
[0128] Select a target feature point from the feature points according to the measurement position of the to-be-measured index on the human body, start from the target feature point, perform a pixel-by-pixel scan in the measurement direction corresponding to the to-be-measured index, and then use the scanned human body contour edge points as the other end measurement point corresponding to the to-be-measured index in the human body image.
[0129] In some embodiments, the fourth determination subunit is specifically configured to:
[0130] If the to-be-measured index is a physical dimension corresponding to the distance between two contour edge points of a human body, determine a scanning range corresponding to the to-be-measured index according to the contour map of the human body image and the feature points, perform a line-by-line scan in the scanning range, and obtain a plurality of human body contour edge points;
[0131] Determine the two end measurement points corresponding to the to-be-measured index in the human body image from the plurality of human body contour edge points according to the measurement position of the to-be-measured index on the human body, the scanning direction of the line-by-line scan, and the numerical magnitudes of the plurality of human body contour edge points in a specific direction.
[0132] In some embodiments, the fourth determination subunit is specifically configured to:
[0133] If the measurement index to be measured needs to be measured between the contour edge points of two human bodies, a target feature point is selected from the feature points according to the measurement position of the human body for the measurement index to be measured;
[0134] Taking the target feature point as the starting position, pixel-by-pixel scanning is respectively performed in the two measurement directions corresponding to the measurement index to be measured, and then the two human body contour edge points obtained by scanning are used as the two end measurement points corresponding to the measurement index to be measured in the human body image.
[0135] The implementation processes of the functions and roles of each unit in the above device are specifically detailed in the implementation processes of the corresponding steps in the above method, and will not be elaborated here.
[0136] For the device embodiment, since it basically corresponds to the method embodiment, the relevant parts can be referred to the partial description of the method embodiment. The device embodiment described above is only illustrative. The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the present disclosure solution. Those of ordinary skill in the art can understand and implement it without creative work.
[0137] The system, device, module or unit illustrated in the above embodiments can be specifically implemented by a computer chip or entity, or by a product with certain functions. A typical implementation device is a computer, and the specific form of the computer can be a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email transceiver device, a game console, a tablet computer, a wearable device, or a combination of any several of these devices.
[0138] In a typical configuration, a computer includes one or more processors (CPUs), an input / output interface, a network interface, and a memory.
[0139] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of, for example, read-only memory (ROM) or flash memory (flash RAM). The memory is an example of a computer-readable medium.
[0140] A computer-readable medium includes both permanent and non-permanent, removable and non-removable media and can implement information storage by any method or technology. The information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory, or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD), or other optical storage, magnetic cassette tapes, disk storage, quantum memory, graphene-based storage media, or other magnetic storage devices, or any other non-transitory media that can be used to store information accessible by a computing device. As defined herein, a computer-readable medium does not include transitory computer-readable media, such as modulated data signals and carrier waves.
[0141] The user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in this disclosure are all information and data that have been authorized by the user or fully authorized by all parties. Moreover, the collection, use, and processing of relevant data need to comply with the relevant laws, regulations, and standards of the relevant countries and regions, and corresponding operation entrances are provided for users to choose to authorize or reject.
[0142] It should also be noted that the term "comprising," "including," or any other variant thereof is intended to cover non-exclusive inclusion, such that a process, method, commodity, or device comprising a series of elements not only includes those elements but also includes other elements not expressly listed, or further includes elements inherent to such process, method, commodity, or device. Without further limitation, an element defined by the statement "comprising one..." does not exclude the existence of additional identical elements in the process, method, commodity, or device comprising the said element.
[0143] The above describes specific embodiments of the present disclosure. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be performed in a different order than in the embodiments and still achieve the desired result. Additionally, the processes depicted in the figures do not necessarily require the specific order or sequential order shown to achieve the desired result. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0144] The terms used in one or more embodiments of the present disclosure are for the purpose of describing particular embodiments only and are not intended to limit one or more embodiments of the present disclosure. The singular forms "a", "the", and "said" used in one or more embodiments of the present disclosure and the appended claims are also intended to include the plural forms unless the context clearly dictates otherwise. It should also be understood that the term "and / or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
[0145] It should be understood that although the terms first, second, third, etc. may be used in one or more embodiments of the present disclosure to describe various information, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from each other. For example, without departing from the scope of one or more embodiments of the present disclosure, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "when" or "while" or "in response to determining".
[0146] The foregoing is only a preferred embodiment of one or more embodiments of the present disclosure and is not intended to limit one or more embodiments of the present disclosure. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of one or more embodiments of the present disclosure shall be included within the scope of protection of one or more embodiments of the present disclosure.
Claims
1. A method for calculating an index to be measured, characterized in that The method includes: Determining the number of pixels corresponding to the index to be measured and the reference object with a known physical size in the acquired image respectively, where the index to be measured and the reference object are in the same or different images, and the different images are captured by cameras with the same focal length; Determining the corresponding relationship between the unit pixel of the reference object and the physical size according to the physical size of the reference object and the number of pixels corresponding to the reference object; Collecting the distances from the focal planes of the reference object and the index to be measured to the lens respectively, so as to determine the corresponding relationship between the unit pixel of the index to be measured and the physical size according to the distances from the focal planes of the two to the lens and the corresponding relationship between the unit pixel of the reference object and the physical size; Calculating the index to be measured according to the corresponding relationship between the unit pixel of the index to be measured and the physical size and the number of pixels corresponding to the index to be measured.
2. The method according to claim 1, wherein The determining the number of pixels corresponding to the index to be measured and the reference object with a known physical size in the acquired image respectively includes: Determining the two measurement points corresponding to the index to be measured and the reference object with a known physical size in the acquired image respectively; Obtaining the number of pixels corresponding to the index to be measured in the acquired image according to the distance between the two measurement points corresponding to the index to be measured in the acquired image; Obtaining the number of pixels corresponding to the reference object in its image according to the distance between the two measurement points corresponding to the reference object in the acquired image.
3. The method according to claim 2, wherein When the index to be measured is in a human body image, the determining the two measurement points corresponding to the index to be measured in the acquired image includes: Collecting the feature points of the human body included in the human body image, and the feature points include the joint points and facial feature points of the human body; If the index to be measured is the physical size corresponding to the distance between two feature points, determining the two feature points related to the index to be measured among the feature points of the human body included in the acquired human body image; Determining the two determined feature points related to the index to be measured as the two measurement points corresponding to the index to be measured in the human body image.
4. The method according to claim 2, characterized in that, When the index to be measured is in a human body image, the determining the two measurement points corresponding to the index to be measured in the acquired image includes: Collecting the contour map of the human body image and the feature points of the human body included in the human body image, the feature points include the joint points and facial feature points of the human body, and the contour map is used to determine the contour edge points of the human body included in the human body image; Determining at least one contour edge point as the measurement point corresponding to the index to be measured in the human body image according to whether the index to be measured involves the contour edge points of the human body.
5. The method according to claim 4, characterized in that The determining at least one contour edge point as the measurement point corresponding to the index to be measured in the human body image according to whether the index to be measured involves the contour edge points of the human body includes: If the index to be measured is the physical size corresponding to the distance between one feature point and one contour edge point of the human body, using the feature point as one measurement point corresponding to the index to be measured in the human body image; According to the measurement position of the human body for the to-be-measured index, select a target feature point from the feature points. Taking the target feature point as the starting position, perform pixel-by-pixel scanning in the measurement direction corresponding to the to-be-measured index, and then use the obtained human body contour edge points as the other end measurement points corresponding to the to-be-measured index in the human body image.
6. The method according to claim 4, wherein The method for determining at least one contour edge point in the contour edge points of the human body as the measurement point corresponding to the to-be-measured index in the human body image according to whether the to-be-measured index involves the contour edge points of the human body includes: If the to-be-measured index is a physical dimension corresponding to the distance between two contour edge points of the human body, determine the scanning range corresponding to the to-be-measured index according to the contour map of the human body image and the feature points, and perform line-by-line scanning in the scanning range to obtain a number of human body contour edge points. According to the measurement position of the human body for the to-be-measured index, the scanning direction of line-by-line scanning, and the numerical magnitudes of the aforenamed number of human body contour edge points in a specific direction, determine the two end measurement points corresponding to the to-be-measured index in the human body image among the aforenamed number of human body contour edge points.
7. The method according to claim 4, wherein The method for determining at least one contour edge point in the contour edge points of the human body as the measurement point corresponding to the to-be-measured index in the human body image according to whether the to-be-measured index involves the contour edge points of the human body includes: If the to-be-measured index needs to be measured between two contour edge points of the human body, select a target feature point from the feature points according to the measurement position of the human body for the to-be-measured index. Taking the target feature point as the starting position, perform pixel-by-pixel scanning in the two measurement directions corresponding to the to-be-measured index respectively, and then use the obtained two human body contour edge points as the two end measurement points corresponding to the to-be-measured index in the human body image.
8. A device for calculating an index to be measured, characterized in that The device includes: A first determination unit, configured to determine the pixel numbers corresponding to the to-be-measured index and the reference object with a known physical dimension in the acquired image respectively, where the to-be-measured index and the reference object are in the same or different images, and the different images are captured by cameras with the same focal length. A second determination unit, configured to determine the correspondence between the unit pixel of the reference object and the physical dimension according to the physical dimension of the reference object and the pixel number corresponding to the reference object. A third determination unit, configured to collect the distances from the focal planes of the reference object and the to-be-measured index to the lens respectively, so as to determine the correspondence between the unit pixel of the to-be-measured index and the physical dimension according to the distances from the focal planes of the two to the lens and the correspondence between the unit pixel of the reference object and the physical dimension. A calculation unit, configured to calculate the to-be-measured index according to the correspondence between the unit pixel of the to-be-measured index and the physical dimension and the pixel number corresponding to the to-be-measured index.
9. An electronic device, characterized in that, It includes a communication interface, a processor, a memory, and a bus, and the communication interface, the processor, and the memory are interconnected with each other through the bus. Machine-readable instructions are stored in the memory, and the processor executes the method according to any one of claims 1 to 7 by calling the machine-readable instructions.
10. A machine-readable storage medium, characterized in that, The machine-readable storage medium stores machine-readable instructions, and when the machine-readable instructions are called and executed by a processor, the method according to any one of claims 1 to 7 is implemented.