A dynamic weighing and visual inspection system for seabuckthorn juice filling production line
By using a dynamic weighing and visual inspection system on the sea buckthorn juice bottling production line, combining grayscale values, gradient values, and chain code values, the system screens and analyzes impurity areas in the sea buckthorn juice, solving the problem of insufficient detection accuracy in existing technologies and achieving high-precision impurity detection.
Patent Information
- Application Number
- CN202510977738.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-16
- Publication Date
- 2026-03-03
- Estimated Expiration
- 2045-07-16
AI Technical Summary
In existing technologies, the detection of impurities in sea buckthorn juice based on differences in grayscale values is prone to misjudgment, resulting in poor detection accuracy.
A dynamic weighing and visual inspection system for the sea buckthorn juice bottling production line is adopted. By acquiring back images and weight detection data of the sea buckthorn juice during the conveying process, suspected impurity areas are screened. By combining grayscale values, gradient values, and chain code values, the morphological movement matching degree of the suspected impurity areas is determined, and the impurity movement pattern is analyzed. Finally, the target impurity areas are screened out for grade detection.
The accuracy of impurity detection in sea buckthorn juice has been improved. By comprehensively considering the morphological movement matching degree of impurity regions based on multiple features, high-precision impurity detection of bottled sea buckthorn juice has been achieved.
Smart Images

Figure CN120876403B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image analysis technology, specifically to a dynamic weighing and visual inspection system for a sea buckthorn juice bottling production line. Background Technology
[0002] With the development of technology, image processing technology is being applied more and more widely. For example, it can be used to detect impurities in sea buckthorn juice after it has been filled on a sea buckthorn juice bottling production line. Currently, the common method for impurity detection is based on differences in grayscale values.
[0003] However, when detecting impurities in bottled sea buckthorn juice based on different grayscale values, the following technical problems often arise:
[0004] Since the grayscale difference between some impurities in sea buckthorn juice and the juice itself is often small—for example, the grayscale difference between the peel impurities and the juice itself is often small—if only the difference in grayscale value is considered when detecting impurities in the bottled sea buckthorn juice, it may lead to misjudgment of impurity pixels, resulting in poor accuracy in detecting impurities in the bottled sea buckthorn juice. Summary of the Invention
[0005] To address the technical problem of poor accuracy in impurity detection of finished sea buckthorn juice, this invention proposes a dynamic weighing and visual inspection system for a sea buckthorn juice bottling production line.
[0006] In a first aspect, the present invention provides a dynamic weighing and visual inspection system for a sea buckthorn juice bottling production line, the system comprising:
[0007] The screening module is used to acquire back images and weight detection data of the sea buckthorn juice to be tested at each preset position during the transmission process, and to screen out suspected impurity areas from each back image, wherein the front of the sea buckthorn juice to be tested is directly illuminated by light.
[0008] The matching degree determination module is used to determine the morphological movement matching degree between different suspected impurity regions based on the position of different suspected impurity regions in adjacent back images and the gray value, gradient value and chain code value of the pixels within them.
[0009] The region filtering module is used to filter out suspected impurity regions that represent the same object from all back images based on the morphological movement matching degree between different suspected impurity regions in all adjacent back images, thus forming a suspected impurity region sequence.
[0010] The analysis and processing module is used to analyze the impurity movement pattern of each suspected impurity region sequence and obtain the impurity movement characteristic index corresponding to each suspected impurity region sequence.
[0011] The region sequence screening module is used to screen out the target impurity region sequence from all suspected impurity region sequences based on all impurity movement characteristic indicators.
[0012] The impurity level detection module is used to perform impurity level detection on the sea buckthorn juice to be tested based on all target impurity region sequences and all weight detection data.
[0013] In conjunction with the first aspect above, in one possible implementation, the step of filtering out suspected impurity regions from each backside image includes:
[0014] The liquid region in each back image was identified using a semantic segmentation algorithm;
[0015] The Canny operator is used to perform edge detection on the liquid region in each back image, and morphological closing operation is used to fill in the detected edges. Each closed region formed by the filled edges is determined as a candidate region.
[0016] The degree of conformity of the impurity features corresponding to each candidate region is determined based on the gray value, gradient value and chain code value of each pixel in each candidate region in each back image;
[0017] If the impurity feature conformity of the candidate region is greater than the preset conformity threshold, then the candidate region is identified as a suspected impurity region.
[0018] In conjunction with the first aspect above, in one possible implementation, determining the impurity feature conformity of each candidate region based on the grayscale value, gradient value, and chain code value corresponding to pixels within each candidate region in each backside image includes:
[0019] The mean of the gray values of all pixels in each candidate region is determined as the gray representative factor for each candidate region.
[0020] The minimum gradient value among all pixels in each candidate region is determined as the minimum gradient factor for each candidate region.
[0021] The chain code values corresponding to all edge pixels of each candidate region are used to form the chain code value sequence for each candidate region.
[0022] The absolute value of the difference between every two adjacent chain code values in the chain code value sequence corresponding to each candidate region is determined as the chain code difference, thus obtaining the chain code difference sequence corresponding to each candidate region;
[0023] The mean of all chain code differences in the chain code difference sequence corresponding to each candidate region is used to determine the chain code representative difference for each candidate region.
[0024] Based on the gray-level representative factor, the minimum gradient factor, and the chain code representative difference corresponding to each candidate region, the impurity feature conformity degree corresponding to each candidate region is determined. Among them, the gray-level representative factor is negatively correlated with the impurity feature conformity degree, while the minimum gradient factor and the chain code representative difference are both positively correlated with the impurity feature conformity degree.
[0025] In conjunction with the first aspect above, in one possible implementation, determining the morphological movement matching degree between different suspected impurity regions based on the positions of different suspected impurity regions in adjacent back images and the grayscale values, gradient values, and chain code values corresponding to their pixels includes:
[0026] Based on the center point position of different suspected impurity regions in adjacent back images and the degree of conformity of impurity features corresponding to different suspected impurity regions, the morphological matching index between different suspected impurity regions in adjacent back images is determined.
[0027] Based on the morphological matching index between different suspected impurity regions in adjacent back images, the morphological movement matching degree between different suspected impurity regions in adjacent back images is determined.
[0028] In conjunction with the first aspect above, in one possible implementation, determining the morphological matching index between different suspected impurity regions in adjacent back images based on the center point positions of different suspected impurity regions in adjacent back images and the impurity feature conformity corresponding to the different suspected impurity regions includes:
[0029] Any two adjacent back images are respectively designated as the first back image and the second back image. The center point of the liquid region in the first back image is designated as the first liquid center point, and the center point of the liquid region in the second back image is designated as the second liquid center point.
[0030] Any suspected impurity area in the first back image is identified as the first marked area, and the center point of the first marked area is identified as the first marked center point.
[0031] Any suspected impurity area in the second back image is identified as the second marked area, and the center point of the second marked area is identified as the center point of the second mark.
[0032] A first vector is constructed based on the first liquid center point and the first marker center point, and a second vector is constructed based on the second liquid center point and the second marker center point;
[0033] If the first liquid center point coincides with the first marker center point, or the second liquid center point coincides with the second marker center point, then the positional similarity between the first marker region and the second marker region is determined based on the difference between the magnitude of the first vector and the magnitude of the second vector.
[0034] If the first liquid center point does not coincide with the first mark center point, and the second liquid center point does not coincide with the second mark center point, then the positional similarity between the first mark region and the second mark region is determined based on the difference between the magnitude of the first vector and the magnitude of the second vector, and the angle between the direction of the first vector and the direction of the second vector.
[0035] Based on the positional similarity and area difference between the first and second marked regions, and the difference between the impurity feature conformity of the first and second marked regions, the morphological matching index between the first and second marked regions is determined.
[0036] In conjunction with the first aspect above, in one possible implementation, determining the morphological movement matching degree between different suspected impurity regions in adjacent back images based on the morphological matching index between different suspected impurity regions in adjacent back images includes:
[0037] Any two adjacent back images are respectively designated as the first back image and the second back image. Any suspected impurity region in the first back image is designated as the first marked region, and any suspected impurity region in the second back image is designated as the second marked region.
[0038] If the first back image and the second back image constitute the first group of adjacent back images, then the morphological matching index between the first marked region and the second marked region is determined as the morphological movement matching degree between the first marked region and the second marked region.
[0039] If the adjacent back images formed by the first back image and the second back image are not the first group of adjacent back images, then the morphological movement matching degree between the first marker region and the second marker region is determined according to the morphological matching index between the first marker region and the second marker region, and the morphological movement matching degree between the first back image and different suspected impurity regions in the previous back images.
[0040] In conjunction with the first aspect above, in one possible implementation, determining the morphological movement matching degree between the first and second marked regions based on the morphological matching index between the first and second marked regions, and the morphological movement matching degree between different suspected impurity regions in the first back image and its preceding back images, includes:
[0041] From the previous back image of the first back image, select the suspected impurity region with the highest morphological movement matching degree with the first marked region, and use it as the first matching region corresponding to the first marked region. The first matching region corresponding to the first marked region is the same as the object represented by the first marked region.
[0042] If the back image to which the first matching region corresponding to the first marked region belongs is not the first back image, then the suspected impurity region with the highest morphological movement matching degree with the first matching region is selected from the back image preceding the back image to which the first matching region belongs, and is used as the second matching region corresponding to the first marked region. This process is repeated to obtain all matching regions corresponding to the first marked region.
[0043] The first marked region and all its corresponding matching regions are used to form a reference region sequence corresponding to the first marked region.
[0044] Pixels that are at the same center point position as the first marked area are selected from the second back image and used as reference pixels;
[0045] Based on the center point of the second marked region and the reference pixel, a target displacement vector is constructed between the first marked region and the second marked region. Similarly, a target displacement vector is constructed between each adjacent suspected impurity region in the reference region sequence.
[0046] The sum of the target displacement vectors between all adjacent suspected impurity regions in the reference region sequence corresponding to the first marked region is determined as the historical overall vector corresponding to the first marked region.
[0047] The target displacement vector between the first marked region and the second marked region is determined as the current local vector corresponding to the first marked region;
[0048] Based on the morphological matching index between the first and second marked regions, and the angle between the direction of the historical overall vector corresponding to the first marked region and the direction of the current local vector, the morphological movement matching degree between the first and second marked regions is determined.
[0049] In conjunction with the first aspect above, in one possible implementation, the step of performing impurity movement pattern analysis on each suspected impurity region sequence to obtain impurity movement characteristic indicators corresponding to each suspected impurity region sequence includes:
[0050] Any suspected impurity region sequence is determined as a temporary sequence, and the target displacement vectors between all adjacent suspected impurity regions in the temporary sequence are used to form the target displacement vector sequence corresponding to the temporary sequence.
[0051] The normalized value of the cosine of the angle between the direction of each target displacement vector in the target displacement vector sequence and the vertical downward direction is determined as the vertical similarity, thus obtaining the vertical similarity sequence corresponding to the temporary sequence;
[0052] Based on the vertical similarity sequence, the morphological matching index and vertical distance between all adjacent suspected impurity regions in the temporary sequence, and the number of region groups formed by adjacent suspected impurity regions in the temporary sequence whose morphological matching index is greater than a preset matching threshold, the impurity movement feature index corresponding to the temporary sequence is determined.
[0053] In conjunction with the first aspect above, in one possible implementation, the step of filtering out the target impurity region sequence from all suspected impurity region sequences based on all impurity movement characteristic indicators includes:
[0054] If the impurity movement characteristic index corresponding to the suspected impurity region sequence is greater than the pre-defined impurity characteristic threshold, then the suspected impurity region sequence is determined as the target impurity region sequence.
[0055] In conjunction with the first aspect above, in one possible implementation, the impurity level detection of the sea buckthorn juice to be tested, based on all target impurity region sequences and all weight detection data, includes:
[0056] The average area of all target impurity regions in each target impurity region sequence is used as the area representative index for each target impurity region sequence.
[0057] The overall severity of impurities is determined based on the cumulative value of all area-representative indicators, the number of target impurity region sequences, and the difference between the pre-acquired standard weight data and the weight detection data.
[0058] Based on the overall severity of impurities, the impurity level of the sea buckthorn juice to be tested is determined.
[0059] Secondly, this invention provides a dynamic weighing and visual inspection method for a sea buckthorn juice bottling production line, implemented by a dynamic weighing and visual inspection system. The method includes:
[0060] The back images and weight detection data of the sea buckthorn juice to be tested at each preset position during the transmission process are obtained, and suspected impurity areas are screened out from each back image. The front of the sea buckthorn juice to be tested is directly illuminated by light.
[0061] Based on the location of different suspected impurity regions in adjacent back images and the grayscale value, gradient value and chain code value of the pixels within them, the morphological movement matching degree between different suspected impurity regions is determined.
[0062] Based on the morphological movement matching degree between different suspected impurity regions in all adjacent back images, suspected impurity regions representing the same object are screened out from all back images to form a suspected impurity region sequence.
[0063] Each suspected impurity region sequence was analyzed for impurity movement patterns to obtain the impurity movement characteristic index corresponding to each suspected impurity region sequence.
[0064] Based on all impurity movement characteristic indicators, the target impurity region sequence is selected from all suspected impurity region sequences;
[0065] Based on all target impurity region sequences and all weight detection data, the impurity level of the sea buckthorn juice to be tested was determined.
[0066] Thirdly, a server is provided, including a memory and a processor. The memory is used to store executable program code, and the processor is used to call and run the executable program code from the memory, so that the device executes the aforementioned dynamic weighing and visual inspection method for a sea buckthorn juice bottling production line.
[0067] Fourthly, a computer program product is provided, comprising: computer program code, which, when run on a computer, causes the computer to execute the aforementioned dynamic weighing and visual inspection method for a sea buckthorn juice bottling production line.
[0068] Fifthly, a computer-readable storage medium is provided, which stores computer program code that, when executed on a computer, causes the computer to perform the aforementioned dynamic weighing and visual inspection method for a sea buckthorn juice bottling production line.
[0069] The present invention has the following beneficial effects:
[0070] This invention discloses a dynamic weighing and visual inspection system for a sea buckthorn juice bottling production line. By analyzing back images and weight detection data, it achieves impurity detection in sea buckthorn juice, solving the technical problem of poor accuracy in impurity detection of finished sea buckthorn juice and improving the accuracy of impurity detection in finished sea buckthorn juice. Specifically, when detecting impurities in finished sea buckthorn juice, this invention comprehensively considers multiple impurity-related features, such as the positions of different suspected impurity regions in adjacent back images and the grayscale values, gradient values, and chain code values of the pixels within them. This quantifies the morphological movement matching degree between different suspected impurity regions, performs impurity movement pattern analysis, and then filters out a sequence of target impurity regions that characterize impurities. Finally, based on all target impurity region sequences and all weight detection data, it achieves impurity level detection of the sea buckthorn juice to be inspected, and improves the accuracy of impurity detection in sea buckthorn juice to a certain extent. Attached Figure Description
[0071] To more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0072] Figure 1 This is a schematic diagram of the dynamic weighing and visual inspection system for a seabuckthorn juice filling production line according to the present invention;
[0073] Figure 2 This is a flowchart of a dynamic weighing and visual inspection method for a sea buckthorn juice filling production line according to the present invention;
[0074] Figure 3 This is a schematic diagram of the structure of a computer device according to the present invention. Detailed Implementation
[0075] To further illustrate the technical means and effects adopted by the present invention to achieve its intended purpose, the specific implementation methods, structures, features, and effects of the technical solution proposed according to the present invention are described in detail below with reference to the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. Furthermore, specific features, structures, or characteristics in one or more embodiments can be combined in any suitable form.
[0076] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.
[0077] refer to Figure 1 This diagram illustrates a dynamic weighing and visual inspection system for a sea buckthorn juice bottling production line according to the present invention. The dynamic weighing and visual inspection system for the sea buckthorn juice bottling production line includes:
[0078] The acquisition and screening module 101 is used to acquire the back image and weight detection data of the sea buckthorn juice to be tested at each preset position during the transmission process, and to screen out the suspected impurity area from each back image.
[0079] The sea buckthorn juice to be tested can be sea buckthorn juice that has been filled and is presented in canned form, also known as canned sea buckthorn juice. In practice, on a sea buckthorn juice bottling production line, the filled canned sea buckthorn juice can be relatively smoothly conveyed to a designated position via a conveyor belt, and during the conveying process, impurities in the canned sea buckthorn juice often gradually settle down. Therefore, the back images of the sea buckthorn juice to be tested at different positions during the conveying process can, to some extent, characterize the movement of the objects inside the can of the sea buckthorn juice to be tested. The preset position can be a position pre-set on the conveyor belt. The distance between adjacent preset positions can be the same. For example, the conveyor belt can be divided into ten equal parts, and the position of each division point can be recorded as the preset position. The front of the sea buckthorn juice to be tested can be directly illuminated by light. In practice, one side of the canned sea buckthorn juice conveyed on the conveyor belt is often directly illuminated by light. In this embodiment of the invention, the side of the canned sea buckthorn juice directly illuminated by light can be called the front of the canned sea buckthorn juice, and the other side can be called the back of the canned sea buckthorn juice. The back image at the preset location can be a grayscale image of the back of the sea buckthorn juice to be tested, collected when the bottled sea buckthorn juice is transported to the preset location. The weight detection data at the preset location can be the weight of the bottled sea buckthorn juice to be tested, collected when the bottled sea buckthorn juice is transported to the preset location.
[0080] It should be noted that under backlighting conditions, light passing through sea buckthorn juice is typically captured by the camera. The light has high transmittance in the juice, resulting in higher brightness and corresponding higher grayscale values in the image. Conversely, when light passes through impurities, it is absorbed or scattered, leading to lower brightness and corresponding lower grayscale values. Therefore, in images of the back of a bottle of sea buckthorn juice under backlighting, the grayscale value of the juice is typically higher, while the grayscale value of impurities is typically lower. These impurities in sea buckthorn juice usually include fruit pits, peels, insects, and metals.
[0081] As an example, obtaining the filtering module 101 can be achieved by implementing the following steps:
[0082] The first step is to acquire back images of the sea buckthorn juice to be tested at each preset position during the transmission process.
[0083] For example, when the sea buckthorn juice to be tested is conveyed to a preset position, an image of the back of the sea buckthorn juice to be tested can be captured by a camera, and the image can be converted to grayscale. The grayscale image is recorded as the back image at the preset position.
[0084] The second step is to obtain the weight detection data of the sea buckthorn juice to be tested at each preset position during the transmission process.
[0085] For example, when the sea buckthorn juice to be tested is transported to a preset position, the weight of the sea buckthorn juice to be tested can be collected by a weighing sensor and recorded as the weight detection data at that preset position.
[0086] The third step involves using a semantic segmentation algorithm to identify the liquid region in each back image.
[0087] The liquid area in the reverse image can represent the sea buckthorn juice inside the container.
[0088] The fourth step involves using the Canny operator to perform edge detection on the liquid region in each back image, and then using morphological closing operations to fill in the detected edges. Each closed region formed by the filled edges is then identified as a candidate region.
[0089] The fifth step is to determine the impurity feature conformance of each candidate region based on the grayscale value, gradient value, and chain code value of each pixel in each candidate region in each back image.
[0090] For example, determining the impurity feature conformity corresponding to each candidate region may include the following sub-steps:
[0091] The first sub-step is to determine the mean of the gray values of all pixels in each candidate region as the gray-level representative factor for each candidate region.
[0092] The second sub-step is to determine the minimum gradient value among all the gradient values corresponding to all pixels in each candidate region as the minimum gradient factor for each candidate region.
[0093] The third sub-step involves constructing a chain code value sequence for each candidate region by taking the chain code values corresponding to all edge pixels of each candidate region.
[0094] The chain code value corresponding to an edge pixel can be an eight-neighbor chain code value. The two edge pixels corresponding to two adjacent chain code values in the chain code value sequence are adjacent in position.
[0095] The fourth sub-step involves determining the absolute value of the difference between every two adjacent chain code values in the chain code value sequence corresponding to each candidate region as the chain code difference, thus obtaining the chain code difference sequence corresponding to each candidate region.
[0096] The fifth sub-step is to determine the mean of all chain code differences in the chain code difference sequence corresponding to each candidate region as the representative difference of the chain code for each candidate region.
[0097] The sixth sub-step is to determine the impurity feature conformity of each candidate region based on the gray-level representative factor, the gradient minimum factor, and the chain code representative difference corresponding to each candidate region.
[0098] Among them, the grayscale representative factor can be negatively correlated with the impurity feature conformity. The gradient minimum factor and the chain code representative difference can both be positively correlated with the impurity feature conformity.
[0099] For example, the formula for determining the conformity of impurity features corresponding to candidate regions can be:
[0100] ;in, It is the first a The degree of conformity of the impurity features corresponding to each candidate region. a It is the sequence number of the candidate region. It is a normalization function. It is the first a The minimum gradient factor corresponding to each candidate region. It is the first a The chaincode corresponding to each candidate region represents a difference. It is a natural exponential function. It is the first a The gray-level representative factor corresponding to each candidate region. h It is the first a The average grayscale value of all pixels within the liquid region to which each candidate region belongs.
[0101] It should be noted that when The smaller the size, the more likely it is to indicate the first a The smaller the relative gray level within the candidate region, the more likely it is to indicate that the first candidate region is the most suitable candidate region. a The more candidate regions there are, the more likely they are to be impurity regions. In reality, impurities are usually irregular in shape, but their edge contours are often relatively clear. When The larger the value, the more likely it is to indicate the first a The greater the fluctuation of the edge chain codes of each candidate region, the more likely it is to indicate that the first... a The more likely a candidate region is to be irregular. The larger the value, the more likely it is to indicate the first a The larger the gradient value of the candidate region, the more likely it is to indicate that the... a The edges of each candidate region are relatively clearer. Therefore, when The larger the value, the more likely it is to indicate the first... a The more the features of the candidate region match the impurity features, the more likely it is that the first candidate region... aThe more candidate regions there are, the more likely they are to be impurity regions.
[0102] Step 6: If the impurity feature conformity of the candidate region is greater than the preset conformity threshold, then the candidate region is determined as a suspected impurity region.
[0103] The preset compliance threshold can be a pre-set threshold, which is mainly used to filter out suspected impurity areas. For example, the preset compliance threshold can be 0.5.
[0104] The matching degree determination module 102 is used to determine the morphological movement matching degree between different suspected impurity regions based on the position of different suspected impurity regions in adjacent back images and the gray value, gradient value and chain code value of the pixels within them.
[0105] Among them, adjacent back images can be back images that are adjacent at the acquisition time, or back images that are adjacent at a preset position.
[0106] As an example, determining the morphological movement matching degree between different suspected impurity regions may include the following steps:
[0107] The first step is to determine the morphological matching index between different suspected impurity regions in adjacent back images based on the center point positions of different suspected impurity regions in adjacent back images and the degree of conformity of impurity features corresponding to different suspected impurity regions.
[0108] For example, determining the morphological matching index between different suspected impurity regions in adjacent back images may include the following sub-steps:
[0109] The first sub-step involves determining any two adjacent back images as the first back image and the second back image, respectively, and determining the center point of the liquid region in the first back image as the first liquid center point, and determining the center point of the liquid region in the second back image as the second liquid center point.
[0110] The second sub-step involves identifying any suspected impurity area in the first back image as the first marked area, and identifying the center point of the first marked area as the first marked center point.
[0111] The third sub-step involves identifying any suspected impurity area in the second back image as the second marked area, and identifying the center point of the second marked area as the center point of the second mark.
[0112] The fourth sub-step involves constructing a first vector based on the first liquid center point and the first marker center point, and constructing a second vector based on the second liquid center point and the second marker center point.
[0113] The magnitude of the first vector can be equal to the distance between the center point of the first liquid and the center point of the first mark. The direction of the first vector can be from the center point of the first liquid to the center point of the first mark. The magnitude of the second vector can be equal to the distance between the center point of the second liquid and the center point of the second mark. The direction of the second vector can be from the center point of the second liquid to the center point of the second mark. Both the first and second vectors can be located in an image coordinate system, which can be a coordinate system with the upper left corner of the back image as the origin, the horizontal direction as the x-axis, and the vertical direction as the y-axis.
[0114] In the fifth sub-step, if the first liquid center point coincides with the first marker center point, or the second liquid center point coincides with the second marker center point, then the formula for determining the positional similarity between the first marker region and the second marker region based on the difference between the magnitude of the first vector and the magnitude of the second vector can be:
[0115] ;
[0116] in, It is the positional similarity between the first and second labeled regions. It is a natural exponential function. It is an absolute value function. It is the magnitude of the first vector. It is the magnitude of the second vector.
[0117] It should be noted that when The smaller the value, the closer the distance between the object represented by the first marked area and the center point of the sea buckthorn juice is to the distance between the object represented by the second marked area and the center point of the sea buckthorn juice; this often indicates that the objects represented by the first and second marked areas are more likely to be located in the same position in the sea buckthorn juice.
[0118] The sixth sub-step involves determining the positional similarity between the first and second marked regions based on the difference between the magnitudes of the first and second vectors, and the angle between the directions of the first and second vectors. The formula for this similarity is as follows:
[0119] ;
[0120] in, It is the positional similarity between the first and second labeled regions. It is a normalization function. yes and The cosine of the angle between them. It is the direction of the first vector. It is the direction of the second vector. It is a natural exponential function. It is an absolute value function. It is the magnitude of the first vector. It is the magnitude of the second vector.
[0121] It should be noted that when A larger value generally indicates that the orientation of the object represented by the first marked region relative to the center point of the sea buckthorn juice is closer to the orientation of the object represented by the second marked region relative to the center point of the sea buckthorn juice; it also generally indicates that the objects represented by the first and second marked regions are more likely to be located in the same position within the sea buckthorn juice. Therefore, when The larger the value, the more likely the object represented by the first and second marked regions is to be located in the same position in the sea buckthorn juice.
[0122] The seventh sub-step involves determining the morphological matching index between the first and second marked regions based on the positional similarity and area difference between the first and second marked regions, as well as the difference between the impurity feature conformity of the first and second marked regions.
[0123] For example, the formula for determining the morphological matching index between the first and second marked regions can be:
[0124] ;
[0125] in, It is a morphological matching index between the first and second marked regions. It is a normalization function. It is the positional similarity between the first and second labeled regions. It is a natural exponential function. It is an absolute value function. It is the area of the first marked region. It is the area of the second marked region. It is the conformity of the impurity features corresponding to the first marked region. It is the degree of conformity of the impurity features corresponding to the second marked region.
[0126] It should be noted that during transport, impurities tend to settle slowly, so the position of the same impurity often changes little between adjacent images. Therefore, if impurities are present in the sea buckthorn juice being tested, the same impurity will often be located in similar positions in adjacent back images. Secondly, the morphology of impurities is often relatively stable and does not change significantly. For example, air bubbles in sea buckthorn juice may gradually shrink or disappear during transport, while impurities typically do not. Therefore, when... The larger the value, the more similar the positions of the objects represented by the first and second marked regions are, and the more similar the object area and impurity characteristics represented by the first and second marked regions are. To a certain extent, this can reduce the interference of bubbles, and it often indicates that the first and second marked regions are more likely to represent impurities, and more likely to represent the same impurity.
[0127] The second step, determining the morphological movement matching degree between different suspected impurity regions in adjacent back images based on the morphological matching index, may include the following sub-steps:
[0128] The first sub-step involves determining any two adjacent back images as the first back image and the second back image, respectively, and determining any suspected impurity region in the first back image as the first marked region, and determining any suspected impurity region in the second back image as the second marked region.
[0129] In the second sub-step, if the first back image and the second back image constitute a first group of adjacent back images, then the morphological matching index between the first marked region and the second marked region is determined as the morphological movement matching degree between the first marked region and the second marked region.
[0130] The first set of adjacent back images may include a first back image and a second back image. If the first back image and the second back image constitute the first set of adjacent back images, it means that the first back image and the second back image are respectively the first back image and the second back image. The first back image may be the earliest acquired back image, and the second back image may be the second earliest acquired back image.
[0131] The third sub-step, if the adjacent back image formed by the first back image and the second back image is not the first group of adjacent back images, then determining the morphological movement matching degree between the first marked region and the second marked region based on the morphological matching index between the first marked region and the second marked region, and the morphological movement matching degree between the first back image and different suspected impurity regions in its previous back images, may include the following steps:
[0132] First, from the previous back image of the first back image, the suspected impurity region with the highest morphological movement matching degree with the first marked region is selected as the first matching region corresponding to the first marked region.
[0133] The first matching region corresponding to the first marked region can be the same as the object represented by the first marked region. The acquisition time of the back image can be later than the acquisition time of the previous back image.
[0134] Next, if the back image to which the first matching region corresponding to the first marked region belongs is not the first back image, then the suspected impurity region with the largest morphological movement matching degree with the first matching region is selected from the back image preceding the back image to which the first matching region belongs, and is used as the second matching region corresponding to the first marked region. This process is repeated to obtain all matching regions corresponding to the first marked region.
[0135] For example, if the back image to which the second matching region belongs is not the first back image, then the suspected impurity region with the highest morphological movement matching degree with the second matching region can be selected from the back image preceding the back image to which the second matching region belongs, and used as the third matching region.
[0136] Then, the first marked region and all its corresponding matching regions are combined to form a reference region sequence corresponding to the first marked region.
[0137] It should be noted that the earlier a suspected impurity region appears in the reference region sequence, the earlier its corresponding sampling time.
[0138] Next, pixels that are at the same position as the center point of the first marked area are selected from the second back image and used as reference pixels.
[0139] Continuing, based on the center point of the second marked region and the reference pixel, a target displacement vector is constructed between the first marked region and the second marked region. Similarly, a target displacement vector is constructed between each adjacent suspected impurity region in the reference region sequence.
[0140] Specifically, the magnitude of the target displacement vector between the first and second marked regions can be equal to the distance between the center point of the second marked region and the reference pixel. The direction of the target displacement vector between the first and second marked regions can be the direction from the reference pixel to the center point of the second marked region. The target displacement vector between the first and second marked regions can characterize the displacement between them. Similarly, the target displacement vector between adjacent suspected impurity regions in the reference region sequence can characterize the displacement between adjacent suspected impurity regions.
[0141] Furthermore, the sum of the target displacement vectors between all adjacent suspected impurity regions in the reference region sequence corresponding to the first marked region is determined as the historical overall vector corresponding to the first marked region.
[0142] Subsequently, the target displacement vector between the first marked region and the second marked region is determined as the current local vector corresponding to the first marked region.
[0143] Finally, based on the morphological matching index between the first and second marked regions, and the angle between the direction of the historical overall vector corresponding to the first marked region and the direction of the current local vector, the formula for determining the morphological movement matching degree between the first and second marked regions can be:
[0144] ;
[0145] in, U It is the morphological movement matching degree between the first and second marked regions. It is a normalization function. It is a morphological matching index between the first and second marked regions. yes and The cosine of the angle between them. It is the direction of the current local vector corresponding to the first marked region. It is the direction of the historical overall vector corresponding to the first marked region.
[0146] It should be noted that when A larger value generally indicates that the first and second marked regions are more likely to represent impurities, and more likely to represent the same impurity. In reality, impurities often gradually precipitate during transport; therefore, the movement trend of the same impurity at a given moment during transport is often similar to its movement trend at historical moments. It can characterize the motion trend of the object represented by the first marked area during the time period between the acquisition time corresponding to the first marked area and the acquisition time corresponding to the second marked area. It can characterize the historical motion trend of the object represented by the first marked region before the acquisition time corresponding to the first marked region. When The larger the value, the more similar the motion trend of the object represented by the first marked region is to its motion trend over historical time. Therefore, when U The larger the value, the more likely the first and second marked regions are to represent impurities, and more likely they are to represent the same impurity.
[0147] The region filtering module 103 is used to filter out suspected impurity regions representing the same object from all back images based on the morphological movement matching degree between different suspected impurity regions in all adjacent back images, thus forming a suspected impurity region sequence.
[0148] As an example, the region filtering module 103 can specifically implement the following steps:
[0149] The first step is to identify the rear image with the latest acquisition time from all the rear images as the current rear image.
[0150] The second step is to determine each suspected impurity region in the current back image as the current region, and to determine the reference region sequence corresponding to each current region as the suspected impurity region sequence.
[0151] The analysis and processing module 104 is used to perform impurity movement pattern analysis on each suspected impurity region sequence to obtain the impurity movement characteristic index corresponding to each suspected impurity region sequence.
[0152] As an example, determining the impurity movement characteristic index corresponding to each suspected impurity region sequence may include the following steps:
[0153] The first step is to determine any suspected impurity region sequence as a temporary sequence, and to construct the target displacement vector sequence corresponding to the temporary sequence by taking the target displacement vectors between all adjacent suspected impurity regions in the temporary sequence.
[0154] The second step is to determine the normalized value of the cosine of the angle between the direction of each target displacement vector in the above target displacement vector sequence and the vertical downward direction as the vertical similarity, thus obtaining the vertical similarity sequence corresponding to the above temporary sequence.
[0155] The third step is to determine the impurity movement feature index corresponding to the above temporary sequence based on the above vertical similarity sequence, the morphological matching index and vertical distance between all adjacent suspected impurity regions in the above temporary sequence, and the number of region groups formed by adjacent suspected impurity regions in the above temporary sequence whose morphological matching index is greater than the preset matching threshold.
[0156] The vertical distance between two suspected impurity regions can be obtained by determining the absolute value of the difference between the ordinates of the center points of these two suspected impurity regions. The preset matching threshold can be a pre-set threshold, such as 0.6. A region group can consist of two adjacent suspected impurity regions. For example, the first and second suspected impurity regions in a temporary sequence can form a region group, and the second and third suspected impurity regions can form another region group, and so on, resulting in multiple region groups. A region group consisting of adjacent suspected impurity regions in a temporary sequence whose morphological matching index is greater than the preset matching threshold is, in other words, a region group in which the morphological matching index between two suspected impurity regions in the temporary sequence is greater than the preset matching threshold.
[0157] For example, the formula for determining the impurity shift characteristic index corresponding to a temporary sequence can be:
[0158] ;
[0159] in, v It is an indicator of impurity movement characteristics corresponding to temporary sequences. JE It is the mean of all vertical similarities in the vertical similarity sequence. It is the standard deviation of all vertical similarities in the vertical similarity sequence. It is the mean of the morphological matching index among all adjacent suspected impurity regions in the temporary sequence. n It is the number of adjacent suspected impurity regions in a temporary sequence whose morphological matching index is greater than a preset matching threshold. N It is the total number of region groups formed by adjacent suspected impurity regions in the temporary sequence. L It is the sum of the vertical distances between all adjacent suspected impurity regions in the temporary sequence.
[0160] It should be noted that in practice, sea buckthorn juice is often bottled at low temperatures, and it often contains pulp and air bubbles. During transport, the air bubbles tend to rise to the surface and may shrink or disappear. Since the juice is usually extracted from the pulp, the pulp's density is often close to that of the juice; therefore, the pulp tends to remain suspended in the juice during low-temperature bottling. Impurities, on the other hand, tend to sink during transport due to their stable shape and higher density, and their travel distance is often greater than that of the pulp. JE The larger the value, the closer the direction of motion of the object represented by the temporary sequence is to the vertically downward direction. The smaller the value, the more stable the motion direction of the object represented by the temporary sequence is at different times. When A larger value generally indicates that the region in the temporary sequence is more likely to represent the same impurity. When The smaller the value, the more likely it is that the morphology of the object represented by different regions in the temporary sequence will change significantly. L A larger value generally indicates a greater vertical distance traveled by the object represented by the temporary sequence. Therefore, when v The larger the value, the more likely the object represented by the temporary sequence is to be an impurity.
[0161] The region sequence screening module 105 is used to screen out the target impurity region sequence from all suspected impurity region sequences based on all impurity movement characteristic indicators.
[0162] As an example, if the impurity movement characteristic index corresponding to a suspected impurity region sequence is greater than a pre-set impurity characteristic threshold, then the suspected impurity region sequence can be identified as the target impurity region sequence. The pre-set impurity characteristic threshold can be a pre-defined maximum impurity movement characteristic index allowed when a region sequence is considered not to be an impurity region sequence; it can be 0.7.
[0163] The impurity level detection module 106 is used to perform impurity level detection on the sea buckthorn juice to be tested based on the sequence of all target impurity regions and all weight detection data.
[0164] As an example, the impurity level testing of bottled sea buckthorn juice may include the following steps:
[0165] The first step is to determine the average area of all target impurity regions in each target impurity region sequence as the area representative index corresponding to each target impurity region sequence.
[0166] The second step is to determine the overall severity of impurities based on the cumulative values of all area-representative indicators, the number of target impurity region sequences, and the difference between the pre-acquired standard weight data and the weight detection data.
[0167] The standard weight data represents the weight of normally bottled sea buckthorn juice. Normally bottled sea buckthorn juice refers to sea buckthorn juice that meets production requirements.
[0168] For example, the formula for determining the overall severity of impurities can be:
[0169] ;
[0170] ;
[0171] in, Q It refers to the overall severity of impurities. It is a normalization function. It is the cumulative value of all area-representing indicators. It is the average area of the liquid region in all back images. q It represents the number of target impurity region sequences. Characterizes the difference between the weight of the tested bottled sea buckthorn juice and the weight of the normally bottled sea buckthorn juice. H It refers to the number of preset positions of the sea buckthorn juice to be tested during the conveying process. i It is the sequence number of the preset position of the sea buckthorn juice to be tested during the transportation process. It is an absolute value function. It is the first i Weight detection data of the sea buckthorn juice to be tested were collected at several preset locations. k It is a standard weight data characterizing the weight of normally bottled sea buckthorn juice.
[0172] It should be noted that when A larger value usually indicates that the weight of the sea buckthorn juice being tested deviates more from the normal weight of bottled sea buckthorn juice, and often suggests the presence of impurities in the juice. q A larger value generally indicates a greater number of target impurity regions, suggesting a more severe impurity situation in the sea buckthorn juice being tested. A larger value generally indicates a larger area of the target impurity region sequence, and often suggests a more severe impurity situation in the sea buckthorn juice being tested. Therefore, when Q The larger the value, the more serious the impurities in the sea buckthorn juice being tested.
[0173] The third step, based on the overall severity of impurities described above, is to determine the impurity level of the sea buckthorn juice to be tested, which may include the following sub-steps:
[0174] In the first sub-step, if the overall impurity severity is less than or equal to the first preset severity threshold, the impurity level of the sea buckthorn juice to be tested is determined to be the highest impurity severity level, which often indicates that the impurity situation of the sea buckthorn juice to be tested is relatively serious at this time.
[0175] The first preset severity threshold can be a pre-set threshold, which can be 0.4.
[0176] In the second sub-step, if the overall severity of impurities is greater than the first preset severity threshold and less than or equal to the second preset severity threshold, then the impurity level of the sea buckthorn juice to be tested is determined to be medium, which often indicates that the severity of impurities in the sea buckthorn juice to be tested is at an intermediate level.
[0177] The second preset severity threshold can be a pre-set threshold, which can be greater than the first preset severity threshold, and can be 0.6.
[0178] In the third sub-step, if the overall severity of impurities is greater than the second preset severity threshold, the impurity level of the sea buckthorn juice to be tested is determined to be normal. This usually indicates that the sea buckthorn juice to be tested has no impurities or very few impurities, and the sea buckthorn juice to be tested usually meets the production standards.
[0179] refer to Figure 2 Based on the same inventive concept as the method embodiment of the dynamic weighing and visual inspection system for the seabuckthorn juice bottling production line described above, this invention provides a dynamic weighing and visual inspection method for a seabuckthorn juice bottling production line, comprising the following steps:
[0180] Step S1: Obtain the back image and weight detection data of the sea buckthorn juice to be tested at each preset position during the transmission process, and screen out the suspected impurity areas from each back image.
[0181] Step S2: Determine the morphological movement matching degree between different suspected impurity regions based on the positions of different suspected impurity regions in adjacent back images and the gray values, gradient values and chain code values of the pixels within them.
[0182] Step S3: Based on the morphological movement matching degree between different suspected impurity regions in all adjacent back images, suspected impurity regions representing the same object are selected from all back images to form a suspected impurity region sequence.
[0183] Step S4: Perform impurity movement pattern analysis on each suspected impurity region sequence to obtain the impurity movement characteristic index corresponding to each suspected impurity region sequence.
[0184] Step S5: Based on all impurity movement characteristic indicators, select the target impurity region sequence from all suspected impurity region sequences.
[0185] Step S6: Based on all target impurity region sequences and all weight detection data, perform impurity level detection on the sea buckthorn juice to be tested.
[0186] Figure 3 This is a schematic diagram of the structure of a computer device provided in an embodiment of the present invention. For example, as shown... Figure 3 As shown, the computer device 300 includes: a memory 301, a processor 302, and a computer program 303 stored in the memory 301 and running on the processor 302. When the processor 302 executes the computer program 303, the computer device can execute the aforementioned dynamic weighing and visual inspection method for a sea buckthorn juice filling production line.
[0187] Based on the same inventive concept as the above-described method embodiments, the present invention provides a server, including a memory and a processor. The memory is used to store executable program code, and the processor is used to call and run the executable program code from the memory, causing the device to execute the above-described dynamic weighing and visual inspection method for a sea buckthorn juice bottling production line.
[0188] Based on the same inventive concept as the above-described method embodiments, the present invention provides a computer program product comprising: computer program code, which, when run on a computer, causes the computer to execute the above-described dynamic weighing and visual inspection method for a sea buckthorn juice bottling production line.
[0189] Based on the same inventive concept as the above-described method embodiments, the present invention provides a computer-readable storage medium storing computer program code, which, when executed on a computer, causes the computer to perform the above-described dynamic weighing and visual inspection method for a sea buckthorn juice bottling production line.
[0190] In summary, when detecting impurities in filled sea buckthorn juice, this invention comprehensively considers multiple impurity-related features, such as the positions of different suspected impurity regions in adjacent back images and the grayscale values, gradient values, and chain code values of the pixels within them. This quantifies the morphological movement matching degree between different suspected impurity regions, performs impurity movement pattern analysis, and then filters out the target impurity region sequence that characterizes impurities. Finally, based on all target impurity region sequences and all weight detection data, the impurity level detection of the filled sea buckthorn juice is achieved, and the accuracy of impurity detection in sea buckthorn juice is improved to a certain extent.
[0191] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.
Claims
1. A dynamic weighing and visual inspection system for a sea buckthorn juice bottling production line, characterized in that, The system includes: The screening module is used to acquire back images and weight detection data of the sea buckthorn juice to be tested at each preset position during the transmission process, and to screen out suspected impurity areas from each back image, wherein the front of the sea buckthorn juice to be tested is directly illuminated by light. The matching degree determination module is used to determine the morphological movement matching degree between different suspected impurity regions based on the position of different suspected impurity regions in adjacent back images and the gray value, gradient value and chain code value of the pixels within them. The region filtering module is used to filter out suspected impurity regions that represent the same object from all back images based on the morphological movement matching degree between different suspected impurity regions in all adjacent back images, thus forming a suspected impurity region sequence. The analysis and processing module is used to analyze the impurity movement pattern of each suspected impurity region sequence and obtain the impurity movement characteristic index corresponding to each suspected impurity region sequence. The region sequence screening module is used to screen out the target impurity region sequence from all suspected impurity region sequences based on all impurity movement characteristic indicators. The impurity level detection module is used to detect the impurity level of the sea buckthorn juice to be tested based on the sequence of all target impurity regions and all weight detection data. The process of filtering out suspected impurity regions from each backside image includes: The liquid region in each back image is identified using a semantic segmentation algorithm. The Canny operator is used to perform edge detection on the liquid region in each back image, and morphological closing operations are used to fill in the detected edges. Each closed region formed by the filled edges is identified as a candidate region. The impurity feature conformance of each candidate region is determined based on the grayscale value, gradient value, and chain code value of the pixels within each candidate region in each back image. If the impurity feature conformance of a candidate region is greater than a preset conformance threshold, the candidate region is identified as a suspected impurity region. The step of determining the morphological movement matching degree between different suspected impurity regions based on the positions of different suspected impurity regions in adjacent back images and the grayscale values, gradient values, and chain code values of their corresponding pixels includes: Based on the center point positions of different suspected impurity regions in adjacent back images and the impurity feature conformity of different suspected impurity regions, the morphological matching index between different suspected impurity regions in adjacent back images is determined; based on the morphological matching index between different suspected impurity regions in adjacent back images, the morphological movement matching degree between different suspected impurity regions in adjacent back images is determined.
2. The dynamic weighing and visual inspection system for a sea buckthorn juice bottling production line according to claim 1, characterized in that, The step of determining the impurity feature conformance of each candidate region based on the grayscale value, gradient value, and chain code value of each pixel within each candidate region in each backside image includes: The mean of the gray values of all pixels in each candidate region is determined as the gray representative factor for each candidate region. The minimum gradient value among all pixels in each candidate region is determined as the minimum gradient factor for each candidate region. The chain code values corresponding to all edge pixels of each candidate region are used to form the chain code value sequence for each candidate region. The absolute value of the difference between every two adjacent chain code values in the chain code value sequence corresponding to each candidate region is determined as the chain code difference, thus obtaining the chain code difference sequence corresponding to each candidate region; The mean of all chain code differences in the chain code difference sequence corresponding to each candidate region is used to determine the chain code representative difference for each candidate region. Based on the gray-level representative factor, the minimum gradient factor, and the chain code representative difference corresponding to each candidate region, the impurity feature conformity degree corresponding to each candidate region is determined. Among them, the gray-level representative factor is negatively correlated with the impurity feature conformity degree, while the minimum gradient factor and the chain code representative difference are both positively correlated with the impurity feature conformity degree.
3. The dynamic weighing and visual inspection system for a sea buckthorn juice bottling production line according to claim 1, characterized in that, The step of determining the morphological matching index between different suspected impurity regions in adjacent back images based on the center point positions of different suspected impurity regions in adjacent back images and the impurity feature conformity of different suspected impurity regions includes: Any two adjacent back images are respectively designated as the first back image and the second back image. The center point of the liquid region in the first back image is designated as the first liquid center point, and the center point of the liquid region in the second back image is designated as the second liquid center point. Any suspected impurity area in the first back image is identified as the first marked area, and the center point of the first marked area is identified as the first marked center point. Any suspected impurity area in the second back image is identified as the second marked area, and the center point of the second marked area is identified as the center point of the second mark. A first vector is constructed based on the first liquid center point and the first marker center point, and a second vector is constructed based on the second liquid center point and the second marker center point; If the first liquid center point coincides with the first marker center point, or the second liquid center point coincides with the second marker center point, then the positional similarity between the first marker region and the second marker region is determined based on the difference between the magnitude of the first vector and the magnitude of the second vector. If the first liquid center point does not coincide with the first mark center point, and the second liquid center point does not coincide with the second mark center point, then the positional similarity between the first mark region and the second mark region is determined based on the difference between the magnitude of the first vector and the magnitude of the second vector, and the angle between the direction of the first vector and the direction of the second vector. Based on the positional similarity and area difference between the first and second marked regions, and the difference between the impurity feature conformity of the first and second marked regions, the morphological matching index between the first and second marked regions is determined.
4. The dynamic weighing and visual inspection system for a sea buckthorn juice bottling production line according to claim 1, characterized in that, The step of determining the morphological movement matching degree between different suspected impurity regions in adjacent back images based on the morphological matching index between different suspected impurity regions in adjacent back images includes: Any two adjacent back images are respectively designated as the first back image and the second back image. Any suspected impurity region in the first back image is designated as the first marked region, and any suspected impurity region in the second back image is designated as the second marked region. If the first back image and the second back image constitute the first group of adjacent back images, then the morphological matching index between the first marked region and the second marked region is determined as the morphological movement matching degree between the first marked region and the second marked region. If the adjacent back images formed by the first back image and the second back image are not the first group of adjacent back images, then the morphological movement matching degree between the first marker region and the second marker region is determined according to the morphological matching index between the first marker region and the second marker region, and the morphological movement matching degree between the first back image and different suspected impurity regions in the previous back images.
5. The dynamic weighing and visual inspection system for a sea buckthorn juice bottling production line according to claim 4, characterized in that, The step of determining the morphological movement matching degree between the first and second marked regions based on the morphological matching index between the first and second marked regions, and the morphological movement matching degree between different suspected impurity regions in the first back image and its previous back images, includes: From the previous back image of the first back image, select the suspected impurity region with the highest morphological movement matching degree with the first marked region, and use it as the first matching region corresponding to the first marked region. The first matching region corresponding to the first marked region is the same as the object represented by the first marked region. If the back image to which the first matching region corresponding to the first marked region belongs is not the first back image, then the suspected impurity region with the highest morphological movement matching degree with the first matching region is selected from the back image preceding the back image to which the first matching region belongs, and is used as the second matching region corresponding to the first marked region. This process is repeated to obtain all matching regions corresponding to the first marked region. The first marked region and all its corresponding matching regions are used to form a reference region sequence corresponding to the first marked region. Pixels that are at the same center point position as the first marked area are selected from the second back image and used as reference pixels; Based on the center point of the second marked region and the reference pixel, a target displacement vector is constructed between the first marked region and the second marked region. Similarly, a target displacement vector is constructed between each adjacent suspected impurity region in the reference region sequence. The sum of the target displacement vectors between all adjacent suspected impurity regions in the reference region sequence corresponding to the first marked region is determined as the historical overall vector corresponding to the first marked region. The target displacement vector between the first marked region and the second marked region is determined as the current local vector corresponding to the first marked region; Based on the morphological matching index between the first and second marked regions, and the angle between the direction of the historical overall vector corresponding to the first marked region and the direction of the current local vector, the morphological movement matching degree between the first and second marked regions is determined.
6. The dynamic weighing and visual inspection system for a sea buckthorn juice bottling production line according to claim 5, characterized in that, The impurity movement pattern analysis of each suspected impurity region sequence yields impurity movement characteristic indices corresponding to each suspected impurity region sequence, including: Any suspected impurity region sequence is determined as a temporary sequence, and the target displacement vectors between all adjacent suspected impurity regions in the temporary sequence are used to form the target displacement vector sequence corresponding to the temporary sequence. The normalized value of the cosine of the angle between the direction of each target displacement vector in the target displacement vector sequence and the vertical downward direction is determined as the vertical similarity, thus obtaining the vertical similarity sequence corresponding to the temporary sequence; Based on the vertical similarity sequence, the morphological matching index and vertical distance between all adjacent suspected impurity regions in the temporary sequence, and the number of region groups formed by adjacent suspected impurity regions in the temporary sequence whose morphological matching index is greater than a preset matching threshold, the impurity movement feature index corresponding to the temporary sequence is determined.
7. The dynamic weighing and visual inspection system for a sea buckthorn juice bottling production line according to claim 1, characterized in that, The step of selecting the target impurity region sequence from all suspected impurity region sequences based on all impurity movement characteristic indicators includes: If the impurity movement characteristic index corresponding to the suspected impurity region sequence is greater than the pre-defined impurity characteristic threshold, then the suspected impurity region sequence is determined as the target impurity region sequence.
8. The dynamic weighing and visual inspection system for a sea buckthorn juice bottling production line according to claim 1, characterized in that, The impurity level detection of the sea buckthorn juice to be tested, based on all target impurity region sequences and all weight detection data, includes: The average area of all target impurity regions in each target impurity region sequence is used as the area representative index for each target impurity region sequence. The overall severity of impurities is determined based on the cumulative value of all area-representative indicators, the number of target impurity region sequences, and the difference between the pre-acquired standard weight data and the weight detection data. Based on the overall severity of impurities, the impurity level of the sea buckthorn juice to be tested is determined.
Citation Information
Patent Citations
Communication equipment defect detection method based on artificial intelligence
CN116758057A
Hard carbon electrode production quality detection method
CN116843678A