Calorie content evaluation method and device based on AR glasses
Automatically identify and calculate the calorie content of food through AR glasses, solving the problem of inefficiency of traditional manual input and achieving efficient and accurate calorie calculations.
Patent Information
- Application Number
- CN202411539020.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-31
- Publication Date
- 2025-03-25
AI Technical Summary
Traditional calorie calculation methods rely on user manual input, resulting in inefficient calculation of food calorie content.
Obtain the target image of the target food through AR glasses, automatically identify the volume and distance of the corresponding container of the food, and intelligently calculate the calorie content of the food based on preset calorie data.
The steps of users manually querying calorie content are avoided, which significantly improves computing efficiency and reduces artificial errors.
Smart Images

Figure CN119694497A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of AR glasses, and in particular to a calorie content assessment method and device based on AR glasses. Background Art
[0002] As public health awareness has significantly increased, accurate management of energy intake in daily diet has become a common pursuit. Calories, as a standard unit for measuring the energy content of food, are directly related to the balance between intake and consumption of calories, which is directly related to the individual's weight management. Therefore, paying close attention to the calorie content of food can help individuals scientifically plan and effectively regulate daily energy intake based on their own physiological needs and health goals, and achieve the maintenance and promotion of healthy weight.
[0003] At present, this trend has also actively promoted the construction and dissemination of healthy eating culture, and further promoted the improvement of the overall health level of society. However, the traditional calorie calculation method relies on manual input by users. Users manually input the name of the food and other related information to understand the calorie content of the food. However, this manual input process is cumbersome, resulting in low efficiency in calculating the calorie content of food.
[0004] Therefore, there is an urgent need for a calorie content assessment method and device based on AR glasses that can solve the above-mentioned technical problems. Summary of the invention
[0005] The present application provides a calorie content assessment method and device based on AR glasses. The method obtains a target image corresponding to a target food through AR glasses, automatically calculates based on the target image and distance, and obtains the calorie content corresponding to the target food, effectively solving the problem that the traditional calorie calculation method relies on the cumbersome and inefficient manual input of the user.
[0006] In a first aspect, the present application provides a calorie content assessment method based on AR glasses, which is applied to a server, and the method includes: receiving a target image sent by a target device, where the target device is an AR glasses, and the target image is an image of a target user wearing the target device and photographing a target food; inputting the target image into a preset model for processing to obtain first data, where the first data is volume data of a container corresponding to the target food; obtaining a target distance, where the target distance is the distance between the target device and the target food when the target image is photographed; calculating the first data and the target distance to obtain second data; determining a first calorie content based on the second data and the calorie data corresponding to the target food; and sending the first calorie content to the target device so that the target device displays the first calorie content corresponding to the target food to the target user.
[0007] By adopting the above technical solution, a target image corresponding to a target food photographed by AR glasses is received, and the target image is then input into a preset model for processing to obtain first data, automatically identify the volume data of a container corresponding to the target food, and then obtain the distance between the target device and the target food when the target image is photographed, that is, the target distance, and then calculate the target distance and the first data to obtain second data, and intelligently calculate the first calorie content corresponding to the target food, thereby avoiding the need for users to manually query the calorie content of the target food, thereby improving the efficiency of calculating the calorie content of food.
[0008] Optionally, the first calorie content is determined based on the second data and the calorie data corresponding to the target food, specifically including: identifying the target food to obtain a first sub-food and a second sub-food, where the first sub-food and the second sub-food are any two sub-foods from multiple sub-foods included in the target food; obtaining a first unit calorie data corresponding to the first sub-food, and determining a first weight corresponding to the first sub-food from the second data; calculating the first unit calorie data and the first weight to obtain a first sub-calorie content; obtaining a second unit calorie data corresponding to the second sub-food, and determining a second weight corresponding to the second sub-food from the second data; calculating the second unit calorie data and the second weight to obtain a second sub-calorie content; and adding the first sub-calorie content to the second sub-calorie content to obtain the first calorie content.
[0009] By adopting the above technical solution, multiple sub-foods in the target food are identified respectively to obtain the first sub-food and the second sub-food, and the first unit calorie data and the second unit calorie data corresponding to the first sub-food and the second sub-food are obtained in turn, and then the first weight and the second weight corresponding to the first sub-food and the second sub-food are obtained from the second data, and the sub-calorie content corresponding to the first sub-food and the second sub-food is calculated respectively, and then the first sub-calorie content is added to the second sub-calorie content to obtain the first calorie content. The whole calculation process is highly automated and does not require manual input by the user, which improves the calculation efficiency and reduces the errors that may be caused by manual operation of the user.
[0010] Optionally, obtaining the first unit calorie data corresponding to the first sub-food specifically includes: identifying the first sub-food to obtain a target food name; inputting the target food name into a preset calorie database for matching to obtain the first unit calorie data.
[0011] By adopting the above technical solution, the first sub-food is identified to obtain the target food name, and then the target food name is input into the preset calorie database for matching to obtain the first unit calorie data, thereby avoiding errors caused by manual input and improving the accuracy of calorie calculation.
[0012] Optionally, before receiving the target image sent by the target device, the method further includes: based on the target scanning indication, using the target device to scan the target food to obtain multiple scanning features; and integrating the multiple scanning features to obtain the target image.
[0013] By adopting the above technical solution, the target food is scanned at multiple angles using the target device, and multiple scanning features of the target food can be captured. The multiple scanning features can fully reflect the actual situation of the food. The multiple scanning features are then integrated and processed to obtain the target image. The automated scanning and integration processing process can significantly reduce manual intervention and improve the speed and efficiency of data processing.
[0014] Optionally, before inputting the target image into the preset model for processing to obtain the first data, the method also includes: extracting the target image to obtain target information; determining whether the target information exists in the preset component information table; when the target information does not exist in the preset component information table, confirming to input the target image into the preset model for processing to obtain the first data.
[0015] By adopting the above technical solution, the target image is extracted to obtain the target information, and the target information is compared with the preset component information table. It can be quickly determined whether the target image needs to be input into the preset model for processing. When the target information does not exist in the preset component information table, the target image is input into the preset model for processing, thereby improving the user experience.
[0016] Optionally, after determining whether the target information exists in the preset ingredient information table, the method also includes: when the target information exists in the preset ingredient information table, confirming the calculation of the target information to obtain a second calorie content; and sending the second calorie content to the target device so that the target user can view the second calorie content.
[0017] By adopting the above technical solution, when the target information exists in the preset ingredient information table, the second calorie content can be quickly generated according to the target information, and the second calorie content can be fed back to the user, eliminating the need for complex image processing and model calculations, and saving computing resources.
[0018] Optionally, after sending the first calorie content to the target device so that the target device displays the first calorie content corresponding to the target food to the target user, the method also includes: obtaining preference information corresponding to the target user, and determining a preset calorie content based on the preference information; determining whether the first calorie content is less than or equal to the preset calorie content; and when the first calorie content is greater than the preset calorie content, confirming to send a prompt message to the target device so that the target user can process the target food according to the prompt message.
[0019] By adopting the above technical solution, the preference information of the target user is obtained, the preset calorie content is determined according to the preference information, and it is automatically determined whether the first calorie content exceeds the preset calorie content. When the first calorie content is greater than the preset calorie content, a prompt message is sent to the target device. By sending the prompt message, the target user can be guided to pay attention to the calorie content of the target food, thereby achieving personalized diet management.
[0020] In a second aspect of the present application, a calorie content assessment device based on AR glasses is provided. The device is a server, and the server includes an acquisition unit, a processing unit, and a sending unit. The acquisition unit receives a target image sent by a target device, where the target device is AR glasses, and the target image is an image of a target user wearing the target device and photographing a target food; acquires a target distance, where the target distance is the distance between the target device and the target food when the target image is photographed; the processing unit inputs the target image into a preset model for processing to obtain first data, where the first data is volume data of a container corresponding to the target food; calculates the first data and the target distance to obtain second data; determines a first calorie content based on the second data and the calorie data corresponding to the target food; and the sending unit sends the first calorie content to the target device so that the target device displays the first calorie content corresponding to the target food to the target user.
[0021] Optionally, the processing unit is used to identify the target food to obtain a first sub-food and a second sub-food, where the first sub-food and the second sub-food are any two sub-foods among multiple sub-foods contained in the target food; the acquisition unit is used to obtain first unit calorie data corresponding to the first sub-food, and determine a first weight corresponding to the first sub-food from the second data; the processing unit is used to calculate the first unit calorie data and the first weight to obtain a first sub-calorie content; the acquisition unit is used to obtain second unit calorie data corresponding to the second sub-food, and determine a second weight corresponding to the second sub-food from the second data; the processing unit is used to calculate the second unit calorie data and the second weight to obtain a second sub-calorie content; and the first sub-calorie content is added to the second sub-calorie content to obtain the first calorie content.
[0022] Optionally, the processing unit is used to identify the first sub-food to obtain a target food name; input the target food name into a preset calorie database for matching to obtain first unit calorie data.
[0023] Optionally, the processing unit is used to scan the target food using the target device based on the target scanning indication to obtain multiple scanning features; and integrate the multiple scanning features to obtain a target image.
[0024] Optionally, the processing unit is used to extract the target image to obtain target information; determine whether the target information exists in the preset component information table; when the target information does not exist in the preset component information table, confirm that the target image is input into the preset model for processing to obtain the first data.
[0025] Optionally, the processing unit is used to confirm the calculation of the target information to obtain the second calorie content when the target information exists in the preset ingredient information table; the sending unit is used to send the second calorie content to the target device so that the target user can view the second calorie content.
[0026] Optionally, the acquisition unit is used to obtain preference information corresponding to the target user and determine the preset calorie content based on the preference information; the processing unit is used to determine whether the first calorie content is less than or equal to the preset calorie content; and the sending unit is used to confirm sending a prompt message to the target device when the first calorie content is greater than the preset calorie content, so that the target user can process the target food according to the prompt information.
[0027] In a third aspect of the present application, an electronic device is provided, which includes a processor, a memory, a user interface and a network interface, the memory is used to store instructions, the user interface and the network interface are used to communicate with other devices, and the processor is used to execute the instructions stored in the memory, so that an electronic device executes any one of the methods described above in the present application.
[0028] In a fourth aspect of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores instructions, and when the instructions are executed, any one of the above methods of the present application is executed.
[0029] In summary, one or more technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages: 1. Receive a target image corresponding to a target food photographed by AR glasses, then input the target image into a preset model for processing to obtain first data, automatically identify the volume data of the container corresponding to the target food, and then obtain the distance between the target device and the target food when the target image is photographed, that is, the target distance, and then calculate the target distance and the first data to obtain second data, and intelligently calculate the first calorie content corresponding to the target food, thereby avoiding the need for users to manually query the calorie content of the target food and improving the efficiency of calculating the calorie content of food.
[0030] 2. Identify multiple sub-foods in the target food respectively to obtain a first sub-food and a second sub-food, obtain first unit calorie data and second unit calorie data corresponding to the first sub-food and the second sub-food respectively in turn, obtain first weights and second weights corresponding to the first sub-food and the second sub-food respectively from the second data, calculate the sub-calorie content corresponding to the first sub-food and the second sub-food respectively, and then add the first sub-calorie content to the second sub-calorie content to obtain the first calorie content. The entire calculation process is highly automated and does not require manual input by the user, thereby improving the calculation efficiency and reducing errors that may be caused by manual operations of the user.
[0031] 3. Use the target device to scan the target food at multiple angles to capture multiple scanning features of the target food. Multiple scanning features can fully reflect the true situation of the food. Then, multiple scanning features are integrated to obtain the target image. The automated scanning and integration process can significantly reduce manual intervention and improve the speed and efficiency of data processing. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] Figure 1 is a flow chart of a calorie content assessment method based on AR glasses provided in an embodiment of the present application; Figure 2 is a structural schematic diagram of a calorie content assessment device based on AR glasses provided in an embodiment of the present application; Figure 3 It is a structural schematic diagram of an electronic device disclosed in an embodiment of the present application.
[0033] Explanation of the reference numerals: 201, acquisition unit; 202, processing unit; 203, sending unit; 300, electronic device; 301, processor; 302, communication bus; 303, user interface; 304, network interface; 305, memory. DETAILED DESCRIPTION
[0034] In order to enable technicians in this field to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this application, not all of the embodiments.
[0035] In the description of the embodiments of the present application, words such as "for example" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "for example" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "for example" or "for example" is intended to present related concepts in a specific way.
[0036] In the description of the embodiments of the present application, the meaning of the term "multiple" refers to two or more. For example, multiple systems refer to two or more systems, and multiple screen terminals refer to two or more screen terminals. In addition, the terms "first" and "second" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance or implicitly indicating the indicated technical features. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. The terms "include", "comprise", "have" and their variations all mean "including but not limited to", unless otherwise specifically emphasized.
[0037] As public health awareness has significantly increased, accurate management of energy intake in daily diet has become a common pursuit. Calories, as a standard unit for measuring the energy content of food, are directly related to the balance between intake and consumption of calories, which is directly related to the individual's weight management. Therefore, paying close attention to the calorie content of food can help individuals scientifically plan and effectively regulate daily energy intake based on their own physiological needs and health goals, and achieve the maintenance and promotion of healthy weight.
[0038] At present, this trend has also actively promoted the construction and dissemination of healthy eating culture, and further promoted the improvement of the overall health level of society. However, the traditional calorie calculation method relies on manual input by users. Users manually input the name of the food and other related information to understand the calorie content of the food. However, this manual input process is cumbersome, resulting in low efficiency in calculating the calorie content of food.
[0039] Therefore, how to solve the cumbersome and inefficient traditional calorie calculation method that relies on manual input by users is a problem that needs to be solved urgently. The embodiment of the present application provides a calorie content assessment method based on AR glasses, which is applied to a server. The server of the present application can be a platform that provides calorie assessment services for dietary health. Figure 1 is a flowchart of a calorie content assessment method based on AR glasses provided in an embodiment of the present application, refer to Figure 1 The method includes the following steps S101-S106.
[0040] S101: receiving a target image sent by a target device, where the target device is an AR pair of glasses, and the target image is an image of a target food photographed by a target user wearing the target device.
[0041] In the above S101, the server receives a target image from the AR glasses (target device) through a network communication interface. The target image is obtained by the target user wearing the AR glasses to shoot the target food. That is, based on the target scanning instruction, the target food is scanned using the target device to obtain multiple scanning features; the multiple scanning features are integrated and processed to obtain the target image. Specifically, the target user refers to a person who wears AR glasses and has a calorie assessment requirement for diet. The target food refers to the vegetables, fruits, rice, beverages, snacks, meat and other daily dietary foods to be assessed. The interactive interface of the target device (such as AR glasses) receives the target scanning instruction sent by the server. The target user uses the target device to start the scanning mode according to the instruction and prepares to scan the target food. The target device uses its built-in camera and sensor system to locate and focus the target food. This usually involves image recognition technology, such as edge detection, texture analysis, etc., to ensure the accuracy and clarity of the scan. After accurate positioning and focusing, the target device starts to perform the scanning operation. During the scanning process, the target device captures multiple angles, levels or feature information of the target food to obtain comprehensive scanning data. The target device may capture the appearance features of the target food, such as shape, size, color, texture, etc., through its camera. At the same time, the target device may also be equipped with a depth sensor to measure the distance between the target food and the device to obtain its three-dimensional morphological information. For target foods that require more in-depth analysis, the target device may also be equipped with advanced devices such as chemical sensors or spectrometers. These devices are capable of detecting chemical features such as chemical composition, microbial content, pH, etc. in the target food. The multiple scan features obtained are preprocessed, and the preprocessing includes steps such as removing noise, correcting distortion, and enhancing contrast to ensure the accuracy and reliability of the data. Next, the multiple scan features after preprocessing are fused. This usually involves feature-level fusion techniques such as weighted summation, feature connection, feature mapping, etc. By fusing the information of different features, a more comprehensive and accurate target image representation can be generated. After the feature fusion is completed, the fused feature data is converted into a visual target image using image processing algorithms (such as image reconstruction, rendering, etc.). At this time, the target image will contain all the important feature information of the target food and can be used for subsequent recognition and analysis.
[0042] S102: Input the target image into a preset model for processing to obtain first data, where the first data is volume data of a container corresponding to the target food.
[0043] In the above S102, the target image is processed in the preset model. Before obtaining the first data, the target image needs to be analyzed to determine whether the target food in the target image belongs to the type with an ingredient table, and then the corresponding operation is performed according to the judgment result, which specifically includes: extracting the target image to obtain the target information; determining whether the target information exists in the preset ingredient information table; when the target information does not exist in the preset ingredient information table, confirming that the target image is input into the preset model for processing to obtain the first data. Specifically, the target image is extracted, and the extraction refers to obtaining the text in the target image, and then integrating the obtained text to obtain the target information. In determining whether the target information exists in the preset ingredient table, the preset ingredient information table is a database containing known food ingredients and their corresponding information, which may include food names, nutritional ingredients, content, etc. It can be determined whether the target information matches a record in the preset ingredient information table by similarity calculation and other methods. If the target information does not exist in the preset ingredient information table, it means that the target food has not been marked with the corresponding nutritional ingredient table, and the target image needs to be input into the preset model for processing to determine the calorie data corresponding to the target food. For example, the target food is vegetables, and there is no nutritional information table on the container or packaging of the vegetables. In this case, the target image corresponding to the vegetables needs to be input into the preset model for processing.
[0044] In addition, before the target image is input into the preset model for processing and the first data is obtained, a preset model must be constructed first. The preset model is constructed based on deep learning (such as convolutional neural network CNN) or traditional image processing algorithms. Various containers for storing food can be stored in the preset model in advance, and images corresponding to various containers can be constructed so that the container storing the target food can be determined according to the target image later, and the volume data corresponding to the container, i.e., the first data, can be obtained. The preset model first preprocesses the image, such as resizing, noise removal, etc. Then, the preset model identifies the container where the target food is located from the image through feature extraction and classification recognition technology. Finally, the preset model estimates the volume of the container using geometric measurement or deep learning methods to obtain the first data.
[0045] Further, when the target information exists in the preset ingredient information table, it is confirmed that the target information is calculated to obtain the second calorie content; the second calorie content is sent to the target device so that the target user can view the second calorie content. Specifically, the text in the target image is extracted to obtain the target information, and then it is determined whether the target information exists in the preset ingredient information table. When the target information exists in the preset ingredient information table, the nutritional information corresponding to each of the target information is obtained, and then the nutritional information is calculated to obtain the second calorie content corresponding to the target image. For example, when the target food is milk, the milk box is photographed to obtain the target image, and then the text on the target image is extracted to obtain the nutritional ingredient table. At this time, the nutritional ingredient table refers to the target information. The target information exists in the preset ingredient information table, and then the target information is calculated to obtain the second calorie content corresponding to the target food. At this time, the target food milk belongs to the type of having an ingredient table.
[0046] S103: Acquire a target distance, where the target distance is the distance between the target device and the target food when the target image is captured.
[0047] In the above S103, when the target user uses the target device to shoot the target food, it is necessary to obtain the distance between the AR glasses and the target food when shooting the target image, that is, the target distance. The AR glasses are equipped with a distance sensor (such as an infrared sensor, an ultrasonic sensor, or a vision-based depth estimation technology). When the AR glasses shoot an image, the distance sensor will simultaneously measure the distance to the target food and send the distance data to the server.
[0048] S104: Calculate the distance between the first data and the target to obtain second data.
[0049] In the above S104, after the target image is input into the preset model for processing and the first data is obtained, the target distance is obtained, and the second data is obtained by calculation using the first data (container volume) and the target distance. The second data is an estimate of the actual volume of the target food. During the calculation process, it is necessary to consider that the container may not be completely filled, and the server needs to estimate the actual volume of the target food in the container based on the target distance and the geometric shape of the container. It may involve geometric calculations, such as correcting the estimated value of the container volume based on the distance and the viewing angle. After the calculation is completed, the second data, i.e., the estimated value of the actual volume of the target food, is obtained.
[0050] S105: Determine a first calorie content according to the second data and the calorie data corresponding to the target food.
[0051] In the above S105 , the total calorie content of the target food, ie, the first calorie content, is calculated using the second data (the actual volume of the target food) and the calorie data per unit volume of the target food.
[0052] In addition, according to the calorie data corresponding to the second data and the target food, the first calorie content is determined, specifically including: identifying the target food to obtain the first sub-food and the second sub-food, the first sub-food and the second sub-food being any two sub-foods among the multiple sub-foods contained in the target food; obtaining the first unit calorie data corresponding to the first sub-food, and determining the first weight corresponding to the first sub-food from the second data; calculating the first unit calorie data and the first weight to obtain the first sub-calorie content; obtaining the second unit calorie data corresponding to the second sub-food, and determining the second weight corresponding to the second sub-food from the second data; calculating the second unit calorie data and the second weight to obtain the second sub-calorie content; adding the first sub-calorie content and the second sub-calorie content to obtain the first calorie content. Specifically, after acquiring the target image, the server needs to identify the target food in the target image and determine whether there are multiple sub-foods in the target food, and one sub-food represents one food type. A deep learning model (such as a convolutional neural network CNN) can be used to identify the type and quantity of food in an image. The model analyzes features such as color, texture, and shape in the image to distinguish different types of food. If there are multiple sub-foods in the target image, the model may need to further analyze the boundaries and overlaps between the foods to accurately segment each sub-food. During the segmentation process, the model will output each segmented food, namely the first sub-food and the second sub-food. Next, the server needs to obtain the calorie data per unit weight or volume of each sub-food. For the first sub-food, its corresponding first unit calorie data needs to be found. The image containing the first sub-food can be preprocessed, including resizing, denoising, contrast enhancement, etc., to improve the accuracy of subsequent recognition. Use deep learning models (such as convolutional neural networks CNN) or traditional image processing methods (such as edge detection, texture analysis, etc.) to extract features from the image. These features may include color, shape, texture, etc., which are essential for distinguishing different types of food. The extracted features are input into a classifier, such as a support vector machine (SVM), random forest, or deep learning classifier, to identify the specific type of the first sub-food. The classifier matches the input image with a predefined food type template based on the similarity of the features, and outputs the most likely food name, i.e., the target food name. After successfully identifying the first sub-food and obtaining its name, the server needs to enter the target food name into the preset calorie database for matching to obtain the corresponding per-unit calorie data. The preset calorie database should contain various food names and their corresponding per-unit calorie data. The food names in the preset calorie database should be as comprehensive and accurate as possible to cover various types of food that the user may consume. At the same time, the database should also support fast retrieval and matching functions so that the corresponding calorie data can be quickly returned when the food name is received.The identified target food name is input as a query condition into the preset calorie database, and the server uses a string matching algorithm (such as exact matching, fuzzy matching, etc.) to search for food names that match the query condition in the preset calorie database. Once a food name that matches the query condition is found in the preset calorie database, the server returns the first unit calorie data corresponding to the food. At this time, the first unit calorie data is usually expressed in units of per gram, per milliliter, or per portion, depending on the storage method and standard of the preset calorie database. When the total volume of the target food (the second data) is known, the server needs to further analyze to determine the specific weight or volume (i.e., the first weight) of the first sub-food. This can be done in combination with image analysis, geometric measurement, and possible user input. For example, the server can use image segmentation technology to estimate the area or volume ratio occupied by the first sub-food in the image. Then, combined with the total volume (the second data) of the target food, the approximate weight or volume (i.e., the first weight) of the first sub-food can be calculated. The first unit calorie data is then multiplied by the first weight to obtain the first sub-calorie content of the first sub-food. For example, if the first sub-food is bread, the first unit calorie data corresponding to the first sub-food is obtained. If the first unit calorie data is 50 calories per gram and the first weight is 100 grams, the first sub-calorie content is 5000 calories. Then the second sub-food is processed according to the above processing process for the first sub-food, but for the second sub-food, the second sub-food can be identified first, and the food name corresponding to the second sub-food is input into the preset calorie database for matching to obtain the second unit calorie data. Then the weight or volume of the second sub-food (i.e., the second weight) is estimated from the second data using a similar method as described above. The second unit calorie data is multiplied by the second weight to obtain the second sub-calorie content. Since only the first sub-food and the second sub-food exist in the target image, the calorie content of the first sub-food and the second sub-food is added to obtain the total calorie content of the target food (i.e., the first calorie content). For example, if the first sub-calorie content is 5000 calories and the second sub-calorie content is 3000 calories, the first calorie content of the target food is 8000 calories. After completing the above steps, the total calorie content corresponding to the target food can be obtained.
[0053] S106: Send the first calorie content to the target device, so that the target device displays the first calorie content corresponding to the target food to the target user.
[0054] In the above S106, the calculated first calorie content is sent to the AR glasses (target device) so that it can display this information to the target user. The server encodes the first calorie content into a format suitable for transmission (such as JSON, XML, etc.). The encoded data is sent to the AR glasses through wireless communication technology (such as Wi-Fi, Bluetooth, etc.). After receiving the data, the AR glasses decode and display it on its screen for the target user to view. The user can see the calorie content information corresponding to the target food through the target device.
[0055] In a possible implementation, after obtaining the first calorie content corresponding to the target food, personalized calorie management suggestions can be provided according to the preference information set in advance by the target user, so that the target user can make a healthier and more reasonable diet choice, specifically including: obtaining the preference information corresponding to the target user, determining the preset calorie content according to the preference information; judging whether the first calorie content is less than or equal to the preset calorie content; when the first calorie content is greater than the preset calorie content, confirming to send a prompt information to the target device so that the target user can process the target food according to the prompt information. Specifically, the identity of the target user can be determined first, which can be achieved by user login, device pairing, biometrics (such as fingerprint, facial recognition), etc. Once the user identity is verified, the server retrieves the user's preference information from the user profile, database or cloud service. The preference information may include dietary preferences (such as low fat, high sugar, vegetarian, etc.), health goals (such as weight loss, muscle gain, weight maintenance, etc.), and calorie intake restrictions. The retrieved preference information is parsed into a format that can be understood and processed by the server. This may involve steps such as data cleaning, conversion and standardization to ensure the accuracy and consistency of the information. Based on the user's health goals and dietary preferences, the server applies a series of predefined calorie calculation rules to determine the preset calorie content. These rules may be based on nutritional principles, industry standards, or user-defined settings. The preset calorie content is not fixed, but is dynamically updated based on the user's actual intake, physical condition, or goal adjustments. The server is able to monitor these changes in real time and adjust the preset calorie content accordingly. After ensuring that the first calorie content of the target food has been obtained in the above manner, the first calorie content is compared with the preset calorie content. When the first calorie content is greater than the preset calorie content, the server needs to generate a prompt message. This prompt message should clearly and concisely point out the problem (such as "The calorie content of this food exceeds your preset limit") and may provide further suggestions or action guidelines (such as "It is recommended to choose a low-calorie alternative" or "Please consider reducing your total calorie intake today"). Determine the target device to which the prompt message is to be sent. This is usually based on the target user's current login status, device pairing information, or user preferences. Use appropriate communication protocols and interfaces to send the prompt message to the target device. This can be achieved through Bluetooth, Wi-Fi, mobile network, SMS, in-app notifications, etc. After receiving the prompt information, the target device displays it to the user through the user interface. The user can process the target food according to the prompt information (such as giving up eating, reducing the amount of consumption, or choosing a substitute), and may provide feedback through the user interface (such as confirming receipt, ignoring the prompt, or adjusting preference settings).
[0056] In addition, when the first calorie content is less than or equal to the preset calorie content, it is confirmed that the normal meal information is sent to the target user, that is, the calorie content of the target food does not exceed your preset limit and can be used with confidence.
[0057] Through the above method, the target user automatically shoots the food by wearing AR glasses, and then inputs the shot image into the preset model for processing to obtain the volume data of the container corresponding to the food. The target image is processed by the preset model to automatically identify the container corresponding to the food and its volume data. The distance between the target device and the target food when shooting the image can also be obtained. After obtaining the container volume data and the shooting distance, the actual volume data (second data) of the food is obtained by calculation. Subsequently, the calorie content (first calorie content) of the food is intelligently calculated in combination with the calorie data corresponding to the food. This process completely avoids the need for users to manually look up the food calorie table and perform complex calculations. Finally, the calculated calorie content is instantly sent to the target device (AR glasses) so that the target user can immediately obtain information about the calories of the target food. This instant feedback mechanism not only improves the user experience, but also provides users with a more convenient, accurate and efficient calorie calculation service.
[0058] The embodiment of the present application also provides a calorie content assessment device based on AR glasses, Figure 2 is a schematic diagram of a calorie content assessment device based on AR glasses provided in an embodiment of the present application, with reference to Figure 2 The device is a server, and the server includes an acquisition unit 201, a processing unit 202 and a sending unit 203.
[0059] The acquisition unit 201 receives a target image sent by a target device, where the target device is an AR pair of glasses, and the target image is an image of a target food photographed by a target user wearing the target device; and acquires a target distance, where the target distance is the distance between the target device and the target food when the target image is photographed.
[0060] The processing unit 202 inputs the target image into a preset model for processing to obtain first data, where the first data is volume data of a container corresponding to the target food; calculates the distance between the first data and the target to obtain second data; and determines the first calorie content based on the second data and the calorie data corresponding to the target food.
[0061] The sending unit 203 sends the first calorie content to the target device, so that the target device displays the first calorie content corresponding to the target food to the target user.
[0062] In a possible implementation, the processing unit 202 is used to identify the target food and obtain a first sub-food and a second sub-food, where the first sub-food and the second sub-food are any two sub-foods among the multiple sub-foods included in the target food; the acquisition unit 201 is used to obtain first unit calorie data corresponding to the first sub-food, and determine a first weight corresponding to the first sub-food from the second data; the processing unit 202 is used to calculate the first unit calorie data and the first weight to obtain a first sub-calorie content; the acquisition unit 201 is used to obtain second unit calorie data corresponding to the second sub-food, and determine a second weight corresponding to the second sub-food from the second data; the processing unit 202 is used to calculate the second unit calorie data and the second weight to obtain a second sub-calorie content; the first sub-calorie content is added to the second sub-calorie content to obtain the first calorie content.
[0063] In a possible implementation, the processing unit 202 is configured to identify the first sub-food to obtain a target food name; and input the target food name into a preset calorie database for matching to obtain first unit calorie data.
[0064] In a possible implementation, the processing unit 202 is configured to scan the target food using a target device based on the target scanning indication to obtain a plurality of scanning features; and integrate the plurality of scanning features to obtain a target image.
[0065] In one possible implementation, the processing unit 202 is used to extract the target image to obtain target information; determine whether the target information exists in the preset component information table; when the target information does not exist in the preset component information table, confirm that the target image is input into the preset model for processing to obtain the first data.
[0066] In a possible implementation, the processing unit 202 is used to confirm the calculation of the target information to obtain the second calorie content when there is target information in the preset ingredient information table; the sending unit 203 is used to send the second calorie content to the target device so that the target user can view the second calorie content.
[0067] In a possible implementation, the acquisition unit 201 is used to acquire preference information corresponding to the target user and determine the preset calorie content according to the preference information; the processing unit 202 is used to determine whether the first calorie content is less than or equal to the preset calorie content; and the sending unit 203 is used to confirm that a prompt message is sent to the target device when the first calorie content is greater than the preset calorie content, so that the target user can process the target food according to the prompt information.
[0068] It should be noted that: when the device provided in the above embodiment realizes its function, only the division of the above functional modules is used as an example. In actual application, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the device and method embodiments provided in the above embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.
[0069] The present application also discloses an electronic device. Figure 3 , Figure 3 The electronic device 300 may include: at least one processor 301 , at least one network interface 304 , a user interface 303 , a memory 305 , and at least one communication bus 302 .
[0070] The communication bus 302 is used to realize the connection and communication between these components.
[0071] The user interface 303 may include a display screen (Display) and a camera (Camera). Optionally, the user interface 303 may also include a standard wired interface and a wireless interface.
[0072] The network interface 304 may optionally include a standard wired interface or a wireless interface (such as a WI-FI interface).
[0073] Among them, the processor 301 may include one or more processing cores. The processor 301 uses various interfaces and lines to connect various parts in the entire server, and executes various functions of the server and processes data by running or executing instructions, programs, code sets or instruction sets stored in the memory 305, and calling data stored in the memory 305. Optionally, the processor 301 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The processor 301 can integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application requests; the GPU is responsible for rendering and drawing the content to be displayed on the display screen; the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 301, and it can be implemented separately through a chip.
[0074] Among them, the memory 305 may include a random access memory (RAM) or a read-only memory (Read-Only Memory). Optionally, the memory 305 includes a non-transitory computer-readable storage medium. The memory 305 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 305 may include a program storage area and a data storage area, wherein the program storage area. Instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned various method embodiments, etc. can be stored; the data storage area can store data involved in the above-mentioned various method embodiments, etc. The memory 305 can also be optionally at least one storage device located away from the aforementioned processor 301.
[0075] like Figure 3 As shown, the memory 305 as a computer storage medium may include an operating system, a network communication module, a user interface module, and an application for calorie content assessment based on AR glasses.
[0076] exist Figure 3In the electronic device 300 shown, the user interface 303 is mainly used to provide an input interface for the user and obtain data input by the user; and the processor 301 can be used to call the application for calorie content assessment based on AR glasses stored in the memory 305. When executed by one or more processors, the electronic device executes one or more methods described in the above embodiments.
[0077] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the order of the actions described, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required for the present application.
[0078] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0079] In the several embodiments provided in the present application, it should be understood that the disclosed devices can be implemented in other ways. For example, the device embodiments described above are only schematic, such as the division of the units, which is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some service interfaces, and the indirect coupling or communication connection of devices or units can be electrical or other forms.
[0080] 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 distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0081] 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. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0082] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a memory and includes several instructions for 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 memory includes: various media that can store program codes, such as USB flash drives, mobile hard drives, magnetic disks or optical disks.
[0083] The above is only an exemplary embodiment of the present disclosure and cannot be used to limit the scope of the present disclosure. That is, any equivalent changes and modifications made according to the teachings of the present disclosure are still within the scope of the present disclosure. After considering the disclosure of the specification and the truth of practice, it will be easy for those skilled in the art to think of other embodiments of the present disclosure. This application is intended to cover any variation, use or adaptive change of the present disclosure, which follows the general principles of the present disclosure and includes common knowledge or customary technical means in the technical field that are not recorded in the present disclosure.
Claims
1. A calorie content assessment method based on AR glasses, characterized in that: Applied in a server, the method comprises: receiving a target image sent by a target device, wherein the target device is an AR pair of glasses, and the target image is an image of a target food photographed by a target user wearing the target device; Input the target image into a preset model for processing to obtain first data, where the first data is volume data of a container corresponding to the target food; Acquire a target distance, where the target distance is the distance between the target device and the target food when the target image is captured; Calculating the distance between the first data and the target to obtain second data; determining a first calorie content according to the second data and the calorie data corresponding to the target food; The first calorie content is sent to the target device so that the target device displays the first calorie content corresponding to the target food to the target user.
2. The method according to claim 1, characterized in that The determining the first calorie content according to the second data and the calorie data corresponding to the target food specifically includes: Identify the target food to obtain a first sub-food and a second sub-food, where the first sub-food and the second sub-food are any two sub-foods among a plurality of sub-foods included in the target food; acquiring first unit calorie data corresponding to the first sub-food, and determining a first weight corresponding to the first sub-food from the second data; Calculating the first unit calorie data and the first weight to obtain a first sub-calorie content; acquiring second unit calorie data corresponding to the second sub-food, and determining a second weight corresponding to the second sub-food from the second unit calorie data; Calculating the second unit calorie data and the second weight to obtain a second sub-calorie content; The first sub-calorie content is added to the second sub-calorie content to obtain the first calorie content.
3. The method according to claim 2, characterized in that The obtaining of the first unit calorie data corresponding to the first sub-food specifically includes: Identify the first sub-food to obtain the name of the target food; The target food name is input into a preset calorie database for matching to obtain the first unit calorie data.
4. The method according to claim 1, characterized in that: Before receiving the target image sent by the target device, the method further includes: Based on the target scanning instruction, use a target device to scan the target food to obtain a plurality of scanning features; A plurality of the scanning features are integrated and processed to obtain the target image.
5. The method according to claim 1, characterized in that Before inputting the target image into a preset model for processing to obtain the first data, the method further includes: Extracting the target image to obtain target information; Determine whether the target information exists in the preset component information table; When the target information does not exist in the preset component information table, it is confirmed that the target image is input into the preset model for processing to obtain the first data.
6. The method according to claim 5, characterized in that After determining whether the target information exists in the preset component information table, the method further includes: When the target information exists in the preset ingredient information table, confirming to calculate the target information to obtain a second calorie content; The second calorie content is sent to the target device so that the target user can view the second calorie content.
7. The method according to claim 1, characterized in that After sending the first calorie content to the target device so that the target device displays the first calorie content corresponding to the target food to the target user, the method further includes: Obtaining preference information corresponding to the target user, and determining a preset calorie content according to the preference information; determining whether the first calorie content is less than or equal to the preset calorie content; When the first calorie content is greater than the preset calorie content, it is confirmed to send a prompt message to the target device so that the target user can process the target food according to the prompt message.
8. A calorie content assessment device based on AR glasses, characterized in that: The device is a server, and the server comprises an acquisition unit (201), a processing unit (202) and a sending unit (203). The acquisition unit (201) receives a target image sent by a target device, wherein the target device is an AR pair of glasses, and the target image is an image of a target food photographed by a target user wearing the target device; Acquire a target distance, where the target distance is the distance between the target device and the target food when the target image is captured; The processing unit (202) inputs the target image into a preset model for processing to obtain first data, wherein the first data is volume data of a container corresponding to the target food; Calculating the distance between the first data and the target to obtain second data; determining a first calorie content according to the second data and the calorie data corresponding to the target food; The sending unit (203) sends the first calorie content to the target device, so that the target device displays the first calorie content corresponding to the target food to the target user.
9. An electronic device, characterized in that: The electronic device (300) comprises a processor (301), a memory (305), a user interface (303) and a network interface (304), wherein the memory (305) is used to store instructions, the user interface (303) and the network interface (304) are used to communicate with other devices, and the processor (301) is used to execute the instructions stored in the memory (305) so that the electronic device (300) executes the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, and when the instructions are executed, the method according to any one of claims 1 to 7 is executed.