Image data processing method and device

Through the combination of image acquisition unit and infrared ranging unit, the key point spacing and pixel values ​​are obtained to correct the depth map, solving the problem of low accuracy in screen distance and posture calculation, and achieving higher calculation accuracy and health monitoring effects.

CN119360431BActive Publication Date: 2025-08-29BOE YIYUN (HANGZHOU) TECH CO LTD +2
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411897614.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-23
Publication Date
2025-08-29
Estimated Expiration
2044-12-23

AI Technical Summary

Technical Problem

In the prior art, the use of a monocular camera distance measurement method leads to low calculation accuracy of screen distance and screen posture.

Method used

Through the image acquisition unit and infrared ranging unit of the terminal device, the face image and depth map of the target user are collected, the key point spacing is obtained, the depth map is corrected using pixel values ​​and current interval distances to determine the panoramic distance and posture.

Benefits of technology

The calculation accuracy of screen distance and screen posture is improved, the error of the monocular camera distance measurement method is avoided, and the accuracy of health monitoring is enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119360431B_ABST
    Figure CN119360431B_ABST
Patent Text Reader

Abstract

The present application provides a method and device for processing image data, which relates to the field of image processing technology. The method includes: using an image acquisition unit to acquire a current facial image of a target user, and determining the current facial parameters and depth map of the target user based on the current facial image; obtaining the key point spacing corresponding to the current facial features, and determining the current interval distance between the target user and the terminal device based on the key point spacing and the current facial parameters; for each preset facial key point, obtaining the pixel value of the target pixel point corresponding to the preset facial key point on the depth map; using the pixel value and the current interval distance to correct the depth map, obtain the panoramic distance at the current moment, and use the panoramic distance to determine the current posture of the target user. By adopting the above-mentioned method and device for processing image data, the problem of low accuracy in calculating the screen distance and screen posture between the user and the electronic device is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to a method and device for processing image data. Background Art

[0002] With the rapid development of digital technology, people are using electronic devices for an increasing number of times and in an increasing number of situations. Smartphones, tablets, computer monitors, televisions, and other electronic devices have become part of daily life. This trend not only affects people's vision but can also negatively impact posture, sleep quality, and even physical health. Therefore, accurately monitoring users' screen distance and posture is crucial.

[0003] Currently, a monocular camera is typically used to capture a facial image of a target user while viewing a terminal device. Distance measurement is then performed based on this facial image to determine the distance between the target user and the electronic device, as well as the user's posture when using the device. While this monocular camera-based distance measurement method offers the advantages of low cost and simple implementation, it can also suffer from significant measurement errors, resulting in low accuracy in calculating the user's distance from the device and their posture. Summary of the Invention

[0004] In view of this, the purpose of this application is to provide a method and device for processing image data to solve the problem of low calculation accuracy of screen distance and screen posture.

[0005] In a first aspect, an embodiment of the present application provides a method for processing image data, wherein a terminal device provides an image acquisition unit and an infrared ranging unit, and the method includes:

[0006] Using the image acquisition unit to acquire a current facial image of the target user, and determining current facial parameters and a depth map of the target user based on the current facial image, where the current facial parameters include current facial features;

[0007] Obtaining the key point distance between two preset facial key points representing the target user corresponding to the current facial features, and determining the current separation distance between the target user and the terminal device based on the key point distance and the current facial parameters, where the key point distance is determined based on the infrared ranging unit;

[0008] For each preset facial key point, obtain the pixel value of the target pixel point corresponding to the preset facial key point on the depth map;

[0009] The depth map is corrected using pixel values ​​and the current interval distance to obtain the panoramic distance at the current moment, so as to use the panoramic distance to determine the current posture of the target user. The panoramic distance is used to reflect the distance between each position on the target user in the depth map and the terminal device.

[0010] Optionally, the pixel value includes a first pixel value and a second pixel value, and the depth map is corrected using the pixel value and the key point spacing, including: normalizing the first pixel value and the second pixel value to obtain a normalized distance; determining a distance correction value based on the normalized distance and the current interval distance; and using the distance correction value to correct the depth map matrix corresponding to the depth map to determine the panoramic distance corresponding to the target user at the current moment.

[0011] Optionally, an infrared ranging unit is provided by the terminal device. Before using the image acquisition unit to acquire the current facial image of the target user, the method also includes: when the target user performs facial recognition registration for the terminal device, using the image acquisition unit to obtain the initial facial image of the target user, and obtaining initial facial parameters based on the initial facial image, the initial facial parameters including the initial facial rotation angle and the initial pixel distance corresponding to two preset facial key points; using the infrared ranging unit to determine the initial interval distance between the target user and the terminal device; using the initial interval distance, the initial facial rotation angle and the device parameters of the image acquisition unit, correcting the initial pixel distance to obtain the key point spacing.

[0012] Optionally, the initial pixel distance is corrected using the initial interval distance, the initial facial rotation angle and the device parameters of the image acquisition unit, including: constructing an interval distance equation based on the pinhole imaging principle, the interval distance equation including the key point spacing; substituting the initial pixel distance, the initial interval distance, the initial facial rotation angle and the device parameters into the interval distance equation to determine the key point spacing.

[0013] Optionally, the current facial parameters also include the current facial rotation angle, the current pixel distance between two preset facial key points on the current facial image, and the current interval distance between the target user and the terminal device is determined based on the key point spacing and the current facial parameters, including: substituting the key point spacing, the current pixel distance, the current facial rotation angle and the device parameters of the image acquisition unit into the interval distance equation to determine the current interval distance.

[0014] Optionally, the device parameters include the focal length and internal parameters of the image acquisition unit, and based on the pinhole imaging principle, an interval distance expression is constructed, including: determining a first expression based on the ratio of the pixel distance to the cosine value of the facial rotation angle; determining a second expression based on the ratio of the product of the internal parameter, the key point spacing and the focal length to the interval distance; establishing an interval distance expression based on the equation relationship between the first expression and the second expression.

[0015] Optionally, the initial facial parameters also include initial facial features. After substituting the initial pixel distance, initial interval distance, initial facial rotation angle and device parameters into the interval distance equation to determine the key point spacing, the method also includes: establishing and saving the correspondence between the initial facial features and the key point spacing, so as to use the correspondence to obtain the key point spacing corresponding to the target user at the current moment.

[0016] Optionally, determining the distance correction parameter according to the normalized distance and the current interval distance includes: determining the distance correction parameter according to a ratio of the current interval distance to the normalized distance.

[0017] Optionally, obtaining the pixel value of the target pixel point corresponding to the preset facial key point on the depth map includes: obtaining the position information of the preset facial key point in the current face image; selecting the target pixel point corresponding to the position information in the depth map, and obtaining the pixel value of the target pixel point corresponding to the position information.

[0018] In a second aspect, an embodiment of the present application further provides an image data processing device, which provides an image acquisition unit and an infrared ranging unit through a terminal device, and the device includes:

[0019] A parameter and image acquisition module is used to use the image acquisition unit to acquire the current facial image of the target user, and determine the current facial parameters and depth map of the target user based on the current facial image, where the current facial parameters include current facial features;

[0020] A distance determination module is used to obtain the key point distance between two preset facial key points corresponding to the current facial features and used to represent the actual distance of the target user, and determine the current separation distance between the target user and the terminal device based on the key point distance and the current facial parameters. The key point distance is determined based on the infrared ranging unit;

[0021] A pixel value acquisition module is used to obtain the pixel value of a target pixel point corresponding to each preset facial key point on the depth map;

[0022] The panoramic distance determination module is used to correct the depth map using pixel values ​​and the current interval distance to obtain the panoramic distance at the current moment, so as to use the panoramic distance to determine the current posture of the target user. The panoramic distance is used to reflect the distance between each position on the target user in the depth map and the terminal device.

[0023] The embodiments of the present application bring the following beneficial effects:

[0024] An image data processing method and device provided in an embodiment of the present application can determine the current interval distance representing the screen distance between the target user and the terminal device based on the key point interval, and the key point interval is determined based on the infrared ranging unit, which improves the calculation accuracy of the current interval distance and avoids the problem of low accuracy in calculating the screen distance caused by the monocular camera ranging method. At the same time, the panoramic distance is obtained by correcting the depth map using the pixel values ​​in the depth map and the current interval interval. It does not rely solely on the face image to calculate the distance between the user and the electronic device, but also improves the accuracy of the screen posture calculation. Compared with the image data processing method in the prior art, the problem of low accuracy in calculating the screen distance and screen posture between the user and the electronic device is solved.

[0025] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can be obtained based on these drawings without creative work.

[0027] Figure 1 A flowchart showing a method for processing image data provided by an embodiment of the present application is shown;

[0028] Figure 2 A flowchart of a depth map correction method provided by an embodiment of the present application is shown;

[0029] Figure 3 A schematic diagram showing the structure of an image data processing device provided in an embodiment of the present application is shown;

[0030] Figure 4 A schematic structural diagram of an electronic device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION

[0031] In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. The components of the embodiments of the present application generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application for which protection is claimed, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, each other embodiment obtained by those skilled in the art without making creative work falls within the scope of protection of the present application.

[0032] It is worth noting that prior to the filing of this application, with the rapid development of digital technology, people were using electronic devices for an increasing number of times and in an increasing number of situations. For example, smartphones, tablets, computer monitors, televisions, and other electronic devices have become part of daily life. This trend not only affects people's vision health, but can also have adverse effects on posture, sleep quality, and even physical health.

[0033] For example, prolonged close viewing of electronic screens is one of the main causes of aggravated vision problems such as myopia and dry eye. By monitoring and reminding users to maintain an appropriate viewing distance, we can effectively reduce the strain on the eyes and prevent or alleviate these vision problems.

[0034] At the same time, incorrect screen posture, such as looking down at a phone or leaning forward over a computer, can not only cause neck and back pain but also affect spinal health. Monitoring screen distance can help users identify posture issues and encourage them to adjust to a healthier sitting or standing position. Proper screen distance helps reduce visual fatigue, allowing users to maintain attention and focus longer, thereby improving work and learning efficiency.

[0035] For example, for parents, monitoring the distance and duration of their children's screen use can help control their dependence on electronic devices, encourage more parent-child interaction and outdoor activities, and promote their children's all-round development. Through monitoring and feedback mechanisms, users can more intuitively understand their screen usage habits, thereby enhancing their awareness of healthy lifestyles. This increased awareness may prompt users to adopt more positive health behaviors, such as regular eye exercises and increased outdoor activities.

[0036] At the same time, as market demand for health monitoring increases, the technology for monitoring screen distance will continue to develop and improve. This will drive innovation in related hardware and software, providing users with more convenient and accurate health management services.

[0037] Therefore, accurately monitoring the user's screen distance and posture is crucial. Currently, a monocular camera is usually used to capture a facial image of the target user while viewing a terminal device, and distance measurement is performed based on the captured facial image to determine the distance between the target user and the electronic device and the posture of the user using the electronic device. This method of relying on a monocular camera for distance measurement has the advantages of low cost and simple implementation. However, the measurement error is large, resulting in low accuracy in calculating the screen distance and posture between the user and the electronic device.

[0038] Based on this, an embodiment of the present application provides a method for processing image data to improve the accuracy of calculating the screen distance and screen posture between a user and an electronic device.

[0039] See also Figure 1 , Figure 1 This is a flow chart of a method for processing image data provided by an embodiment of the present application. Figure 1 As shown, the image data processing method provided in the embodiment of the present application provides an image acquisition unit and an infrared ranging unit through a terminal device, and the method includes:

[0040] Step S101, using an image acquisition unit to acquire a current face image of a target user, and determining current facial parameters and a depth map of the target user based on the current face image;

[0041] Step S102: obtaining a key point distance between two preset facial key points corresponding to the current facial feature and representing the actual distance between the target user and the terminal device, and determining the current distance between the target user and the terminal device based on the key point distance and the current facial parameters;

[0042] Step S103: for each preset facial key point, obtaining the pixel value of the target pixel point corresponding to the preset facial key point on the depth map;

[0043] Step S104 : Correcting the depth map using the pixel values ​​and the current interval distance to obtain the panoramic distance at the current moment, so as to determine the current posture of the target user using the panoramic distance.

[0044] Through the above method, the present application can determine the current interval distance that represents the screen distance between the target user and the terminal device based on the key point spacing, and the key point spacing is determined based on the infrared ranging unit, which improves the calculation accuracy of the current interval distance and avoids the problem of low accuracy in calculating the screen distance caused by the monocular camera ranging method. At the same time, the panoramic distance is obtained by correcting the depth map using the pixel values ​​in the depth map and the current interval spacing. It does not rely solely on the face image to calculate the distance between the user and the electronic device, but also improves the accuracy of the screen posture calculation, solving the problem of low accuracy in calculating the screen distance and screen posture between the user and the electronic device.

[0045] Below Figure 1 Each step is explained in detail.

[0046] In step S101 , an image acquisition unit is used to acquire a current face image of a target user, and current facial parameters and a depth map of the target user are determined based on the current face image.

[0047] The image acquisition unit may refer to an image acquisition device. For example, the image acquisition unit may be a monocular camera or a binocular camera.

[0048] The target user may refer to a user who is currently using the terminal device.

[0049] The current facial parameters may refer to parameters used to characterize the target user's facial position and features. Facial parameters include the current facial features, the current facial rotation angle, and the current pixel distance between two preset facial key points on the current facial image. The current facial features are used to uniquely identify a user's facial features. The current facial features include but are not limited to facial contour features and facial expression features. The current facial rotation angle may refer to the rotation angle of the target user's face relative to the plane where the terminal device is located. The current pixel distance may refer to the pixel distance between two preset facial key points on the facial image. The unit of the current pixel distance is pixel.

[0050] The preset facial key points are pre-selected key points on the user's face. The two preset facial key points are symmetrical about the midline of the target user's face. For example, the two preset facial key points can be the inner canthi of the eyes, i.e., the two corners of the eyes located in the center of the face; the two preset facial key points can also be the outer canthi of the eyes. Those skilled in the art can select the specific locations of the preset facial key points based on actual circumstances, but the two preset facial key points must be symmetrical about the midline of the face to further improve calculation accuracy.

[0051] A depth map may refer to an image that represents the distance between each location on the target user's body and the image acquisition unit (terminal device). Specifically, the pixel value of each pixel on the depth map represents the relative distance between that location and the image acquisition unit (terminal device). Pixel values ​​range from 0 to 255. A larger pixel value and a darker color indicate a location closer to the image acquisition unit. A smaller pixel value and a lighter color indicate a location farther from the image acquisition unit.

[0052] In an embodiment of the present application, when a target user is viewing a terminal device, an image acquisition unit on the terminal device captures the target user's current facial image in real time and uses a facial key point detection algorithm to detect key points in the current facial image to determine current facial parameters. Here, there are multiple key points, including two inner corners of the eyes, i.e., two preset facial key points. Furthermore, a depth map of the target user can be determined using a deep learning model. For example, the current facial image is input into a deep learning model to obtain a depth map. The deep learning model can be depth-anything, fcrn-depth prediction, dense depth, etc.

[0053] In addition, before using the image acquisition unit to capture the current facial image of the target user, it is necessary to determine the key point spacing of the target user when the target user performs face recognition registration, and save the key point spacing, so that when the target user subsequently uses the terminal device, the saved key point spacing can be directly called to determine the current interval distance.

[0054] When a target user performs facial recognition registration on a terminal device, an image acquisition unit may be used to obtain an initial facial image of the target user, and initial facial parameters may be obtained based on the initial facial image. During facial recognition registration, the facial recognition algorithm is also used to obtain the initial facial parameters, which include initial facial features, initial facial rotation angles, and initial pixel distances. The initial facial features may refer to the facial features obtained during facial recognition registration, the initial facial rotation angles may refer to the facial rotation angles obtained during facial recognition registration, and the initial pixel distance may refer to the pixel distance between two preset facial key points on the facial image obtained during facial recognition registration.

[0055] While acquiring the initial facial parameters, the infrared ranging unit can be used to determine the initial separation distance between the target user and the terminal device. This initial separation distance refers to the actual distance between the target user and the terminal device obtained during facial recognition registration. At this point, the infrared ranging unit on the terminal device transmits an infrared signal at a specific frequency in a fixed direction. Based on the time difference between the received reflected signal and the transmitted infrared signal, the distance between the target user and the infrared ranging unit is calculated. This distance is the initial separation distance. To this end, after the image acquisition unit captures the current facial image, it also detects whether the face is within a specified area. If not, the target user is prompted to move within the specified area so that the infrared light emitted by the infrared ranging unit can illuminate the target user's face. For example, this ensures that the emitted infrared light illuminates the target user's forehead to accurately measure the initial separation distance between the target user and the terminal device during facial recognition registration.

[0056] After determining the initial spacing distance, the initial pixel distance can be corrected using the initial spacing distance, the initial facial rotation angle, and the device parameters of the image acquisition unit to obtain the key point spacing. Here, a spacing distance equation can be constructed based on the pinhole imaging principle. Then, the initial pixel distance, the initial spacing distance, the initial facial rotation angle, and the device parameters are substituted into the spacing distance equation to determine the key point spacing. The spacing distance equation includes the key point spacing, the facial rotation angle is denoted as: α, and the pixel distance is denoted as: , the interval distance is recorded as: H, the equipment parameters include the focal length and internal parameters of the image acquisition unit, the internal parameters include the distortion coefficient, the focal length is recorded as: F, the internal parameter is recorded as: A, the key point spacing is recorded as: .

[0057] When constructing the interval distance expression, you can use the pixel distance The ratio of the cosine value cosα of the facial rotation angle determines the first expression, that is, the first expression is At the same time, according to the internal reference A, key point spacing The product of the three and the ratio of the distance H is used to determine the second expression, that is, the second expression is: In this way, the separation distance expression can be established based on the equality relationship between the first expression and the second expression. The separation distance expression is: Here, the pixel distance The value of is the initial pixel distance, the value of the facial rotation angle α is the initial facial rotation angle, and the value of the interval distance H is the initial interval distance. In addition, the internal parameters A and focal length F are also known. Therefore, the key point spacing during face recognition registration can be calculated. The key point spacing is an inherent parameter of the target user and is fixed. Therefore, the key point spacing can be directly saved and directly retrieved when the target user uses the terminal device later. In addition, since the current interval distance H is measured based on the infrared ranging unit, it is more accurate, which also improves the accuracy of the calculation of the key point spacing.

[0058] To improve the accuracy and speed of subsequent distance calculations, after determining the keypoint distance, a correspondence between the initial facial features and the keypoint distance is established and saved on the terminal device. This correspondence can be used to retrieve the keypoint distance corresponding to the target user at a future moment (for example, the current moment is a future moment after facial recognition registration). This allows each user of the terminal device to register only once. Upon subsequent use of the terminal device, the user's keypoint distance can be retrieved simply by matching the user's facial features.

[0059] In step S102, the actual distance between two preset facial key points representing the target user corresponding to the current facial features is obtained, and the current distance between the target user and the terminal device is determined based on the key point distance and the current facial parameters. The key point distance is determined based on the infrared ranging unit.

[0060] The infrared distance measuring unit may refer to a device that uses infrared rays to measure distance. For example, the infrared distance measuring unit may be an infrared rangefinder.

[0061] The key point distance may refer to the actual distance between the two inner corners of the target user's eyes. The unit of the key point distance may be centimeters or meters.

[0062] In the embodiment of the present application, when the target user uses the terminal device again at the current moment, it is only necessary to obtain the target user's current facial image and use the current facial image to determine the target user's current facial parameters. Then, using the established correspondence between initial facial features and key point spacing, an initial facial feature that matches the current facial feature is selected from the database, and the key point spacing corresponding to the initial facial feature is used as the key point spacing corresponding to the acquired current facial feature.

[0063] After obtaining the target user's key point spacing, the key point spacing, current pixel distance, current facial rotation angle, and current device parameters of the image acquisition unit can be substituted into the aforementioned separation distance equation to determine the current separation distance between the target user and the terminal device. This allows the target user to quickly calculate the actual separation distance between them at any given time based on the target user's key point spacing stored in the database. Furthermore, since this key point spacing is based on the measurement results of the infrared ranging unit, it is highly accurate, thereby also improving the accuracy of the calculated actual separation distance.

[0064] It should be noted that while the infrared ranging unit's measurement results offer the advantage of high accuracy, because it uses a single infrared ray to measure distance, it can only measure the distance from a point on the infrared ray's path to the infrared ranging unit. However, if the target user is not in the path of the infrared ray emitted by the infrared ranging unit while viewing the terminal device, the distance between the target user and the terminal device cannot be measured, and this is a common occurrence. Therefore, the infrared ranging unit cannot be relied upon to measure the distance between the target user and the terminal device during daily use.

[0065] In step S103, for each preset facial key point, the pixel value of the target pixel point corresponding to the preset facial key point on the depth map is obtained.

[0066] In the embodiment of the present application, when obtaining the pixel value of the target pixel corresponding to each preset facial key point, the position information of the preset facial key point in the current face image can be obtained first. Then, the target pixel corresponding to the position information is selected in the depth map, and the pixel value of the target pixel corresponding to the position information is obtained.

[0067] Taking the above example, the position coordinates of the two inner corners of the eyes in the current face image are first obtained, and the pixel points corresponding to the position coordinates of the two inner corners of the eyes are selected in the depth map as the target pixel points. The pixel value of the target pixel point is the pixel value of the two inner corners of the eyes in the depth map.

[0068] The target pixel includes a first target pixel and a second target pixel, and the pixel value includes a first pixel value and a second pixel value, wherein the first pixel value is the pixel value of the first target pixel, and the second pixel value is the pixel value of the second target pixel. Taking the left and right inner corners of the eye as an example, the first pixel value may represent the pixel value of the left inner corner of the eye, and the second pixel value may represent the pixel value of the right inner corner of the eye.

[0069] The depth map is represented by a depth map matrix, which is denoted as: B. The pixel value of each pixel in the depth map matrix represents the distance between the position and the image acquisition unit.

[0070] In step S104 , the depth map is corrected using the pixel values ​​and the current interval distance to obtain the panoramic distance at the current moment, so as to determine the current posture of the target user using the panoramic distance.

[0071] The panoramic distance is used to reflect the distance between each location on the target user in the depth map and the terminal device. The panoramic distance is represented by the panoramic distance matrix, which is denoted as: C.

[0072] Refer to the following Figure 2 To introduce the process of correcting the depth map using pixel values ​​and key point distances.

[0073] Figure 2 FIG. 1 shows a flow chart of a depth map correction method provided by an embodiment of the present application. Figure 2 As shown, the depth map correction method includes:

[0074] Step S201 : normalize the first pixel value and the second pixel value to obtain a normalized distance.

[0075] Here, the first pixel value is recorded as: , the second pixel value is recorded as: , the normalized distance is recorded as: . It can be normalized by the following formula:

[0076] ;

[0077] Among them, the normalized distance It is a value ranging from 0 to 1, which is obtained by normalizing the mean of the pixel values ​​corresponding to the two preset facial key points of the target user.

[0078] Step S202: determining a distance correction value according to the normalized distance and the current interval distance.

[0079] Here, the distance correction value can be determined based on the ratio of the current interval distance to the normalized distance. For example, the distance correction value is recorded as: param, and the current interval distance is recorded as: H, then .

[0080] Step S203: Correcting the depth map matrix corresponding to the depth map using the distance correction value to determine the panoramic distance corresponding to the target user at the current moment.

[0081] Here, the panoramic distance can be calculated by the following formula:

[0082] .

[0083] In this way, the panoramic matrix C can be used to represent the actual distance between each location on the target user and the terminal device in the depth map. Based on the actual distance between each location on the target user and the terminal device, the target user's current posture can be calculated. For example, the target user's current posture can be calculated using a neural network model or based on geometric relationships. The specific method for calculating the current posture is not detailed here.

[0084] At the same time, the system can determine whether the target user's current posture meets the warning requirements based on the current posture. For example, if the head-down angle in the current posture is less than a first set angle threshold, or the body leaning forward angle in the current posture is greater than a second set angle threshold, then the warning requirements are determined to be met. If the warning requirements are met, a posture error prompt message will be sent to the target user to promptly remind the user to view the electronic device in the correct posture and improve usage habits.

[0085] Based on the same inventive concept, an image data processing device corresponding to the image data processing method is also provided in the embodiment of the present application. Since the principle of solving the problem by the device in the embodiment of the present application is similar to the above-mentioned image data processing method in the embodiment of the present application, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.

[0086] See also Figure 3 , Figure 3 This is a schematic diagram of the structure of an image data processing device provided in an embodiment of the present application. Figure 3 As shown in , an image acquisition unit and an infrared ranging unit are provided by a terminal device, and the image data processing device 300 includes:

[0087] The parameter and image acquisition module 301 is used to acquire the current face image of the target user using the image acquisition unit, and determine the facial parameters and depth map of the target user based on the current face image, where the current facial parameters include current facial features;

[0088] A distance determination module 302 is configured to obtain a key point distance between two preset facial key points representing a target user, corresponding to the current facial features, and determine a current distance between the target user and the terminal device based on the key point distance and the current facial parameters. The key point distance is determined based on an infrared ranging unit.

[0089] The pixel value acquisition module 303 is used to obtain the pixel value of the target pixel corresponding to each preset facial key point on the depth map;

[0090] The panoramic distance determination module 304 is used to correct the depth map using pixel values ​​and the current interval distance to obtain the panoramic distance at the current moment, so as to use the panoramic distance to determine the current posture of the target user. The panoramic distance is used to reflect the distance between each position on the target user in the depth map and the terminal device.

[0091] See also Figure 4 , Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 4 As shown in FIG, the electronic device 400 includes a processor 410 , a memory 420 and a bus 430 .

[0092] The memory 420 stores machine-readable instructions executable by the processor 410. When the electronic device 400 is running, the processor 410 communicates with the memory 420 via the bus 430. When the machine-readable instructions are executed by the processor 410, the above-mentioned Figure 1 The steps of the method for processing image data in the method embodiment shown are specifically implemented in accordance with the method embodiment and will not be described in detail here.

[0093] The embodiment of the present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the computer program can execute the above-mentioned Figure 1 The steps of the method for processing image data in the method embodiment shown are specifically implemented in accordance with the method embodiment and will not be described in detail here.

[0094] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0095] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is merely a logical function division. There may be other division methods in actual implementation. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed may be through some communication interface, indirect coupling or communication connection of devices or units, which may be electrical, mechanical or other forms.

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

[0097] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0098] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes various media that can store program code, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0099] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present application, which are used to illustrate the technical solutions of the present application, rather than to limit them. The scope of protection of the present application is not limited thereto. Although the present application has been described in detail with reference to the above-mentioned embodiments, those skilled in the art should understand that any person skilled in the art can modify or easily conceive of changes to the technical solutions described in the above-mentioned embodiments within the technical scope disclosed in the present application, or perform equivalent replacements for some of the technical features thereof. These modifications, changes, or replacements do not deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.

Claims

1. A method for processing image data, characterized in that: Providing an image acquisition unit and an infrared ranging unit through a terminal device, the method includes: Using the image acquisition unit to acquire a current facial image of the target user, and determining current facial parameters and a depth map of the target user based on the current facial image, wherein the current facial parameters include current facial features; Obtaining a key point distance corresponding to the current facial feature and used to represent the actual distance between two preset facial key points of the target user, and determining a current interval distance between the target user and the terminal device based on the key point distance and the current facial parameters, wherein the key point distance is determined based on an infrared ranging unit; For each preset facial key point, obtaining a pixel value of a target pixel point corresponding to the preset facial key point on the depth map; Correcting the depth map using the pixel values ​​and the current interval distance to obtain a panoramic distance at the current moment, so as to determine the current posture of the target user using the panoramic distance, where the panoramic distance is used to reflect the distance between each position on the target user in the depth map and the terminal device; An infrared ranging unit is provided by the terminal device. Before using the image acquisition unit to acquire the current face image of the target user, the method further includes: When the target user performs face recognition registration on the terminal device, the image acquisition unit is used to obtain an initial face image of the target user, and initial facial parameters are obtained based on the initial face image, wherein the initial facial parameters include an initial face rotation angle and an initial pixel distance corresponding to the two preset facial key points; Determine the initial distance between the target user and the terminal device using the infrared ranging unit; Correcting the initial pixel distance using the initial interval distance, the initial facial rotation angle, and device parameters of the image acquisition unit to obtain a key point spacing; The correcting the initial pixel distance using the initial interval distance, the initial facial rotation angle, and the device parameters of the image acquisition unit includes: Based on the pinhole imaging principle, a spacing distance equation is constructed, wherein the spacing distance equation includes the key point spacing; Substituting the initial pixel distance, the initial separation distance, the initial facial rotation angle, and the device parameters into the separation distance equation to determine the keypoint spacing; The device parameters include the focal length and internal parameters of the image acquisition unit. The spacing distance expression constructed based on the pinhole imaging principle includes: Determine a first expression based on a ratio of a pixel distance to a cosine value of a facial rotation angle; Determine a second expression based on a ratio of a product of the internal parameter, the key point spacing, and the focal length to the spacing distance; An interval distance expression is established based on the equality relationship between the first expression and the second expression.

2. The method according to claim 1, characterized in that The pixel value includes a first pixel value and a second pixel value, and the correcting the depth map using the pixel value and the key point distance includes: Normalizing the first pixel value and the second pixel value to obtain a normalized distance; determining a distance correction value according to the normalized distance and the current interval distance; The depth map matrix corresponding to the depth map is corrected using the distance correction value to determine the panoramic distance corresponding to the target user at the current moment.

3. The method according to claim 1, characterized in that The current facial parameters also include a current facial rotation angle and a current pixel distance between the two preset facial key points on the current facial image. The determining the current interval distance between the target user and the terminal device based on the key point spacing and the current facial parameters includes: The key point spacing, the current pixel distance, the current facial rotation angle, and the device parameters of the image acquisition unit are substituted into the interval distance equation to determine the current interval distance.

4. The method according to claim 1, wherein The initial facial parameters also include initial facial features. After substituting the initial pixel distance, the initial spacing distance, the initial facial rotation angle, and the device parameters into the spacing distance equation to determine the key point spacing, the method further includes: A correspondence between the initial facial features and the key point distances is established and saved, so as to obtain the key point distances corresponding to the target user by using the correspondence at the current moment.

5. The method according to claim 2, characterized in that The determining of a distance correction parameter according to the normalized distance and the current interval distance includes: A distance correction parameter is determined according to a ratio of the current interval distance to the normalized distance.

6. The method according to claim 1, characterized in that The obtaining of the pixel value of the target pixel corresponding to the preset facial key point on the depth map includes: Obtaining position information of the preset facial key points in the current face image; A target pixel point corresponding to the position information is selected in the depth map, and a pixel value of the target pixel point corresponding to the position information is obtained.

7. An image data processing device, characterized in that: The terminal device provides an image acquisition unit and an infrared ranging unit, and the device includes: a parameter and image acquisition module, configured to acquire a current facial image of a target user using the image acquisition unit, and determine current facial parameters and a depth map of the target user based on the current facial image, wherein the current facial parameters include current facial features; a distance determination module, configured to obtain a key point distance corresponding to the current facial feature and used to represent the actual distance between two preset facial key points of the target user, and determine a current separation distance between the target user and the terminal device based on the key point distance and the current facial parameters, wherein the key point distance is determined based on an infrared ranging unit; A pixel value acquisition module is used to obtain, for each preset facial key point, a pixel value of a target pixel point corresponding to the preset facial key point on the depth map; a panoramic distance determination module, configured to modify the depth map using the pixel values ​​and the current interval distance to obtain a panoramic distance at a current moment, so as to determine the current posture of the target user using the panoramic distance, wherein the panoramic distance is used to reflect the distance between each position on the target user in the depth map and the terminal device; The terminal device provides an infrared distance measurement unit, parameter and image acquisition module, and is also used for: When the target user performs face recognition registration on the terminal device, the image acquisition unit is used to obtain an initial face image of the target user, and initial facial parameters are obtained based on the initial face image, wherein the initial facial parameters include an initial face rotation angle and an initial pixel distance corresponding to the two preset facial key points; Determine the initial distance between the target user and the terminal device using the infrared ranging unit; Based on the pinhole imaging principle, a spacing distance equation is constructed, wherein the spacing distance equation includes the key point spacing; Substituting the initial pixel distance, the initial separation distance, the initial facial rotation angle, and device parameters into the separation distance equation to determine the keypoint spacing; The device parameters include the focal length and internal parameters of the image acquisition unit. The spacing distance expression constructed based on the pinhole imaging principle includes: Determine a first expression based on a ratio of a pixel distance to a cosine value of a facial rotation angle; Determine a second expression based on a ratio of a product of the internal parameter, the key point spacing, and the focal length to the spacing distance; An interval distance expression is established based on the equality relationship between the first expression and the second expression.

Citation Information

Patent Citations

  • Face image processing method and electronic equipment

    CN117495937A

  • Three-dimensional light field image generation method and device, display equipment and storage medium

    CN118381888A

  • Distance detection method and apparatus, control method and apparatus, and storage medium and electronic device

    WO2023056811A1