Food counting method for food portioning apparatus and device therefor
By using cameras and ResNet50 neural network models to identify food image regions in food packaging equipment, combined with conveyor belt rotation and image segmentation technology, the problem of inaccurate food counting was solved, achieving accurate counting and efficient packaging in food packaging equipment.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BOZHON PRECISION IND TECH CO LTD
- Filing Date
- 2024-05-24
- Publication Date
- 2026-07-14
AI Technical Summary
Existing food packaging equipment struggles to achieve accurate and efficient counting, especially when packing food into pre-set quantities of bags, where inaccurate counting is a problem.
The system uses a camera to capture images of the conveyor belt surface and a ResNet50 neural network model to identify food image regions. Combined with conveyor belt rotation and image segmentation technology, it can accurately count the number of food items and then repackage and seal them when the preset quantity is reached.
It enables accurate counting and efficient packaging of food, ensuring precise control of the quantity of food in each bag, and improving production efficiency and product quality.
Smart Images

Figure CN118469978B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of food packaging technology, and in particular to a food counting method and apparatus for food packaging equipment. Background Technology
[0002] In reality, packaging bags are commonly used to package food. In one scenario, a predetermined amount of food is required to be placed in the packaging bag (for example, the amount of sugar in a wedding candy bag is usually a fixed value). Understandably, in actual production, when using food packaging equipment to package these foods, it is necessary to count the food.
[0003] Therefore, how to realize the technical functions in food packaging equipment has become an urgent problem to be solved. Summary of the Invention
[0004] The purpose of this invention is to provide a food counting method and apparatus for food packaging equipment.
[0005] To achieve one of the above-mentioned invention purposes, an embodiment of the present invention provides a food counting method for a food packaging device. The food packaging device includes: a conveyor belt and an information storage device. Above the conveyor belt, a camera is provided, and the camera can capture the upper surface of the conveyor belt and obtain a picture. The conveyor belt has a left end and a right end, and the conveyor belt can convey the food at the right end to the left end. The length of the picture in the left-right direction ≥ L. The information storage device is used to store a number of food image regions and the number of foods. When the information storage device is initialized, no food image regions are stored, and the number of foods is zero. The method includes the following steps: Control the conveyor belt to rotate from right to left, control the camera to capture the upper surface of the conveyor belt and output the obtained picture to be processed. Then, whenever it rotates a preset distance D, control the camera to capture the upper surface of the conveyor belt once and output the obtained picture to be processed, where 2*D ≤ L. When a picture to be processed is received from the camera, the following first processing is performed on all the pictures to be processed: In the direction from left to right, a first sub-picture with a length of D - W and a second sub-picture with a length of 2*W are segmented from the picture to be processed. The distance between the left side of the first sub-picture and the left side of the picture to be processed is a fixed value, and the right side of the first sub-picture is adjacent to the left side of the second sub-picture, 0 < W < D. Then, Num1 first food image regions are identified from the first sub-picture, and Num2 second food image regions are identified from the second sub-picture. Then, for any first food image region, if the absolute value of the difference between the distance Distance between it and all the food image regions in the information storage device and D is > a preset error value, the number of foods is increased by one. Then, all the food image regions in the information storage device are deleted, and each second food image region is stored in the information storage device and the number of foods is increased by one.
[0006] As a further improvement of an embodiment of the present invention, a packaging box is provided at the left end, and the packaging box can receive the food sent out by the left end of the conveyor belt. The specific content of "for any first food image region, if the absolute value of the difference between the distance Distance between it and all the food image regions in the information storage device and D is > a preset error value, the number of foods is increased by one" includes: In the direction from left to right, the following second processing is sequentially performed on each first food image region: If the absolute value of the difference between the distance Distance between the first food image region and all the food image regions in the information storage device and D is > a preset error value, the number of foods is increased by one. If the number of foods ≤ a preset number value, control the conveyor belt to rotate the food corresponding to the first food image region into the packaging box. Then, if the number of foods > the preset number value, the food counting for this time ends.
[0007] As a further improvement of one embodiment of the present invention, a dispensing box is provided at the left end, the dispensing box being able to receive the food delivered from the left end of the conveyor belt; the "store each second food image area into the information storage device and increase the food quantity by one" specifically includes: performing the following second processing on each second food image area in sequence from left to right: storing each second food image area into the information storage device and increasing the food quantity by one; if the food quantity ≤ a preset quantity value, then controlling the conveyor belt to rotate the food corresponding to the second food image area into the dispensing box, and then, if the food quantity > the preset quantity value, then the food counting ends.
[0008] As a further improvement of one embodiment of the present invention, the "end of this food counting" specifically includes: controlling the dispensing box to put all the food into the packaging bag and sealing the packaging bag.
[0009] As a further improvement of one embodiment of the present invention, the step of "identifying Num1 first food image regions from the first sub-image and Num2 second food image regions from the second sub-image" specifically includes: based on the ResNet50 neural network model, identifying Num1 first food image regions from the first sub-image and Num2 second food image regions from the second sub-image.
[0010] An embodiment of the present invention further provides a food counting device for a food packaging device. The food packaging device includes a conveyor belt and an information storage device. Above the conveyor belt, a camera is provided, and the camera can capture the upper surface of the conveyor belt and obtain a picture. The conveyor belt has a left end and a right end, and the conveyor belt can convey the food at the right end to the left end. The length of the picture in the left-right direction ≥ L. The information storage device is used to store a number of food image areas and the number of foods. When the information storage device is initialized, no food image areas are stored, and the number of foods is zero. It includes the following modules: A picture acquisition module, which is used to control the conveyor belt to rotate from right to left, control the camera to capture the upper surface of the conveyor belt and output the obtained picture to be processed. After that, whenever it rotates a preset distance D, it controls the camera to capture the upper surface of the conveyor belt once and output the obtained picture to be processed, where 2*D ≤ L. A picture processing module, which is used to, when receiving the picture to be processed from the camera, perform the following first processing on the picture to be processed: In the direction from left to right, cut out a first sub-picture with a length of D - W and a second sub-picture with a length of 2*W from the picture to be processed. The distance between the left side of the first sub-picture and the left side of the picture to be processed is a fixed value, and the right side of the first sub-picture is adjacent to the left side of the second sub-picture, 0 < W < D. Then, identify Num1 first food image areas from the first sub-picture and Num2 second food image areas from the second sub-picture. Then, for any first food image area, if the absolute value of the difference between the distance Distance between it and all the food image areas in the information storage device and D is > the preset error value, the number of foods is incremented by one. Then, delete all the food image areas in the information storage device, store each second food image area into the information storage device, and increment the number of foods by one.
[0011] As a further improvement of an embodiment of the present invention, a packaging box is provided at the left end, and the packaging box can receive the food sent out by the left end of the conveyor belt. The picture processing module is further used to: In the direction from left to right, sequentially perform the following second processing on each first food image area: If the absolute value of the difference between the distance Distance between the first food image area and all the food image areas in the information storage device and D is > the preset error value, the number of foods is incremented by one. If the number of foods ≤ the preset number value, control the conveyor belt to rotate the food corresponding to the first food image area into the packaging box. Then, if the number of foods > the preset number value, the food counting for this time ends.
[0012] As a further improvement of one embodiment of the present invention, a packaging box is provided at the left end, the packaging box being able to receive food delivered from the left end of the conveyor belt; the image processing module is also used to: sequentially perform the following second processing on each second food image area in a left-to-right direction: store each second food image area into the information storage device and increase the food quantity by one; if the food quantity ≤ a preset quantity value, control the conveyor belt to rotate the food corresponding to the second food image area into the packaging box, and then, if the food quantity > the preset quantity value, the food counting ends.
[0013] As a further improvement of one embodiment of the present invention, the image processing module is also used to: control the dispensing box to put all the food into the packaging bag and seal the packaging bag.
[0014] As a further improvement of one embodiment of the present invention, the image processing module is also used to: identify Num1 first food image regions from the first sub-image and Num2 second food image regions from the second sub-image based on the ResNet50 neural network model.
[0015] Compared to existing technologies, the technical advantages of this invention are as follows: This invention provides a food counting method and apparatus for a food packaging device. The method includes the following steps: controlling the conveyor belt to rotate, and taking a picture of the upper surface to be processed each time it rotates a preset distance D; performing the following first processing on each picture to be processed: segmenting a first sub-image and a second sub-image from the picture to be processed; then, identifying first and second food image regions from the first and second sub-images respectively; then, for any first food image region, if the absolute value of the difference between its distance Distance and all food image regions in the information storage device is greater than a preset error value, the food quantity is increased by one; then, deleting all food image regions in the information storage device, storing each second food image region in the information storage device, and increasing the food quantity by one. This achieves the counting of food. Attached Figure Description
[0016] Figure 1 This is a schematic diagram of the structure of the food packaging equipment in an embodiment of the present invention;
[0017] Figure 2A and Figure 2B This is a schematic diagram of the food counting method in an embodiment of the present invention;
[0018] Figure 3 This is a schematic flowchart of the food counting method in an embodiment of the present invention. Detailed Implementation
[0019] The following description and accompanying drawings fully illustrate specific embodiments described herein to enable those skilled in the art to practice them. Some embodiments may include or substitute parts and features of other embodiments. The scope of the embodiments herein encompasses the entire scope of the claims and all available equivalents thereof. Throughout this document, the terms “first,” “second,” etc., are used only to distinguish one element from another without requiring or implying any actual relationship or order between the elements. Indeed, a first element can also be referred to as a second element, and vice versa. Furthermore, the terms “comprising,” “including,” or any other variations thereof are intended to cover non-exclusive inclusion, such that a structure, apparatus, or device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a structure, apparatus, or device. Without further limitation, an element defined by the phrase “comprising one…” does not exclude the presence of other identical elements in the structure, apparatus, or device that includes said element. The various embodiments described herein are presented in a progressive manner, with each embodiment focusing on its differences from other embodiments; similar or identical parts between embodiments can be referred to interchangeably.
[0020] The terms "longitudinal," "lateral," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," and "outer" used in this document to indicate orientation or positional relationships are based on the orientation or positional relationships shown in the accompanying drawings and are used only for the convenience of describing this document and simplifying the description. They do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as limiting the invention. In the description herein, unless otherwise specified and limited, the terms "installed," "connected," and "linked" should be interpreted broadly. For example, they can refer to mechanical or electrical connections, or internal connections between two elements, or direct connections or indirect connections through an intermediate medium. Those skilled in the art can understand the specific meaning of the above terms according to the specific circumstances.
[0021] Embodiment 1 of the present invention provides a food counting method for a food packaging device. The food packaging device includes: a conveyor belt 1 and an information storage device. A camera is disposed above the conveyor belt 1, and the camera is capable of capturing images of the upper surface of the conveyor belt 1. The conveyor belt has a left end and a right end, and the conveyor belt 1 is capable of conveying food from the right end to the left end. The length of the image in the left-right direction is ≥ L. The information storage device is used to store several food image areas and the quantity of food. When the information storage device is initialized, it does not store any food image areas, and the quantity of food is zero. Figure 1As shown, the conveyor belt 1 conveys food in the direction from right to left. A food providing device 2 is provided at the right end of the conveyor belt 1. The food providing device 2 can output food to the right end. Optionally, a vibrating disk is provided in the food providing device 2. The vibrating disk can disperse the food and then input it to the right end. After that, the conveyor belt 1 can convey the food to the left. A packing box 3 can be provided at the left end. Packaging bags are provided in the packing box 3. As the conveyor belt 1 rotates, the food will eventually fall into the packing box 3. When the quantity reaches the preset quantity, the packing box 3 will pack all the food in it into the packaging bags. Alternatively, as the conveyor belt 1 rotates, the food will eventually fall into the packaging bags in the packing box 3 until the quantity reaches the preset quantity. After that, the packing box 3 outputs the packaging bags filled with the preset quantity of food, and then, a packaging operation is performed.
[0022] As Figure 3 shown, it includes the following steps:
[0023] Step 301: Control the conveyor belt 1 to rotate from right to left. Control the camera to photograph the upper surface of the conveyor belt 1 and output the obtained to-be-processed picture. After that, whenever it rotates a preset distance D, control the camera to photograph the upper surface of the conveyor belt 1 once and output the obtained to-be-processed picture, where 2*D ≤ L;
[0024] Step 302: When receiving the to-be-processed picture from the camera, perform the following first processing on the to-be-processed picture: In the direction from left to right, divide the to-be-processed picture into a first sub-picture with a length of D - W and a second sub-picture with a length of 2*W. The distance between the left side of the first sub-picture and the left side of the to-be-processed picture is a fixed value. The right side of the first sub-picture is adjacent to the left side of the second sub-picture, 0 < W < D; After that, identify Num1 first food image regions from the first sub-picture and Num2 second food image regions from the second sub-picture; After that, for any first food image region, if the absolute value of the difference between the distance Distance between it and all the food image regions in the information storage device and D is > the preset error value, the food quantity is increased by one; After that, delete all the food image regions in the information storage device, and store each second food image region into the information storage device and increase the food quantity by one.
[0025] Here, when the camera photographs once, a to-be-processed picture is obtained. So each to-be-processed picture corresponds to a shooting time. "In the order of the shooting time" can be understood as: in the order from the earliest to the latest shooting time.
[0026] Here, refer to Figure 2A and Figure 2BIn practice, conveyor belt 1 does not typically move strictly at a predetermined speed during operation. That is, when conveyor belt 1 is working, it stops after rotating a preset distance D. In most cases, the rotation distance may be [DW, D+W], where the value of W can be determined based on the operator's long-term experience. Understandably, conveyor belt 1 will continue to work until the next image to be processed is captured. Figure 2A Any food item between Line 1 and Line 2 may be located in Figure 2B Any region between Line 3 and Line 4; that is, in Figure 2A Any food item in the second subgraph may be located in Figure 2B Any area between Line 3 and Line 4 in the text, that is, possibly located in Figure 2B Therefore, it needs to be filtered out from the first subgraph.
[0027] In this embodiment, a dispensing box 3 is provided at the left end, which can receive the food delivered from the left end of the conveyor belt 1.
[0028] The statement "For any first food image region, if the absolute value of the difference between Distance and D between it and all food image regions in the information storage device is greater than a preset error value, then the number of food items increases by one" specifically includes:
[0029] Following the left-to-right direction, the following second processing is performed on each first food image area: if the absolute value of the difference between Distance and D between the first food image area and all food image areas in the information storage device is greater than the preset error value, then the food quantity is increased by one; if the food quantity is less than or equal to the preset quantity value, then the conveyor belt 1 is controlled to rotate the food corresponding to the first food image area into the packaging box 3; then, if the food quantity is greater than the preset quantity value, then the food counting ends.
[0030] Here, before the food counting method runs, there is no food in the packaging box 3. Therefore, when the food in the packaging box 3 reaches the preset quantity value, the food in the packaging box 3 needs to be put into the packaging bag. After that, the food counting method needs to be restarted. Before the food counting method runs, the information storage device needs to be initialized.
[0031] In practice, the packaging box 3 can be equipped with two sub-dispensing ports, which can be separated by a baffle. First, the baffle will move to the first sub-dispensing port, which receives the food delivered from the left end of the conveyor belt 1. When the first sub-dispensing port is full (i.e., the number of food items reaches a preset value), the baffle will move to the second sub-dispensing port, and the first sub-dispensing port can continue to process the subsequent bagging and sealing. This food counting method will restart, and the cycle will repeat. Then, the second sub-dispensing port will receive the food delivered from the left end of the conveyor belt 1. When the second sub-dispensing port is full (i.e., the number of food items reaches a preset value), the baffle will move to the first sub-dispensing port, and the second sub-dispensing port can continue to process the subsequent bagging and sealing. This food counting method will restart, and the cycle will repeat.
[0032] Here, by adjusting the positional relationship between the camera and the conveyor belt 1, the left end of the conveyor belt 1 can be positioned in the image to be processed when the camera is taking a picture. Thus, the distance between the first food image area and the left end can be obtained, and then this distance can be rotated. At the same time, in practice, the positional relationship between the camera and the conveyor belt 1 is generally fixed. Therefore, the position of the first food image area in the image to be processed can be obtained. Then, based on the positional relationship between the camera and the conveyor belt 1, the distance between the first food image area and the left end can be obtained, and then this distance can be rotated.
[0033] In this embodiment, a dispensing box 3 is provided at the left end, which can receive the food delivered from the left end of the conveyor belt 1.
[0034] The phrase "store each second food image region into the information storage device and increase the number of food items by one" specifically includes:
[0035] Following the left-to-right direction, the following second processing is performed on each second food image area: the second food image area is stored in the information storage device and the food quantity is increased by one; if the food quantity is less than or equal to a preset quantity value, the conveyor belt 1 is controlled to rotate the food corresponding to the second food image area into the packaging box 3; then, if the food quantity is greater than the preset quantity value, the food counting ends.
[0036] In this embodiment, "the end of this food counting" specifically includes: controlling the dispensing box 3 to put all the food into the packaging bag and sealing the packaging bag.
[0037] In this embodiment, the operation of "identifying Num1 first food image regions from the first sub-image and identifying Num2 second food image regions from the second sub-image" specifically includes: Based on the ResNet50 neural network model, identifying Num1 first food image regions from the first sub-image and identifying Num2 second food image regions from the second sub-image.
[0038] Embodiment 2 of the present invention provides a food counting device for a food packaging device. The food packaging device includes: a conveyor belt 1 and an information storage device. Above the conveyor belt 1, a camera is provided. The camera can photograph the upper surface of the conveyor belt 1 and obtain a picture. The conveyor belt has a left end and a right end. The conveyor belt 1 can convey the food at the right end to the left end. The length of the picture in the left-right direction ≥ L. The information storage device is used to store several food image regions and the number of foods. When the information storage device is initialized, no food image regions are stored, and the number of foods is zero. It includes the following modules:
[0039] A picture acquisition module, configured to control the conveyor belt 1 to rotate from right to left, control the camera to photograph the upper surface of the conveyor belt 1 and output the obtained picture to be processed. After that, whenever it rotates a preset distance D, control the camera to photograph the upper surface of the conveyor belt 1 once and output the obtained picture to be processed, where 2*D ≤ L;
[0040] A picture processing module, configured to, when receiving the picture to be processed from the camera, perform the following first processing on the picture to be processed: In the direction from left to right, segment a first sub-image with a length of D - W and a second sub-image with a length of 2*W from the picture to be processed. The distance between the left side of the first sub-image and the left side of the picture to be processed is a fixed value. The right side of the first sub-image is adjacent to the left side of the second sub-image, 0 < W < D. Then, identify Num1 first food image regions from the first sub-image and identify Num2 second food image regions from the second sub-image. Then, for any first food image region, if the absolute value of the difference between the distance Distance between it and all the food image regions in the information storage device and D is > the preset error value, the number of foods is incremented by one. Then, delete all the food image regions in the information storage device, and store each second food image region into the information storage device and increment the number of foods by one.
[0041] In this embodiment, a packaging box is provided at the left end, which can receive the food delivered from the left end of the conveyor belt 1; the image processing module is also used to: sequentially perform the following second processing on each first food image area in a left-to-right direction: if the absolute value of the difference between Distance and D between the first food image area and all food image areas in the information storage device is greater than a preset error value, then the food quantity is increased by one; if the food quantity is less than or equal to a preset quantity value, then the conveyor belt 1 is controlled to rotate the food corresponding to the first food image area into the packaging box; then, if the food quantity is greater than the preset quantity value, then the food counting ends.
[0042] In this embodiment, a packaging box is provided at the left end, which can receive the food delivered from the left end of the conveyor belt 1; the image processing module is also used to: perform the following second processing on each second food image area in sequence from left to right: store each second food image area into the information storage device and increase the food quantity by one; if the food quantity is less than or equal to a preset quantity value, control the conveyor belt 1 to rotate the food corresponding to the second food image area into the packaging box, and then, if the food quantity is greater than the preset quantity value, the food counting ends.
[0043] In this embodiment, the image processing module is also used to: control the dispensing box 3 to put all the food into the packaging bag and seal the packaging bag.
[0044] In this embodiment, the image processing module is further configured to: identify Num1 first food image regions from the first sub-image and Num2 second food image regions from the second sub-image based on the ResNet50 neural network model.
[0045] It should be noted that although the steps are described in a specific order above, it does not mean that the steps must be executed in the above specific order. In fact, some of these steps can be executed concurrently, or even in a different order, as long as the required function can be achieved.
[0046] This invention can be a system, method, and / or computer program product. A computer program product may include a readable storage medium having computer-readable program instructions loaded thereon for causing a processor to implement various aspects of the invention.
[0047] A readable storage medium can be a tangible device that holds and stores instructions for use by an instruction execution device. Readable storage media can include, for example, but not limited to, electrical storage devices, magnetic storage devices, optical storage devices, electromagnetic storage devices, semiconductor storage devices, or any suitable combination thereof. More specific examples (a non-exhaustive list) of readable storage media include: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static random access memory (SRAM), portable compact disc read-only memory (CD-ROM), digital multifunction disc (DVD), memory sticks, floppy disks, mechanical encoding devices, such as punch cards or recessed protrusions storing instructions thereon, and any suitable combination thereof.
[0048] The various embodiments of the present invention have been described above. These descriptions are exemplary and not exhaustive, nor are they limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen to best explain the principles, practical application, or technical improvements to the embodiments in the market, or to enable others skilled in the art to understand the embodiments disclosed herein.
Claims
1. A method for counting food in a food dispensing device, the food dispensing device comprising: A conveyor belt (1) and an information storage device. Above the conveyor belt (1), a camera is provided, and the camera can capture the upper surface of the conveyor belt (1) and obtain a picture; the conveyor belt has a left end and a right end, and the conveyor belt (1) can convey the food at the right end to the left end, and the length of the picture in the left-right direction ≥ L; the information storage device is used to store a number of food image areas and the quantity of food. When the information storage device is initialized, no food image areas are stored and the quantity of food is zero; it is characterized by including the following steps: Control the conveyor belt (1) to rotate from right to left, control the camera to capture the upper surface of the conveyor belt (1) and output the obtained picture to be processed. After that, every time it rotates a preset distance D, control the camera to capture the upper surface of the conveyor belt (1) once and output the obtained picture to be processed, where 2*D ≤ L; When receiving the picture to be processed from the camera, perform the following first processing on all the pictures to be processed: In the direction from left to right, divide the picture to be processed into a first sub-picture with a length of D - W and a second sub-picture with a length of 2*W. The distance between the left side of the first sub-picture and the left side of the picture to be processed is a fixed value, and the right side of the first sub-picture is adjacent to the left side of the second sub-picture, 0 < W < D; then, identify Num1 first food image areas from the first sub-picture and Num2 second food image areas from the second sub-picture; then, for any first food image area, if the absolute value of the difference between the distance Distance between it and all the food image areas in the information storage device and D is > the preset error value, the quantity of food increases by one; then, delete all the food image areas in the information storage device, store each second food image area into the information storage device and increase the quantity of food by one.
2. The food counting method according to claim 1, wherein A packing box (3) is provided at the left end, and the packing box (3) can receive the food sent out from the left end of the conveyor belt (1); A dispensing box (3) is provided at the left end, which is capable of receiving food delivered from the left end of the conveyor belt (1); The step of storing each second food image region into the information storage device and increasing the number of food items specifically includes: Following the direction from left to right, the following second processing is performed on each second food image area: the second food image area is stored in the information storage device and the food quantity is increased by one; if the food quantity is less than or equal to a preset quantity value, the conveyor belt (1) is controlled to rotate the food corresponding to the second food image area into the packaging box (3); then, if the food quantity is greater than the preset quantity value, the food counting ends.
4. The food counting method according to claim 2 or 3, characterized in that, The completion of this food counting process specifically includes: The control box (3) packs all the food into the packaging bag and seals the packaging bag.
5. The food counting method according to claim 1, characterized in that, The process of identifying Num1 first food image regions from the first sub-image and Num2 second food image regions from the second sub-image specifically includes: Based on the ResNet50 neural network model, Num1 first food image regions are identified from the first sub-image, and Num2 second food image regions are identified from the second sub-image.
6. A food counting device for a food dispensing equipment, the food dispensing equipment comprising: A conveyor belt (1) and an information storage device are provided. A camera is installed above the conveyor belt (1) and can capture images of the upper surface of the conveyor belt (1). The conveyor belt has a left end and a right end, and the conveyor belt (1) can transport food from the right end to the left end. The length of the image in the left-right direction is ≥ L. The information storage device is used to store several food image areas and the quantity of food. When the information storage device is initialized, it does not store any food image areas and the quantity of food is zero. The device is characterized by including the following modules: The image acquisition module is used to control the conveyor belt (1) to rotate from right to left, control the camera to capture the upper surface of the conveyor belt (1) and output the obtained image to be processed. Then, whenever the conveyor belt (1) rotates by a preset distance D, the camera is controlled to capture the upper surface of the conveyor belt (1) once and output the obtained image to be processed, where 2*D≤L; An image processing module, which is used to perform the following first processing on the to-be-processed image when receiving the to-be-processed image from the camera: segment a first sub-image with a length of D - W and a second sub-image with a length of 2 * W from the to-be-processed image in the direction from left to right. The distance between the left side of the first sub-image and the left side of the to-be-processed image is a fixed value, and the right side of the first sub-image is adjacent to the left side of the second sub-image, where 0 < W < D; then, identify Num1 first food image regions from the first sub-image and Num2 second food image regions from the second sub-image; then, for any first food image region, if the absolute value of the difference between the distance Distance between it and all food image regions in the information storage device and D is > the preset error value, the food quantity is increased by one; then, delete all food image regions in the information storage device, store each second food image region into the information storage device and increase the food quantity by one.
7. The food counting device according to claim 6, wherein A packing box (3) is provided at the left end, and the packing box (3) can receive the food sent out by the left end of the conveyor belt (1); The image processing module is further used to: in the direction from left to right, sequentially perform the following second processing on each first food image region: if the absolute value of the difference between the distance Distance between the first food image region and all food image regions in the information storage device and D is > the preset error value, the food quantity is increased by one; if the food quantity ≤ the preset quantity value, control the conveyor belt (1) to rotate the food corresponding to the first food image region into the packing box (3); then, if the food quantity > the preset quantity value, the food counting for this time ends.
8. The food counting device according to claim 6, wherein A packing box (3) is provided at the left end, and the packing box (3) can receive the food sent out by the left end of the conveyor belt (1); The image processing module is further used to: in the direction from left to right, sequentially perform the following second processing on each second food image region: store each second food image region into the information storage device and increase the food quantity by one; if the food quantity ≤ the preset quantity value, control the conveyor belt (1) to rotate the food corresponding to the second food image region into the packing box (3), and then, if the food quantity > the preset quantity value, the food counting for this time ends.
9. The food counting device according to claim 7 or 8, characterized in that, The image processing module is further used to: Control the packing box (3) to pack all the food in it into a packaging bag and seal the packaging bag.
10. The food counting device according to claim 6, characterized in that, The image processing module is further used to: Based on the ResNet50 neural network model, identify NumI first food image regions from the first sub-image and Num2 second food image regions from the second sub-image.