Commodity counting and blanking method, device, computer equipment and storage medium
By acquiring images of goods on the conveyor belt, determining the quantity to be unloaded and the target goods at a fixed distance, and calculating the moving distance, the automatic counting and unloading of goods is realized, solving the problem of low counting and packaging efficiency in the existing technology and improving work efficiency and reliability.
Patent Information
- Application Number
- CN202211302954.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-24
- Publication Date
- 2025-09-12
- Estimated Expiration
- 2042-10-24
AI Technical Summary
It is difficult to achieve fully automated inspection and bagging of commodity counting and packaging with existing technologies, resulting in slow working speed, low efficiency and low reliability.
By acquiring the image of the target product on the conveyor belt, determining the quantity to be unloaded and the target product at a fixed distance, calculating the moving distance of the conveyor belt, and aligning the target product to be unloaded with the unloading port, automatic counting and unloading is achieved.
It realizes the automatic counting and unloading of goods, improves work efficiency and reliability, and reduces manual intervention.
Smart Images

Figure CN115583477B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image detection technology, and in particular to a method, device, computer equipment and storage medium for counting and blanking goods. Background Art
[0002] With the rapid development of science and technology, in order to improve production efficiency, various commodities have begun to gradually realize automated production, that is, abandoning traditional production and processing methods and transforming to automated production with higher production efficiency.
[0003] For goods that need to be counted and packaged, in order to ensure the accuracy of the bagging quantity when packaging the goods, the relevant technology is currently difficult to achieve fully automated detection and bagging, and bagging is mainly carried out manually.
[0004] Although manual methods can be used to count and pack goods, they have various problems such as slow working speed, low working efficiency, and low reliability. Summary of the Invention
[0005] In order to solve the above technical problems, the present application provides a method, device, computer equipment and storage medium for counting and unloading goods, which can realize the automatic counting and unloading of goods.
[0006] In a first aspect, a method for counting and blanking commodities is provided, comprising:
[0007] Get the i-th product image of the target product on the conveyor belt, i ≥ 1, and the target product is the product that needs to be counted, unloaded and packaged;
[0008] According to the quantity to be cut corresponding to the i-th product image, determine one or more target products to be cut that meet the quantity to be cut corresponding to the i-th product image from the target products included in the i-th product image;
[0009] Determine a target commodity with a fixed distance from one or more target commodities to be unloaded, wherein the target commodity with a fixed distance is the target commodity with the longest distance from the unloading opening of the conveyor belt among the one or more target commodities to be unloaded;
[0010] Determine the target moving distance of the conveyor belt based on the position of the target product and the conveyor belt unloading port in the i-th product image;
[0011] The conveyor belt is controlled to move a target distance, and after the conveyor belt completes this movement, the i+1th product image of the target product on the conveyor belt is obtained.
[0012] In a second aspect, a commodity counting and unloading device is provided, comprising:
[0013] An acquisition unit is used to acquire the i-th product image of the target product on the conveyor belt, where i ≥ 1, and the target product is a product that needs to be counted, blanked, and packaged;
[0014] a first determining unit configured to determine, based on the quantity to be cut corresponding to the i-th product image, one or more target products to be cut that meet the quantity to be cut corresponding to the i-th product image from the target products included in the i-th product image;
[0015] The second determining unit is configured to determine a target commodity with a predetermined distance from one or more target commodities to be unloaded, wherein the target commodity with a predetermined distance is the target commodity to be unloaded that is the farthest from the unloading opening of the conveyor belt among the one or more target commodities to be unloaded;
[0016] a third determining unit, configured to determine a target moving distance of the conveyor belt according to the positions of the target product at a fixed distance and the unloading port of the conveyor belt in the i-th product image;
[0017] The moving unit is used to control the moving distance of the conveyor belt and obtain the (i+1)th product image of the target product on the conveyor belt after the conveyor belt completes this movement.
[0018] In a third aspect, a computer device is provided. The computer device includes a processor and a memory. The memory stores a computer program. When the processor executes the computer program, the steps in the above-mentioned commodity counting and cutting method are implemented.
[0019] In a fourth aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned commodity counting and blanking method are implemented.
[0020] In a fifth aspect, a computer program product is provided. The computer program product includes a computer program, and when the computer program is executed by a processor, the steps in the commodity counting and blanking method are implemented.
[0021] It can be seen from the above technical solution that in order to automatically count and unload the goods that need to be counted and unloaded, the product image of the target product on the conveyor belt is first obtained. According to the corresponding number of goods to be unloaded, one or more target goods to be unloaded that meet the number of goods to be unloaded are determined from the target products included in the product image. The fixed-distance target product with the farthest distance from the conveyor belt unloading port is determined from the target products to be unloaded. Since the number of target goods to be unloaded is used to meet the number of goods to be unloaded, in order to successfully unload the target goods to be unloaded, the target moving distance of the conveyor belt is determined according to the positions of the fixed-distance target product and the conveyor belt unloading port in the product image respectively. The conveyor belt moves the target moving distance so that the target goods to be unloaded can be unloaded, and after the conveyor belt completes the movement, the product image of the target product on the conveyor belt is obtained again to count and unload again. Through the above technical solution, automatic counting and unloading of goods can be realized. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0023] Figure 1 A flowchart of a method for counting and discharging goods provided in an embodiment of the present application;
[0024] Figure 2 An image without distortion correction provided in an embodiment of the present application;
[0025] Figure 3 An image after distortion correction provided in an embodiment of the present application;
[0026] Figure 4 An image of a commodity obtained when there are multiple sub-conveyor belts provided in an embodiment of the present application;
[0027] Figure 5 A schematic diagram of a commodity counting and unloading device provided in an embodiment of the present application;
[0028] Figure 6 A structural diagram of a terminal device provided in an embodiment of the present application;
[0029] Figure 7 A structural diagram of a server provided in an embodiment of the present application;
[0030] Figure 8 A structural diagram of a computer-readable storage medium provided in an embodiment of the present application. DETAILED DESCRIPTION
[0031] The embodiments of the present application are described below with reference to the accompanying drawings.
[0032] For goods that require counting and packaging, in order to ensure the accuracy of the number of goods in the bag, the relevant technology mainly uses manual bagging. Although manual bagging can achieve the counting and bagging of goods, it has various problems such as slow work efficiency, low work efficiency, and low reliability.
[0033] In view of this, the present application provides a method, device, computer equipment and storage medium for counting and unloading goods, which can realize the automated counting and unloading of goods.
[0034] The following is an example of a method for illustrating the method of counting and blanking commodities provided by the present application. Figure 1 As shown, Figure 1 This is a flowchart of a method for counting and cutting goods provided in an embodiment of the present application, which includes the following steps:
[0035] S101. A computer device obtains the i-th image of a target product on a conveyor belt, where i≥1. The target product is a product that needs to be counted, blanked, and packaged.
[0036] In the automated production process of target products that require counting, unloading, and packaging, a conveyor belt is used to move the target products for unloading. To obtain the distribution of the target products on the conveyor belt for subsequent counting and unloading, a computer device can use a camera to capture the i-th image of the target product on the conveyor belt, where i ≥ 1.
[0037] It should be noted that in order to accurately obtain the distribution of the target goods on the conveyor belt, since the position of the conveyor belt usually does not change during the automatic unloading process of the target goods, the shooting range of the camera can be pre-adjusted according to the position of the conveyor belt so that the corresponding product image can be accurately obtained in S101.
[0038] S102: The computer device determines, based on the quantity to be cut corresponding to the i-th product image, one or more target products to be cut that meet the quantity to be cut corresponding to the i-th product image from the target products included in the i-th product image.
[0039] The quantity to be cut corresponding to the i-th product image refers to the expected cutting quantity of the corresponding current cutting, which is related to the packaging quantity of the target product.
[0040] The target product to be unloaded corresponding to the i-th product image refers to the expected target product to be unloaded for this unloading, that is, the corresponding target product to be unloaded is expected to be unloaded through subsequent steps, and among the target products included in the i-th product image, the target products other than the target product to be unloaded will still remain on the conveyor belt after subsequent steps.
[0041] After obtaining the i-th product image corresponding to the target product in S101, the corresponding target product to be unloaded can be determined from the target products included in the i-th product image according to the quantity to be unloaded corresponding to the i-th product image; wherein, the target product to be unloaded needs to meet the above-mentioned corresponding quantity to be unloaded. For example, image recognition can be used to start from the unloading port of the conveyor belt and count the target products in the opposite direction of movement of the conveyor belt. When the number meets the corresponding quantity to be unloaded, the target product that meets the corresponding quantity to be unloaded will be determined as the corresponding target product to be unloaded.
[0042] In some embodiments, in order to determine the quantity of materials to be unloaded for the (i+1)th time, the computer device may first determine the target quantity of the target product included in the (i)th product image;
[0043] When the target quantity is less than the quantity to be cut corresponding to the i-th product image, the computer device uses the difference between the quantity to be cut and the target quantity as the quantity to be cut corresponding to the i+1-th product image; or
[0044] When the target quantity is greater than or equal to the quantity to be unloaded corresponding to the i-th product image, the computer device uses the package quantity of the target product as the quantity to be unloaded corresponding to the i+1-th product image.
[0045] Specifically, a target quantity of target commodities included in the i-th commodity image may be determined first. The target quantity refers to the total quantity of target commodities included in the i-th commodity image.
[0046] When the target quantity is less than the quantity to be unloaded corresponding to the i-th product image, in order to meet the corresponding quantity to be unloaded, all target products included in the i-th product image will be determined as target products to be unloaded, and the difference between the quantity to be unloaded and the target quantity will be used as the quantity to be unloaded corresponding to the i+1-th product image, so as to complete the number in the relevant steps corresponding to the i+1-th product image.
[0047] When the target quantity is greater than or equal to the quantity to be unloaded corresponding to the i-th product image, the target products included in the i-th product image can achieve the expected target of the quantity to be unloaded. Accordingly, the packaging quantity of the target products can be used as the quantity to be unloaded corresponding to the i+1-th product image, so that the next counting and packaging unloading can be started again in the relevant steps corresponding to the i+1-th product image.
[0048] Since the distribution of target products on the conveyor belt is relatively random, the target products included in the (i+1)th product image may not necessarily reach the corresponding quantity to be unloaded, that is, each unloading may not necessarily meet the quantity of target products to be unloaded. Therefore, through the above steps, when one unloading cannot meet the corresponding target quantity to be unloaded, the target packaging quantity of the target product can be achieved through multiple unloading, that is, the accuracy of counting and bagging can be guaranteed.
[0049] S103. The computer device determines a fixed-distance target commodity from one or more target commodities to be unloaded. The fixed-distance target commodity is the target commodity to be unloaded that is farthest from the unloading port of the conveyor belt among the one or more target commodities to be unloaded.
[0050] Determine the target product with the longest distance from the conveyor belt discharge port from the target products to be discharged. For example, the distance between the target product to be discharged and the conveyor belt discharge port can be calculated by image detection, and the target product to be discharged with the largest distance value can be determined as the target product with the longest distance.
[0051] After the corresponding target products to be unloaded are determined in S102, in order to successfully unload the target products to be unloaded in the subsequent steps, it is necessary to determine the target products with fixed distances. In the subsequent steps, the distances between the target products to be unloaded other than the target products with fixed distances and the unloading port of the conveyor belt are smaller than the distances between the target products with fixed distances and the unloading port of the conveyor belt. If the target products with fixed distances that are farthest from the unloading port of the conveyor belt are successfully unloaded by moving the conveyor belt, the other target products to be unloaded can also be successfully unloaded. Therefore, the target products with fixed distances determined from the target products to be unloaded can serve as an important basis for determining the moving distance of the conveyor belt in the subsequent steps.
[0052] In some embodiments, when the target product at a fixed distance does not exist, the computer device can determine the moving distance of the conveyor belt based on the distance between the farthest end of the conveyor belt and the conveyor belt unloading port in the i-th product image. The farthest end of the conveyor belt is the farthest distance between the conveyor belt included in the product image and the conveyor belt unloading port in the opposite direction of the conveyor belt movement.
[0053] During the automated counting and packaging process of target products, the distribution of target products on the conveyor belt is relatively random. It's possible that the target product doesn't exist within the conveyor belt range included in the i-th product image. In this case, there's naturally no corresponding target product at a fixed distance. Therefore, the conveyor belt's movement distance can be determined based on the distance between the farthest end of the conveyor belt and the conveyor belt's discharge port in the i-th product image. The farthest end of the conveyor belt is the maximum distance between the conveyor belt included in the product image and the conveyor belt's discharge port in the direction opposite to the conveyor belt's movement. This distance is the length of the conveyor belt included in the product image. This movement method allows the conveyor belt to be moved even when the target product isn't included in the product image, allowing for the next unloading operation.
[0054] In some embodiments, the computer device determines a relative image distance between a target product included in the i-th product image and the fixed-distance target product along a moving direction of the conveyor belt;
[0055] If the relative image spacing is less than or equal to the preset adhesion spacing, and the corresponding target product does not belong to one or more target products to be unloaded, the corresponding target product and the fixed-distance target product are determined to be adhesion target products, and an alarm signal is generated.
[0056] Since the embodiment of the present application unloads materials by controlling the movement of a conveyor belt, and the distribution of target products on the conveyor belt is relatively random, it is possible that multiple target products are unloaded together due to being close to each other.
[0057] If the relative image distance between the target product and the fixed-distance target product in the i-th product image along the conveyor belt's movement direction is less than or equal to the preset adhesion distance, and the target product is not a target product to be unloaded, this indicates that the target product and the fixed-distance target product are likely to be unloaded together as the conveyor belt moves. Since the target product is not a target product to be unloaded, the target product actually unloaded does not match the target product to be unloaded. In this case, the target product and the fixed-distance target product can be determined to be stuck together, and an alarm signal can be generated. After the alarm signal is generated, other control equipment such as a robot can take appropriate action to ensure the accuracy of target product unloading.
[0058] S104. The computer device determines the target moving distance of the conveyor belt according to the position of the fixed-distance target product and the conveyor belt discharge port in the i-th product image.
[0059] In order to ensure that the target product to be unloaded determined in S102 can be successfully unloaded, the conveyor belt movement distance required to move the target product to the conveyor belt unloading port can be determined based on the positions of the target product and the conveyor belt unloading port in the i-th product image. For example, the corresponding image spacing can be determined based on the positions of the target product and the conveyor belt unloading port in the i-th product image, and the target movement distance of the conveyor belt can be determined based on the image spacing. Because the target movement distance of the conveyor belt allows the target product to be unloaded to the conveyor belt unloading port, other target products to be unloaded that are closer to the conveyor belt unloading port can also be moved to the conveyor belt unloading port. In other words, the target movement distance of the conveyor belt for unloading the target product to be unloaded can be accurately determined based on the positions of the target product and the conveyor belt unloading port in the i-th product image.
[0060] In some embodiments, the computer device determines the target moving distance of the conveyor belt based on the positions of the target product and the conveyor belt discharge port in the i-th product image, including:
[0061] The computer device determines the target number of pixels corresponding to the distance between the target product and the conveyor belt unloading port in the i-th product image based on the positions of the target product and the conveyor belt unloading port in the i-th product image;
[0062] The computer device determines the target moving distance of the conveyor belt based on the target number of pixels and the pixel equivalent. The pixel equivalent is used to represent the corresponding relationship between the number of pixels in the product image and the moving distance of the conveyor belt.
[0063] A pixel is a small square with a clear position in an image. It is an indivisible unit of the entire image. A pixel determines the size of the image displayed on the screen.
[0064] Pixel equivalent refers to the actual physical size of a pixel in an image. It represents the correspondence between the number of pixels in a product image and the distance the conveyor belt moves. Since the pixel equivalent of a product image captured by the same camera remains unchanged without changing the camera parameters, the pixel equivalent can be used to accurately construct the correspondence between the image coordinate system and the actual coordinate system.
[0065] According to the positions of the target product with a fixed distance and the conveyor belt unloading port in the i-th product image, the target number of pixels corresponding to the distance between the target product with a fixed distance and the conveyor belt unloading port can be determined. This target number of pixels can accurately measure the distance between the target product with a fixed distance and the conveyor belt unloading port, and the target moving distance of the conveyor belt can be accurately determined based on the target number of pixels and pixel equivalent.
[0066] Since the camera parameters are usually not changed during the automated unloading process of the target product, the correspondence between the image coordinate system and the actual coordinate system can be accurately constructed based on the pixel equivalent. In addition, the number of pixels between the target product at a fixed distance and the conveyor belt unloading port in the product image can accurately measure the image spacing between the target product at a fixed distance and the conveyor belt unloading port. Therefore, the target moving distance of the conveyor belt can be accurately determined by the target number of pixels and the pixel equivalent.
[0067] In some embodiments, the corresponding pixel equivalents may be predetermined by the following steps:
[0068] The computer device obtains a first calibration plate image of the calibration plate on the conveyor belt through a camera;
[0069] The computer device moves the conveyor belt based on a preset moving distance, and obtains a second calibration plate image of the calibration plate on the conveyor belt after the movement through a camera;
[0070] The computer device determines the number of moved pixels of the calibration plate according to the first calibration plate image and the second calibration plate image;
[0071] The computer device uses the ratio of the preset moving distance to the number of moved pixels as the pixel equivalent.
[0072] A calibration plate refers to a flat plate with a fixed-pitch pattern array. Calibration plates include glass dot calibration plates, checkerboard calibration plates, QR code calibration plates, and other flat plates with fixed-pitch pattern arrays. They can be used to determine the correspondence between pixels and actual size.
[0073] A first calibration plate image is acquired by a camera, wherein the calibration plate is placed on a conveyor belt within the camera's field of view. The conveyor belt is then moved based on a preset movement distance. The preset movement distance can be determined based on the image size of the first calibration plate image. For example, the preset movement distance can be set between half and two-thirds of the image size of the first calibration plate image to ensure the reliability of pixel equivalence. After the conveyor belt is moved, a corresponding second calibration plate image is acquired. Based on the first and second calibration plate images, the number of pixels moved by the calibration plate in the image is determined. The ratio of the preset movement distance to the number of pixels moved is used as the pixel equivalent. This method can accurately determine the pixel equivalent corresponding to the image.
[0074] It should be noted that the pixel equivalent of an image is related to the camera parameters. After the camera parameters are debugged, in order to obtain the pixel equivalent corresponding to the image at this time, the corresponding pixel equivalent should be re-determined through the above steps.
[0075] In some embodiments, to ensure pixel equivalent uniformity, when a calibration plate is placed on a conveyor belt in the camera's field of view at multiple different angles, the computer device obtains multiple images to be corrected at multiple angles corresponding to the calibration plate; the computer device performs correction processing on the multiple images to be corrected at multiple angles to determine the camera's distortion correction parameters;
[0076] The computer device determines the number of moved pixels of the calibration plate according to the first calibration plate image and the second calibration plate image, including:
[0077] The computer device performs distortion correction processing on the first calibration plate image and the second calibration plate image according to the distortion correction parameters to obtain corresponding first corrected calibration plate image and second corrected calibration plate image;
[0078] The computer device determines the number of moved pixels of the calibration plate according to the first corrected calibration plate image and the second corrected calibration plate image.
[0079] In order to ensure the automatic counting of target products, the corresponding camera needs to adopt a wide field of view shooting range, such as Figure 2 As shown, Figure 2 An undistorted image provided in an embodiment of the present application is Figure 2The item indicated by number 1 is the calibration plate used for calibration. When the camera has a large field of view, the image obtained will be distorted. For example, Figure 2 In the figure, there are various distortions, such as the deformation shown in A and the bending shown in B. Therefore, it is necessary to perform corresponding distortion correction on the image acquired by the camera. Among them, the placed calibration plate can serve as a reference for the distortion correction.
[0080] The calibration plate can be placed at multiple angles in the camera field of view, and the corresponding calibration plate images at multiple angles can be collected. For example, 15-20 images can be obtained to ensure the effect of distortion correction. The images to be corrected at the above multiple angles are corrected through the distortion correction program to obtain the distortion correction parameters of the camera image. The distortion correction parameters may include the camera's internal parameters and correction factors, etc. The image can be distortion corrected by the distortion correction parameters, such as Figure 3 As shown, Figure 3 An embodiment of the present application provides a distortion-corrected image, which can effectively correct the distortion of the image acquired by the camera through the distortion correction parameters. For example, the curvature of the conveyor belt in the original image is corrected accordingly to obtain a camera image with a low degree of distortion.
[0081] After obtaining the camera's distortion correction parameters, they can be loaded into the first and second calibration plate images during the pixel equivalent determination process to obtain the corrected first and second calibration plate images. The corrected calibration plate images can be used to accurately determine the number of pixels moved by the calibration plate, and thus the pixel equivalent corresponding to the image.
[0082] In some embodiments, the computer device determines the target moving distance of the conveyor belt based on the positions of the target product and the conveyor belt discharge port in the i-th product image, including:
[0083] The computer device determines an auxiliary fixed-distance target product corresponding to the fixed-distance target product in the i-th product image, where the auxiliary fixed-distance target product is a target product that is closest to the fixed-distance target product along the moving direction of the conveyor belt and is not one of the one or more target products to be unloaded;
[0084] The computer device determines the target moving distance of the conveyor belt according to the position of the auxiliary distance-fixed target product and the conveyor belt unloading port in the i-th product image.
[0085] If the conveyor belt can be guaranteed to move the maximum distance each time, the number of starts and stops of the conveyor belt can be effectively reduced, thereby saving time and improving production capacity. However, in order to ensure the accurate unloading of the target products to be unloaded, the moving distance of the conveyor belt cannot be set arbitrarily.
[0086] The auxiliary fixed-distance product refers to the target product that is closest to the fixed-distance target product along the moving direction of the conveyor belt and is not a target product to be unloaded. That is, the auxiliary fixed-distance product is the target product included in the product image that is closest to the fixed-distance target product along the moving direction of the conveyor belt except the target product to be unloaded.
[0087] The moving distance of the conveyor belt can be determined based on the position of the auxiliary fixed-distance target product and the conveyor belt discharge port in the product image. For example, the moving distance of the conveyor belt can be determined based on the position of the end of the auxiliary fixed-distance target product and the distance between the conveyor belt discharge port. This moving distance is the maximum moving distance allowed for this discharge, that is, this moving distance can ensure that the auxiliary fixed-distance target product remains on the conveyor belt after this discharge. Accordingly, it can ensure that all target products included in the product image, except for the target product to be discharged, remain on the conveyor belt. By determining the moving distance of the conveyor belt by the auxiliary fixed-distance product that is closest to the fixed-distance target product along the direction of conveyor belt movement, the maximum moving distance allowed for the conveyor belt can be determined. By controlling the movement of the conveyor belt through this maximum moving distance, the number of starts and stops of the conveyor belt can be effectively reduced, thereby improving production capacity.
[0088] S105 . The computer device controls the conveyor belt to move a target moving distance, and obtains the (i+1)th product image of the target product on the conveyor belt through the camera after the conveyor belt completes this movement.
[0089] After determining the corresponding movement distance in S104, the computer controls the conveyor belt to move based on the target movement distance, so that the target product on the conveyor belt reaches the conveyor belt discharge port through the movement of the conveyor belt and is successfully discharged. After the conveyor belt completes this movement, the counting, spacing, and discharge operations corresponding to the i-th product image are completed. The camera should then capture the i+1th product image of the target product on the conveyor belt to perform the counting, spacing, and discharge operations corresponding to the i+1th product image.
[0090] In some embodiments, to improve the efficiency of automated counting and unloading of target commodities, the conveyor belt includes multiple sub-conveyor belts, each of which moves independently and corresponds to the same unloading port. The computer device determines, based on the quantity to be unloaded corresponding to the i-th commodity image, one or more target commodities to be unloaded that meet the quantity to be unloaded corresponding to the i-th commodity image from the target commodities included in the i-th commodity image, including:
[0091] The computer device counts the target products on each sub-conveyor included in the i-th product image along the reverse direction of the sub-conveyor until the number of products to be unloaded corresponding to the i-th product image is met, and determines the corresponding one or more target products to be unloaded.
[0092] In the actual production process of the target product, in order to improve the efficiency of automatic counting and cutting of the target product, such as Figure 4 As shown, Figure 4 The present application provides an embodiment of a product image obtained when there are multiple sub-conveyors, wherein 1, 2, 3, and 4 respectively indicate sub-conveyors 1, 2, 3, and 4 included in the product image. Multiple sub-conveyors can be used to unload from the same conveyor unloading port. In this case, when counting the number of items to be unloaded corresponding to the i-th product image, it is not necessary to count each sub-conveyor separately. Instead, the target items on each conveyor included in the i-th product image can be counted together along the opposite direction of the sub-conveyor movement. For example, if all four sub-conveyors move from left to right to unload from the same unloading port, the target items can be counted starting from the target item closest to the conveyor unloading port. Instead of counting each sub-conveyor individually, the number of items to be unloaded can be counted together from right to left until the corresponding number of items to be unloaded is met. At this time, the target items counted above are determined as the corresponding target items to be unloaded. When multiple sub-conveyors are unloading from the same unloading port, by counting the multiple sub-conveyors together, a unified control effect can be achieved for the multiple sub-conveyors.
[0093] In some embodiments, after counting multiple sub-conveyor belts to determine target commodities to be unloaded, the computer device determines a target moving distance of the conveyor belt based on the position of the target commodities and the conveyor belt unloading port in the i-th commodity image, including:
[0094] The computer device determines a sub-auxiliary fixed-distance target product corresponding to the sub-fixed-distance target product on each sub-conveyor included in the i-th product image, where the sub-auxiliary fixed-distance target product is a target product that is closest to the corresponding sub-fixed-distance target product along the moving direction of the sub-conveyor and is not one of the one or more target products to be unloaded;
[0095] The computer device determines the target moving distance of each sub-conveyor belt according to the position of the sub-auxiliary fixed-distance product and the sub-conveyor belt unloading port in the i-th product image.
[0096] After counting multiple sub-conveyors together to determine the target products to be unloaded, the target products with fixed distances can be determined accordingly. In order to reduce the number of starts and stops, the sub-auxiliary fixed-distance products corresponding to each sub-conveyor included in the i-th product image and the target products with fixed distances are determined. The sub-auxiliary fixed-distance target products are the target products that are closest to the target products with fixed distances along the moving direction of the sub-conveyor and are not the target products to be unloaded, such as Figure 4As shown, when the number of items to be unloaded is 20, the sub-fixed-distance target commodity determined on the sub-conveyor belt 3 is target commodity A. Correspondingly, for sub-conveyor belt 3, the sub-auxiliary fixed-distance target commodity is target commodity B, because the distance between target commodity B and target commodity A along the moving direction of sub-conveyor belt 3 is the shortest, and target commodity B does not belong to the target commodities to be unloaded. Since target commodity C belongs to the target commodities to be unloaded, it cannot be used as an auxiliary fixed-distance target commodity for the fixed-distance target commodity. Similarly, for sub-conveyor belt 1, sub-conveyor belt 2 and sub-conveyor belt 4, the corresponding sub-auxiliary fixed-distance target commodities are target commodity F, target commodity E and target commodity D respectively.
[0097] Based on the position of the sub-auxiliary fixed-distance products corresponding to each sub-conveyor belt and the conveyor belt discharge port in the i-th product image, the movement distance of each sub-conveyor belt is determined. This movement distance is the maximum allowable movement distance for all target products in the product image, excluding the target product to be discharged. By determining the sub-auxiliary fixed-distance target products for each sub-conveyor belt, the maximum allowable movement distance of each sub-conveyor belt can be accurately determined, reducing the number of sub-conveyor belt starts and stops, thereby saving time and improving production capacity.
[0098] In some embodiments, when a conveyor belt includes multiple sub-conveyor belts, and the multiple sub-conveyor belts move independently to discharge materials from the same discharge port, the computer device determines the sub-image spacing between sub-target products included in the i-th product image along the moving direction of the sub-conveyor belts, where the sub-target products are used to represent target products located on the same sub-conveyor belt;
[0099] If the sub-image spacing is less than or equal to the preset adhesion spacing, the computer device determines that the corresponding sub-target product is a sub-adhesion target product, and the sub-adhesion target product is collectively determined as one or more to-be-unloaded target products or residual target products corresponding to the i-th product image in the process of jointly counting the target products on each sub-conveyor belt included in the i-th product image along the reverse direction of movement of the sub-conveyor belt.
[0100] In the process of using multiple sub-conveyors to unload and package target products, since the distribution of target products on the sub-conveyors is relatively random, there may be a situation where target products located on the same sub-conveyor are unloaded together during the unloading process due to being too close to each other. Therefore, in order to achieve accurate unloading with multiple sub-conveyors, the sub-image spacing between sub-target products included in the i-th product image along the direction of conveyor movement is first determined, where the sub-target products represent target products located on the same sub-conveyor. If the sub-image spacing is less than or equal to the preset adhesion spacing, it means that the corresponding sub-target products are close to each other along the direction of sub-conveyor movement, and there may be a problem of unloading together following the movement of the sub-conveyor. Therefore, the corresponding sub-target products are determined to be sub-adhesion target products. In the process of jointly counting the target products on each sub-conveyor included in the i-th product image along the opposite direction of sub-conveyor movement, the sub-adhesion target products will be jointly determined as the corresponding target products to be unloaded or the remaining target products. That is, the sub-adhesion target products will be unloaded together or remain together on the corresponding sub-conveyor.
[0101] like Figure 4 As shown, target product H, target product I, target product J, target product K and target product L are sub-target products located on the same conveyor belt, and target product P and target product Q are sub-target products located on another conveyor belt. Since the sub-image spacing between target product H, target product I, target product J and target product K along the conveyor belt moving direction is less than the preset adhesion spacing, target product H, target product I, target product J and target product K are determined to be sub-adhesion target products. Similarly, target product P and target product Q are determined to be sub-adhesion target products, as shown in FIG. Figure 4 As shown, the sub-adhesive target commodities can be identified as a whole with a frame. During the counting process, target commodity H, target commodity I, target commodity J and target commodity K should be jointly determined as target commodities to be unloaded or residual target commodities, and target commodity P and target commodity Q should also be jointly determined as target commodities to be unloaded or residual target commodities. For example, when the target quantity to be unloaded is 3, the sub-conveyor belts are counted together from right to left. Since the quantity of target commodities H, target commodity I, target commodity J and target commodity K is greater than 3, target commodities H, target commodity I, target commodity J and target commodity K should be determined as residual target commodities, and since target commodities P and target commodity Q are also sub-adhesive target commodities, target commodities P, target commodity Q and target commodity O are determined as target commodities to be unloaded that meet the target commodities to be unloaded.
[0102] By determining the sub-target products that are close to each other along the moving direction of the sub-conveyor on the same sub-conveyor as sub-adhesive target products before counting, and by making the sub-adhesive target products jointly determined as target products to be unloaded or residual target products, the problem of inaccurate unloading due to the target products being too close to each other can be avoided.
[0103] It should be noted that if, during the joint counting of the sub-conveyor belts, the target quantity to be unloaded cannot be met due to the sub-sticking of the target goods, an alarm signal should be generated. After the alarm signal is generated, other control equipment such as the robot can perform corresponding processing to ensure the accuracy of unloading the target goods.
[0104] In summary, the embodiment of the present application provides a method for counting and unloading goods, which first obtains a product image of a target product on a conveyor belt, and then determines one or more target products to be unloaded that meet the number of products to be unloaded from the target products included in the product image according to the corresponding number of products to be unloaded, and determines the fixed-distance target product with the farthest distance from the conveyor belt unloading port from the target products to be unloaded. Since the number of target products to be unloaded is used to meet the number of products to be unloaded, in order to successfully unload the target products to be unloaded, the target moving distance of the conveyor belt is determined according to the positions of the fixed-distance target product and the conveyor belt unloading port in the product image respectively. The conveyor belt moves the target moving distance so that the target products to be unloaded can be unloaded, and after the conveyor belt completes the movement, the product image of the target product on the conveyor belt is obtained again to count and unload again. Through the above technical solution, automatic counting and unloading of goods can be realized.
[0105] The following is an explanation of a commodity counting and unloading device provided by the present application through an embodiment of the device. Figure 5 As shown, Figure 5 This is a schematic diagram of a commodity counting and unloading device provided in an embodiment of the present application, the device comprising:
[0106] An acquisition unit 501 is configured to acquire the i-th image of a target product on a conveyor belt, where i≥1, and the target product is a product that needs to be counted, blanked, and packaged;
[0107] The first determining unit 502 is configured to determine, based on the quantity to be cut corresponding to the i-th product image, one or more target products to be cut from the target products included in the i-th product image that meet the quantity to be cut corresponding to the i-th product image;
[0108] The second determining unit 503 is configured to determine a target commodity with a predetermined distance from one or more target commodities to be unloaded, wherein the target commodity with a predetermined distance is the target commodity with the greatest distance from the unloading opening of the conveyor belt among the one or more target commodities to be unloaded;
[0109] The third determining unit 504 is configured to determine a target moving distance of the conveyor belt according to the positions of the target product at a fixed distance and the unloading port of the conveyor belt in the i-th product image;
[0110] The moving unit 505 is used to control the moving distance of the conveyor belt and obtain the (i+1)th product image of the target product on the conveyor belt after the conveyor belt completes this movement.
[0111] In some embodiments, the product counting and unloading device also includes a fourth determination unit, which is used to determine the target quantity of the target product included in the i-th product image; when the target quantity is less than the quantity to be unloaded corresponding to the i-th product image, the difference between the quantity to be unloaded and the target quantity is used as the quantity to be unloaded corresponding to the i+1-th product image; or, when the target quantity is greater than or equal to the quantity to be unloaded corresponding to the i-th product image, the number of packages of the target product is used as the quantity to be unloaded corresponding to the i+1-th product image.
[0112] In some embodiments, in determining the target moving distance of the conveyor belt according to the positions of the target product at a fixed distance and the conveyor belt discharge port in the i-th product image, the third determining unit 504 is specifically configured to:
[0113] Determine the target number of pixels corresponding to the distance between the target product and the conveyor belt unloading port in the i-th product image based on the positions of the target product and the conveyor belt unloading port in the i-th product image;
[0114] The target moving distance of the conveyor belt is determined based on the target number of pixels and the pixel equivalent. The pixel equivalent is used to represent the correspondence between the number of pixels in the product image and the moving distance of the conveyor belt.
[0115] In some embodiments, the commodity counting and unloading device also includes a fifth determination unit, which is used to obtain a first calibration plate image of the calibration plate on the conveyor belt; move the conveyor belt based on a preset moving distance, and obtain a second calibration plate image of the calibration plate on the conveyor belt after the movement; determine the number of moved pixels of the calibration plate based on the first calibration plate image and the second calibration plate image; and use the ratio of the preset moving distance to the number of moved pixels as the pixel equivalent.
[0116] In some embodiments, the commodity counting and unloading device also includes a correction unit, which is used to place the calibration plate on the conveyor belt in the camera field of view based on multiple different angles before obtaining the first calibration plate image of the calibration plate on the conveyor belt, and obtain multiple angles of the calibration plate corresponding to the calibration plate to be corrected; correct the multiple angles of the images to be corrected to determine the distortion correction parameters of the camera image.
[0117] In determining the number of moved pixels of the calibration plate according to the first calibration plate image and the second calibration plate image, the fifth determining unit is specifically configured to:
[0118] Performing distortion correction processing on the first calibration plate image and the second calibration plate image according to the distortion correction parameters to obtain corresponding first corrected calibration plate image and second corrected calibration plate image;
[0119] The number of moved pixels of the calibration plate is determined according to the first corrected calibration plate image and the second corrected calibration plate image.
[0120] In some embodiments, in determining the target moving distance of the conveyor belt according to the positions of the target product at a fixed distance and the conveyor belt discharge port in the i-th product image, the third determining unit 504 is specifically configured to:
[0121] Determine an auxiliary fixed-distance target product corresponding to the fixed-distance target product in the i-th product image. The auxiliary fixed-distance target product is a target product that is closest to the fixed-distance target product along the moving direction of the conveyor belt and is not one of the one or more target products to be unloaded.
[0122] The target moving distance of the conveyor belt is determined according to the position of the auxiliary distance-fixed target product and the conveyor belt unloading port in the i-th product image.
[0123] In some embodiments, the product counting and unloading device also includes a sixth determination unit, which is used to determine the relative image spacing between the target product included in the i-th product image and the fixed-distance target product along the moving direction of the conveyor belt; if the relative image spacing is less than or equal to the preset adhesion spacing, and the corresponding target product does not belong to one or more target products to be unloaded, it is determined that the corresponding target product and the fixed-distance target product are adhesion target products, and an alarm signal is generated.
[0124] In some embodiments, the conveyor belt includes multiple sub-conveyor belts, which move independently and correspond to the same unloading port. In determining, based on the quantity to be unloaded corresponding to the i-th product image, one or more target products to be unloaded that meet the quantity to be unloaded corresponding to the i-th product image from the target products included in the i-th product image, the first determining unit 502 is specifically configured to:
[0125] The target products on each sub-conveyor included in the i-th product image are counted together along the reverse direction of the sub-conveyor, until the number of products to be unloaded corresponding to the i-th product image is met, and the corresponding one or more target products to be unloaded are determined.
[0126] In some embodiments, in determining the target moving distance of the conveyor belt according to the positions of the target product at a fixed distance and the conveyor belt discharge port in the i-th product image, the third determining unit 504 is specifically configured to:
[0127] Determine the sub-auxiliary fixed-distance target product corresponding to the sub-fixed-distance target product on each sub-conveyor included in the i-th product image, where the sub-auxiliary fixed-distance target product is the target product that is closest to the corresponding sub-fixed-distance target product along the moving direction of the sub-conveyor and is not one of the one or more target products to be unloaded;
[0128] According to the position of the sub-auxiliary fixed-distance product and the sub-conveyor unloading port in the i-th product image, the target moving distance of each sub-conveyor is determined.
[0129] In some embodiments, the product counting and unloading device also includes a seventh determination unit, which is used to: determine the sub-image spacing between the sub-target products included in the i-th product image along the moving direction of the sub-conveyor before jointly counting the target products on each sub-conveyor included in the i-th product image along the opposite direction of movement of the sub-conveyor, and the sub-target products are used to represent the target products located on the same sub-conveyor; if the sub-image spacing is less than or equal to the preset adhesion spacing, the corresponding sub-target product is determined to be a sub-adhesion target product, and the sub-adhesion target product is jointly determined as one or more target products to be unloaded or residual target products corresponding to the i-th product image in the process of jointly counting the target products on each sub-conveyor included in the i-th product image along the opposite direction of movement of the sub-conveyor.
[0130] The commodity counting and unloading method provided in the embodiments of the present application can be implemented by a computer device, which can be a terminal device or a server; wherein the server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services. Terminal devices include but are not limited to mobile phones, computers, intelligent voice interaction devices, smart home appliances, vehicle-mounted terminals, aircraft, etc. The terminal device and the server can be directly or indirectly connected via wired or wireless communication, and this application does not impose any restrictions on this.
[0131] The embodiment of the present application further provides a computer device, which is the computer device described above and may include a terminal device or a server. The computer device is described below with reference to the accompanying drawings.
[0132] If the computer device is a terminal device, see Figure 6 As shown, the embodiment of the present application provides a terminal device, taking a mobile phone as an example:
[0133] Figure 6 The block diagram shows a partial structure of a mobile phone related to the terminal device provided in the embodiment of the present application. Figure 6The mobile phone includes components such as a radio frequency (RF) circuit 610, a memory 620, an input unit 630, a display unit 640, a sensor 650, an audio circuit 660, a wireless fidelity (WiFi) module 670, a processor 680, and a power supply 690. Those skilled in the art will understand that Figure 6 The mobile phone structure shown in the figure does not constitute a limitation to the mobile phone, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0134] The following combination Figure 6 A detailed introduction to the various components of a mobile phone:
[0135] The RF circuit 610 may be used to receive and send signals during information transmission or calls. In particular, it receives downlink information from the base station and sends it to the processor 680 for processing. In addition, it sends uplink data to the base station.
[0136] The memory 620 can be used to store software programs and modules. The processor 680 executes the various functional applications and data processing of the mobile phone by running the software programs and modules stored in the memory 620. The memory 620 may mainly include a program storage area and a data storage area. The program storage area may store an operating system and at least one application required for a function (such as a sound playback function, an image playback function, etc.); the data storage area may store data created based on the use of the mobile phone (such as audio data, a phone book, etc.). In addition, the memory 620 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage device.
[0137] The input unit 630 may be configured to receive input digital or character information and generate key signal input related to user settings and function control of the mobile phone. Specifically, the input unit 630 may include a touch panel 631 and other input devices 632 .
[0138] The display unit 640 may be configured to display information input by a user or information provided to a user, as well as various menus of the mobile phone. The display unit 640 may include a display panel 641 .
[0139] The mobile phone may also include at least one sensor 650, such as a light sensor, a motion sensor, and other sensors.
[0140] The audio circuit 660 , the speaker 661 , and the microphone 662 can provide an audio interface between the user and the mobile phone.
[0141] WiFi is a short-range wireless transmission technology. The mobile phone can help users send and receive emails, browse web pages, and access streaming media through the WiFi module 670, providing users with wireless broadband Internet access.
[0142] The processor 680 is the control center of the mobile phone. It uses various interfaces and lines to connect various parts of the entire mobile phone. It performs various functions of the mobile phone and processes data by running or executing software programs and / or modules stored in the memory 620 and calling data stored in the memory 620.
[0143] The mobile phone also includes a power source 690 (such as a battery) for supplying power to various components.
[0144] In this embodiment, the processor 680 included in the terminal device further has the following functions:
[0145] Get the i-th product image of the target product on the conveyor belt, i ≥ 1, and the target product is the product that needs to be counted, unloaded and packaged;
[0146] According to the quantity to be cut corresponding to the i-th product image, determine one or more target products to be cut that meet the quantity to be cut corresponding to the i-th product image from the target products included in the i-th product image;
[0147] Determine a target commodity with a fixed distance from one or more target commodities to be unloaded, wherein the target commodity with a fixed distance is the target commodity with the farthest distance from the unloading port of the conveyor belt among the one or more target commodities to be unloaded;
[0148] Determine the target moving distance of the conveyor belt based on the position of the target product and the conveyor belt unloading port in the i-th product image;
[0149] The conveyor belt is controlled to move a target distance, and after the conveyor belt completes this movement, the i+1th product image of the target product on the conveyor belt is obtained.
[0150] If the computer device is a server, this embodiment of the application also provides a server, see Figure 7 As shown, Figure 7The structural diagram of the server 700 provided in the embodiment of the present application, the server 700 may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPUs) 722 (for example, one or more processors) and memories 732, and one or more storage media 730 (for example, one or more massive storage devices) for storing application programs 742 or data 744. Among them, the memories 732 and the storage media 730 can be temporary storage or persistent storage. The program stored in the storage medium 730 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations on the server. Furthermore, the central processing unit 722 can be configured to communicate with the storage medium 730 to execute a series of instruction operations in the storage medium 730 on the server 700.
[0151] The server 700 may also include one or more power supplies 726, one or more wired or wireless network interfaces 750, one or more input and output interfaces 758, and / or one or more operating systems 741, such as Windows Server 2000. TM , Mac OS X TM , Unix TM ,Linux TM , FreeBSD TM etc.
[0152] The steps performed by the server in the above embodiment can be based on Figure 7 The server structure shown.
[0153] Figure 8 This is a structural diagram of a computer-readable storage medium provided in an embodiment of the present application. A computer program 820 is stored in the computer-readable storage medium 800. When the computer program is executed by a processor, the steps in the method provided in the above embodiment are implemented.
[0154] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps in the method provided in the above embodiment are implemented.
[0155] Those skilled in the art will understand that all or part of the steps of implementing the above-mentioned method embodiment can be completed by hardware related to program instructions, and the above-mentioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above-mentioned method embodiment; and the above-mentioned storage medium can be at least one of the following media: read-only memory (English: Read-only Memory, abbreviated: ROM), RAM, magnetic disk or optical disk, etc., various media that can store program codes.
[0156] It should be noted that the various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device and system embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments. The device and system embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of this embodiment. A person of ordinary skill in the art can understand and implement it without expending creative work.
[0157] The above is only one specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present application should be included in the scope of protection of the present application. Moreover, based on the implementation methods provided in the above aspects, the present application can also be further combined to provide more implementation methods. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.
Claims
1. A method for counting and blanking commodities, characterized in that: include: Obtain the i-th product image of the target product on the conveyor belt, where i≥1. The target product is the product that needs to be counted, blanked, and packaged; According to the to-be-cut quantity corresponding to the i-th product image, determining one or more target products to be cut from the target products included in the i-th product image that meet the to-be-cut quantity corresponding to the i-th product image; Determine a target commodity with a fixed distance from the one or more target commodities to be unloaded, wherein the target commodity with a fixed distance is the target commodity to be unloaded that is the farthest from the unloading opening of the conveyor belt among the one or more target commodities to be unloaded; Determining a target moving distance of the conveyor belt according to the positions of the target product at a fixed distance and the conveyor belt discharge port in the i-th product image; Controlling the conveyor belt to move the target moving distance, and obtaining the (i+1)th product image of the target product on the conveyor belt after the conveyor belt completes this movement; The step of determining a target moving distance of the conveyor belt according to the positions of the fixed-distance target commodity and the conveyor belt discharge port in the i-th commodity image includes: Determining, based on the positions of the target product at the fixed distance and the conveyor belt unloading port in the i-th product image, a target number of pixels corresponding to the distance between the target product at the fixed distance and the conveyor belt unloading port in the i-th product image; Acquire a first calibration plate image of the calibration plate on the conveyor belt; Moving the conveyor belt based on a preset moving distance, and acquiring a second calibration plate image of the calibration plate on the conveyor belt after the movement; Determining the number of moved pixels of the calibration plate according to the first calibration plate image and the second calibration plate image; The ratio of the preset moving distance to the number of moving pixels is used as a pixel equivalent; The target moving distance of the conveyor belt is determined according to the target number of pixels and the pixel equivalent, where the pixel equivalent is used to represent the corresponding relationship between the number of pixels of the product image and the moving distance of the conveyor belt.
2. The method according to claim 1, characterized in that The method further comprises: Determining a target quantity of the target product included in the i-th product image; When the target quantity is less than the quantity to be cut corresponding to the i-th product image, the difference between the quantity to be cut and the target quantity is used as the quantity to be cut corresponding to the i+1-th product image; or When the target quantity is greater than or equal to the quantity to be cut corresponding to the i-th product image, the package quantity of the target product is used as the quantity to be cut corresponding to the i+1-th product image.
3. The method according to claim 1, characterized in that Before acquiring the first calibration plate image of the calibration plate on the conveyor belt, the method further includes: When the calibration plate is placed on the conveyor belt in the camera field of view based on multiple different angles, multiple images to be corrected corresponding to the calibration plate are respectively obtained; Performing correction processing on the images to be corrected at the multiple angles to determine distortion correction parameters of the camera image; The determining, based on the first calibration plate image and the second calibration plate image, the number of moved pixels of the calibration plate includes: Performing distortion correction processing on the first calibration plate image and the second calibration plate image according to the distortion correction parameters to obtain corresponding first corrected calibration plate image and second corrected calibration plate image; The number of moved pixels of the calibration plate is determined according to the first corrected calibration plate image and the second corrected calibration plate image.
4. The method according to claim 1, wherein The step of determining a target moving distance of the conveyor belt according to the positions of the fixed-distance target commodity and the conveyor belt discharge port in the i-th commodity image includes: Determining an auxiliary fixed-distance target product corresponding to the fixed-distance target product in the i-th product image, where the auxiliary fixed-distance target product is a target product that is closest to the fixed-distance target product along the moving direction of the conveyor belt and is not one of the one or more target products to be unloaded; The target moving distance of the conveyor belt is determined according to the positions of the auxiliary distance-fixed target product and the conveyor belt unloading port in the i-th product image.
5. The method according to claim 1, characterized in that The method further comprises: determining a relative image distance between the target product included in the i-th product image and the fixed-distance target product along the moving direction of the conveyor belt; If the relative image spacing is less than or equal to the preset adhesion spacing, and the corresponding target product does not belong to the one or more target products to be unloaded, it is determined that the corresponding target product and the fixed-distance target product are adhesion target products, and an alarm signal is generated.
6. The method according to claim 1, characterized in that The conveyor belt includes a plurality of sub-conveyor belts, the plurality of sub-conveyor belts move independently and correspond to the same unloading port, and determining, based on the quantity to be unloaded corresponding to the i-th product image, one or more target products to be unloaded that meet the quantity to be unloaded corresponding to the i-th product image from the target products included in the i-th product image, includes: The target commodities on each sub-conveyor included in the i-th commodity image are counted together along the reverse direction of movement of the sub-conveyor belt until the number of commodities to be unloaded corresponding to the i-th commodity image is met, and the corresponding one or more target commodities to be unloaded are determined.
7. The method according to claim 6, characterized in that The step of determining a target moving distance of the conveyor belt according to the positions of the fixed-distance target commodity and the conveyor belt discharge port in the i-th commodity image includes: Determine a sub-auxiliary fixed-distance target commodity corresponding to a sub-fixed-distance target commodity on each sub-conveyor included in the i-th commodity image, wherein the sub-auxiliary fixed-distance target commodity is a target commodity that is closest to the corresponding sub-fixed-distance target commodity along the moving direction of the sub-conveyor and is not one of the one or more target commodities to be unloaded; The target moving distance of each sub-conveyor belt is determined according to the positions of the sub-auxiliary fixed-distance products and the unloading opening of the sub-conveyor belt in the i-th product image.
8. The method according to claim 6, characterized in that Before counting the target products on each sub-conveyor belt included in the i-th product image along the reverse direction of movement of the sub-conveyor belt, the method further includes: Determining a sub-image spacing between sub-target products included in the i-th product image along the moving direction of the sub-conveyor belt, wherein the sub-target products are used to represent target products located on the same sub-conveyor belt; If the sub-image spacing is less than or equal to the preset adhesion spacing, the corresponding sub-target product is determined to be a sub-adhesion target product, and the sub-adhesion target products are collectively determined as one or more to-be-unloaded target products or remaining target products corresponding to the i-th product image in the process of jointly counting the target products on each sub-conveyor belt included in the i-th product image along the reverse direction of movement of the sub-conveyor belt.
9. A commodity counting and unloading device, characterized in that: include: An acquisition unit is used to acquire the i-th product image of the target product on the conveyor belt, where i≥1, and the target product is a product that needs to be counted, blanked, and packaged; a first determining unit configured to determine, based on the quantity to be cut corresponding to the i-th product image, one or more target products to be cut from the target products included in the i-th product image that meet the quantity to be cut corresponding to the i-th product image; A second determining unit is configured to determine a target commodity with a fixed distance from the one or more target commodities to be unloaded, wherein the target commodity with a fixed distance is the target commodity to be unloaded that is the farthest from the unloading opening of the conveyor belt among the one or more target commodities to be unloaded; a third determining unit, configured to determine a target moving distance of the conveyor belt according to the positions of the target product at a fixed distance and the unloading port of the conveyor belt in the i-th product image; The third determining unit is specifically configured to determine, based on the positions of the target product at the fixed distance and the conveyor belt unloading port in the i-th product image, a target number of pixels corresponding to the distance between the target product at the fixed distance and the conveyor belt unloading port in the i-th product image; a fifth determining unit, configured to obtain a first calibration plate image of the calibration plate on the conveyor belt; Moving the conveyor belt based on a preset moving distance, and acquiring a second calibration plate image of the calibration plate on the conveyor belt after the movement; Determining the number of moved pixels of the calibration plate according to the first calibration plate image and the second calibration plate image; The ratio of the preset moving distance to the number of moving pixels is used as a pixel equivalent; The third determining unit is configured to determine a target moving distance of the conveyor belt based on the target number of pixels and the pixel equivalent, wherein the pixel equivalent is used to represent a corresponding relationship between the number of pixels of the product image and the moving distance of the conveyor belt; The moving unit is used to control the conveyor belt to move the target moving distance, and obtain the (i+1)th commodity image of the target commodity on the conveyor belt after the conveyor belt completes this movement.
10. A computer device, characterized in that: The computer device includes a processor and a memory, wherein the memory stores a computer program, and when the processor executes the computer program, the method according to any one of claims 1 to 8 is implemented.
11. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Distributed thousand-grain counting method, system, device and terminal
CN109598328A
Visual inspection and counting method for dried fruits
CN114926435A