Infant and child care method, device, equipment and medium based on hazard source positioning
By performing corner detection and edge feature extraction in the infant and young child care system, and combining depth perception technology to analyze the numerical and positional relationship of the depth field, the relative distance between infants and young child and dangerous sources is solved, and the problem of inability to effectively evaluate the distance between infants and young child and dangerous sources in the existing technology is solved, and accurate early warning and more reliable infant and young child care services are achieved.
Patent Information
- Application Number
- CN202411431814.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-14
- Publication Date
- 2025-04-08
- Estimated Expiration
- 2044-10-14
AI Technical Summary
The prior art cannot effectively evaluate the relative distance between infants and young children and dangerous sources, resulting in the inability to ensure immediate intervention and the problem of false alarms or missed reports.
By obtaining the target image and infant area position information in infant care scenarios, corner point detection and edge feature extraction, location information of hazardous areas are determined, and depth perception technology is used to analyze the numerical and position relationship of depth field, and the relative distance between infants and dangerous sources is evaluated.
Accurate early warnings for infants and young children and dangerous areas have been achieved, emergency response capabilities to potential dangers have been improved, accidental injuries in families have been effectively prevented, and more reliable infant care services are provided for guardians.
Smart Images

Figure CN119007122B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of infant care, and in particular to an infant care method, device, equipment and medium based on danger source positioning. Background Art
[0002] In today's society, family safety has become one of the focuses of people's attention. Especially for families with infants and young children, how to effectively prevent accidental injuries has become an important task. In this context, the technology of automatically identifying potential dangerous edges in the home environment, such as sharp corners of furniture and table edges, and timely pushing warning information to guardians has emerged. The application of this technology makes the family more intelligent and safe, and effectively helps guardians take timely measures when infants and young children approach dangerous areas, thereby avoiding accidental injuries. Through the intelligent early warning system, family members can live more at ease, improve the quality of family life, and create a safer and more comfortable living environment for family members. The promotion and application of this technology will provide new solutions for family security, promote relationships between family members, and build a healthier and happier family atmosphere.
[0003] However, although the technology of automatically identifying the potential danger edge of the home and pushing warning information to the guardian has brought many benefits, there are also some technical issues that deserve attention. First, the existing technology may face the problem of false positives or false negatives, that is, the system may mistakenly identify situations that are not really dangerous as potential dangers, or fail to issue an alarm in time when the real danger occurs. In addition, the accuracy and stability of the technology are also a challenge, because the complexity and variability of the home environment may cause the system to fail to accurately identify the danger edge in some cases. In addition, privacy and data security issues are also challenges faced by current technology. Monitoring the home environment may involve the collection and processing of personal privacy information. How to protect user data security and privacy has become an important issue in the development of technology. Therefore, although the existing technology plays an important role in improving home safety, it still needs to be continuously improved and perfected to better meet people's needs for home safety.
[0004] The existing Chinese patent CN115187888A discloses a deep learning-based infant monitoring system and construction method, the method includes: the user can customize the virtual electronic fence boundary, and the alarm is issued by detecting whether the subject crosses the virtual boundary to reduce the possibility of accidents. However, if the infant accidentally crosses the virtual electronic fence boundary, in the actual application scenario, the infant has fallen from the bed and was injured. The caregiver will issue an alarm to the parents at this time. The safety prompt at this time is obviously lagging, the infant has been injured, and the problem of actually preventing the infant from falling from the bed has not been solved, and the user's actual care experience is poor; at the same time, if the infant is simply judged to have crossed the electronic fence boundary, and an alarm is immediately issued when it crosses, then when the infant accidentally touches the electronic fence boundary but does not actually fall, the user will be not disturbed. Therefore, the above-mentioned method of issuing safety reminders is not timely and accurate enough.
[0005] To this end, how to assess the relative distance between infants and danger sources and ensure immediate intervention is an urgent issue to be addressed. Summary of the invention
[0006] In view of this, the present invention provides an infant care method, device, equipment and medium based on danger source positioning, which is used to solve the problem in the prior art that the relative distance between infants and danger sources cannot be assessed and timely intervention cannot be ensured.
[0007] The technical solution adopted by the present invention is:
[0008] In a first aspect, the present invention provides an infant care method based on danger source positioning, the method comprising:
[0009] S1: Acquire a target image containing a target infant in an infant care scene and location information of an infant region in the target image;
[0010] S2: performing corner point detection and edge feature extraction on the target image to determine the location information of the dangerous area;
[0011] S3: Based on the infant area location information and the dangerous area location information, when it is identified that the infant is in a preset dangerous state, a safety warning is issued.
[0012] Preferably, the S1 includes:
[0013] S11: acquiring real-time video data in an infant care scene, and decomposing the real-time video data into multiple frames of target images;
[0014] S12: inputting each of the target images into a pre-trained pedestrian target detection model, and outputting pedestrian position information;
[0015] S13: Classify each pedestrian target according to the pedestrian position information using a pre-trained target classification model to obtain the target image;
[0016] S14: Perform target detection on the target image and output the position information of the infant area.
[0017] Preferably, the S2 includes:
[0018] S21: grayscale the target image and output a grayscale image;
[0019] S22: Performing angle detection and screening on the grayscale image to obtain target corner points;
[0020] S23: Segmenting the target image according to the target corner points and the preset region size information, and outputting the region image;
[0021] S24: Performing a dangerous point analysis on the area image and outputting dangerous point location information.
[0022] Preferably, the S22 includes:
[0023] S221: using a preset corner point detection method to obtain initial corner points in the grayscale image;
[0024] S222: Segmenting a ground area from the grayscale image using a preset image segmentation method;
[0025] S223: Eliminate the corner points in the ground area from the initial corner points, and use the remaining corner points as the target corner points.
[0026] Preferably, the S24 includes:
[0027] S241: extracting edge features from the region image to obtain edge feature information;
[0028] S242: using a preset line detection algorithm to process the edge feature information to obtain line feature information, wherein the line feature information at least includes: a line direction and a line position;
[0029] S243: selecting one of the target corner points as a feature point for analysis, and determining whether there is a target straight line passing through the feature point;
[0030] S244: If there is a target straight line passing through the feature point, determine the number of target straight lines;
[0031] S245: If the number of target straight lines is greater than or equal to 2, determine target straight line feature information corresponding to each target straight line according to the straight line feature information;
[0032] S246: judging the angle of the first target straight line according to the target straight line feature information, and judging the angles of other straight lines other than the first target straight line when the angle between the first target straight line and the horizontal straight line is less than a preset first angle and the first target straight line does not continue to extend after passing through the feature point;
[0033] S247: When there is a second target straight line among other straight lines and the angle between the horizontal straight line is greater than the preset second angle and less than the third angle, and the second target straight line does not continue to extend after passing through the feature point, identifying the feature point as a dangerous point, wherein the second angle is greater than the first angle, and the third angle is greater than the second angle;
[0034] S248: Repeat steps S243 to S246 until all dangerous points in the area image are identified and the dangerous point location information is output.
[0035] Preferably, S3 includes:
[0036] S31: segmenting the target image according to the infant area position information, and outputting an infant image;
[0037] S32: inputting the infant image into a pre-trained monocular depth calculation model according to the danger point position information, and calculating an average depth value corresponding to the infant image and a target depth value corresponding to the danger point position;
[0038] S33: obtaining the body thickness of the infant;
[0039] S34: determining the center point position coordinates of the infant area and the width of the infant area according to the infant area position information;
[0040] S35: Determine the relative distance between the center point and the dangerous point according to the center point position coordinates and the dangerous point position information;
[0041] S36: comparing the relative distance and the width of the infant area, and when the relative distance is smaller than a preset ratio of the width of the infant area, obtaining the target depth value, the average depth value and the body thickness;
[0042] S37: Calculate the difference between the target depth value and the average depth value. When the calculated depth difference is less than the body thickness, identify that the infant is in the dangerous state and issue a safety warning.
[0043] Preferably, the S33 includes:
[0044] S331: segmenting the infant image using an image segmentation model, and outputting an infant body region image;
[0045] S332: Inputting the infant body region image into a pre-trained monocular depth calculation model to obtain a maximum depth value and a minimum depth value;
[0046] S333: Calculate the difference between the maximum depth value and the minimum depth value, and output the body thickness.
[0047] In a second aspect, the present invention further provides an infant care device based on danger source positioning, the device comprising:
[0048] A data acquisition module, used to acquire a target image containing a target infant in an infant care scene and location information of an infant region in the target image;
[0049] A position information extraction module is used to perform corner point detection and edge feature extraction on the target image to determine the position information of the dangerous area;
[0050] The safety warning module is used to issue a safety warning when it is identified that the infant is in a preset dangerous state based on the infant area position information and the dangerous area position information.
[0051] In a third aspect, an embodiment of the present invention further provides an electronic device, comprising: at least one processor, at least one memory, and computer program instructions stored in the memory, which, when executed by the processor, implement the method of the first aspect in the above-mentioned embodiment.
[0052] In a fourth aspect, an embodiment of the present invention further provides a storage medium on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the method of the first aspect in the above-mentioned embodiment is implemented.
[0053] In summary, the beneficial effects of the present invention are as follows:
[0054] The present invention provides an infant care method, device, equipment and medium based on the location of dangerous sources, the method comprising: obtaining a target image containing a target infant in an infant care scene and the position information of the infant area in the target image; performing corner point detection and edge feature extraction on the target image to determine the position information of the dangerous area; according to the position information of the infant area and the position information of the dangerous area, when the infant is identified to be in a preset dangerous state, a safety warning is issued. On the one hand, the present invention monitors the position of the infant and the dangerous area in real time, and immediately gives a warning once the infant is close to a dangerous area such as a sharp corner, thereby improving the emergency response capability to potential dangers and effectively preventing the occurrence of accidental injuries in the family; using deep learning technology and advanced image processing algorithms, the intelligent perception of the family environment and the intelligent analysis of the infant's behavior are realized, and it can intelligently judge whether the infant is close to the dangerous area, providing a scientific and intelligent management method for the guardian; on the other hand, by combining the depth perception technology and the warning analysis module, the depth field value and the position relationship are intelligently analyzed, and the accurate warning of the infant close to the dangerous area such as the sharp corner is realized, providing an intelligent and efficient warning system, and providing a more reliable infant care service for the guardian. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] In order to more clearly illustrate the technical solution of the embodiment of the present invention, the drawings required for use in the embodiment of the present invention will be briefly introduced below. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work, and these are all within the protection scope of the present invention.
[0056] Figure 1 This is a schematic diagram of the overall working process of the infant care method based on danger source positioning in Example 1 of the present invention;
[0057] Figure 2 Schematic diagram of the process of pedestrian target detection and infant classification in Example 1 of the present invention;
[0058] Figure 3 It is a schematic diagram of the process of performing corner point detection and edge feature extraction on the target image in Embodiment 1 of the present invention;
[0059] Figure 4 Schematic diagram of the process of angle detection and screening of the grayscale image in Embodiment 1 of the present invention;
[0060] Figure 5 It is a schematic diagram of a process of performing dangerous point analysis on the regional image in Embodiment 1 of the present invention;
[0061] Figure 6This is a flow chart of identifying the dangerous state of an infant based on the infant area position information and the dangerous area position information in Embodiment 1 of the present invention;
[0062] Figure 7 This is a schematic diagram of a process for obtaining the body thickness of an infant in Embodiment 1 of the present invention;
[0063] Figure 8 This is a structural block diagram of an infant care device based on danger source positioning in Example 2 of the present invention;
[0064] Fig. 9 It is a schematic diagram of the structure of the electronic device in Embodiment 3 of the present invention. DETAILED DESCRIPTION
[0065] In order to make the purpose, technical solution and advantages of the embodiment of the present invention clearer, the technical solution in the embodiment of the present invention will be clearly and completely described in conjunction with the drawings in the embodiment of the present invention. It should be noted that, in this article, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that there is any such actual relationship or order between these entities or operations. In the description of the present invention, it should be understood that the orientation or position relationship indicated by the terms "center", "upper", "lower", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", etc. is based on the orientation or position relationship shown in the drawings, which is only for the convenience of describing the present application and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation of the present invention. Moreover, the term "include", "comprise" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such a process, method, article or device. In the absence of further restrictions, the elements defined by the phrase "comprising..." do not exclude the existence of other identical elements in the process, method, article or device comprising the elements. If there is no conflict, the embodiments of the present invention and the various features in the embodiments can be combined with each other, all within the protection scope of the present invention.
[0066] Example 1
[0067] See also Figure 1 Embodiment 1 of the present invention discloses a method for caring for infants and young children based on location of danger sources, the method comprising:
[0068] S1: Acquire a target image containing a target infant in an infant care scene and location information of an infant region in the target image;
[0069] Specifically, first obtain the target image containing the target infant in the infant care scene, and extract the specific area location information of the infant in the image. Through advanced image processing technology and target detection algorithms, the position of the infant in the image is accurately located, laying the foundation for subsequent key point detection and behavior analysis. This step ensures the accurate capture of the infant's activity area, can monitor the dynamic changes of the infant in real time, and improve the safety and effectiveness of care. The system's accurate acquisition and processing of this information can achieve more intelligent and efficient infant care and management.
[0070] In one embodiment, see Figure 2 , the S1 comprises:
[0071] S11: acquiring real-time video data in an infant care scene, and decomposing the real-time video data into multiple frames of target images;
[0072] Specifically, firstly, real-time video data is obtained from a surveillance camera or video source. These video data contain real-time activities in the infant care scene. For further processing, the continuous video stream is decomposed into multiple static image frames. Usually, a certain number of frames are extracted per second, such as 30 frames per second, to ensure that the dynamic changes in the video are fully captured. In this way, it is ensured that the subsequent processing steps can be analyzed based on the detailed information of each frame, which is convenient for detection and tracking.
[0073] S12: inputting each of the target images into a pre-trained pedestrian target detection model, and outputting pedestrian position information;
[0074] Specifically, each frame of image obtained from step S11 is input into the pre-trained pedestrian target detection model, which includes at least the YOLOv8s model, which has been trained with a large-scale data set and can effectively identify and locate pedestrians in the image. The output result of the YOLOv8s model is the location information of each detected pedestrian, which usually includes the bounding box of the pedestrian in the image, that is, the coordinates (x, y) of the pedestrian and its width and height (w, h). These location data provide basic data for subsequent target classification and further processing.
[0075] S13: Classify each pedestrian target according to the pedestrian position information using a pre-trained target classification model to obtain the target image;
[0076] Specifically, after obtaining the location information of pedestrians, the next step is to classify these detected pedestrians to determine whether they are infants or young children. Each detected pedestrian is further classified using a pre-trained target classification model, such as a classification model based on MobileNet. The target classification model is specially trained to distinguish different pedestrian categories, such as adults and infants. Finally, the classification results of each pedestrian are output, so as to identify which targets are infants and young children, and obtain images of these targets for subsequent processing.
[0077] S14: Perform target detection on the target image and output the position information of the infant area.
[0078] Specifically, further target detection is performed on the identified infant target image to accurately determine the specific position of the infant in the image. More sophisticated target detection technology, such as the refined detection performed by the YOLOv8s model, is used to ensure that the infant area is accurately framed. Combined with tracking algorithms such as DeepSort, the detection frame of the infant is continuously tracked to ensure that the dynamic position of the infant is accurately tracked throughout the video stream. This tracking method can handle situations such as occlusion and rapid movement, and provide stable infant position data to support subsequent monitoring and analysis needs.
[0079] S2: performing corner point detection and edge feature extraction on the target image to determine the location information of the dangerous area;
[0080] Specifically, corner detection and edge feature extraction are performed on each infant target image to identify and determine the dangerous areas in the image. Corner detection includes the Harris corner detection algorithm, which is used to identify areas with significant angle changes in the image. These areas may be potential dangerous areas; edge feature extraction includes the Canny edge detection algorithm, which helps to identify significant edges or contours in the image. These edges can reveal the location of potential obstacles or dangerous objects. By combining corner and edge features, the specific location of the dangerous area can be determined, thereby achieving more effective monitoring and protection of infants and young children.
[0081] In one embodiment, see Figure 3 , said S2 comprises:
[0082] S21: grayscale the target image and output a grayscale image;
[0083] Specifically, each target image is grayscaled and converted into a grayscale image. This process is achieved by converting the color information of each pixel in the color image into a single grayscale value, usually by calculating the weighted average of each pixel, for example, using the weighting coefficients of the red, green, and blue channels. Grayscale processing simplifies image data, reduces computational complexity, and makes subsequent image processing and analysis more efficient.
[0084] S22: Performing angle detection and screening on the grayscale image to obtain target corner points;
[0085] Specifically, the grayscale image is subjected to corner detection and screening to extract key corners in the image; corner detection is a technique for identifying significant feature points in local areas of an image. These points usually have large local variations and can provide important information about the shape and boundaries of the target area. By applying corner detection algorithms, such as Harris corner detection or Shi-Tomasi method, corners in the image are found, which are used to define the contours of the target area. The screening process further ensures that only those corners that are significant and relevant to the target are retained to improve the accuracy and efficiency of subsequent analysis.
[0086] In one embodiment, see Figure 4 , the S22 comprises:
[0087] S221: using a preset corner point detection method to obtain initial corner points in the grayscale image;
[0088] Specifically, a preset corner detection method, such as the Harris corner detection algorithm, is applied to identify and extract initial corner points in the grayscale image. The corner detection algorithm calculates the local gradient changes of the image and identifies those points with significant features in the local area. These points are usually where angle changes occur in the image. The acquisition of initial corner points provides key visual feature points for subsequent analysis, which can be used to further analyze the shape and structural features in the image.
[0089] S222: Segmenting a ground area from the grayscale image using a preset image segmentation method;
[0090] Specifically, by using a preset image segmentation method, such as SAM segmentation, threshold segmentation, region growing or other segmentation techniques, the ground area in the grayscale image is segmented from other areas. Image segmentation technology divides the image into different areas according to the change of grayscale value or specific features of the image. Here, the focus is on identifying and separating the ground area, because the ground area usually contains a lot of background information rather than target features. The segmented ground area will be used for further screening of diagonal points in subsequent steps.
[0091] S223: Eliminate the corner points in the ground area from the initial corner points, and use the remaining corner points as the target corner points.
[0092] Specifically, the corner points in the ground area are removed from the initial corner points to exclude those points that do not meet the target requirements. The specific operation is to compare the previously segmented ground area with the initial corner points, remove those corner points located in the ground area, and the remaining corner points are the target corner points. These points represent the areas in the image that are more likely to contain target features.
[0093] S23: Segmenting the target image according to the target corner points and the preset region size information, and outputting the region image;
[0094] Specifically, the target image is segmented according to the position of the target corner point and the preset region size information. First, the specific position of each target corner point is determined, and the region of interest is defined around these corner points according to the preset region size information, such as the specified width and height. For example, if the preset region size is a square region of W*W, a square region with a side length of W is demarcated in the image around each target corner point. These regions represent specific regions in the image that need further analysis. Next, using this region information, the image data of these regions are extracted from the original target image to generate regional images. These regional images contain detailed feature information of the location of the target corner points, which is helpful for further image analysis and processing, such as feature extraction or target detection. Through this segmentation process, the region of interest in the target image can be isolated from the overall image, so that the subsequent processing steps can focus more on the key areas, improving the accuracy and efficiency of the analysis.
[0095] S24: Performing a dangerous point analysis on the area image and outputting dangerous point location information.
[0096] Specifically, when performing a dangerous point analysis on the regional image, firstly, the edge features in the image are analyzed in detail to identify potential dangerous areas, which includes extracting edge features in the image through an edge detection algorithm, and further identifying straight line structures in the image using a straight line detection algorithm; then, based on these straight line features and their geometric relationship with the target corner points, possible sharp corners or protruding dangerous structures are analyzed. By combining this information, the specific location of the dangerous point is determined. This process aims to accurately locate areas in the image that may cause safety hazards and output the location information of these dangerous points so that appropriate preventive measures can be taken.
[0097] In one embodiment, see Figure 5 , the S24 comprises:
[0098] S241: extracting edge features from the region image to obtain edge feature information;
[0099] Specifically, firstly, edge detection algorithms are applied to the regional image, such as the Canny edge operator. The Canny edge operator can effectively identify the edge in the image by calculating the gradient strength in the image. Firstly, a Gaussian filter is applied to smooth the image to reduce the interference of noise. Then, the gradient and direction of each pixel in the image are calculated. Then, the edge is accurately located by the non-maximum suppression algorithm. Finally, the real edge is determined by double threshold processing. This process extracts the edge information in the image, laying the foundation for subsequent straight line detection and dangerous point analysis.
[0100] S242: using a preset line detection algorithm to process the edge feature information to obtain line feature information, wherein the line feature information at least includes: a line direction and a line position;
[0101] Specifically, a preset straight line detection algorithm, such as Hough transform, is used to process the extracted edge feature information. Hough transform is an image processing algorithm that can detect straight lines in an image. The algorithm transforms the edge image from the spatial domain to the parameter space and finds the straight line features in the image by accumulating the parameters of the straight line, such as the slope and intercept. In this way, the direction and position of each straight line in the image can be obtained. These straight line feature information provides an important basis for identifying potential dangerous points in the regional image.
[0102] S243: selecting one of the target corner points as a feature point for analysis, and determining whether there is a target straight line passing through the feature point;
[0103] Specifically, a specific corner point is selected from the detected target corner points as a feature point, and a detailed analysis is performed to determine whether there is a target straight line passing through the feature point; if the straight line passing through the corner point does not exist or is not obvious, the corner point is marked as a point with no potential for danger, otherwise its geometric features are further analyzed. This step helps determine whether the corner point is located in a complex geometric structure and provides a basis for subsequent steps.
[0104] S244: If there is a target straight line passing through the feature point, determine the number of target straight lines;
[0105] Specifically, once it is confirmed that a straight line passes through the feature point, the number of straight lines passing through the point will be calculated. This process usually uses algorithms such as Hough transform to further process the edge features extracted from the image to determine the number of straight lines. Not only is it necessary to detect a straight line, but it is also necessary to identify whether multiple straight lines pass through the corner point at the same time. The presence of multiple straight lines usually means that the point is located at a geometric intersection, which may indicate that the area has greater structural complexity and potential danger.
[0106] S245: If the number of target straight lines is greater than or equal to 2, determine target straight line feature information corresponding to each target straight line according to the straight line feature information;
[0107] Specifically, if the number of target lines is greater than or equal to 2, when two or more lines are detected passing through the feature point, the feature information of each target line will be further analyzed. The features of each target line include parameters such as its direction, position, and length. This information can reveal the relationship between the target line and the surrounding environment. The feature information of the target line will be used to determine the degree of danger of the corner point, such as whether the high risk is caused by the geometric structure near the corner point. Combined with these feature information, potential dangerous areas can be identified more accurately.
[0108] S246: judging the angle of the first target straight line according to the target straight line feature information, and judging the angles of other straight lines other than the first target straight line when the angle between the first target straight line and the horizontal straight line is less than a preset first angle and the first target straight line does not continue to extend after passing through the feature point;
[0109] Specifically, a specific angle analysis is performed on the first target straight line that passes through the feature point. If the angle between the first target straight line and the horizontal line is less than a preset angle, such as 5°, and the first target straight line does not extend after passing through the feature point, the angles of other target straight lines will be further determined. This is done by analyzing the extension of the straight line and its angle with the horizontal line to determine whether there are sharp corners or other complex structures; the importance of this step lies in distinguishing between ordinary edges and potentially dangerous sharp edges through angle and extension characteristics.
[0110] S247: When there is a second target straight line among other straight lines and the angle between the horizontal straight line is greater than the preset second angle and less than the third angle, and the second target straight line does not continue to extend after passing through the feature point, identifying the feature point as a dangerous point, wherein the second angle is greater than the first angle, and the third angle is greater than the second angle;
[0111] Specifically, after analyzing other target lines passing through the feature point, if the angle between the angle of a second target line and the horizontal line meets a specific range, such as between 85° and 95°, and the second target line does not extend after passing through the feature point, the feature point will be identified as a dangerous point. This indicates that there is a sharp or complex geometric structure at the corner point, which poses a threat to the safety of infants and young children. By comprehensively analyzing the angles and extensions of multiple lines, potential dangerous areas can be effectively identified.
[0112] S248: Repeat steps S243 to S246 until all dangerous points in the area image are identified and the dangerous point location information is output.
[0113] Specifically, the previous steps S243 to S246 are repeated to traverse all target corner points, and the straight line feature analysis is performed on each target corner point until all potential dangerous points in the image are identified. The location information of these dangerous points will be output and can be used for subsequent safety warnings or protective measures. Through this iterative process, the system ensures that no important dangerous points are missed, providing comprehensive safety protection for infant care.
[0114] S3: Based on the infant area location information and the dangerous area location information, when it is identified that the infant is in a preset dangerous state, a safety warning is issued.
[0115] Specifically, based on the infant area location information and the dangerous area location information, the system first compares the infant's real-time location with the preset dangerous area in the image; if the infant's location information falls into these identified dangerous areas, the system will automatically determine that the infant is in a potential dangerous state; at this time, the safety warning mechanism will be triggered to immediately remind the guardian through alarms, notifications or other means to remind them to pay attention to the safety of the infant. This warning mechanism can quickly respond to potential safety threats, so that timely measures can be taken to protect infants and prevent accidents.
[0116] In one embodiment, see Figure 6 , said S3 comprises:
[0117] S31: segmenting the target image according to the infant area position information, and outputting an infant image;
[0118] Specifically, based on the previously obtained infant area position information, the corresponding area in the target image is extracted to obtain a sub-image specifically containing the infant; specifically, using image segmentation technology, based on preset area boundary information, the image portion of the infant is accurately cut out from the target image. The purpose of this is to ensure that subsequent processing only focuses on the data in the infant image to avoid interference from other image information.
[0119] S32: inputting the infant image into a pre-trained monocular depth calculation model according to the danger point position information, and calculating an average depth value corresponding to the infant image and a target depth value corresponding to the danger point position;
[0120] Specifically, a pre-trained monocular depth calculation model, such as MobileDepth, is used to analyze infant images and dangerous point location images. By inputting infant images into the model, the model generates a depth map representing the depth information of each pixel in the image. Then, the average depth value of all pixels in the infant image is calculated, and the target depth value related to the dangerous point location is calculated separately. In this way, the relative position of the infant area and the dangerous point in the depth space can be obtained, which can be further used to assess potential safety risks.
[0121] S33: obtaining the body thickness of the infant;
[0122] Specifically, the body thickness of the infant is obtained by analyzing the depth information in the infant image.
[0123] In one embodiment, see Figure 7 , the S33 comprises:
[0124] S331: segmenting the infant image using an image segmentation model, and outputting an infant body region image;
[0125] Specifically, the infant image is further processed using an image segmentation model to extract an area specifically representing the infant's body. This process involves using an image segmentation algorithm, such as SAM, to accurately calibrate and extract the boundaries of the infant's body, thereby obtaining a sub-image containing only the infant's body as the infant's body area image.
[0126] S332: Inputting the infant body region image into a pre-trained monocular depth calculation model to obtain a maximum depth value and a minimum depth value;
[0127] Specifically, the segmented infant body region image is input into a monocular depth calculation model to calculate the depth information in the region, and the model outputs the depth value of each point in the region, thereby obtaining the maximum depth value and minimum depth value of the infant body region. These depth values are used to further calculate the thickness of the infant body.
[0128] S333: Calculate the difference between the maximum depth value and the minimum depth value, and output the body thickness.
[0129] Specifically, the thickness of the infant's body is obtained by calculating the difference between the maximum depth value and the minimum depth value in the infant's body area image; this difference reflects the actual thickness of the infant's body in the image, providing necessary data support for subsequent depth analysis.
[0130] S34: determining the center point position coordinates of the infant area and the width of the infant area according to the infant area position information;
[0131] Specifically, first obtain the position coordinates of the infant in the image, and analyze the area to determine its center point and width. The center point position coordinates are calculated based on the boundary information of the infant area, for example, by calculating the midpoints of the upper and lower and left and right boundaries of the infant area to obtain the center point position. The width of the area represents the horizontal size of the infant's body area in the image, which can be obtained by calculating the distance between the left and right boundaries of the infant area. Determining the center point and width provides a key geometric basis for subsequent distance calculation and depth analysis.
[0132] S35: Determine the relative distance between the center point and the dangerous point according to the center point position coordinates and the dangerous point position information;
[0133] Specifically, the relative distance between the center point of the infant area and the previously identified danger point is calculated using the Euclidean distance formula to accurately measure the distance between the infant and the potential danger area. This calculation is the basis for further determining whether the infant is close to the danger area. If the distance is short, it indicates that the infant is approaching the danger area, which triggers further analysis and warning.
[0134] S36: comparing the relative distance and the width of the infant area, and when the relative distance is smaller than a preset ratio of the width of the infant area, obtaining the target depth value, the average depth value and the body thickness;
[0135] Specifically, the calculated relative distance is compared with the width of the infant area. If the relative distance between the infant and the danger point is less than a preset ratio of the width of the infant area (such as 3 times the width), it indicates that the infant may be too close to the danger area. At this time, the average depth value of the infant area, the target depth value of the danger point, and the body thickness of the infant are further obtained. This comparison step is used to screen out situations that require more in-depth depth analysis to ensure that further analysis is performed only when the infant is close to the danger area.
[0136] S37: Calculate the difference between the target depth value and the average depth value. When the calculated depth difference is less than the body thickness, identify that the infant is in the dangerous state and issue a safety warning.
[0137] Specifically, the target depth value of the danger point is calculated from the average depth value of the infant area. If the difference is less than the thickness of the infant's body, it means that the infant is very close to the danger area. At this time, the infant is identified as being in danger and a safety warning is issued. By combining the depth difference and the thickness of the infant's body, the spatial relationship between the infant and the danger point is accurately determined, ensuring that a warning is issued in time when danger approaches to protect the safety of the infant.
[0138] Example 2
[0139] See also Figure 8 Embodiment 2 of the present invention further provides an infant care device based on danger source positioning, the device comprising:
[0140] A data acquisition module, used to acquire a target image containing a target infant in an infant care scene and location information of an infant region in the target image;
[0141] A position information extraction module is used to perform corner point detection and edge feature extraction on the target image to determine the position information of the dangerous area;
[0142] The safety warning module is used to issue a safety warning when it is identified that the infant is in a preset dangerous state based on the infant area position information and the dangerous area position information.
[0143] Specifically, an infant care device based on danger source positioning provided by an embodiment of the present invention is used, and the device includes: a data acquisition module, used to obtain a target image containing a target infant in an infant care scenario and infant area position information in the target image; a position information extraction module, used to perform corner point detection and edge feature extraction on the target image to determine the danger area position information; a safety warning module, used to issue a safety warning when it is identified that the infant is in a preset danger state based on the infant area position information and the danger area position information. On the one hand, the device monitors the position of infants and young children and the situation of dangerous areas in real time. Once it finds that infants and young children are close to dangerous areas such as sharp corners, it will immediately give a warning, thereby improving the emergency response capability to potential dangers and effectively preventing the occurrence of accidental injuries in the family; using deep learning technology and advanced image processing algorithms, it realizes intelligent perception of the family environment and intelligent analysis of infant behavior, and can intelligently judge whether infants and young children are close to dangerous areas, providing guardians with scientific and intelligent management methods; on the other hand, by combining depth perception technology and early warning analysis modules, the depth field value and position relationship are intelligently analyzed, and accurate early warning of infants and young children close to dangerous areas such as sharp corners is realized, providing an intelligent and efficient early warning system, providing guardians with more reliable infant care services.
[0144] Example 3
[0145] In addition, combined Figure 1 The infant care method based on danger source positioning of the described embodiment 1 of the present invention can be implemented by an electronic device. Fig. 9 A schematic diagram of the hardware structure of an electronic device provided in Embodiment 3 of the present invention is shown.
[0146] The electronic device may include a processor and a memory storing computer program instructions.
[0147] Specifically, the processor may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present invention.
[0148] The memory may include a large capacity memory for data or instructions. By way of example and not limitation, the memory may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. Where appropriate, the memory may include a removable or non-removable (or fixed) medium. Where appropriate, the memory may be inside or outside a data processing device. In a particular embodiment, the memory is a non-volatile solid-state memory. In a particular embodiment, the memory includes a read-only memory (ROM). Where appropriate, the ROM may be a mask-programmed ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), an electrically rewritable ROM (EAROM) or a flash memory or a combination of two or more of these.
[0149] The processor implements any one of the infant care methods based on hazard source positioning in the above embodiments by reading and executing computer program instructions stored in the memory.
[0150] In one example, the electronic device may further include a communication interface and a bus. Fig. 9 As shown, the processor, memory, and communication interface are connected via a bus and communicate with each other.
[0151] The communication interface is mainly used to implement communication between the modules, devices, units and / or equipment in the embodiments of the present invention.
[0152] The bus includes hardware, software or both, and the parts of the device are coupled to each other. For example, but not limitation, the bus may include accelerated graphics port (AGP) or other graphics bus, enhanced industrial standard architecture (EISA) bus, front side bus (FSB), hypertransport (HT) interconnection, industrial standard architecture (ISA) bus, infinite bandwidth interconnection, low pin count (LPC) bus, memory bus, micro channel architecture (MCA) bus, peripheral component interconnection (PCI) bus, PCI-Express (PCI-X) bus, serial advanced technology attachment (SATA) bus, video electronics standard association local (VLB) bus or other suitable bus or two or more of these combinations. In suitable cases, the bus may include one or more buses. Although the embodiment of the present invention describes and shows a specific bus, the present invention considers any suitable bus or interconnection.
[0153] Example 4
[0154] In addition, in combination with the infant care method based on danger source location in the above embodiment 1, embodiment 4 of the present invention can also provide a computer-readable storage medium for implementation. The computer-readable storage medium stores computer program instructions; when the computer program instructions are executed by the processor, any one of the infant care methods based on danger source location in the above embodiments is implemented.
[0155] In summary, the embodiments of the present invention provide an infant care method, device, equipment and storage medium based on danger source positioning.
[0156] It should be clear that the present invention is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present invention is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present invention.
[0157] The functional blocks shown in the above-described block diagram can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present invention are programs or code segments that are used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link by a data signal carried in a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, optical fiber media, radio frequency (RF) links, etc. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.
[0158] It should also be noted that the exemplary embodiments mentioned in the present invention describe some methods or systems based on a series of steps or devices. However, the present invention is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiments, or in a different order from the embodiments, or several steps can be performed simultaneously.
[0159] The above is only a specific implementation of the present invention. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working process of the system, module and unit described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here. It should be understood that the protection scope of the present invention is not limited to this. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be covered within the protection scope of the present invention.
Claims
1. A method for caring for infants and young children based on locating danger sources, characterized in that: The method comprises: S1: Acquire a target image containing a target infant in an infant care scene and location information of an infant region in the target image; S2: performing corner point detection and edge feature extraction on the target image to determine the location information of the dangerous area; S3: Based on the infant area location information and the dangerous area location information, when it is identified that the infant is in a preset dangerous state, a safety warning is issued; The S1 includes: S11: acquiring real-time video data in an infant care scene, and decomposing the real-time video data into multiple frames of target images; S12: inputting each of the target images into a pre-trained pedestrian target detection model, and outputting pedestrian position information; S13: Classifying each pedestrian target using a pre-trained target classification model according to the pedestrian position information, and obtaining an image of an infant as the target; S14: performing target detection on the image of the infant as the target, and outputting the position information of the infant area; The S2 includes: S21: grayscale the target image and output a grayscale image; S22: Performing angle detection and screening on the grayscale image to obtain target corner points; S23: Segmenting the target image according to the target corner points and the preset region size information, and outputting the region image; S24: Analyze the danger points on the regional image and output the danger point location information; The S3 includes: S31: segmenting the target image according to the infant area position information, and outputting an infant image; S32: inputting the infant image into a pre-trained monocular depth calculation model according to the danger point position information, and calculating an average depth value corresponding to the infant image and a target depth value corresponding to the danger point position; S33: obtaining the body thickness of the infant; S34: determining the center point position coordinates of the infant area and the width of the infant area according to the infant area position information; S35: Determine the relative distance between the center point and the dangerous point according to the center point position coordinates and the dangerous point position information; S36: comparing the relative distance and the width of the infant area, and when the relative distance is smaller than a preset ratio of the width of the infant area, obtaining the target depth value, the average depth value and the body thickness; S37: Calculate the difference between the target depth value and the average depth value. When the calculated depth difference is less than the body thickness, identify that the infant is in the dangerous state and issue a safety warning.
2. The method for caring for infants and young children based on danger source positioning according to claim 1, characterized in that: The S22 includes: S221: using a preset corner point detection method to obtain initial corner points in the grayscale image; S222: Segmenting a ground area from the grayscale image using a preset image segmentation method; S223: Eliminate the corner points in the ground area from the initial corner points, and use the remaining corner points as the target corner points.
3. The method for caring for infants and young children based on danger source positioning according to claim 1, characterized in that: The S24 includes: S241: extracting edge features from the region image to obtain edge feature information; S242: using a preset line detection algorithm to process the edge feature information to obtain line feature information, wherein the line feature information at least includes: a line direction and a line position; S243: selecting one of the target corner points as a feature point for analysis, and determining whether there is a target straight line passing through the feature point; S244: If there is a target straight line passing through the feature point, determine the number of target straight lines; S245: If the number of target straight lines is greater than or equal to 2, determine target straight line feature information corresponding to each target straight line according to the straight line feature information; S246: judging the angle of the first target straight line according to the target straight line feature information, and judging the angles of other straight lines other than the first target straight line when the angle between the first target straight line and the horizontal straight line is less than a preset first angle and the first target straight line does not continue to extend after passing through the feature point; S247: When there is a second target straight line among other straight lines and the angle between the horizontal straight line is greater than the preset second angle and less than the third angle, and the second target straight line does not continue to extend after passing through the feature point, identifying the feature point as a dangerous point, wherein the second angle is greater than the first angle, and the third angle is greater than the second angle; S248: Repeat steps S243 to S246 until all dangerous points in the area image are identified and the dangerous point location information is output.
4. The method for caring for infants and young children based on danger source positioning according to claim 1, characterized in that: The S33 includes: S331: segmenting the infant image using an image segmentation model, and outputting an infant body region image; S332: Inputting the infant body region image into a pre-trained monocular depth calculation model to obtain a maximum depth value and a minimum depth value; S333: Calculate the difference between the maximum depth value and the minimum depth value, and output the body thickness.
5. An infant care device based on danger source positioning, characterized in that: The device comprises: A data acquisition module, used to acquire a target image containing a target infant in an infant care scene and location information of an infant region in the target image; A position information extraction module is used to perform corner point detection and edge feature extraction on the target image to determine the position information of the dangerous area; A safety warning module, configured to issue a safety warning when it is identified that the infant is in a preset dangerous state based on the infant area location information and the dangerous area location information; The step of obtaining a target image containing a target infant in an infant care scene and the location information of the infant region in the target image comprises: Acquire real-time video data in an infant care scene, and decompose the real-time video data into multiple frames of target images; Inputting each of the target images into a pre-trained pedestrian target detection model, and outputting pedestrian position information; Based on the pedestrian position information, using a pre-trained target classification model, classify each pedestrian target to obtain an image of an infant; Performing target detection on the image where the target is an infant, and outputting the position information of the infant area; The performing corner point detection and edge feature extraction on the target image to determine the location information of the dangerous area includes: Performing grayscale processing on the target image and outputting a grayscale image; Performing angle detection and screening on the grayscale image to obtain target corner points; According to the target corner points and the preset area size information, the target image is segmented and the area image is output; Performing a dangerous point analysis on the regional image and outputting dangerous point location information; The issuing of a safety warning when identifying that the infant is in a preset dangerous state based on the infant area position information and the dangerous area position information includes: Segmenting the target image according to the infant region position information and outputting an infant image; According to the danger point location information, the infant image is input into a pre-trained monocular depth calculation model to calculate an average depth value corresponding to the infant image and a target depth value corresponding to the danger point location; Obtain the body thickness of infants and young children; Determine the center point position coordinates of the infant area and the width of the infant area according to the infant area position information; Determine the relative distance between the center point and the dangerous point based on the center point position coordinates and the dangerous point position information; Comparing the relative distance with the width of the infant area, and when the relative distance is smaller than a preset ratio of the width of the infant area, acquiring the target depth value, the average depth value, and the body thickness; The target depth value and the average depth value are subjected to a difference calculation, and when the calculated depth difference is less than the body thickness, it is identified that the infant is in the dangerous state and a safety warning is issued.
6. An electronic device, characterized in that: include: At least one processor, at least one memory and computer program instructions stored in the memory, when the computer program instructions are executed by the processor, implement the method according to any one of claims 1 to 4.
7. A storage medium having computer program instructions stored thereon, characterized in that: When the computer program instructions are executed by a processor, the method according to any one of claims 1 to 4 is implemented.
Citation Information
Patent Citations
Infant monitoring system based on deep learning and building method
CN115187888A
Intelligent monitoring method, device and equipment for preventing infant from falling from high place
CN116311780A