An apparatus and method for processing livestock feed pellets
By analyzing the video data of the feed pellet machine, determining the clarity of the boundary pixel points and being affected by noise, adjusting the filter window size, solving the problem of image quality degradation, and achieving more accurate video data and better processing quality evaluation.
Patent Information
- Application Number
- CN202510179584.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-19
- Publication Date
- 2025-05-27
- Estimated Expiration
- 2045-02-19
AI Technical Summary
When the existing feed pelletizers process forage, the dust and particles at the discharge port move fast, resulting in a decrease in image quality and inaccurate boundaries of the connection domain, which affects the accuracy of video information, and thus leads to poor processing effects of livestock materials.
By obtaining video data from the feed pellet machine discharge port, analyzing the motion of the connecting domain and center of mass of the feed pellet in each frame of the image, determining the clarity of the boundary pixel points and the degree of influence of noise, and adjusting the filter window size of the bilateral filter to improve the image denoising effect.
By enhancing the clarity of the image and obtaining more accurate video data, it can better assist in judging the processing quality of the feed pellet machine and improve the effect of animal husbandry material processing.
Smart Images

Figure CN119648574B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image data processing, and particularly relates to a device and method for processing livestock feed pellets. Background Art
[0002] Livestock material processing equipment plays an important role in modern animal husbandry. They not only improve breeding efficiency but also contribute to environmental protection and sustainable use of resources. Livestock material processing equipment includes feed pelletizers, feed mixers, automatic feeders, etc. For the livestock breeding industry, if winter comes, sufficient forage must be prepared. However, directly storing forage will occupy a large amount of space because straw-like forage is fluffy and takes up a lot of space. If not properly guarded against, it will also become a breeding ground for rodent pests, spoiling the forage and spreading diseases, which is not worth the loss. Using a feed pelletizer can process and press forage into pellets, effectively reducing the occupied space of forage. During the use of the feed pelletizer, it may be affected by factors such as raw material quality, operating conditions, equipment technical parameters, and environmental factors, resulting in problems such as uneven particle size and overly rough particle surfaces of the processed pellets. By obtaining and analyzing the image of the processed feed pellets at the discharge outlet, it can assist in judging the operating state or processing quality of the feed pelletizer.
[0003] When the feed pelletizer is operating, there will be some forage dust at the discharge port, which affects the quality of the obtained image. And the movement speed of the pellets is relatively fast. These factors will all affect the image quality, especially resulting in inaccurate boundaries of the connected regions representing the feed pellets. When using a bilateral filter to denoise the image, the size of the filtering window will affect the denoising result of the image, thereby leading to inaccurate video information and further resulting in poor livestock material processing effects. Summary of the Invention
[0004] The present invention provides a device and method for processing livestock feed pellets to solve the existing problems.
[0005] The device and method for processing livestock feed pellets of the present invention adopt the following technical solutions:
[0006] An embodiment of the present invention provides a method for processing livestock feed pellets, which includes the following steps:
[0007] Obtain video data at the discharge outlet of the feed pelletizer;
[0008] Obtain the connected regions representing feed particles and the movement distances and movement directions of the centroids of each connected region in each frame of the video data; determine the clarity of the boundary pixel points of each connected region according to the movement distances and movement directions of the centroids of the connected regions; combine the clarity of the boundary pixel points of the connected regions and the gray - scale differences between the boundary pixel points and the surrounding pixel points to determine the degree of influence of noise on the boundary pixel points of each connected region;
[0009] Determine the adjustment coefficient of the filtering window size for the boundary pixel points of the connected region according to the degree of influence of noise on the boundary pixel points, determine the final filtering window size according to the adjustment coefficient of the filtering window size, and enhance each frame of the image to obtain the enhanced video data of the discharge port of the feed granulator.
[0010] Furthermore, the specific calculation method for the clarity of each boundary pixel point of the connected region is as follows:
[0011]
[0012] In the formula, represents the clarity of the th boundary pixel point of the th connected region in the th frame of the image; represents the minimum included angle between the movement direction of the centroid of the th connected region in the th frame of the image and the direction from the centroid of the th connected region to the th boundary pixel point of the th connected region; represents the minimum included angle of the movement direction of the centroid of the th connected region in the th frame of the image between the th frame of the image and the represents the movement distance of the centroid of the th connected region in the th frame of the image; is a preset value; represents the exponential function with the natural constant as the base.
[0013] Furthermore, the specific method for determining the degree of influence of noise on the boundary pixel points of each connected region includes:
[0014] Obtain the minimum bounding rectangle of the th connected region, and expand the minimum bounding rectangle of the th connected region according to the clarity of each boundary pixel point of the th connected region and the distance from each boundary pixel point to the corresponding side of the minimum bounding rectangle of the connected region to obtain the The updated rectangle of a connected component;
[0015] According to the gray - level difference between each pixel point in the updated rectangle of a connected component and its surrounding pixel points, determine the initial possibility that each pixel point in the updated rectangle of the connected component belongs to noise;
[0016] According to the initial possibility that each pixel point in the updated rectangle of a connected component belongs to noise, determine the noise pixel points;
[0017] According to the number of noise pixel points in the updated rectangle of a connected component and the area of the updated rectangle, obtain the dust concentration in the updated rectangle of a connected component;
[0018] Obtain the distance from the noise pixel points in the updated rectangle of a connected component to the boundary pixel points of the connected component, and combine with the dust concentration in the updated rectangle of a connected component and the initial possibility that pixel points in the updated rectangle of a connected component belong to noise, determine the degree to which boundary pixel points are affected by noise.
[0019] Furthermore, the method for expanding the minimum bounding rectangle of the connected component to obtain the updated rectangle of the connected component includes the following specific method:
[0020] The expansion distance of each side of the minimum bounding rectangle of a connected component is expressed as:
[0021]
[0022] In the formula, represents the expansion distance of the first side of the minimum bounding rectangle of a connected component; represents the number of boundary pixel points of a connected component; represents the distance from the th boundary pixel point of a connected component to the first side of the minimum bounding rectangle of a connected component; represents the clarity of the th boundary pixel point of a connected component; represents the preset basic distance for expanding the first side of the minimum bounding rectangle of a connected component; represents a linear normalization function; represents rounding down;
[0023] According to the above formula, obtain the extension distance of each side of the minimum circumscribed rectangle of the th connected component. Expand each side of the minimum circumscribed rectangle of the th connected component according to the obtained extension distance. The rectangle formed by extending each expanded side is denoted as the th connected component's updated rectangle.
[0024] Furthermore, the specific method for determining noise pixel points includes:
[0025] Set a window centered on each pixel point in the updated rectangle of the th connected component, with a size of , as the gray-scale comparison range of each pixel point in the updated rectangle of the th connected component;
[0026] Obtain the gray-scale differences between the th pixel point in the updated rectangle of the th connected component and all pixel points within its gray-scale comparison range, sort them by size, and take the mean of the smallest values with a preset quantity threshold, denoted as . Use to represent the initial possibility that the th pixel point in the updated rectangle of the th connected component belongs to noise. When the normalized value of is greater than the preset threshold, mark the th pixel point as a noise pixel point.
[0027] Furthermore, the specific method for obtaining the dust concentration within the updated rectangle of the th connected component includes:
[0028] Determine the dust concentration within the updated rectangle of the th connected component according to the number of noise pixel points within the updated rectangle of the th connected component and the area of the updated rectangle of the th connected component. The area of the updated rectangle of the th connected component is inversely proportional to the dust concentration within the updated rectangle of the th connected component.
[0029] Furthermore, the specific calculation method for determining the degree to which boundary pixel points are affected by noise is:
[0030]
[0031] In the formula, represents the degree of influence of noise on the -th boundary pixel point of the -th connected component; represents the dust concentration within the updated rectangle of the -th connected component; represents the number of noise pixel points within the updated rectangle of the -th connected component; represents the initial probability that the -th pixel point within the updated rectangle of the -th connected component belongs to noise; represents the distance from the -th noise pixel point within the updated rectangle of the -th connected component to the -th boundary pixel point; The initial probability that the -th boundary pixel point of the -th connected component belongs to noise; represents the linear normalization function.
[0032] Furthermore, the specific calculation method for the adjustment coefficient of the filtering window size of the connected component boundary pixel points is as follows:
[0033]
[0034] In the formula, represents the adjustment coefficient of the filtering window size of the -th boundary pixel point of the -th connected component; represents the clarity of the -th boundary pixel point of the -th connected component; represents the degree of influence of noise on the -th boundary pixel point of the -th connected component.
[0035] Furthermore, the specific method for determining the final filtering window size includes:
[0036] Based on the adjustment coefficient of the filtering window size of the -th boundary pixel point of the -th connected component, determine the adjustment value of the filtering window for each boundary pixel point on the -th connected component and the size of the final filtering window;
[0037] When the -th boundary pixel point of the When the adjustment value of the filtering window for a boundary pixel is an even number, the size of the final filtering window is expressed as:
[0038]
[0039] When the th connected component's th boundary pixel has an odd adjustment value for the filtering window, the size of the final filtering window is expressed as:
[0040]
[0041] In the formula, represents the size of the filtering window for the th boundary pixel of the th connected component; represents the adjustment coefficient of the size of the filtering window for the th boundary pixel of the th connected component; represents the adjustment value of the filtering window for the th boundary pixel of the th connected component; represents the preset minimum side length of the filtering window; represents the original filtering window size using the bilateral filter preset; represents rounding down.
[0042] A device for processing livestock feed pellets, the device includes an image processor and a memory, a processor, and a computer program stored in the memory and executable on the processor included in the image processor. When the processor executes the computer program, it implements the steps of any one of the methods for processing livestock feed pellets.
[0043] The beneficial effects of the technical solution of the present invention are: According to the movement distance and movement direction of the centroid of the connected component, the clarity of each boundary pixel of the connected component can be determined, the influence of noise on the boundary pixel can be determined, and combined with the clarity of the boundary pixel of the connected component and the gray difference between the boundary pixel and the surrounding pixels, the degree of influence of noise on the boundary pixel of each connected component can be determined, which helps to determine the adjustment coefficient of the size of the filtering window for the boundary pixel of the connected component. According to the degree of influence and clarity of the boundary pixel by noise, the adjustment coefficient of the size of the boundary pixel filtering window is determined, so as to determine the final size of the filtering window, enhance each frame of the image, and obtain clearer video data of the discharge port of the feed pellet machine after enhancement. The enhanced video data can provide better support and assistance for the evaluation of the processing quality of the feed pellet machine. Description of the Drawings
[0044] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0045] Figure 1 It is a flowchart of the steps of a method for processing livestock feed pellets according to the present invention. Detailed implementation manners
[0046] To further elaborate on the technical means and effects adopted by the present invention to achieve the intended invention purpose, the following will, in conjunction with the accompanying drawings and preferred embodiments, describe in detail the specific implementation manners, structures, features, and effects of a device and a method for processing livestock feed pellets according to the present invention. In the following description, different "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. In addition, the specific features, structures, or characteristics in one or more embodiments can be combined in any suitable form.
[0047] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the technical field to which the present invention belongs.
[0048] The following will specifically describe the specific solution of a method for processing livestock feed pellets provided by the present invention in conjunction with the accompanying drawings.
[0049] Please refer to Figure 1 , which shows a flowchart of the steps of a method for processing livestock feed pellets provided by an embodiment of the present invention. The method includes the following steps:
[0050] Step S001: Obtain video data at the discharge port of the feed pellet machine.
[0051] It should be noted that in order to analyze the feed pellet image, it is first necessary to obtain the video data at the discharge port of the feed pellet machine.
[0052] Specifically, the specific process of obtaining the video data at the discharge port of the feed pellet machine is as follows: Install a camera at the upper end of the discharge port of the feed pellet machine, shoot the movement of the feed pellets at the discharge port for a period of time after the feed pellet machine starts running, and adjust the angle to ensure that the camera can shoot the movement of all the pellets at the discharge port of the feed pellet machine, and transmit the captured video data to the data center. The shooting duration for each time is 15 minutes.
[0053] It should be noted that the shooting duration can be adjusted according to the actual situation, and no specific limitation is made in this embodiment.
[0054] So far, the video data of the discharge port of the feed granulator has been obtained through the above method.
[0055] Step S002: Obtain the connected regions representing feed pellets and the moving distances and moving directions of the centroids of each connected region in each frame image of the video data; determine the clarity of the boundary pixel points of each connected region according to the moving distances and moving directions of the centroids of the connected regions; combine the clarity of the boundary pixel points of the connected regions and the gray-scale differences between the boundary pixel points and the surrounding pixel points to determine the degree to which the boundary pixel points of each connected region are affected by noise.
[0056] It should be noted that when using a bilateral filter to denoise each frame image, the size of the filtering window will affect the denoising result and image details of the image. A larger filtering window can contain more neighboring pixels and can better remove noise, but for small textures and edges, there will be over-smoothing, resulting in the loss of image details. A smaller filtering window can better retain the details and textures of the image, but cannot denoise well. Since there are feed pellets in motion in each frame image of the video data, and the movement of the feed pellets will generate blurred trajectories, and in addition, there are some dust carried on the surface of the floating feed pellets at the discharge port, resulting in different degrees of importance of pixel points at different positions in the image. Therefore, it is necessary to adjust the size of the filtering window of the bilateral filter according to the clarity of the boundary pixel points of different connected regions to improve the denoising effect of the image.
[0057] Step (2.1), obtain the connected regions representing feed pellets and the moving distances and moving directions of the centroids of each connected region in each frame image of the video data.
[0058] Specifically, for each frame image in the obtained video data, a segmentation neural network is used to identify and segment the background region and feed pellets in each frame image of the video data of the discharge port of the feed granulator, and the connected regions representing feed pellets in different frame images are obtained.
[0059] The relevant content of the segmentation neural network is as follows:
[0060] The segmentation neural network used in this embodiment is the Mask R-CNN neural network; the dataset used is each frame image in the video data of the discharge port of the feed granulator. Among them, Mask R-CNN is a well-known technology, and the specific method will not be introduced here. The Chinese full name of Mask R-CNN is "Mask Region-based Convolutional Neural Network", and the English full name is "Mask Region-based Convolutional Neural Network".
[0061] The pixel points to be segmented are divided into 2 categories. The corresponding label annotation process for the training set is as follows: for the single-channel semantic label, the pixel points at the corresponding positions are labeled as 0 if they belong to the background area, and labeled as 1 if they belong to the connected domain of feed particles.
[0062] The task of the network is classification, so the loss function used is the cross-entropy loss function.
[0063] The background area and the connected domain of feed particles in the enhanced image are obtained through the segmentation neural network. This process is a well-known technology, and the specific method will not be introduced here.
[0064] Due to the influence of the particle movement speed and the dust at the discharge port, the boundary of the connected domain of the obtained feed particles may not be completely accurate. Therefore, for each connected domain, its centroid is obtained, and the CamShift algorithm (Continuously Adaptive Mean-Shift) is used to track each centroid to obtain the movement distance and movement direction of each centroid. This is a well-known technology.
[0065] The specific method for obtaining the movement distance and movement direction of each centroid is as follows: taking the position coordinates of the centroid of the connected domain of the same feed particle from the frame image to the frame image as the movement distance and direction of the centroid of this connected domain in the frame image.
[0066] It should be noted that when the connected domain of the feed particle does not exist in the frame, this connected domain will not be analyzed, and the information of this connected domain can be obtained from other frame images of the video data.
[0067] Step (2.2), determine the clarity of the boundary pixel points of each connected domain according to the movement distance and movement direction of the centroid of the connected domain.
[0068] It should be noted that during the movement of feed pellets, due to their relatively high movement speed, in each frame of the obtained pellet movement video, there will be blurred trajectories generated by the movement of feed pellets. The blurred trajectories will also show different degrees of blurring due to the movement of the pellets. At the front end of the movement direction, the pellets arrive first and start to leave traces on the image. At this time, due to the initial contact and the fact that the pellets instantaneously reach the initial position in the field of view, it is more likely to form a clear edge, that is, a strong edge; while at the rear end of the movement direction, the pellets may have stayed at this position for some time before leaving, so the trajectory will become blurred due to the continuous movement of the pellets, that is, a weak edge. At the discharge port, the feed pellets will collide with each other during the movement process, thereby changing the movement trajectory and direction of the feed pellets. When the movement direction of the feed pellets changes greatly, the change in the movement trajectory will also be large, resulting in an increase in the degree of motion blur in the image. Therefore, according to the movement characteristics of the feed pellets at the discharge port, the clarity of each boundary pixel point on the connected domain is determined.
[0069] Specifically, taking the th frame image as an example, according to the movement direction of the centroid of the th connected domain in the th frame image, the direction from the centroid of the th connected domain in the th frame image to the th boundary pixel point of the th connected domain, the minimum included angle between the movement direction of the centroid of the th connected domain in the th frame image and the th frame image, and the movement distance of the centroid of the th connected domain from the th frame to the th frame, the clarity of the th boundary pixel point of the th connected domain in the th frame image is determined.
[0070] As an embodiment, the clarity of the th boundary pixel point of the th connected domain in the th frame image can be expressed as:
[0071]
[0072] In the formula, represents the clarity of the th boundary pixel point of the th connected domain in the th frame image; represents the th frame image in the The moving direction of the centroid of a connected region, and the centroid of the connected region to the minimum included angle with the direction to the th boundary pixel point of the connected region; The minimum included angle of the moving direction of the centroid of the connected region in the th frame image and the th frame image; The moving distance of the centroid of the connected region in the th frame image; is a preset value;
[0073] It should be noted that according to the characteristics of motion blur, the smaller the value of , the clearer the th boundary pixel point of the connected region in the th frame image. Conversely, the smaller it is; The smaller the value of , the smaller the change in the moving direction of the th boundary pixel point of the connected region in the th frame image, the smaller the change in the moving direction of the
[0074] connected region, and the clearer the pixel point, corresponding to the larger the value of
[0075] Step (2.3), combining the clarity of the boundary pixel points of the connected region and the gray - scale difference between the boundary pixel points and the surrounding pixel points, determine the degree to which the boundary pixel points of each connected region are affected by noise.
[0076] It should be noted that the clarity of the boundary pixel points of the connected region determined according to the moving - direction characteristics of the centroid of the connected region only considers the movement of feed particles. However, at the outlet of the feed granulator, there will be feed particles on the surface and unprocessed feed dust floating, and these dusts will also affect the clarity of the boundary pixel points in the image. Therefore, it is necessary to determine the influence of dust on the clarity of the boundary pixel points of the connected region.
[0077] Specifically, taking the th connected region in the th frame image as an example, first, obtain the The minimum bounding rectangle of the th connected component is expanded according to the clarity of each boundary pixel point of the th connected component and the distance from each boundary pixel point to the corresponding side of the minimum bounding rectangle of the connected component, to obtain the updated rectangle of the th connected component.
[0078] The expansion distance of each side of the minimum bounding rectangle of the
[0079]
[0080] In the formula, represents the expansion distance of the first side of the minimum bounding rectangle of the th connected component; represents the number of boundary pixel points of the th connected component; represents the shortest distance from the th boundary pixel point of the th connected component to the first side of the minimum bounding rectangle of the th connected component; represents the clarity of the th boundary pixel point of the th connected component; represents the preset basic distance for expanding the first side of the minimum bounding rectangle of the th connected component; represents a linear normalization function for normalizing data values to the range; represents rounding down.
[0081] It should be noted that in this embodiment takes a value of 5, which can be adjusted according to the actual situation and is not specifically limited in this embodiment.
[0082] It should be noted that the smaller the clarity of the th boundary pixel point of the th connected component, that is, the smaller the value of , the blurrier the boundary pixel point is, and the larger the expansion distance of the side of the minimum bounding rectangle corresponding to this boundary pixel point should be. At the same time, the smaller the distance from the th boundary pixel point of the th connected component to the first side of the minimum bounding rectangle of the th connected component, that is, the smaller the value of , the larger the expansion distance of the side of the minimum bounding rectangle corresponding to this boundary pixel point should be, corresponding to The larger the value is, and round down the calculated value.
[0083] According to the above formula, obtain the extension distance of each side of the minimum bounding rectangle of the th connected component. Expand each side of the minimum bounding rectangle of the th connected component according to the obtained extension distance. The rectangle formed by extending each expanded side is denoted as the updated rectangle of the th connected component.
[0084] Then, set a window centered on each pixel point in the updated rectangle of the th connected component, with a size of as the grayscale comparison range of each pixel point in the updated rectangle of the th connected component, and determine the grayscale difference between each pixel point in the updated rectangle of the th connected component and all pixel points within its grayscale comparison range.
[0085] It should be noted that is the preset side length of the window. In this embodiment the value is 5, which can be adjusted according to the actual situation and is not specifically limited in this embodiment.
[0086] The grayscale difference between the th pixel point in the updated rectangle of the th connected component and the th pixel point within its grayscale comparison range can be expressed as:
[0087]
[0088] In the formula, represents the grayscale difference between the th pixel point in the updated rectangle of the th connected component and the th pixel point within its grayscale comparison range; represents the grayscale value of the th pixel point in the updated rectangle of the th connected component; represents the grayscale value of the th pixel point within the grayscale comparison range of the th pixel point in the updated rectangle of the th connected component; represents taking the absolute value.
[0089] It should be noted that the greater the grayscale difference between the boundary pixel point and each pixel point within the grayscale comparison range, that is The larger the value, the greater the gray - level difference between the pixel and its surrounding pixels, and the greater the likelihood that the boundary pixel belongs to noise.
[0090] Obtain the gray - level differences between the th pixel in the updated rectangle of the th connected component and all pixels within its gray - level comparison range, sort them by size, and take the mean of the smallest values, denoted as , and use to represent the initial likelihood that the th pixel in the updated rectangle of the th connected component belongs to noise.
[0091] It should be noted that is a preset quantity threshold, and in this embodiment takes the value of 5, which can be adjusted according to the actual situation and is not specifically limited in this embodiment.
[0092] It should be noted that the gray - level differences between noise pixels and their surrounding pixels are all relatively large, while the gray - level values of non - noise pixels are similar to those of some of their surrounding pixels, with relatively small differences. Therefore, when the value is larger, the th pixel in the updated rectangle of the th connected component is more likely to be a noise pixel.
[0093] Use the normalization function to normalize the value of to the range of , and mark the pixels whose normalized value in the updated rectangle of the th connected component is greater than the preset threshold as noise pixels.
[0094] It should be noted that in this embodiment takes the value of 0.6, which can be adjusted according to the actual situation and is not specifically limited in this embodiment.
[0095] Thus, the number of noise pixels in the updated rectangle of the th connected component is obtained. According to the number of noise pixels in the updated rectangle of the th connected component and the area of the updated rectangle, determine the dust concentration in the updated rectangle of the th connected component.
[0096] The dust concentration in the updated rectangle of the th connected component can be expressed as:
[0097]
[0098] In the formula, represents the dust concentration within the updated rectangle of the th connected component; represents the number of noise pixel points within the updated rectangle of the th connected component; represents the area of the updated rectangle of the th connected component.
[0099] It should be noted that when the area of the updated rectangle of the th connected component is fixed, the more the number of noise pixel points, the larger , indicating that the dust concentration within the updated rectangle of the
[0100] Then, obtain the distance from each noise pixel point within the updated rectangle of the th connected component to the th boundary pixel point of the th connected component. Based on the distance from each noise pixel point within the updated rectangle of the th connected component to the th boundary pixel point of the th connected component, the dust concentration within the updated rectangle of the th connected component, and the initial possibility that the pixel points within the updated rectangle of the th connected component belong to noise, determine the degree of influence of noise on the th boundary pixel point of the th connected component.
[0101] The degree of influence of noise on the th boundary pixel point of the th connected component can be expressed as:
[0102]
[0103] In the formula, represents the degree of influence of noise on the th boundary pixel point of the th connected component; represents the dust concentration within the updated rectangle of the th connected component; represents the number of noise pixel points within the updated rectangle of the th connected component; represents the initial possibility that the th pixel point within the updated rectangle of the th connected component belongs to noise; represents the th pixel point within the updated rectangle of the The distance from the th boundary pixel point to the noise pixel point; The th connected component's th boundary pixel point's initial possibility of belonging to noise; Represents a linear normalization function used to normalize data values to the range.
[0104] It should be noted that Represents the degree of correlation between all noise pixel points within the updated rectangle of the th connected component and the th boundary pixel point of the th connected component. The larger the value of , the more correlated all noise pixel points within the updated rectangle of the th connected component are with the th boundary pixel point. Then, the greater the degree to which the th boundary pixel point is affected by noise, and the corresponding value is larger.
[0105] Thus far, the degree to which the boundary pixel points of the connected component are affected by noise is obtained through the above method.
[0106] Step S003: Determine the adjustment coefficient of the filtering window size for the boundary pixel points of the connected component according to the degree to which the boundary pixel points are affected by noise. Determine the final filtering window size based on the adjustment coefficient of the filtering window size, and enhance each frame of the image to obtain the enhanced video data of the discharge port of the feed granulator.
[0107] First, determine the adjustment coefficient of the filtering window size for the boundary pixel points of the connected component according to the degree to which each boundary pixel point of the connected component is affected by noise and its clarity.
[0108] The th adjustment coefficient of the filtering window size for the th boundary pixel point of the
[0109]
[0110] connected component can be expressed as: In the formula, represents the th adjustment coefficient of the filtering window size for the th boundary pixel point of the th connected component; represents the clarity of the th boundary pixel point of the th connected component; represents the degree to which the
[0111] It should be noted that the clearer the boundary pixels of the connected component are, the more likely they are to be the pixels on the strong edge. On the contrary, the more likely they are to be the pixels on the weak edge. For the pixels on the strong edge, a smaller filtering window should be assigned to better preserve the clarity and details of the connected component boundary. Therefore, the adjustment coefficient of its filtering window should be smaller, that is the value of is smaller. On the contrary, for the pixels on the weak edge, a larger filtering window should be assigned, corresponding to a larger adjustment coefficient of the filtering window size. According to the above formula, the corrected clarity of each boundary image point on each connected component is obtained.
[0112] Then, according to the adjustment coefficient of the filtering window size of each boundary pixel on the connected component, the adjustment value of the filtering window of each boundary pixel on the connected component and the size of the final filtering window are determined.
[0113] Specifically, when the adjustment value of the filtering window of the -th boundary pixel of the -th connected component is an even number, the size of the final filtering window can be expressed as:
[0114]
[0115] When the adjustment value of the filtering window of the -th boundary pixel of the -th connected component is an odd number, the size of the final filtering window can be expressed as:
[0116]
[0117] In the formula, represents the size of the filtering window of the -th boundary pixel of the -th connected component; represents the adjustment coefficient of the size of the filtering window of the -th boundary pixel of the -th connected component; represents the adjustment value of the filtering window of the -th boundary pixel of the -th connected component; represents the minimum side length of the preset filtering window; represents the size of the original filtering window using the bilateral filter preset; represents rounding down.
[0118] It should be noted that in this embodiment the value of is 3, the value of is 9, which can be adjusted according to the actual situation and is not specifically limited in this embodiment.
[0119] It should be noted that the greater the clarity of the boundary pixel points, the more they are the pixel points on the strong edge. On the contrary, the more they are the pixel points on the weak edge. For the pixel points on the strong edge, a larger filtering window should be assigned to better retain the clarity and details of the edge; for the pixel points on the weak edge, more delicate processing is required, so using a smaller window will be more effective because it can reduce the over-smoothing of the edge and make the edge more obvious; since the size of the filtering window must be an odd integer, so for it is rounded down. When the rounded-down result is an even number, its size is increased by 1 to make it an odd number.
[0120] Thus, the filtering window of the th boundary pixel point of the th connected component is obtained . For all non-boundary pixel points in the image, the original filtering window with a preset size of 9*9 is continued to be used without adjustment.
[0121] According to the above steps, the filtering window sizes of all pixel points in each frame of the obtained video are obtained and each frame of the image is denoised. The processed each frame of the image is encoded into a video format using a video encoder, thereby obtaining video data with higher clarity.
[0122] It should be noted that in all the above formulas, when the denominator is 0, the denominator is set to 1.
[0123] Through the above steps, the enhancement of the video image of the discharge port of the feed granulator is completed, and the enhanced video image of the discharge port of the feed granulator is used to assist in evaluating the processing quality of the processed feed pellets.
[0124] Specifically: According to the enhanced video image of the discharge port of the feed granulator, the PLC controller automatically adjusts the discharge parameters according to the results of real-time monitoring to ensure that the quality of the feed pellets meets the requirements.
[0125] An embodiment of the present invention also provides a device for processing livestock feed pellets. The device includes an image processor and a memory, a processor, and a computer program stored in the memory and executable on the processor included in the image processor. When the processor executes the computer program, it implements the steps of a method for processing livestock feed pellets as described in steps S001 to S003.
[0126] In this embodiment, according to the moving distance and moving direction of the centroid of the connected component, the clarity of each boundary pixel point of the connected component can be determined, and the influence of noise on the boundary pixel point can be determined. Combining the clarity of the boundary pixel point of the connected component and the gray level difference between the boundary pixel point and the surrounding pixel points, the degree of influence of noise on the boundary pixel point of each connected component can be determined, which helps to correct the clarity of the boundary pixel point. According to the degree of influence of noise on the boundary pixel point, the final clarity of the boundary pixel point of the corrected connected component is determined. According to the final clarity, the final filtering window size is determined, and each frame of image is enhanced to obtain clearer video data of the discharge port of the feed granulator. The enhanced video data can provide better support and assistance for the evaluation of the processing quality of the feed granulator.
[0127] It should be noted that the model used in this embodiment is only used to represent the negative correlation relationship and to constrain the result of the model output to be within the interval. Specifically, in implementation, it can be replaced with other models with the same purpose. This embodiment only takes the model as an example for description, and does not make specific limitations on it, where refers to the input of the model.
[0128] The above is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modification, equivalent replacement, improvement, etc. made within the principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for processing livestock feed particles, characterized in that: The method comprises the following steps: Get video data of the feed pellet machine outlet; Obtain the connected domains representing feed particles in each frame of the video data and the movement distance and movement direction of the centroid of each connected domain; determine the clarity of the boundary pixels of each connected domain according to the movement distance and movement direction of the centroid of the connected domain; determine the degree to which the boundary pixels of each connected domain are affected by noise by combining the clarity of the boundary pixels of the connected domain and the grayscale difference between the boundary pixels and the surrounding pixels; According to the degree of influence of noise on the boundary pixels, the adjustment coefficient of the filter window size of the connected domain boundary pixels is determined, and the final filter window size is determined according to the adjustment coefficient of the filter window size, and each frame of the image is enhanced to obtain the enhanced video data of the feed pellet machine discharge port; The specific method of determining the degree to which the boundary pixels of each connected domain are affected by noise is as follows: Get the The minimum circumscribed rectangle of a connected domain, according to The clarity of each boundary pixel point of the connected domain and the distance from each boundary pixel point to the corresponding side of the minimum circumscribed rectangle of the connected domain are calculated for the first The minimum circumscribed rectangle of the connected domain is expanded to obtain the Update rectangles of connected domains; According to The grayscale difference between each pixel and the surrounding pixels in the update rectangle of the connected domain is used to determine the The initial possibility that each pixel in the update rectangle of the connected domain belongs to the noise; According to The initial possibility that each pixel in the update rectangle of the connected domain belongs to the noise is determined to determine the noise pixel; According to The number of noise pixels in the update rectangle of the connected domain and the area of the update rectangle are obtained. The dust concentration in the updated rectangle of the connected domain; Get the The noise pixels in the update rectangle of the connected domain are The distance between the boundary pixels of the connected domain and the The dust concentration in the updated rectangle of the connected domain, The initial possibility that the pixels in the updated rectangle of the connected domain belong to the noise is determined to determine the extent to which the boundary pixels are affected by the noise.
2. A method for processing livestock feed particles according to claim 1, characterized in that: The specific calculation method of the clarity of the pixel points at the boundary of each connected domain is: In the formula, Indicates Frame image The first connected domain The clarity of the boundary pixels; Indicates Frame image The movement direction of the centroid of the connected domain is The centroid of the a-th connected domain to the a-th connected domain The minimum angle between the directions of the boundary pixels; Indicates Frame image The movement direction of the centroid of the connected domain is Frame image The minimum angle between the moving directions of the centroids of the connected domains; Indicates Frame image The movement distance of the centroid of a connected domain; is the default value; Represents an exponential function with a natural constant as base.
3. A method for processing livestock feed particles according to claim 1, characterized in that: The said The minimum circumscribed rectangle of the connected domain is expanded to obtain the The updated rectangle of a connected domain includes the following specific methods: No. The extension distance of each side of the minimum circumscribed rectangle of a connected domain is expressed as: In the formula, Indicates The extension distance of the first side of the minimum circumscribed rectangle of a connected domain; Indicates The number of boundary pixels of a connected domain; Indicates The first connected domain From the boundary pixel to the The shortest distance of the first side of the minimum circumscribed rectangle of a connected domain; Indicates The first connected domain The clarity of the boundary pixels; Indicates the preset The basic distance for the extension of the first side of the minimum circumscribed rectangle of a connected domain; represents the linear normalization function; Indicates rounding down; According to the above formula, we can get The expansion distance of each side of the minimum circumscribed rectangle of the connected domain is calculated, and the first Each side of the minimum circumscribed rectangle of the connected domain is extended, and the rectangle formed by extending each extended side is recorded as The updated rectangle of the connected component.
4. A method for processing livestock feed particles according to claim 1, characterized in that: The specific method of determining the noise pixel point includes: Set the Each pixel in the update rectangle of the connected domain is the center and the size is The window as the The grayscale contrast range of each pixel in the update rectangle of the connected domain; Get the The update rectangle of the connected domain The grayscale difference between a pixel and all pixels in its grayscale comparison range is sorted by size, and the mean of the minimum grayscale difference of the preset number threshold is taken, which is recorded as ,use Indicates The update rectangle of the connected domain The initial possibility that a pixel belongs to noise is When the normalized value of is greater than a preset threshold, the Pixels are recorded as noise pixels.
5. A method for processing livestock feed particles according to claim 1, characterized in that: The acquisition The dust concentration in the updated rectangle of a connected domain is calculated, including the following specific methods: According to The number of noise pixels in the update rectangle of the connected domain and the The area of the update rectangle of the connected domain determines the The dust concentration in the updated rectangle of the connected domain is The area of the updated rectangle of the connected domain is equal to the area of the The dust concentration in the updated rectangle of the connected domain is inversely proportional.
6. A method for processing livestock feed particles according to claim 1, characterized in that: The specific calculation method for determining the degree to which the boundary pixel point is affected by noise is: In the formula, Indicates The first connected domain The degree to which the boundary pixels are affected by noise; Indicates The dust concentration in the updated rectangle of the connected domain; Indicates The number of noise pixels in the update rectangle of the connected domain; Indicates The update rectangle of the connected domain The initial probability that the pixel belongs to noise; Indicates The update rectangle of the connected domain Noise pixels to The distance between the boundary pixels; No. The first connected domain The initial possibility that the boundary pixels belong to noise; represents the linear normalization function.
7. A method for processing livestock feed particles according to claim 1, characterized in that: The specific calculation method of the adjustment coefficient of the filter window size of the connected domain boundary pixel point is: In the formula, Indicates The first connected domain The adjustment coefficient of the filter window size for each boundary pixel; Indicates The first connected domain The clarity of the boundary pixels; Indicates The first connected domain The degree to which the boundary pixels are affected by noise.
8. A method for processing livestock feed particles according to claim 1, characterized in that: The specific method of determining the final filtering window size includes: According to The first connected domain The adjustment coefficient of the filter window size of the boundary pixel point is determined The adjustment value of the filter window for each boundary pixel on the connected domain and the size of the final filter window; When The first connected domain When the adjustment value of the filter window of the boundary pixel is an even number, the size of the final filter window is expressed as: When The first connected domain When the adjustment value of the filter window of the boundary pixel point is an odd number, the size of the final filter window is expressed as: In the formula, Indicates The first connected domain The filter window size for each boundary pixel; Indicates The first connected domain The adjustment coefficient of the filter window size for each boundary pixel; Indicates The first connected domain The adjustment value of the filter window of the boundary pixel points; Indicates the minimum side length of the preset filtering window; Indicates the preset original filter window size using bilateral filter; Indicates rounding down.
9. A device for processing livestock feed particles, comprising an image processor, a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the steps of a method for processing livestock feed particles as described in any one of claims 1 to 8 are implemented.
Citation Information
Patent Citations
Freight train model judgment method based on image feature analysis
CN117542003A
Intelligent image denoising method based on sensor
CN117994154A