Article entry / exit determination method and device, smart refrigerator, and readable storage medium
By receiving and processing video stream data in the refrigerator, it can automatically determine the entry and exit of items, solving the problem of time-consuming manual operation by users in the existing technology, and achieving efficient and accurate judgment of items entering and exiting.
Patent Information
- Application Number
- PCT/CN2023/099643
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-04-27
- Filing Date
- 2023-06-12
- Publication Date
- 2024-10-31
AI Technical Summary
Judging the entry and exit of items in the existing refrigerator requires manual operation by the user, resulting in high time costs and low efficiency.
By receiving the video stream data of the target chamber, the item area and center point position are determined based on the color value of the frame image, clustered and stored in the item queue, and the entry and exit of the items in the chamber are automatically determined.
Without the need for manual operation by the user, it can efficiently and quickly determine the entry and exit of items in the refrigerator, saving users time, simplifying the identification process, and improving the efficiency and accuracy of judgment.
Smart Images

Figure CN2023099643_31102024_PF_FP_ABST
Abstract
Description
Method and device for determining entry and exit of items, smart refrigerator, and readable storage medium
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This application claims priority to Chinese patent application number 202310484877.1, filed on April 27, 2023, entitled “Method, device, smart refrigerator and readable medium for determining entry and exit of objects,” the entire contents of which are incorporated by reference into this application. Technical Field
[0003] The present application relates to the field of smart home appliances, and in particular to a method and device for determining the entry and exit of objects, a smart refrigerator, and a readable storage medium. Background Art
[0004] With the rapid development and innovation of technology, the home appliance industry, which is closely related to daily life, is also undergoing technological upgrades to provide users with more intelligent and convenient new functions and new modes. For example, compared to the impression that refrigerators only provide a space for storing ingredients, existing refrigerators can also display relevant information about the ingredients stored in the refrigerator to users. There are many ways to achieve this function. For example, when taking ingredients, users can manually enter and delete relevant information about the ingredients through the display screen, so that users can directly view the relevant information about the ingredients in the refrigerator without opening the refrigerator.
[0005] During the research and practice of the prior art, the inventors of the present application found that manual operation by users brings additional time costs to users, and the steps are cumbersome and inefficient.
[0006] Summary of the Invention
[0007] The present application aims to solve at least one of the technical problems in the related art to a certain extent. To this end, the present application provides a method and device for determining whether items enter or exit a refrigerator, a smart refrigerator, and a readable storage medium, which can detect whether items enter or exit a refrigerator without any sensor.
[0008] According to the first aspect of the present application, some embodiments of the present application provide a method for determining entry and exit of an object, including:
[0009] receiving video stream data recorded for a target chamber, where the video stream data includes a plurality of frame images;
[0010] Determining at least one object region contained in each frame image and an object corresponding to each object region based on the color value of each frame image;
[0011] Clustering obtains the center point of each item area, and stores each center point in the corresponding item queue in turn. The item queue is the item queue corresponding to the item area to which the center point belongs;
[0012] According to each item queue, the entry and exit results of each item in the target chamber are determined.
[0013] According to a second aspect of the present application, some embodiments of the present application provide an object entry and exit determination device, the device comprising:
[0014] A receiving module, configured to receive video stream data recorded for a target chamber, the video stream data including a plurality of frame images;
[0015] a determination module, configured to determine, based on the color value of each frame image, at least one object region contained in each frame image and an object corresponding to each object region;
[0016] The clustering module is used to cluster the center point of each item area and store each center point in the corresponding item queue in turn. The item queue is the item queue corresponding to the item area to which the center point belongs;
[0017] The judgment module is used to judge the entry and exit results of each item in the target chamber according to each item queue.
[0018] In some embodiments of the present application, the color value includes the color value of a pixel in the frame image, and the determination module may include a point set determination submodule, an object determination submodule, and a processing submodule, wherein:
[0019] A point set determination submodule, configured to determine at least one pixel point set having the same color value continuously in the frame image;
[0020] The object determination submodule is used to determine the object corresponding to the color value of the pixel set;
[0021] The processing submodule is used to process the color values of the pixel set to obtain the object area corresponding to the pixel set, and the object area corresponds to the object.
[0022] In some embodiments of the present application, the color value includes a first color value based on a first color gamut and a second color value based on a second color gamut, and the item determination submodule includes an acquisition unit and a determination unit, wherein:
[0023] an acquiring unit, configured to acquire a second color-to-item mapping table, the second color-to-item mapping table including a plurality of mapping relationships between preset second color values and items;
[0024] The determining unit is configured to determine the object corresponding to the second color value of the pixel set according to the second color object mapping table.
[0025] In some embodiments of the present application, the processing submodule includes a modification unit and a calculation unit, wherein:
[0026] a modifying unit configured to, when the second color-object mapping table includes the second color value of the pixel set in the frame image, modify the first color values of all pixels in the pixel set to the first set value, and modify the first color values of all pixels in the frame image except the pixel set to the second set value, thereby obtaining a binary image of the frame image;
[0027] The operation unit is used to perform an opening operation on the binary image to obtain at least one item region with a first set value.
[0028] In some embodiments of the present application, the clustering module includes a setting submodule, a calculation submodule, an update submodule, a determination submodule, and a storage submodule, wherein:
[0029] Setting submodule, used to set a random location point for each item area;
[0030] The calculation submodule is used to calculate the average distance between the random position point and all pixels in each object area;
[0031] An update submodule is used to update the random position point to the average position point of the object area corresponding to the minimum distance, and the minimum distance includes the minimum value of all average distances;
[0032] a determination submodule, configured to determine the updated random position point as the center position point of the item area when the updated random position point meets a preset update condition;
[0033] The storage submodule is used to store each central location point into the corresponding item queue in turn.
[0034] In some embodiments of the present application, the judgment module includes an extraction submodule, a calculation submodule and a judgment submodule, wherein:
[0035] The extraction submodule is used to randomly extract a set number of center position points from the item queue, and each center position point carries the position information in the item queue;
[0036] A calculation submodule is used to sequentially calculate the difference between adjacent center position points;
[0037] The judgment submodule is used to judge the entry and exit results of the items corresponding to the item queue in the target chamber based on the multiple difference values.
[0038] In some embodiments of the present application, the judgment submodule includes an initial value unit, a first updating unit, a second updating unit and a judgment unit, wherein:
[0039] An initial value unit, used for setting initial values for the first count value and the second count value respectively;
[0040] A first updating unit, configured to update the first count value when the difference is greater than a preset threshold;
[0041] A second updating unit, configured to update the second count value when the difference is less than a preset threshold;
[0042] The judging unit is configured to judge the entry and exit results of the object corresponding to the object queue in the target chamber according to the updated first counting value and the updated second counting value.
[0043] In some embodiments of the present application, the judgment unit includes an entry subunit and an extraction subunit, wherein:
[0044] an entry subunit, configured to determine that an item corresponding to the item queue is in an entry state in the target chamber when the updated first count value is greater than the updated second count value;
[0045] The taking-out subunit is configured to determine that the item corresponding to the item queue is in a taken-out state in the target chamber when the updated first count value is less than the updated second count value.
[0046] According to the third aspect of the present application, some embodiments of the present application also provide a computer-readable storage medium, which stores a computer program, and the computer program is suitable for loading by a processor to execute any one of the object entry and exit judgment methods provided by some embodiments of the first aspect of the present application.
[0047] According to the fourth aspect of the present application, some embodiments of the present application also provide a smart refrigerator, including a memory, a processor, and a computer program stored in the memory and runnable on the processor, wherein when the processor executes the computer program, it implements any one of the object entry and exit judgment methods provided in some embodiments of the first aspect of the present application.
[0048] The present application can receive video stream data recorded for a target chamber, which includes multiple frame images. The video stream data can be determined in turn based on the color value of each frame image, including at least one object area and the object corresponding to each object area. Then, the center point position of each object area can be clustered and the center point position can be stored in the corresponding object queue in turn. The object queue is the object queue corresponding to the object area to which the center point position belongs. Finally, based on each object queue, the entry and exit results of the object corresponding to the object queue in the target chamber can be judged.
[0049] This application does not require manual operation by the user. The computer equipment processes and judges the data of the automatically captured video stream, that is, obtains the entry and exit status of the items in the target chamber. Compared with the existing method that requires manual operation by humans, it is efficient and fast, saving users time.
[0050] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become obvious from the description below, or will be learned through practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:
[0052] FIG1 is a schematic diagram of a scenario of an object entry and exit determination system provided in some embodiments of the present application;
[0053] FIG2 is a flow chart of a method for determining entry and exit of an object provided in some embodiments of the present application;
[0054] FIG3 is another flowchart of a method for determining entry and exit of an object provided in some embodiments of the present application;
[0055] FIG4 is a flow chart of a clustering algorithm in a method for determining entry and exit of objects provided in some embodiments of the present application;
[0056] FIG5 is a schematic diagram of the structure of an article entry and exit judgment device provided in some embodiments of the present application. DETAILED DESCRIPTION
[0057] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described in this application are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of this application. The following describes the embodiments of this application with reference to the drawings.
[0058] The present application provides a method, device, smart refrigerator, and readable storage medium for determining whether an item enters or exits. For example, the method can be integrated into a system for determining whether an item enters or exits.
[0059] The item entry and exit judgment system can be integrated into at least one computer device. The computer device can include at least one of a terminal and a server. The terminal can include a smart refrigerator, a smart phone, a tablet computer, a smart camera device, a personal wearable device, etc. The server can include a physical server or a cloud server. The physical server can be a single server, or a server cluster consisting of at least two servers, or a distributed system. The cloud server can provide basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. Different computer devices can be directly or indirectly connected through wired or wireless communication, and this application does not impose any restrictions on this.
[0060] The object entry and exit judgment system can be integrated on at least one terminal, and the terminal can include a smart refrigerator. The smart refrigerator can receive video stream data recorded for the target chamber, and the video stream data includes multiple frame images; based on the color value of each frame image, at least one object area contained in each frame image and the object corresponding to each object area are determined; the center point position of each object area is obtained by clustering, and each center position point is stored in the corresponding object queue in turn. The object queue is the object queue corresponding to the object area to which the center position point belongs; according to each object queue, the entry and exit results of each object in the target chamber are judged.
[0061] For example, referring to FIG1 , FIG1 includes a smart refrigerator 10. The smart refrigerator 10 can shoot a video of the freezer compartment through a camera to obtain a video stream 1 for the freezer compartment. The video stream 1 may include multiple frame images. The smart refrigerator 10 can receive the video stream 1 and determine, based on the color value of each frame image in the video 1, at least one object region contained in each frame image and the object corresponding to each object region.
[0062] The smart refrigerator 10 can create an item queue corresponding to each identified item, and then the smart refrigerator 10 can cluster to obtain the center point position of each item area, and store the center point position in the item queue corresponding to the item area in turn. Finally, according to each item queue, the entry and exit results of the corresponding item in the freezer can be determined.
[0063] In some embodiments of the present application, the method for judging the entry and exit of objects can also be used in conjunction with existing convolutional neural network models, deep learning models, etc. The method for judging the entry and exit of objects of the present application can efficiently and quickly identify objects with significant color information, and can also judge the entry and exit of objects in the target chamber based on the color information of the objects. The method for judging the entry and exit of objects of the present application can be implemented when the frame image records the color information relatively completely, and does not have significant requirements for other aspects such as the clarity of the frame image in the video stream. Therefore, it can be used in conjunction with other models and algorithms with the function of judging the entry and exit of objects to jointly achieve high-precision and high-quality judgment of the entry and exit of objects.
[0064] It should be noted that the scenario diagram of the item entry and exit judgment system shown in Figure 1 is only an example. The item entry and exit judgment system and scenario described in the embodiment of the present application are for the purpose of more clearly illustrating the technical solution of the embodiment of the present application, and do not constitute a limitation on the technical solution provided by the embodiment of the present application. Ordinary technicians in this field can know that with the evolution of the item entry and exit judgment system and the emergence of new business scenarios, the technical solution provided by the embodiment of the present application is also applicable to similar technical problems.
[0065] The present application will be described in detail below with reference to some embodiments. In some embodiments of the present application, the object entry and exit determination method can be implemented by a computer device. Referring to FIG2 , FIG2 is a flow chart of the object entry and exit determination method provided in some embodiments of the present application. The object entry and exit determination method may include:
[0066] 101. Receive video stream data recorded for a target chamber, where the video stream data includes multiple frame images.
[0067] The target chamber can include spaces capable of storing items, such as the refrigerator compartment, freezer compartment, and holding chamber of a refrigerator, the dishwashing space of a dishwasher, and the baking space of an oven. Items can include items with distinct color characteristics, such as fruits and vegetables of specific colors, such as pink dragon fruit, yellow bananas, and earthy ginger. The target chamber can also have certain conditions required for video recording, such as side walls on which a camera can be mounted.
[0068] The video stream data includes image data obtained by photographing the target chamber within a period of time. The video stream data may be photographed by a camera device, and the video stream data may include multiple frame images.
[0069] For example, receiving video stream data may include multiple ways, such as receiving video stream data transmitted by a camera device via a wire harness, or receiving video stream data transmitted by a server via a wireless network, and so on.
[0070] For example, the smart refrigerator can receive video stream data A wirelessly transmitted by a camera installed in the freezer compartment 1.
[0071] 102. Determine at least one object region included in each frame image and an object corresponding to each object region based on the color value of each frame image.
[0072] Among them, the color value may include a value obtained through the color information of the frame image. The color value can represent the color information of the entire area or part of the area of the frame image. The color value can be directly extracted data, or it can be data obtained by calculation, screening, etc. based on the color information of the frame image. The number and type of color values are not limited. For example, the numerical values under different color gamuts of the frame image can all be the color values of the frame image. The color value can refer to a single number or a range. For example, the color value can be a red value, and the red value can include numerical values of all red-related colors such as peach red and pink.
[0073] The object region may be a region in the image containing an object. The object region may be defined by a contour such as a rectangular frame, a circle, or an ellipse. A frame image may include one or more object regions.
[0074] For example, there are many ways to determine object areas and objects based on color values, such as using a trained recognition model to detect and identify objects. Specifically, the color values of the frame image can be input into the trained recognition model to determine the object area in the frame image and its corresponding object.
[0075] The present application can determine the object area and corresponding objects contained in the frame image through the color information (such as color value) of the frame image. Compared with the existing recognition method mainly based on shape, it can effectively simplify the recognition process, and still has better recognition effect for some images with poor imaging effects (such as blurred imaging, ghosting, etc.).
[0076] In some embodiments of the present application, the color value of the frame image may include the color value of the pixel points in the frame image. Due to the color characteristics of different objects, the color information of the image obtained by shooting has significant characteristics, that is, the color value of the image pixel points has significant characteristics. Based on this feature, the present application can determine the objects and object areas in the frame image.
[0077] For a frame image captured with a solid-color object, at least one set of pixels with the same continuous color value in the frame image can be determined, and then the object corresponding to the color value of the pixel set can be determined. The color value of the pixel set is then processed to obtain the object area corresponding to the pixel set, and the object area corresponds to the object.
[0078] Among them, the pixel point set may include multiple pixel points, and the color values of the pixels in the pixel point set meet pre-set conditions, for example, the color values of all pixels in the pixel point set are the same, or more than Q% (Q is a positive integer from 0 to 100) of the pixels in the pixel point set have the same color value, or the color values of all pixels in the pixel point set belong to a preset range, etc.
[0079] A color value corresponding to the pixel set can be determined based on the color values of the pixels in the pixel set. For example, if the color values of all pixels in the pixel set are the same, then it can be determined as the color value of the pixel set. For another example, the top three color values in the pixel set can be selected as the color value of the pixel set, and so on.
[0080] The pixel values of the pixel set can then be used to determine the corresponding item. This can be done in a variety of ways, such as performing a calculation based on the pixel values and obtaining the corresponding item from the calculation result. Finally, the color values of the pixel set can be processed to obtain the item region corresponding to the pixel set. For example, this can be done in a variety of ways, such as sorting by color value, filtering based on the sorting results, and using the remaining pixel regions as the item regions. The correspondence between this item region and the item identified by the pixel set can then be determined.
[0081] In some embodiments of the present application, a color value may include a first color value based on a first color gamut and a second color value based on a second color gamut. A second color-to-item mapping table may be obtained, which may include multiple sets of pre-stored mapping relationships between preset second color values and items. The item corresponding to the second color value of a pixel set is then determined based on the second color-to-item mapping table. This allows for rapid identification of the item corresponding to a pixel set based solely on color.
[0082] The color gamut may include the range of colors defined by different color models. The color gamut may also be called a color space. Common color gamuts may include RGB, CMY, HSV, HSI, Lab, etc. In some embodiments, the first color value based on the first color gamut and the second color value based on the second color gamut may be, for example, an RGB value based on RGB and an HSV value based on HSV.
[0083] The second color-to-item mapping table may include multiple mapping relationships between second color values and items. The second color-to-item mapping table may include one-to-one mapping, one-to-many mapping, or many-to-one mapping, and the mapping may be flexibly selected based on actual circumstances. For example, the second color-to-item mapping table may be an HSV value-to-item mapping table, in which HSV values are mapped one-to-one to items.
[0084] For example, for frame image 1, we can determine its pixel set 1 with the same continuous HSV value, obtain the HSV value item mapping table, and look up the table to determine that the HSV value of pixel set 1 corresponds to item P.
[0085] In some embodiments of the present application, processing the color values of a pixel set to obtain an object region corresponding to the pixel set may include:
[0086] When the second color-item mapping table contains the second color value of a pixel set in the frame image, the first color values of all pixels in the pixel set are modified to the first set value, and the first color values of all pixels in the frame image excluding the pixel set are modified to the second set value, thereby obtaining a binary image of the frame image. An opening operation is then performed on the binary image to obtain at least one item region having the first set value. This method can thus determine the item region included in the pixel click based on the color value of the pixel set in the frame image. Compared to existing technologies, this method is simpler, more efficient, and significantly reduces computing power.
[0087] The first set value and the second set value can be set according to the characteristics of the frame image. For example, if the first color value is an RGB value, the first set value and the second set value can be 0 (black) and 255 (white) respectively. When the frame image is modified to contain only two values, the resulting image is a binary image.
[0088] After obtaining the binary image, the binary image can be eroded first and then dilated, i.e., opened, to separate two partially connected pixel sets in the frame image to obtain multiple independent object regions.
[0089] For example, in frame image 1, the HSV value of pixel set 1 belongs to the HSV value item mapping table. Then, the RGB value of the pixel to which the HSV value belongs is changed to 255 (white), and the RGB value of other pixels in the frame image is changed to 0 (black). This will give a binary image 1 corresponding to frame image 1. Then, an opening operation is performed on the binary image 1 to obtain multiple independent item regions composed of continuous white pixels. The item regions correspond to the items in the pixel set to which they belong.
[0090] 103. Clustering obtains the center point position of each item area, and stores each center position point in the corresponding item queue in turn. The item queue is the item queue corresponding to the item area to which the center position point belongs.
[0091] The item queue can include a queue of items corresponding to the item area to which the center position belongs. The queue is a first-in-first-out data structure and will not be described in detail here. The present application can sequentially process the frame images in the video stream, determine at least one item in each frame data, its corresponding item area, and the center point position, create an item queue for each item, and sequentially store the obtained center point position of the item in the item queue to which it belongs. The item queue can reflect the changing trend of the center point position of each item over time.
[0092] For example, clustering can be achieved using a clustering algorithm. A clustering algorithm can classify data according to specific criteria, so that the similarity of data within the same class is as great as possible, and the difference between data in different classes is as great as possible. The specific criteria may include distance, etc. Clustering algorithms may include partitioning clustering methods, hierarchical clustering methods, etc. Specific examples include the K-means algorithm (a clustering algorithm) and the OPTICS algorithm (a clustering algorithm).
[0093] In some embodiments, clustering is used to determine the center position point. A random position point can be set for each object area in a frame image, and the random position point can be used as the initial center position point of the object area to which it belongs. Then, each initial center position point is updated multiple times to finally obtain the center position point of each object area, and each center position point is stored in the object queue corresponding to the object area to which it belongs.
[0094] For one of the item areas, for example, after setting a random position point as the initial center position point, the distance between the random position point and all pixels in each item area can be calculated. The distance can be, for example, the Euclidean distance. The distances of all pixels in the same item area are then averaged to obtain the average distance between the random position point and each item area. The average distances are sorted, and the average position point of the item area with the smallest average distance is used as the new center position point. For the updated center position point, the above process can be performed again, that is, the distance between the updated center position point and all pixels in each item area is calculated, and the distances of all pixels in the same item area are averaged to obtain the average distance between the updated center position point and each item area. The average position point of the item area with the smallest average distance is used as the new center position point.
[0095] When the new center position point meets the preset update conditions, it can be determined that the update of the center position point is completed. The preset update conditions may include multiple types. For example, the preset update condition may be the update round. If the new update position point is the target update, the update is determined to be completed. For another example, the preset update condition may be a preset difference threshold obtained from adjacent updates. When the difference between the current center position point and the previous center position point is less than the preset difference threshold, the update is determined to be completed. For another example, the distance from the center position point to all pixel points in each object area is calculated, and the error of the distance is also calculated. The average distance from the center position point to each object area is calculated, and the average error of the average distance is also calculated. When the average error of the current center position point is the same as the average error of the previous center position point, the update is determined to be completed, and the current center position point is used as the center position point of the object area in the frame image.
[0096] For example, frame image 1 can identify five object regions. Five random positions are randomly obtained for each of these five object regions as the initial center positions. These five random positions are then updated sequentially to obtain five updated random positions as the center positions of their corresponding object regions. For example, random position 1 is set in object region 1. The average distances between random position 1 and object regions 1-5 are calculated and sorted. The average distance 3 corresponding to object region 3 is determined to be the minimum. The average position of object region 3 is then determined as the new center position. This process can be repeated until the center position after a certain update is the same as the previous center position. The center position of object region 1 is determined to be the center position after the certain update.
[0097] 104. According to each item queue, determine the entry and exit results of each item in the target chamber.
[0098] The entry and exit results may include no entry or exit of items, items in, items out, etc. The entry and exit results may be stored in a computer device in the form of an identifier, etc.
[0099] For example, there are many ways to judge the entry and exit results of items in the target chamber based on the item queue. For example, the center position points in the item queue can be grouped, and a group contains several adjacent center position points. The average value of all center position points in different groups can be calculated, and the entry and exit results of the items in the target chamber can be judged based on the changing trend of each average value with a sequence.
[0100] In some embodiments of the present application, a set number of center locations can be randomly selected from an item queue. Each center location carries its position information within the item queue, and the differences between adjacent center locations are calculated sequentially. For example, if item queue 1 for item 1 stores 100 center locations, 20 center locations can be randomly selected, and the differences between adjacent center locations among the 20 center locations are calculated, resulting in 20 differences.
[0101] Based on these multiple differences, the entry and exit results of the items in the queue can be determined. For example, this can be implemented in a variety of ways. For example, the multiple differences can be averaged and compared with a preset threshold. If the average value is greater than the preset threshold, the item is considered to have entered, and if the average value is less than the preset threshold, the item is considered to have exited.
[0102] In some embodiments of the present application, two count values may be created: a first count value and a second count value. Initial values may be set for the first count value and the second count value, respectively. For example, the initial value may be set to 0. Then, each difference value may be compared with a preset threshold value. The preset threshold value may be flexibly set according to actual needs. For example, if the preset threshold value is 0, when a difference value greater than the preset threshold value exists, the first count value is updated. When a difference value less than the preset threshold value exists, the second count value is updated. For example, if difference value 1 is -1, the second count value is updated to 1. If difference value 2 is 3, the first count value is updated to 1. All differences are compared with the preset threshold value to obtain an updated first count value and an updated second count value.
[0103] The results of items in the item queue entering or exiting the target chamber can be determined based on the updated first count value and the updated second count value. For example, various implementations are possible. For example, the updated first count value and the updated second count value can be compared with a preset count threshold. When the updated first count value is greater than the preset count threshold, the item is determined to have been deposited into the target chamber. When the updated first count value is less than the speech rate and the count threshold, the item is determined to have been removed from the target chamber.
[0104] In some embodiments of the present application, the updated first count value and the updated second count value can also be compared, and the entry and exit results of the items in the target chamber can be determined based on the comparison result. For example, when the updated first count value is greater than the updated second count value, it is determined that the items corresponding to the item queue are in the entry state in the target chamber; when the updated first count value is less than the updated second count value, it is determined that the items corresponding to the item queue are in the removal state in the target chamber.
[0105] This application does not require manual operation by the user. The computer equipment processes and judges the data of the automatically captured video stream, that is, obtains the entry and exit status of the object in the target chamber. Compared with the existing method that requires manual operation by humans, it is efficient and fast, saving user time. In the process of determining the object area contained in the frame image and its corresponding object, this application mainly uses the color information of the frame image. Compared with the existing method that relies on the object outline or internal key features, this method has a simple implementation process, consumes less computing resources, and can obtain better recognition accuracy.
[0106] The following will further introduce the object entry and exit judgment method of the present application in conjunction with Figure 3. For example, the present application can be applied to a smart refrigerator. The video stream can be captured from the refrigerator compartment of the smart refrigerator. Specifically, it can be implemented by a camera. The camera can be kept parallel and facing the refrigerator refrigerator drawer. Multiple RGB images can be obtained from the video stream. These RGB images can be formatted to obtain HSV images. For the multiple RGB images obtained, the HSV value of each pixel in the HSV image can be determined. When the HSV value falls within a preset HSV interval, the RGB value of the pixel corresponding to the HSV value in the corresponding RGB image is modified to 255. The RGB value of the pixel corresponding to the HSV value that does not fall within the preset HSV interval is modified to 0 in the corresponding RGB image. In this way, multiple binary images containing only pixel values 0 and 255 can be obtained. The above process is also called the binarization process. Furthermore, the corresponding object can be specifically determined based on the HSV value, and the set of pixels with an RGB value of 255 is preliminarily determined as the object area.
[0107] Then, an opening operation can be performed on the binary image to remove noise from the image and obtain multiple independent food regions. If the frame image contains N food regions, that is, N food ingredients are detected, the center point of each food region can be determined through the K-mean clustering algorithm. For example, the K-mean clustering algorithm can be used as shown in Figure 4. Clustering can obtain the center point of each food region and store it in the food queue of its corresponding food.
[0108] Finally, the in and out situation of the food in the cold storage room can be determined based on the changing trend of multiple center points in the food queue. For example, the center point can be a two-bit coordinate point. M center points can be extracted from the food queue, of which the mth (m is a positive integer between 0-M) is, and the count value p=0 and the forward count value q=0 are set respectively, and the difference between the current center point and the previous center point is calculated in turn.
[0109] When dy>0, then p=p+1; if dy<0, then q=q+1, all differences are judged, if p>q, it is determined that food has entered the refrigerator, otherwise it is determined that food has been taken out of the refrigerator.
[0110] The solutions of some embodiments of this application can be used to determine the entry and exit of items, effectively improving the efficiency and speed of judgment. In addition, the solutions of some embodiments of this application can be combined with artificial intelligence-related network models to further improve the overall accuracy of determining the entry and exit of items.
[0111] To facilitate better implementation of the object entry and exit determination method provided in some embodiments of this application, some embodiments of this application also provide a device based on the above-mentioned object entry and exit determination method. The meanings of the terms herein are the same as those in the above-mentioned object entry and exit determination method. For specific implementation details, please refer to the description in the method embodiment.
[0112] As shown in FIG5 , FIG5 is a schematic diagram of the structure of an article entry and exit judgment device provided in an embodiment of the present application, wherein the article entry and exit judgment device may include a receiving module 301, a determining module 302, a clustering module 303 and a judging module 304, wherein,
[0113] The receiving module 301 is configured to receive video stream data recorded for a target chamber, where the video stream data includes multiple frame images.
[0114] A determination module 302 is configured to determine, based on the color values of each frame image, at least one object region contained in each frame image and the object corresponding to each object region;
[0115] Clustering module 303, for clustering to obtain the center point position of each item area, and sequentially storing each center position point in the corresponding item queue, which is the item queue corresponding to the item area to which the center position point belongs;
[0116] The judgment module 304 is used to judge the entry and exit results of each object in the target chamber according to each object queue.
[0117] In some embodiments of the present application, the color value includes the color value of a pixel in the frame image, and the determination module may include a point set determination submodule, an object determination submodule, and a processing submodule, wherein:
[0118] A point set determination submodule, configured to determine at least one pixel point set having the same color value continuously in the frame image;
[0119] The object determination submodule is used to determine the object corresponding to the color value of the pixel set;
[0120] The processing submodule is used to process the color values of the pixel set to obtain the object area corresponding to the pixel set, and the object area corresponds to the object.
[0121] In some embodiments of the present application, the color value includes a first color value based on a first color gamut and a second color value based on a second color gamut, and the item determination submodule includes an acquisition unit and a determination unit, wherein:
[0122] an acquiring unit, configured to acquire a second color-to-item mapping table, the second color-to-item mapping table including a plurality of mapping relationships between preset second color values and items;
[0123] The determining unit is configured to determine the object corresponding to the second color value of the pixel set according to the second color object mapping table.
[0124] In some embodiments of the present application, the processing submodule includes a modification unit and a calculation unit, wherein:
[0125] a modifying unit configured to, when the second color-object mapping table includes the second color value of the pixel set in the frame image, modify the first color values of all pixels in the pixel set to the first set value, and modify the first color values of all pixels in the frame image except the pixel set to the second set value, thereby obtaining a binary image of the frame image;
[0126] The operation unit is used to perform an opening operation on the binary image to obtain at least one item region with a first set value.
[0127] In some embodiments of the present application, the clustering module includes a setting submodule, a calculation submodule, an update submodule, a determination submodule, and a storage submodule, wherein:
[0128] Setting submodule, used to set a random location point for each item area;
[0129] The calculation submodule is used to calculate the average distance between the random position point and all pixels in each object area;
[0130] An update submodule is used to update the random position point to the average position point of the object area corresponding to the minimum distance, and the minimum distance includes the minimum value of all average distances;
[0131] a determination submodule, configured to determine the updated random position point as the center position point of the item area when the updated random position point meets a preset update condition;
[0132] The storage submodule is used to store each central location point into the corresponding item queue in turn.
[0133] In some embodiments of the present application, the judgment module includes an extraction submodule, a calculation submodule and a judgment submodule, wherein:
[0134] The extraction submodule is used to randomly extract a set number of center position points from the item queue, and each center position point carries the position information in the item queue;
[0135] A calculation submodule is used to sequentially calculate the difference between adjacent center position points;
[0136] The judgment submodule is used to judge the entry and exit results of the items corresponding to the item queue in the target chamber based on the multiple difference values.
[0137] In some embodiments of the present application, the judgment submodule includes an initial value unit, a first updating unit, a second updating unit and a judgment unit, wherein:
[0138] An initial value unit, used for setting initial values for the first count value and the second count value respectively;
[0139] A first updating unit, configured to update the first count value when the difference is greater than a preset threshold;
[0140] A second updating unit, configured to update the second count value when the difference is less than a preset threshold;
[0141] The judging unit is configured to judge the entry and exit results of the object corresponding to the object queue in the target chamber according to the updated first counting value and the updated second counting value.
[0142] In some embodiments of the present application, the judgment unit includes an entry subunit and an extraction subunit, wherein:
[0143] an entry subunit, configured to determine that an item corresponding to the item queue is in an entry state in the target chamber when the updated first count value is greater than the updated second count value;
[0144] The taking-out subunit is configured to determine that the item corresponding to the item queue is in a taken-out state in the target chamber when the updated first count value is less than the updated second count value.
[0145] The article entry and exit judgment device of the present application can receive video stream data recorded for a target chamber, and the video stream data includes multiple frame images. According to the color value of each frame image, at least one article area contained therein and the article corresponding to each article area are determined in turn. Then, the center point position of each article area can be clustered and the center point position can be stored in the corresponding article queue in turn. The article queue is the article queue corresponding to the article area to which the center point position belongs. Finally, based on each article queue, the entry and exit results of the article corresponding to the article queue in the target chamber can be judged.
[0146] This application does not require manual operation by the user. The computer equipment processes and judges the data of the automatically captured video stream, that is, obtains the entry and exit status of the items in the target chamber. Compared with the existing method that requires manual operation by humans, it is efficient and fast, saving users time.
[0147] It should be noted that, regarding the description in this application, please refer to the description in this application, and the details will not be repeated here.
[0148] It should be noted that the logic and / or steps represented in the flowcharts or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing the logical functions, and can be embodied in any computer-readable storage medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (e.g., a computer-based system, a system including a processor, or other system that can fetch and execute instructions from an instruction execution system, apparatus, or device). For purposes of this specification, a "computer-readable storage medium" can be any device that can contain, store, communicate, propagate, or transmit a program for use by, or in conjunction with, an instruction execution system, apparatus, or device. More specific examples (non-exhaustive list) of computer-readable storage media include the following: an electrical connection having one or more wires (electronic device), a portable computer disk cartridge (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and programmable read-only memory (EPROM or flash memory), fiber optic devices, and portable compact disc read-only memory (CDROM). In addition, the computer-readable storage medium may even be paper or other suitable medium on which the program is printed, since the program can be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or processing it in another suitable manner as necessary, and then stored in a computer memory.
[0149] It should be understood that various parts of the present application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented using software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented using hardware, as in another embodiment, any one of the following technologies known in the art or a combination thereof can be used to implement: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application-specific integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0150] Throughout this specification, reference to terms such as "one embodiment," "some embodiments," "examples," "specific examples," or "some examples" means that a specific feature, structure, material, or characteristic described in conjunction with that embodiment or example is included in at least one embodiment or example of the present application. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
[0151] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of the technical features being referred to. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of such features. Throughout the description of this application, "plurality" means at least two, for example, two, three, etc., unless otherwise specifically defined.
[0152] In this application, unless otherwise specified or limited, the terms "installed," "connected," "connect," "fixed," etc. should be understood in a broad sense. For example, they can refer to fixed connection, detachable connection, or integration; mechanical connection or electrical connection; direct connection or indirect connection through an intermediate medium; internal communication between two elements or interaction between two elements, unless otherwise specified. Those skilled in the art will understand the specific meanings of the above terms in this application based on specific circumstances.
[0153] Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limitations on the present application. Ordinary technicians in this field can change, modify, replace and modify the above embodiments within the scope of the present application.
Claims
1. A method for determining whether an object enters or exits, comprising: Receiving video stream data recorded for a target chamber, wherein the video stream data includes a plurality of frame images; Determining at least one object region included in each of the frame images and an object corresponding to each of the object regions based on the color value of each of the frame images in sequence; Clustering obtains the center point position of each of the item areas, and sequentially stores each of the center position points in a corresponding item queue, where the item queue is an item queue corresponding to the item area to which the center position point belongs; According to each of the object queues, the entry and exit results of each of the objects in the target chamber are determined.
2. The method according to claim 1, wherein: The color value includes the color value of the pixel in the frame image. The determining, based on the color value of each frame image in turn, at least one object region and an object contained in each frame image comprises: Determine at least one set of pixels having the same color value continuously in the frame image; Determine an object corresponding to the color value of the pixel set; The color values of the pixel set are processed to obtain an object region corresponding to the pixel set, wherein the object region corresponds to the object.
3. The method according to claim 2, wherein: The color value includes a first color value based on a first color gamut and a second color value based on a second color gamut, The determining the object corresponding to the color value of the pixel set includes: Acquire a second color-to-object mapping table, where the second color-to-object mapping table includes a plurality of mapping relationships between preset second color values and objects; The object corresponding to the second color value of the pixel set is determined according to the second color-object mapping table.
4. The method according to claim 3, wherein: The step of processing the color values of the pixel set to obtain the object area corresponding to the pixel set includes: When the second color object mapping table includes the second color value of the pixel set in the frame image, the first color values of all the pixels in the pixel set are modified to the first set value, and the first color values of the other pixels in the frame image except the pixel set are modified to the second set value, so as to obtain a binary image of the frame image; An opening operation is performed on the binary image to obtain at least one object region having a first set value.
5. The method according to any one of claims 1 to 4, wherein: The clustering obtains the center position point of each of the item areas, and sequentially stores each of the center position points in a corresponding item queue, including: A random location point is set for each of the item areas; Calculating the average distance between the random position point and all pixel points in each of the object areas; Updating the random position point to the average position point of the object area corresponding to the minimum distance, wherein the minimum distance includes the minimum value of all the average distances; When the updated random position point meets the preset update condition, determining the updated random position point as the center position point of the object area; Each of the central locations is stored in the corresponding item queue in turn.
6. The method according to any one of claims 1 to 5, wherein: The step of determining the entry and exit result of each of the objects in the target chamber according to each of the object queues includes: Randomly extracting a set number of central position points from the item queue, each central position point carrying position information in the item queue; Calculating the differences between adjacent center position points in sequence; Based on the multiple differences, the entry and exit results of the objects corresponding to the object queue in the target chamber are determined.
7. The method according to claim 6, wherein: The step of determining the entry and exit results of the object corresponding to the object queue in the target chamber based on the plurality of the difference values includes: Set initial values for the first count value and the second count value respectively; When the difference is greater than a preset threshold, updating the first count value; When the difference is less than the preset threshold, updating the second count value; According to the updated first count value and the updated second count value, the entry and exit results of the objects corresponding to the object queue in the target chamber are determined.
8. The method according to claim 7, wherein: The step of determining the entry and exit results of the object corresponding to the object queue in the target chamber according to the updated first count value and the updated second count value includes: When the updated first count value is greater than the updated second count value, it is determined that the object corresponding to the object queue is in the entry state in the target chamber; When the updated first count value is less than the updated second count value, it is determined that the object corresponding to the object queue is in a taken-out state in the target chamber.
9. An article entry and exit judgment device, comprising: A receiving module, used for receiving video stream data recorded for a target chamber, wherein the video stream data includes a plurality of frame images; A determination module, configured to determine, based on the color value of each frame image, at least one object region included in each frame image and an object corresponding to each object region; A clustering module, used for clustering to obtain the center point position of each of the item areas, and sequentially storing each of the center position points into a corresponding item queue, where the item queue is an item queue corresponding to the item area to which the center position point belongs; The judging module is used to judge the entry and exit result of each of the objects in the target chamber according to each of the object queues.
10. A smart refrigerator, comprising a processor and a memory, wherein the memory stores a computer program, and the processor executes the method of any one of claims 1 to 8 by calling the computer program stored in the memory.
11. A computer-readable storage medium storing a plurality of computer programs, wherein the computer programs are suitable for being loaded by a processor to execute the steps of any one of the methods of claims 1 to 8.
Citation Information
Patent Citations
License plate positioning method based on color clustering
CN103065141A
Dwelling house entrance guard system for acquisition and analysis of big personnel data
CN108062809A
Omnibearing visual sensor based road monitoring apparatus
CN1804927A
People count system using image analysis and method thereof
KR101064927B1
