A machine vision-based instant noodle boxing positioning method and system
By separating the lighting and texture components, constructing the jagged edge aliasing interference index and comprehensive segmentation weight, stripping the soft skirt, and calculating the rigid core grasping coordinates, the problem of inaccurate positioning caused by lighting and deformation during the instant noodle packing process is solved, improving the packing success rate and stability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHAANXI HUAXIANG FOOD (GRP) CO LTD
- Filing Date
- 2026-02-28
- Publication Date
- 2026-05-15
AI Technical Summary
Existing technologies make it difficult to effectively distinguish between the serrated and overlapping textures of highly reflective packaging bags during the instant noodle packaging process, and the deformation of the soft skirt causes the robot to be unstable in its gripping, resulting in packaging failure.
The illumination component and texture component are separated by low-pass and high-pass filtering. By combining local texture frequency and structural tensor analysis, the jagged edge aliasing interference index and the comprehensive segmentation weight index are constructed. The soft skirt is peeled off by morphological erosion, and the rigid core grasping coordinates are calculated.
It improves the success rate and stability of packing under complex lighting and deformation conditions, reduces the false detection rate, ensures that the robot gripping point is on the solid dough, and improves the packing efficiency of high-speed production lines.
Smart Images

Figure CN121767452B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology. More specifically, this invention relates to a machine vision-based method and system for positioning instant noodles in packaging. Background Technology
[0002] At the back end of a modern instant noodle production line, industrial cameras are typically used to capture images of the conveyor belt in real time. Image processing algorithms are then used to identify the position and posture of the instant noodles, thereby guiding industrial robots to quickly sort and pack them, replacing manual operations.
[0003] To solve the visual positioning problem, existing technologies typically use concave point detection or watershed algorithms for image segmentation; the geometric center or minimum bounding rectangle center of the segmented single connected domain is calculated and directly used as the robot's grasping coordinates.
[0004] However, the aforementioned algorithm has certain shortcomings in the specific scenario of instant noodle packaging: First, instant noodle bags typically have high reflectivity, and the seals at both ends exhibit dense serrated textures. When high-speed transport causes physical overlap or compression between the seals of adjacent packs of instant noodles, the textures in the overlapping areas become mixed. Traditional segmentation algorithms based on gradient magnitude or grayscale thresholds struggle to effectively distinguish between normal single-layer serrated textures and the mixed textures resulting from overlap. They are prone to failure in identifying adhesion points due to uneven lighting or texture complexity, leading to segmentation errors. Second, bagged instant noodles are non-rigid objects, consisting of a solid noodle core and a wide, flexible skirt. The flexible skirt is highly susceptible to random deformation or warping during transport. Existing technologies directly calculate the geometric center of the overall connected domain including the flexible skirt, which often deviates from the true physical centroid of the noodle core due to skirt deformation. Since the robot's vacuum suction cup must adhere to a flat and solid noodle surface to ensure stable negative pressure, this positioning deviation directly leads to weak adhesion, causing problems such as package swapping, skewed grasping, or packaging failure. Summary of the Invention
[0005] To address the technical problem of poor positioning in instant noodle packaging, which easily leads to packaging failure, the present invention provides solutions in the following aspects.
[0006] In a first aspect, the present invention provides a machine vision-based instant noodle packaging and positioning method, comprising:
[0007] The process involves acquiring the original image of the instant noodle delivery process, processing it using low-pass and high-pass filters to extract the illumination and texture components, normalizing and performing frequency domain transformation on the illumination and texture components to obtain the preprocessed image and local texture frequency map, calculating the texture disorder factor based on the texture direction features obtained from the local gradient calculation in the preprocessed image, calculating the aliasing overlap factor based on the packaging machine cutter parameters and the local texture frequency map, and recording the product of the texture disorder factor and the aliasing overlap factor as the aliasing interference index of the corresponding pixel to identify potential adhesion points. Finally, based on the pixel grayscale values in the preprocessed image... The grayscale peak factor of any pixel is calculated based on the ratio of the brightness of the dough and the sealing brightness. The geometric offset factor of any pixel is calculated based on the normalized distance difference from the pixel to the geometric center of the adjacent dough. A comprehensive segmentation weight index is obtained by combining the grayscale peak factor and the geometric offset factor, and the path with the minimum weight is searched as the optimal segmentation line. The erosion radius is determined based on the physical size difference between the packaging bag and the dough entity. A morphological erosion algorithm is used to process the segmented single connected components, and the rigid mask value of the pixel is marked. Based on the rigid mask value and the pixel grayscale value of the preprocessed image, the rigid core grasping coordinates are obtained to complete the boxing positioning.
[0008] This invention eliminates interference from uneven illumination through frequency domain layering; it constructs a jagged overlap interference index using texture disorder factors and jagged overlap factors, which, compared to the traditional simple grayscale thresholding method, can more accurately identify physical adhesion points by utilizing the disorder of texture direction and frequency characteristics when overlapping; by constructing a comprehensive segmentation weight index that integrates grayscale peak value and geometric offset, it searches for the minimum weight path as the optimal segmentation line, avoiding the segmentation line from deviating from the sealing point due to interference from the printed pattern; finally, it uses morphological etching to peel off the unstable soft skirt and calculates the brightness-weighted rigid center to ensure that the robot gripping point is located on a hard and flat dough entity, improving the success rate and stability of boxing in high-speed production lines.
[0009] Preferably, the acquisition of the local texture frequency map includes:
[0010] A local sliding window Fourier transform is performed on the texture components to obtain the local power spectrum. The energy-weighted average frequency of the local power spectrum is calculated and denoted as the local texture frequency of the center pixel of the corresponding local sliding window. According to the coordinate order of the pixels, the local texture frequencies of all pixels are used to form a local texture frequency map.
[0011] Preferably, the texture disorder factor satisfies the expression:
[0012] ;
[0013] In the formula, This represents the texture noise factor of the i-th pixel in the preprocessed image; The first eigenvalue of the structure tensor of the i-th pixel is represented. The second eigenvalue represents the structure tensor of the i-th pixel. Indicates the absolute value symbol; It represents the first infinitesimal positive number.
[0014] This invention can capture the chaotic abrupt changes in texture direction at the adhesion point through the texture disorder factor, thereby providing a reliable geometric feature basis for locating potential physical adhesion locations in complex backgrounds.
[0015] Preferably, the sawtooth overlap factor satisfies the expression:
[0016] ;
[0017] In the formula, This represents the jagged overlap factor of the i-th pixel in the preprocessed image; This represents the local texture frequency of the i-th pixel in the preprocessed image; This indicates the standard saw tooth frequency of the cutting blade in an instant noodle packaging machine. Indicates the tolerance range; This represents the natural exponential function.
[0018] Based on the laws of physical optics, this invention utilizes the multiplication effect of two overlapping serrated seals, where the visual frequency is nearly twice that of a single layer, to construct a frequency-selective Gaussian filter model. As a bandpass filter, this invention can specifically filter out overlapping double-layer regions from complex background textures, reducing the false detection rate of non-adhesive areas caused by printed patterns or high-frequency noise.
[0019] Preferably, obtaining the standard saw tooth frequency of the instant noodle packaging machine cutter includes:
[0020] Obtain the physical tooth pitch of the packaging machine cutter and the imaging resolution of the camera;
[0021] The reciprocal of the product of the physical tooth pitch and the imaging resolution is denoted as the standard saw tooth frequency of the instant noodle packaging machine cutter.
[0022] Preferably, obtaining the tolerance range includes:
[0023] During the production line debugging phase, the standard deviation of the local texture frequency map of normal single instant noodles is collected and recorded as the unit tolerance standard deviation; twice the unit tolerance standard deviation is recorded as the tolerance range.
[0024] Preferably, the acquisition of the grayscale peak factor includes:
[0025] The average gray value of the top 10% of pixels in the illumination component is recorded as the average brightness of the center of the pancake; the average gray value of the bottom 10% to 20% of pixels in the illumination component is recorded as the average brightness of the sealed area; the natural logarithm of the ratio of the average brightness of the center of the pancake to the average brightness of the sealed area is recorded as the gray sensitivity coefficient of the preprocessed image.
[0026] The gray-level peak factor is equal to the power of the gray-level sensitivity coefficient, with the value of the pixel in the preprocessed image as the base.
[0027] This invention constructs a cost function based on an adaptive grayscale sensitivity coefficient. By exponentially amplifying the weight difference between the center of the dough and the sealing gap, the optimal dividing line is found so that the path avoids the bright dough entity and strictly extends along the low-brightness sealing gap, thus solving the problem of abnormal lighting areas inducing the dividing path.
[0028] Preferably, the geometric offset factor satisfies the expression:
[0029] ;
[0030] In the formula, This represents the geometric offset factor of the i-th pixel in the preprocessed image; This represents the x-coordinate of the i-th pixel in the preprocessed image; The abscissa of the centroid of the connected region of the potential adhesion point is represented by the arithmetic mean of the abscissas of all the pixels of the potential adhesion point. This represents the geometric constraint tolerance, which is one-quarter of the standard pixel width of the instant noodle pancake. This represents the natural exponential function.
[0031] This invention introduces a geometric space constraint centered on the adhesion centroid to construct a low-cost vertical channel, preventing the optimal segmentation path from drifting laterally due to complex printing patterns or local light spot interference on the packaging bag surface. This ensures that the segmentation line is always confined within a geometrically reasonable area between the two dough pieces, thus improving the geometric rationality of the segmentation.
[0032] Preferably, the rigid core grasping coordinates satisfy the expression:
[0033] ;
[0034] In the formula, Represents the rigid core capture coordinates of the h-th single-unit connected domain; This represents the number of pixels in the h-th single-unit connected component; This represents the rigid mask value of the m-th pixel in the h-th single-unit connected domain; This represents the value of the m-th pixel in the preprocessed image of the h-th single-unit connected component. This represents the coordinates of the m-th pixel in the h-th single-unit connected component; It represents the second smallest positive number.
[0035] Secondly, the present invention provides a machine vision-based instant noodle packing and positioning system, including a processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the aforementioned machine vision-based instant noodle packing and positioning method is implemented.
[0036] By adopting the above technical solution, a computer program for the instant noodle packing and positioning method based on machine vision is generated and stored in a memory so that it can be loaded and executed by a processor. This allows for the creation of a terminal device based on the memory and processor, making it convenient to use.
[0037] The beneficial effects of this invention are as follows:
[0038] (1) This invention utilizes the periodic texture features of the serrated seal to propose a frequency multiplication effect detection algorithm. Based on Fourier transform, the texture frequency is monitored. When the texture frequency of a local area is detected to be close to twice the standard cutter tooth pitch frequency, it is determined to be double-layer packaging overlap. At the same time, the local texture disorder is analyzed by combining structural tensor to distinguish between normal seal and adhesion and extrusion points, thus reducing the false detection rate under complex lighting conditions.
[0039] (2) In view of the problem of easy collapse and large deformation of the skirt of soft packaging, the present invention proposes a rigid core extraction algorithm. The algorithm removes the loose soft skirt interference through morphological erosion operation and introduces a brightness weighting mechanism to calculate the weighted centroid pointing to the thickest and flattest area of the dough, thereby improving the airtightness and stability of the high-speed industrial robot during vacuum suction. Attached Figure Description
[0040] Figure 1 This is a flowchart illustrating a machine vision-based instant noodle packaging and positioning method according to the present invention.
[0041] Figure 2 This is a schematic illustration of the preprocessed image;
[0042] Figure 3 This is a schematic representation of a local texture frequency map;
[0043] Figure 4 This is a schematic diagram showing the coordinate markers for grabbing. Detailed Implementation
[0044] This invention discloses a machine vision-based instant noodle packaging and positioning method, referring to... Figure 1 This includes steps S1-S4:
[0045] S1: Obtain the original image of the instant noodle delivery process, use low-pass filtering to process the original image to extract the illumination component, and use high-pass filtering to process the original image to extract the texture component; normalize and frequency domain transform the illumination component and texture component to obtain the preprocessed image and local texture frequency map.
[0046] It should be noted that instant noodle packaging bags have optical characteristics of a highly reflective noodle cake area at the center and a low-contrast skirt area at the edges. If the original image is processed directly, the highlights at the noodle cake area often obscure the edge details, making it difficult for subsequent segmentation algorithms to capture the jagged sealing texture. Furthermore, due to uneven lighting in the production environment, grayscale thresholding alone is insufficient to simultaneously adapt to both the center and edges. Therefore, this invention employs a frequency domain hierarchical preprocessing strategy to separate the illumination component reflecting the main structure of the object from the texture component reflecting surface details, thereby enhancing the feature representation of the edge seal while preserving the noodle cake's positional information.
[0047] Specifically, the process involves acquiring the original image of the instant noodle delivery process, using a low-pass filter to extract the illumination component, and using a high-pass filter to extract the texture component, including:
[0048] Industrial cameras were used to capture raw images of instant noodles during the delivery process.
[0049] The original image is convolved using a Gaussian low-pass filter to extract the filtered low-frequency information, and the area covered by this low-frequency information is labeled as the illumination component. A high-pass filter is then used to process the original image to extract the filtered high-frequency information, which is labeled as the texture component. It should be noted that the convolution operation is used to filter out high-frequency noise and subtle textures, and the illumination component represents the main position of the pie. The high-pass filter is used to suppress low-frequency background and areas with slowly changing illumination. The high-frequency information includes the jagged edge texture and details of the printed pattern.
[0050] Preferably, the illumination component and texture component are normalized and subjected to frequency domain transformation to obtain the preprocessed image and local texture frequency map, including:
[0051] The illumination and texture components are numerically normalized separately, so that each pixel value is mapped to... The normalized grayscale image is generated by dividing the image into ranges. It should be noted that the normalized grayscale image comprehensively reflects the height and reflective properties of the object.
[0052] A local sliding window Fourier transform is performed on the texture components to obtain the local power spectrum. The energy-weighted average frequency of the local power spectrum is calculated and denoted as the local texture frequency of the center pixel of the corresponding local sliding window. The local texture frequencies of all pixels are then arranged in the coordinate order to form a local texture frequency map. For example, the size of the local sliding window is... .
[0053] It should be noted that, as Figure 2 The image shown is a preprocessed image obtained during the instant noodle delivery process. Figure 3 This is a local texture frequency map, which shows the local texture frequency values of each pixel in the preprocessed image. The color bars indicate that the local texture frequency values range from 0 to 1.
[0054] At this point, the preprocessed image and local texture frequency map have been obtained.
[0055] S2: Calculate the texture disorder factor based on the texture direction features obtained from the local gradient calculation in the preprocessed image; calculate the serration overlap factor based on the packaging machine cutter parameters and the local texture frequency map; combine the texture disorder factor and the serration overlap factor to obtain the serration aliasing interference index and lock potential adhesion points.
[0056] It should be noted that during high-speed transport, the most likely point where two adjacent packets of instant noodles are to physically stick together is at the serrated seals at both ends. The texture of a single seal is directional, perpendicular to the seal line. However, when two seals are squeezed and overlapped, the texture direction becomes chaotic and isotropic, and the spatial frequency changes abruptly. Segmentation methods based on grayscale thresholds cannot distinguish between normal seals and stuck seals. Therefore, this invention locates the sticking points based on the disorder of the texture direction and the frequency multiplication effect of the preprocessed image.
[0057] Specifically, based on the texture direction features obtained from local gradient calculation in the preprocessed image, the texture clutter factor is calculated, including:
[0058] It should be noted that the structure tensor can effectively describe the geometric orientation information of local image texture. In order to evaluate the orientation consistency of the texture, this invention uses the difference between feature values to construct the structure. When the difference between two feature values is large, it indicates that the texture has a main direction; when the two feature values are close, it indicates that the texture is messy.
[0059] Calculate the covariance matrix of the local gradients of all pixels in the preprocessed image, denoted as the structure tensor of the corresponding pixel; the structure tensor of the i-th pixel has two eigenvalues, denoted as... and ,Regulation , Let be the first eigenvalue of the structure tensor of the i-th pixel. Let denot be the second eigenvalue of the structure tensor of the i-th pixel.
[0060] The texture noise factor of any pixel in the preprocessed image satisfies the expression:
[0061] ;
[0062] In the formula, This represents the texture noise factor of the i-th pixel in the preprocessed image; The first eigenvalue of the structure tensor of the i-th pixel is represented. The second eigenvalue represents the structure tensor of the i-th pixel. Indicates the absolute value symbol; This represents the first tiny positive number, used to avoid a denominator of 0. For example, .
[0063] In the formula, This represents the degree of texture anisotropy in the neighborhood of the i-th pixel in the preprocessed image. When the texture direction is uniform, Much larger This value approaches 1, thus making Approaching 0; when the texture is messy and interwoven, near This value approaches 0, thus making Approaching 1.
[0064] Preferably, the sawtooth overlap factor is calculated based on the packaging machine cutter parameters and local texture frequency map, including:
[0065] It's important to note that the key to identifying adhesion using frequency characteristics lies in capturing the multiplication effect. Physically, when two layers of serrated seals overlap, the visual frequency approaches twice the frequency of a single layer. To construct a frequency-selective filter, the center frequency and bandwidth need to be determined.
[0066] Obtain the physical tooth pitch of the packaging machine cutter; for example, the physical tooth pitch is... ; Obtain the camera's imaging resolution, for example, the imaging resolution is .
[0067] The reciprocal of the product of the physical tooth pitch and the imaging resolution is denoted as the standard saw tooth frequency of the instant noodle packaging machine cutter.
[0068] During the production line debugging phase, the standard deviation of the local texture frequency map of a normal single instant noodle is collected and recorded as the unit tolerance standard deviation; twice the unit tolerance standard deviation is recorded as the tolerance range. If the tolerance range is too large, such as four times the unit tolerance standard deviation, it will lead to a decrease in frequency selectivity, misjudging high-frequency noise in non-adhesive areas as adhesion; if the tolerance range is too small, such as half of the unit tolerance standard deviation, it will lead to excessive sensitivity to small frequency fluctuations in actual production, resulting in missed detections.
[0069] The jagged overlap factor of any pixel in the preprocessed image satisfies the following expression:
[0070] ;
[0071] In the formula, This represents the jagged overlap factor of the i-th pixel in the preprocessed image; This represents the local texture frequency of the i-th pixel in the preprocessed image; This indicates the standard saw tooth frequency of the cutting blade in an instant noodle packaging machine. Indicates the tolerance range; This represents the natural exponential function.
[0072] In the formula, This represents the expected adhesion frequency, which is the target frequency derived from the physical superposition principle. A Gaussian window was constructed, only when the local texture frequency is close to When the output value is large, the double-layer overlapping region is specifically selected.
[0073] Preferably, by combining the texture disorder factor and the aliasing overlap factor, the aliasing interference index is obtained to identify potential adhesion points, including:
[0074] It should be noted that, in order to improve the robustness of detection, both texture disorder and frequency doubling must be met simultaneously to determine adhesion. Therefore, a multiplicative fusion method is used to construct the jagged aliasing interference index.
[0075] The product of the texture clutter factor and the aliasing overlap factor of the i-th pixel in the preprocessed image is denoted as the aliasing interference index of the i-th pixel in the preprocessed image.
[0076] A preset segmentation threshold is used to classify pixels whose aliasing interference index is greater than the threshold as potential adhesion points. For example, the segmentation threshold is 0.8.
[0077] Thus, the aliasing interference index was obtained and potential adhesion points were identified.
[0078] S3: Calculate the grayscale peak factor of any pixel based on the ratio of pixel grayscale value to the brightness of the dough and the seal in the preprocessed image; calculate the geometric offset factor of any pixel based on the normalized distance difference from the pixel to the geometric center of the adjacent dough; combine the grayscale peak factor and the geometric offset factor to obtain the comprehensive segmentation weight index, and search for the minimum weight path as the optimal segmentation line.
[0079] It should be noted that after determining the adhesion point, an optimal segmentation path needs to be generated between the two packs of instant noodles. Since instant noodles have a pillow-like structure with a higher center and lower sealing edges, the optimal segmentation path should be located in the valley between the two noodle cakes, and geometrically as far away from the core of the noodle cake as possible. Relying solely on grayscale is easily affected by the printed pattern, while relying solely on the geometric center line is prone to cutting into noodle cakes that have shifted due to misalignment. Therefore, this invention constructs a comprehensive segmentation weight index to guide the segmentation line along the valley in the darker area and the geometric center line in the middle.
[0080] Specifically, based on the ratio of pixel grayscale values to the brightness of the dough and the seal in the preprocessed image, the grayscale peak factor of any pixel is calculated, including:
[0081] It should be noted that, in order to guide the dividing line to avoid the bright area of the core of the dough and tend towards the dark area of the seal, a cost function that is positively correlated with brightness needs to be constructed, so that the bright area has a high weight and the dark area has a low weight. At the same time, in order to amplify the difference between the dough and the seal, a logarithmic sensitivity coefficient needs to be introduced.
[0082] The average gray value of the top 10% of pixels in the illumination component is obtained and recorded as the average brightness of the center of the pancake.
[0083] The average grayscale value of the bottom 10% to 20% of pixels in the illumination component is recorded as the average brightness at the seal. It should be noted that the high-value areas of the illumination component physically correspond to the center of the dough's arch. When calculating the average brightness at the seal, the bottom 10% are discarded to avoid a pure black background without product, retaining the grayscale information representing the edge of the packaging bag.
[0084] The natural logarithm of the ratio of the average brightness at the center of the dough to the average brightness at the sealed edge is denoted as the grayscale sensitivity coefficient of the preprocessed image.
[0085] The grayscale peak factor of any pixel satisfies the following expression:
[0086] ;
[0087] In the formula, Represents the grayscale peak factor of the i-th pixel; This represents the value of the i-th pixel in the preprocessed image; This represents the grayscale sensitivity coefficient of the preprocessed image.
[0088] In the formula, the area around the seal of instant noodles is usually darker due to diffuse reflection. The color is close to 0, and the pancake area is brighter. Approaching 1. Through exponentiation. This amplifies the weight of the bright areas, creating a high-weight barrier that prevents the dividing line from passing through the pancake, forcing the path to find a low-weight area with low grayscale values.
[0089] Preferably, the geometric offset factor of any pixel is calculated based on the horizontal deviation of the pixel relative to the potential adhesion points in the preprocessed image, including:
[0090] It should be noted that, in addition to avoiding the highlighted areas, the segmentation path should also be constrained in geometric space, so that it passes through the adhesive area as vertically as possible, and avoids the path drifting laterally into the main body of the dough on both sides due to the grayscale interference of the printed pattern.
[0091] Obtain the centroid coordinates of the connected regions of potential adhesion points. The x-coordinate of the centroid of the connected regions of potential adhesion points is obtained by calculating the arithmetic mean of the x-coordinates of all potential adhesion point pixels; the y-coordinate of the centroid of the connected regions of potential adhesion points is obtained by calculating the arithmetic mean of the y-coordinates of all potential adhesion point pixels.
[0092] Obtain the standard pixel width of the instant noodle cake and set the geometric constraint tolerance. For example, the geometric constraint tolerance is one-quarter of the standard pixel width of the instant noodle cake. It should be noted that the standard pixel width of the instant noodle cake refers to the physical width of a normal single instant noodle cake in the conveying direction divided by the imaging resolution of the industrial camera. This value is a fixed constant preset by the system. For example, the standard pixel width of the instant noodle cake is 240 pixels.
[0093] The geometric offset factor of any pixel in the preprocessed image satisfies the expression:
[0094] ;
[0095] In the formula, This represents the geometric offset factor of the i-th pixel in the preprocessed image; This represents the x-coordinate of the i-th pixel in the preprocessed image; The x-coordinate of the centroid of the connected domain of potential adhesion points; Indicates the tolerance of geometric constraints; This represents the natural exponential function.
[0096] In the formula, Constructed with The geometric constraint distribution centered on the pixel, when the pixel is located on the vertical axis of the adhesion point. ,at this time The geometric offset factor is minimized; as pixels deviate horizontally to the left or right, the exponential term decays. Approaching 1, thus forming a high-weight barrier on both sides, keeping the segmentation path within the vertical channel near the adhesion region.
[0097] Preferably, by combining the gray-scale peak factor and the geometric offset factor, a comprehensive segmentation weight index is obtained, and the path with the minimum weight is searched as the optimal segmentation line, including:
[0098] It should be noted that the final segmentation should be based on the superposition of physical and geometric features to ensure that the optimal solution can still be found in the case of abnormal lighting or positional shift.
[0099] The grayscale peak factor of the i-th pixel is added to the geometric offset factor of the i-th pixel to obtain the comprehensive segmentation weight index of the i-th pixel.
[0100] The comprehensive segmentation weight index of all pixels in the preprocessed image is used to construct a comprehensive segmentation weight index map according to the positional order of the pixels. The geometric centroid of the connected domain of potential adhesion points is used as the search starting point. In the comprehensive segmentation weight index map, starting from the search starting point, the minimum weight path is searched for along the upper and lower boundaries of the image using a minimum path algorithm. The complete path that runs through the image is recorded as the optimal segmentation line. For example, the minimum path algorithm is Dijkstra's algorithm.
[0101] At this point, the comprehensive segmentation weight index of each pixel has been obtained, and the optimal segmentation line has been generated.
[0102] S4: Determine the erosion radius based on the physical size difference between the packaging bag and the actual dough, process the segmented single connected components using a morphological erosion algorithm, and mark the rigid mask value of the pixel. Based on the rigid mask value and the pixel grayscale value of the preprocessed image, obtain the rigid core grasping coordinates to complete the boxing positioning.
[0103] It should be noted that after image segmentation using the optimal dividing line, directly calculating the center of the circumscribed rectangle of the connected component of a single unit as the gripping point often leads to positioning errors. This is because the edges of instant noodle packaging bags have wide skirts, which are made of soft material and are prone to irregular deformation, folding, or warping during transport. The vacuum suction cups used by the robot must adhere to the flat, hard surface of the noodle cake. Therefore, this invention employs a positioning method based on a rigid core, using physical dimensions to differentiate the unstable soft edges and combining brightness weighting to calculate the most suitable centroid for gripping the entity.
[0104] Specifically, the erosion radius is determined based on the physical size difference between the packaging bag and the actual dough. A morphological erosion algorithm is used to process the segmented connected components, and the rigid mask values of the pixels are marked, including:
[0105] It should be noted that, in order to accurately peel off the soft skirt, the degree of corrosion needs to be determined based on the difference in physical dimensions between the instant noodle packaging bag and the actual noodle cake.
[0106] The standard value for obtaining the total length of the packaging bag is denoted as: Exemplary ; Obtain the standard value of the dough body length, denoted as Exemplary .
[0107] Set a safety factor, denoted as . Exemplary .like The value is too large, for example Or even larger, it will lead to excessive corrosion, loss of some rigid surface areas, and affect the stability of the center of gravity calculation; if The value is too small, for example This can lead to insufficient corrosion, leaving behind soft fringes, and failing to completely eliminate deformation interference.
[0108] The radius of the corrosion structure element is obtained by multiplying the difference between the standard value of the total length of the packaging bag and the standard value of the actual length of the dough by 2 and the safety factor.
[0109] The preprocessed image's pixels are divided into several independent single-unit connected components using the optimal segmentation line. Morphological erosion is performed on each single-unit connected component, and the regions retained after erosion are marked as rigid regions. For the i-th pixel in the preprocessed image, if the pixel is located within a rigid region, its rigidity mask value is recorded as... If the pixel is located outside the rigid region, its rigid mask value is recorded as... It should be noted that this operation physically removes all soft edges, leaving only the rigid dough area.
[0110] Preferably, based on the rigid mask value and the pixel grayscale value of the preprocessed image, the rigid core grasping coordinates are obtained to complete the bin packing positioning, including:
[0111] It should be noted that within the rigid area, the suitability for suction varies at different locations. The center of the dough is typically the thickest and most reflective, with a higher grayscale value. The brighter and flatter this area, the more suitable it is for suction cup adsorption. Therefore, this invention introduces grayscale weighting to bring the positioning point closer to the flatter center.
[0112] The rigid core grasping coordinates of any single connected domain satisfy the expression:
[0113] ;
[0114] In the formula, Represents the rigid core capture coordinates of the h-th single-unit connected domain; This represents the number of pixels in the h-th single-unit connected component; This represents the rigid mask value of the m-th pixel in the h-th single-unit connected domain; This represents the value of the m-th pixel in the preprocessed image of the h-th single-unit connected component. This represents the coordinates of the m-th pixel in the h-th single-unit connected component; This represents the second smallest positive number, used to avoid a denominator of 0. For example, .
[0115] In the formula, These constitute the weighting factors, and the numerator term Represents the coordinate moments of a pixel within a single connected domain; denominator term This represents the total weight normalization factor; The weighted geometric centroid of the brightness within the h-th single-unit connected domain was calculated. It abandons the unstable soft-edge geometric center and instead points to the flattest solid centroid system.
[0116] The rigid core grasping coordinates of each individual unit's connected domain are converted into robot base coordinate system data and sent to the actuator to complete the packaging and positioning of each instant noodle unit.
[0117] It should be noted that, as Figure 4 This is a coordinate map showing the coordinates of the two individual instant noodle units in the preprocessed image: Left (70, 96) and Right (328, 97), marked with circular areas.
[0118] At this point, the coordinates of the rigid core were obtained and the positioning was completed.
[0119] This invention also discloses a machine vision-based instant noodle packing and positioning system, including a processor and a memory. The memory stores computer program instructions, and when the computer program instructions are executed by the processor, a machine vision-based instant noodle packing and positioning method according to this invention is implemented.
[0120] The system also includes other components well known to those skilled in the art, such as communication buses and communication interfaces, the settings and functions of which are known in the art and will not be described in detail here.
[0121] While this specification has shown and described numerous embodiments of the invention, it will be apparent to those skilled in the art that such embodiments are provided by way of example only. Many modifications, alterations, and alternatives will occur to those skilled in the art without departing from the spirit and essence of the invention. It should be understood that various alternatives to the embodiments of the invention described herein may be employed in the practice of this invention.
Claims
1. A machine vision-based method for positioning instant noodles in packaging, characterized in that, include: The original image of the instant noodle delivery process is obtained, and the original image is processed by low-pass and high-pass filtering to extract the illumination component and texture component. Normalization and frequency domain transformation are performed on the illumination and texture components to obtain the preprocessed image and local texture frequency map. Based on the texture direction features calculated using local gradients in the preprocessed image, the texture disorder factor is calculated. , ; The first eigenvalue of the structure tensor of the i-th pixel is represented. The second eigenvalue represents the structure tensor of the i-th pixel. Indicates the absolute value symbol; Represents the first infinitesimal positive number; calculate the serration overlap factor based on the packaging machine cutter parameters and local texture frequency map. , ; This represents the local texture frequency of the i-th pixel in the preprocessed image; This indicates the standard saw tooth frequency of the cutting blade in an instant noodle packaging machine. Indicates the tolerance range; Represents the natural exponential function; The product of the texture disorder factor and the aliasing overlap factor is recorded as the aliasing interference index of the corresponding pixel, thus locking in potential adhesion points. Obtaining a local texture frequency map includes: performing a local sliding window Fourier transform on the texture components to obtain the local power spectrum, calculating the energy-weighted average frequency of the local power spectrum, denoted as the local texture frequency of the center pixel of the corresponding local sliding window, and constructing a local texture frequency map by arranging the local texture frequencies of all pixels in the order of pixel coordinates. Based on the ratio of pixel grayscale values to the brightness of the dough and the seal in the preprocessed image, calculate the grayscale peak factor of any pixel; based on the normalized distance difference between the pixel and the geometric center of the adjacent dough, calculate the geometric offset factor of any pixel. , ; This represents the x-coordinate of the i-th pixel in the preprocessed image; The abscissa of the centroid of the connected region of the potential adhesion point is represented by the arithmetic mean of the abscissas of all the pixels of the potential adhesion point. The geometric constraint tolerance is represented as one-quarter of the standard pixel width of the instant noodle cake. The comprehensive segmentation weight index is obtained by combining the grayscale peak factor and the geometric offset factor, and the minimum weight path is searched as the optimal segmentation line. The erosion radius is determined according to the physical size difference between the packaging bag and the noodle cake entity. The segmented single connected components are processed using a morphological erosion algorithm, and the rigid mask value of the pixel is marked. Based on the rigid mask values and the pixel grayscale values of the preprocessed image, the coordinates of the rigid core are obtained. , ; This represents the number of pixels in the h-th single-unit connected component; This represents the rigid mask value of the m-th pixel in the h-th single-unit connected domain; This represents the value of the m-th pixel in the preprocessed image of the h-th single-unit connected component. This represents the coordinates of the m-th pixel in the h-th single-unit connected component; This represents the second smallest positive number, completing the packing and positioning.
2. The instant noodle packaging and positioning method based on machine vision according to claim 1, characterized in that, The acquisition of the standard saw tooth frequency of the instant noodle packaging machine cutter includes: Obtain the physical tooth pitch of the packaging machine cutter and the imaging resolution of the camera; The reciprocal of the product of the physical tooth pitch and the imaging resolution is denoted as the standard saw tooth frequency of the instant noodle packaging machine cutter.
3. The instant noodle packaging and positioning method based on machine vision according to claim 1, characterized in that, Obtaining the tolerance range includes: During the production line debugging phase, the standard deviation of the local texture frequency map of normal single instant noodles is collected and recorded as the unit tolerance standard deviation; twice the unit tolerance standard deviation is recorded as the tolerance range.
4. The instant noodle packaging and positioning method based on machine vision according to claim 1, characterized in that, The acquisition of the grayscale peak factor includes: The average gray value of the top 10% of pixels in the illumination component is recorded as the average brightness of the center of the pancake; the average gray value of the bottom 10% to 20% of pixels in the illumination component is recorded as the average brightness of the sealed area; the natural logarithm of the ratio of the average brightness of the center of the pancake to the average brightness of the sealed area is recorded as the gray sensitivity coefficient of the preprocessed image. The gray-level peak factor is equal to the power of the gray-level sensitivity coefficient, with the value of the pixel in the preprocessed image as the base.
5. A machine vision-based instant noodle packaging and positioning system, characterized in that, include: A processor and a memory, the memory storing computer program instructions that, when executed by the processor, implement a machine vision-based instant noodle packing and positioning method according to any one of claims 1-4.