CN117974651A - Method and device for detecting uniformity of crushed particles based on image recognition - Google Patents

Method and device for detecting uniformity of crushed particles based on image recognition Download PDF

Info

Publication number
CN117974651A
CN117974651A CN202410370836.4A CN202410370836A CN117974651A CN 117974651 A CN117974651 A CN 117974651A CN 202410370836 A CN202410370836 A CN 202410370836A CN 117974651 A CN117974651 A CN 117974651A
Authority
CN
China
Prior art keywords
pixel
super
segmentation
superpixel
initial
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202410370836.4A
Other languages
Chinese (zh)
Other versions
CN117974651B (en
Inventor
杨春刚
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shaanxi Tongshan Biotechnology Co ltd
Original Assignee
Shaanxi Tongshan Biotechnology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shaanxi Tongshan Biotechnology Co ltd filed Critical Shaanxi Tongshan Biotechnology Co ltd
Priority to CN202410370836.4A priority Critical patent/CN117974651B/en
Publication of CN117974651A publication Critical patent/CN117974651A/en
Application granted granted Critical
Publication of CN117974651B publication Critical patent/CN117974651B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Image Analysis (AREA)

Abstract

The application relates to the field of image data processing, in particular to a method and a device for detecting uniformity of crushed particles based on image recognition, wherein the method comprises the following steps: the method comprises the steps of obtaining a gray level image of a crushed fertilizer granule image, carrying out binarization processing on the gray level image to obtain a binary image, obtaining an initial superpixel segmentation result, judging the superpixel segmentation condition according to an initial superpixel segmentation effect evaluation index corresponding to the initial superpixel segmentation result, obtaining an adjusted superpixel segmentation number according to the superpixel segmentation condition, comparing the sizes of superpixel segmentation effect evaluation indexes corresponding to the superpixel segmentation number before and after adjustment, selecting the superpixel segmentation number corresponding to a larger value as a new superpixel segmentation number, carrying out self-adaption adjustment on the superpixel segmentation number through iteration to obtain an optimal superpixel segmentation number, and further obtaining an optimal crushed fertilizer granule recognition result, so that the crushed fertilizer granule uniformity detection result is more accurate.

Description

Method and device for detecting uniformity of crushed particles based on image recognition
Technical Field
The present application relates generally to the field of image data processing. More particularly, the present application relates to a method and apparatus for detecting uniformity of pulverized particles based on image recognition.
Background
With the continuous development of computer technology and digital image processing algorithms, image processing is increasingly applied to a wider range of fields.
The fertilizer plays a vital role in agricultural production, and can improve the yield and quality of crops, improve the soil quality and promote the sustainable development of agricultural production by reasonably applying the fertilizer. However, the long-term stacked fertilizer has the problem of wetting and caking, so that the nutrient release of the fertilizer is uneven, and the nutrient absorption efficiency of crops is reduced. In order to ensure the quality of the fertilizer, before the fertilizer is applied, a pulverizer or a vibration dispersing machine is required to pulverize the agglomerated fertilizer, so that the absorption efficiency of crops to the fertilizer is improved, and the growth speed and the yield of the crops are further improved. As agricultural integration is advanced towards automation and digitization, image processing techniques are increasingly being applied to uniformity detection of crushed fertilizer particles. The traditional manual detection mode has the problems of low efficiency, strong subjectivity and the like, and the image processing technology can realize automatic detection, so that the detection efficiency and accuracy are improved.
The common detection method for identifying the crushed fertilizer particles is super-pixel segmentation, and the uniformity of the crushed fertilizer particles can be obtained according to the dead moment standard deviation of the super-pixel segmentation result, but in the process of detecting the crushed fertilizer particles through super-pixel segmentation, the super-pixel segmentation number is difficult to determine, when the super-pixel segmentation number is insufficient, the segmentation precision is lower, and part of crushed particles can be segmented into the same area, so that the calculation result of the uniformity of the crushed fertilizer particles is inaccurate; when the number of super-pixel segmentation is too large, the situation of over-segmentation occurs, and single crushed fertilizer particles can be segmented into a plurality of areas, so that the calculation result of the uniformity of the crushed fertilizer particles is inaccurate, and the subsequent fertilization effect is affected.
Disclosure of Invention
The application provides a method and a device for detecting uniformity of crushed particles based on image recognition, and aims to solve the problem that the uniformity calculation result of the crushed fertilizer is inaccurate and the subsequent fertilization effect is affected due to the fact that the super-pixel segmentation quantity is too large or too small in the process of carrying out super-pixel segmentation on the crushed fertilizer particles.
In a first aspect, the method for detecting uniformity of crushed particles based on image recognition provided by the application adopts the following technical scheme:
The uniformity detection method of the crushed particles based on image recognition comprises the following steps:
step one, acquiring a gray level image of a crushed fertilizer particle image, and performing binarization treatment on the gray level image to obtain a binary image;
Step two, taking the number of connected domains in the binary image as an initial superpixel segmentation number, and performing superpixel segmentation on the image according to the initial superpixel segmentation number to obtain an initial superpixel segmentation result, wherein the initial superpixel segmentation result is a plurality of superpixel block areas;
Step three, carrying out edge detection on the gray level image to obtain an edge detection result, obtaining an initial superpixel block ratio, an initial superpixel segmentation result and an initial structure similarity index of the edge detection result according to the initial superpixel segmentation result, and taking the product of the initial superpixel block ratio and the initial structure similarity index as an initial superpixel segmentation effect evaluation index;
Judging the super-pixel segmentation condition according to the initial super-pixel segmentation effect evaluation index, and obtaining the adjusted super-pixel segmentation quantity according to the super-pixel segmentation condition;
step five, comparing the sizes of the super-pixel segmentation effect evaluation indexes corresponding to the super-pixel segmentation numbers before and after adjustment, and selecting the super-pixel segmentation number corresponding to a larger value as a new super-pixel segmentation number;
step six, repeating the step two to the step five to obtain adjusted super-pixel segmentation effect evaluation indexes, continuing to compare until the super-pixel segmentation effect evaluation indexes before and after adjustment are equal, and stopping iteration to obtain the optimal super-pixel segmentation quantity;
Step seven, obtaining an optimal crushed fertilizer granule superpixel segmentation result according to the optimal superpixel segmentation quantity;
And step eight, calculating the dead moment standard deviation of the superpixel block according to the optimal crushed fertilizer particle superpixel segmentation result, and obtaining the uniformity of crushed fertilizer particles.
In one embodiment, the initial superpixel block ratio expression is:
Wherein, For the initial superpixel block ratio,/>For the number of superpixel blocks shaped like a single whole crushed fertilizer granule,/>For the number of background superpixel blocks,/>The number is split for the initial superpixel.
In one embodiment, the initial structural similarity index expression is:
Wherein, For initial structural similarity index,/>Representing the number of pixel points in the target window,/>The target window is counted as the sum of pixels which are not boundary points nor edge pixels and are not boundary points nor edge pixels in the target window and the matched windowThe boundary points are the/>, corresponding to the target boundary pointsA window, wherein the matching window is a window with the pixel point with the same position as the target boundary point in the edge detection result as the center and the size equal to the target window,Is the first/>, on the boundary line of the super pixel block areaMinimum value of distance from each pixel point to each pixel point on edge line in edge detection result,/>Sampling the number of total pixel points on an image for smashing fertilizer particles,/>For the initial number of superpixel segments,Approximating a square diagonal length for a super pixel block,/>Represents the/>Degree of similarity of pixel locations,/>The total pixel point number on the boundary line of the super pixel block area.
In one embodiment, the super pixel segmentation case includes:
First case: when the undersection degree is larger than the oversection degree, the initial superpixel segmentation number is adjusted to obtain a first superpixel segmentation number;
second case: when the over-segmentation degree is larger than the under-segmentation degree, the initial super-pixel segmentation number is adjusted to obtain a second super-pixel segmentation number;
third case: when the under-segmentation degree is equal to the over-segmentation degree, a first super-pixel segmentation effect evaluation index and a second super-pixel segmentation effect evaluation index are respectively obtained according to the first super-pixel segmentation number and the second super-pixel segmentation number obtained in the first case and the second case, the magnitudes of the first super-pixel segmentation effect evaluation index and the second super-pixel segmentation effect evaluation index are compared, the super-pixel segmentation number corresponding to a larger value is selected as a third super-pixel segmentation number, and the third super-pixel segmentation number is equal to the first super-pixel segmentation number or the second super-pixel segmentation number.
In one embodiment, the undersplit satisfies the following relationship:
in the method, in the process of the invention, Under-segmentation degree for initial superpixel segmentation result,/>For the/>, in the initial superpixel segmentation resultThe number of pixel points belonging to the edge in the pixel point set in the super pixel block area,/>For/>The total number of pixel points in the super pixel block areas;
the degree of over-segmentation satisfies the following relationship:
in the method, in the process of the invention, Over-segmentation for initial superpixel segmentation result,/>For the/>, in the initial superpixel segmentation resultThe number of pixel points which do not belong to edge pixel points on the boundary line of each super pixel block area,/>For/>The total number of pixel points on the boundary line of the super pixel block area.
In one embodiment, the specific expression of the adjusted number of superpixel divisions according to the superpixel division situation is:
Wherein, For the adjusted number of superpixel divisions,/>Dividing the number for the first superpixel,/>Dividing the number for the second superpixel,/>For the initial superpixel block ratio,/>For initial structural similarity index,/>Representing an initial superpixel segmentation effect evaluation index;
When (when) When the initial super-pixel segmentation number is adjusted, an expression for obtaining a third super-pixel segmentation number is as follows:
Wherein, Dividing the number for the first superpixel,/>Dividing the number for the second superpixel,/>Dividing the number for the third superpixel,/>、/>A first superpixel block ratio and a first structural similarity index corresponding to the first superpixel division number,Is an evaluation index of the first super-pixel segmentation effect, i/(>、/>A second superpixel block ratio and a second structural similarity index corresponding to the second superpixel division number, respectively,/>And the evaluation index is the evaluation index of the second super-pixel segmentation effect.
In a second aspect, the present application provides an image recognition-based uniformity detection apparatus for pulverized particles, which adopts the following technical scheme:
Uniformity detection device of smashed granule based on image recognition includes: the apparatus comprises a processor and a memory storing computer program instructions which, when executed by the processor, implement the above-described method for detecting uniformity of pulverized particles based on image recognition.
The application has the following effects:
Obtaining a binary image through threshold segmentation according to a crushed fertilizer particle image, obtaining an initial superpixel segmentation result through the number of binary image connected domains, obtaining an initial superpixel segmentation effect evaluation index according to the initial superpixel segmentation result, analyzing the superpixel segmentation condition according to the initial superpixel segmentation effect evaluation index, correspondingly adjusting the initial superpixel segmentation number through the superpixel segmentation condition, further obtaining an adjusted superpixel segmentation number, comparing the sizes of the superpixel segmentation effect evaluation indexes corresponding to the superpixel segmentation numbers before and after adjustment, selecting the superpixel segmentation number corresponding to a larger value as a new superpixel segmentation number, then obtaining the optimal superpixel segmentation number in an iterative mode in a self-adaption mode, and further obtaining an optimal crushed fertilizer particle identification result, so that the crushed fertilizer particle uniformity calculation result is more accurate, and the subsequent fertilization effect is better.
Drawings
The above, as well as additional purposes, features, and advantages of exemplary embodiments of the present application will become readily apparent from the following detailed description when read in conjunction with the accompanying drawings. In the drawings, embodiments of the application are illustrated by way of example and not by way of limitation, and like reference numerals refer to similar or corresponding parts and in which:
fig. 1 is a flowchart of a method of step one to step eight in a method for detecting uniformity of pulverized particles based on image recognition according to an embodiment of the present application.
Fig. 2 is a flowchart of a method of step four in a method of detecting uniformity of pulverized particles based on image recognition according to an embodiment of the present application.
Fig. 3 is a schematic diagram of the super-pixel segmentation in the fourth step of the method for detecting the uniformity of crushed particles based on image recognition according to the embodiment of the application.
Fig. 4 is a schematic diagram of an initial superpixel segmentation result obtained by superpixel segmentation of crushed fertilizer particles in the method for detecting uniformity of crushed particles based on image recognition according to the embodiment of the application.
Fig. 5 is a schematic diagram of an edge detection result obtained by detecting an edge of a gray image of a crushed fertilizer particle image in the uniformity detection method of crushed particles based on image recognition according to the embodiment of the application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all embodiments of the application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
It should be understood that when the terms "first," "second," and the like are used in the claims, the specification and the drawings of the present application, they are used merely for distinguishing between different objects and not for describing a particular sequential order. The terms "comprises" and "comprising" when used in the specification and claims of the present application are taken to specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
Specific embodiments of the present application are described in detail below with reference to the accompanying drawings.
Referring to fig. 1, the uniformity detection method of crushed particles based on image recognition includes steps one to eight, specifically as follows:
Step one, acquiring a gray level image of a crushed fertilizer granule image, and performing binarization treatment on the gray level image to obtain a binary image.
The method comprises the steps of acquiring a crushed fertilizer particle image through an industrial camera, enhancing image contrast through sharpening operation by using a convolution kernel, highlighting edges and details in a sampled image, enabling the crushed fertilizer particle boundary to be clearer, converting the sharpened crushed fertilizer particle image into a gray level image, and acquiring a binary image through an Ojin method.
In the binary image, the situation that the background area is identified below a threshold value and the boundary of the two areas is not obviously identified as the same connected area occurs because part of the crushed fertilizer particle areas, the quantity of crushed fertilizer particles in the image is difficult to accurately acquire before segmentation, and the super-pixel segmentation quantity is difficult to determine. However, the number of connected domains in the binary image can roughly reflect the number of crushed fertilizer particles in the image, so that the initial superpixel segmentation number can be preliminarily determined according to the number of connected domains in the binary image, and further an initial superpixel segmentation result is obtained.
And secondly, taking the number of connected domains in the binary image as the initial superpixel segmentation number, and performing superpixel segmentation on the image according to the initial superpixel segmentation number to obtain an initial superpixel segmentation result, wherein the initial superpixel segmentation result is a plurality of superpixel block areas.
Counting the number of connected domains in the binary image as the initial superpixel segmentation number, and marking asAccording to the initial superpixel segmentation number/>And performing super-pixel segmentation on the image to obtain an initial super-pixel segmentation result.
And thirdly, carrying out edge detection on the gray level image to obtain an edge detection result, obtaining an initial superpixel block ratio, an initial superpixel segmentation result and an initial structure similarity index of the edge detection result according to the initial superpixel segmentation result, and taking the product of the initial superpixel block ratio and the initial structure similarity index as an initial superpixel segmentation effect evaluation index.
Although the number of connected domains of the binary image can roughly reflect the number of crushed fertilizer particles in the image, an optimal superpixel segmentation result cannot be obtained, and since the crushed fertilizer particles in the binary image have high circularity and the background area has low circularity, the initial superpixel block ratio can be obtained by counting the ratio of the number of superpixel blocks with the actual crushed fertilizer particles to the difference between the total number of superpixel blocks and the number of background superpixel blocks.
It should be noted that, the initial superpixel block ratio can only reflect the superpixel block ratio that accords with the actual crushed fertilizer particles, and the superpixel blocks that may exist and have shapes similar to the single fertilizer particles but are not single complete fertilizer particles cannot be excluded, and at this time, the initial superpixel segmentation effect evaluation index can be obtained by further supplementing by calculating the initial structural similarity index of the initial superpixel segmentation result and the edge detection result of the crushed fertilizer particle sampling image.
As the edges with insignificant gray level change exist at the edges of the crushed fertilizer particles, the accuracy requirement of the edge detection algorithm is higher, and the Canny edge detection can be well adapted to the situation by adopting non-maximum value inhibition.
And carrying out Canny edge detection on the gray level image to obtain an edge detection result of the crushed fertilizer particle sampling image.
According to the initial superpixel segmentation result, obtaining the circularity of a superpixel block, setting the superpixel block with the circularity smaller than 0.3 as a background superpixel block, setting the superpixel block with the circularity larger than 0.7 as a superpixel block with the shape similar to that of single crushed fertilizer particles but not single complete crushed fertilizer particles, and further obtaining the quantity and the quantity of the background superpixel blocks with the shape similar to that of the single complete crushed fertilizer particles.
The calculation formula of the initial super pixel block ratio is:
Wherein, For the initial superpixel block ratio,/>For the number of superpixel blocks shaped like a single whole crushed fertilizer granule,/>For the number of background superpixel blocks,/>The number is split for the initial superpixel.
In addition, in the present embodiment, the first on the boundary line of the super pixel block area is acquiredMinimum value/>, of distance between each pixel point on edge line in edge detection result from each pixel point to edgeBased on all boundary points in the initial superpixel segmentation result, acquiring the initial superpixel segmentation result by the first/>The boundary points are marked as target boundary points, and the corresponding/>The window is marked as a target window, the pixel point with the same position as the target boundary point in the edge detection result is taken as the center, the window with the same size as the target window is marked as a matching window, the number of the pixel points in the target window and the matching window is 9, the number of the pixel points which are both boundary points and edge pixels and the number of the pixel points which are not boundary points and edge pixels in the target window and the matching window are counted, and the number is marked as/>
The calculation formula of the initial structural similarity index is:
in the method, in the process of the invention, For initial structural similarity index,/>For the sum of pixels which are both boundary points and edge pixels and are not boundary points and edge pixels in the target window and the matched window,/>Representing the number ratio of pixel points which are boundary points, edge pixel points and non-boundary points and non-edge pixel points in the target window and the matched window,/>Is the first/>, on the boundary line of the super pixel block areaMinimum value of distance from each pixel point to each pixel point on edge line in edge detection result,/>Sampling the total number of pixels of the image for crushing fertilizer particles,/>For the initial superpixel partition number,/>Approximating a square diagonal length for a super pixel block,/>Represents the/>Degree of similarity of pixel locations,/>The total pixel point number on the boundary line of the super pixel block area.
For example, when the target window and the matching window are both windows with a size of 3×3, at this time, counting the pixel points at the same position (first position) in the two windows, if the pixel point is both a boundary point and an edge pixel point, m=1, continuing counting, and for the pixel point at the second position, if the pixel point is neither a boundary point nor an edge pixel point, M is accumulated, i.e. m=2; and traversing the pixel points at all the rest positions, and accumulating to obtain the final M. It should be noted that the first position and the second position are only for clarity of illustration, and are not specific to a certain position.
The initial super pixel block ratioAnd initial structural similarity index/>The product of (2) is used as an initial super-pixel segmentation effect evaluation index.
When the evaluation index of the initial super-pixel segmentation effect is lower, the super-pixel segmentation result is not ideal, and the super-pixel segmentation condition of under segmentation or over segmentation exists.
And step four, judging the super-pixel segmentation condition according to the initial super-pixel segmentation effect evaluation index, and obtaining the adjusted super-pixel segmentation quantity according to the super-pixel segmentation condition. Referring to fig. 2 to 5, when the super-pixel division effect evaluation index is low, it is described that the super-pixel division result is not ideal, and there is a case of under-division or over-division. When the number of the pixel points with high gradient in the super pixel block area is large, the condition that the super pixel block segmentation result is under-segmented is indicated, and when the number of the pixel points with low gradient on the boundary line of the super pixel block area is large, the condition that the super pixel block segmentation result is over-segmented is indicated, specifically as follows:
The super pixel segmentation condition is judged, and the method concretely comprises the following steps:
first case: and when the under-segmentation degree is larger than the over-segmentation degree, adjusting the initial super-pixel segmentation number to obtain a first super-pixel segmentation number.
Second case: when the over-segmentation degree is larger than the under-segmentation degree, the initial super-pixel segmentation number is adjusted to obtain a second super-pixel segmentation number;
Third case: when the undersection degree is equal to the oversection degree, a first superpixel segmentation effect evaluation index and a second superpixel segmentation effect evaluation index are respectively obtained according to the first superpixel segmentation number and the second superpixel segmentation number obtained in the first case and the second case, the magnitudes of the first superpixel segmentation effect evaluation index and the second superpixel segmentation effect evaluation index are compared, the superpixel segmentation number corresponding to a larger value is selected as a third superpixel segmentation number, and the third superpixel segmentation number is equal to the first superpixel segmentation number or the second superpixel segmentation number.
The under-segmentation and over-segmentation are calculated separately.
Specifically, obtainA super pixel block region according to the/>Edge detection results corresponding to the super pixel block areas are obtained, and the/>, in the initial super pixel segmentation results, are obtainedThe number of pixel points belonging to the edge in the pixel point set in the super pixel block area/>First/>, in initial superpixel segmentation resultsIn the edge detection results of the pixel points corresponding to the same positions on the boundary lines of the super pixel block areas, counting the number/>, which is not the number of the edge pixel points、/>Total number of pixel points in each super pixel block area/>/>Total pixel point number/>
The calculation formula of the undersplit degree is:
Wherein, Under-segmentation degree for super-pixel segmentation result,/>For/>Sum of pixel points belonging to edge pixel points in pixel point set in super pixel block area,/>Representation/>The sum of pixel points of the super pixel blocks belonging to the edge pixel points in the boundary of each super pixel block/>The larger the ratio of the total pixel point number in each super pixel block area, the higher the under-segmentation degree of the super pixel segmentation result is.
The calculation formula of the oversplitting degree is as follows:
Wherein, Over-segmentation for initial superpixel segmentation result,/>For/>Sum of pixel points which are not edge pixel points on boundary line of each super pixel block area,/>Representation/>The sum of pixel points which are not edge pixel points on the boundary line of the super pixel block areas occupies/>The larger the ratio of the number of the total pixel points on the boundary line of each super pixel block area, the higher the over-dividing degree of the super pixel dividing result is.
And obtaining the adjusted super-pixel segmentation quantity according to the super-pixel segmentation condition. The number of super-pixel divisions should be appropriately increased according to the initial super-pixel division effect evaluation index when there is under-division, and the number of super-pixel divisions should be appropriately decreased according to the initial super-pixel division effect evaluation index when there is over-division.
Specifically, according to the initial super-pixel segmentation effect evaluation index and the under-segmentation degreeExcessive degree of division/>Obtaining the adjusted super-pixel segmentation quantity:
In the formula, when When the super-pixel segmentation result is judged to have under segmentation, the super-pixel segmentation number needs to be increased according to the super-pixel segmentation effect evaluation index, and when/>When the super-pixel segmentation result is judged to have over-segmentation, the super-pixel segmentation number needs to be reduced according to the super-pixel segmentation effect evaluation index. /(I)For the adjusted number of superpixel divisions,/>Dividing the number for the first superpixel,/>Dividing the number for the second superpixel,/>For the initial superpixel block ratio,/>For initial structural similarity index,/>And (5) representing an initial super-pixel segmentation effect evaluation index.
When the following is performedWhen the method is used, the super-pixel segmentation effect evaluation indexes corresponding to the first super-pixel segmentation quantity and the second super-pixel segmentation quantity are required to be calculated respectively and compared, and the super-pixel segmentation quantity corresponding to the larger super-pixel segmentation effect evaluation index is selected as the adjusted super-pixel segmentation quantity.
In particular, whenThe first super-pixel dividing number obtained according to the first case and the second caseAnd a second superpixel division number/>And respectively obtaining a first superpixel segmentation effect evaluation index and a second superpixel segmentation effect evaluation index, comparing the magnitudes of the first superpixel segmentation effect evaluation index and the second superpixel segmentation effect evaluation index, and further selecting the superpixel segmentation number corresponding to a larger value as a third superpixel segmentation number. The third number of superpixel divisions is equal to the first number of superpixel divisions or the second number of superpixel divisions.
The expression for obtaining the third super-pixel segmentation number by adjusting the initial super-pixel segmentation number is as follows:
in the method, in the process of the invention, Dividing the number for the first superpixel,/>Dividing the number for the second superpixel,/>Dividing the number for the third superpixel,/>、/>A first superpixel block ratio and a first structural similarity index corresponding to the first superpixel division number,Is an evaluation index of the first super-pixel segmentation effect, i/(>、/>A second superpixel block ratio and a second structural similarity index corresponding to the second superpixel division number, respectively,/>And the evaluation index is the evaluation index of the second super-pixel segmentation effect.
And fifthly, comparing the sizes of the super-pixel segmentation effect evaluation indexes corresponding to the super-pixel segmentation numbers before and after adjustment, and selecting the super-pixel segmentation number corresponding to the larger value as a new super-pixel segmentation number.
Specifically, the adjusted number of the super-pixel divisions according to the super-pixel division condition may be the first number of the super-pixel divisions, the second number of the super-pixel divisions, or the third number of the super-pixel divisions, and the super-pixel divisions corresponding to the larger value are selected as the new number of the super-pixel divisions by comparing the corresponding super-pixel division effect evaluation index with the initial super-pixel division effect evaluation index.
And step six, repeating the step two to the step five to obtain adjusted super-pixel segmentation effect evaluation indexes, continuing to compare until the super-pixel segmentation effect evaluation indexes before and after adjustment are equal, and stopping iteration to obtain the optimal super-pixel segmentation quantity.
When the super-pixel segmentation effect index corresponding to the super-pixel segmentation number obtained in an iterative mode is approximately equal or equal to the recently adjusted super-pixel segmentation effect index value, the corresponding super-pixel segmentation number is the optimal super-pixel segmentation number.
For example, based on the initial superpixel segmentation, the first superpixel segmentation number is assumed to be selected as the new adjusted superpixel segmentation number, the corresponding superpixel segmentation effect evaluation index is compared with the initial superpixel segmentation effect evaluation index, and if the difference between the two is large, the second to fifth steps are repeated to obtain the new adjusted superpixel segmentation number. The new super-pixel segmentation number after the second adjustment may be the fourth super-pixel segmentation number, the fifth super-pixel segmentation number or the sixth super-pixel segmentation number, the magnitudes of the super-pixel segmentation effect evaluation indexes corresponding to the fourth super-pixel segmentation number, the fifth super-pixel segmentation number and the sixth super-pixel segmentation number are compared, the super-pixel segmentation number corresponding to the larger value is selected as the new super-pixel segmentation number after the second adjustment, the super-pixel segmentation effect evaluation index obtained after the second adjustment is compared with the super-pixel segmentation effect evaluation index obtained after the first adjustment, if the values of the two values approach to be equal or equal, iteration is stopped, the super-pixel segmentation number corresponding to the super-pixel segmentation effect evaluation index obtained after the second adjustment is used as the optimal super-pixel segmentation number, and if the difference of the two values is larger, iteration is continued.
And step seven, obtaining the optimal crushed fertilizer granule superpixel segmentation result according to the optimal superpixel segmentation quantity.
In the super-pixel segmentation results obtained according to the optimal super-pixel segmentation quantity, a single super-pixel block can better correspond to one crushed fertilizer particle, and in the super-pixel segmentation results of the crushed fertilizer particle sampling image obtained at the moment, the matching degree of the super-pixel and the crushed fertilizer particle is optimal, so that the super-pixel segmentation effect is optimal at the moment.
And step eight, calculating the standard deviation of the dead moment of the superpixel block according to the optimal crushed fertilizer particle superpixel segmentation result, and obtaining the uniformity of the crushed fertilizer particles.
Based on the four-side static moment theory, the larger the static moment standard deviation of the crushed fertilizer particles is, the higher the difference between the static moment standard deviation and the sum of the static moments under ideal uniform distribution is, and the more nonuniform crushed fertilizer particles is explained at the moment, so that the static moment standard deviation of the super-pixel blocks in the super-pixel segmentation result of the optimal crushed fertilizer particles can be used for representing the uniformity of the crushed fertilizer particles.
According to the best crushed fertilizer granule superpixel segmentation resultArea/>, of the individual superpixel blocksAnd distances/>, from the centroid to four sides of the crushed fertilizer granule sample imageWhere e=1, 2,3,4, obtain the/>Super pixel blocks to the crushed fertilizer granule sampling image/>Dead moment of strip edge/>Sampling the image according to the super pixel blocks to crushed fertilizer particles/>The dead moment of each edge is obtained, and the average value/> of the dead moment sum of each edge of each super pixel block is obtainedAnd further obtaining the dead moment and standard deviation of the super pixel block as the uniformity of the crushed fertilizer particles.
The embodiment of the application also discloses a uniformity detection device of the crushed particles based on image recognition, which comprises a processor and a memory, wherein the memory stores computer program instructions, and the uniformity detection method of the crushed particles based on image recognition is realized when the computer program instructions are executed by the processor.
The above system further comprises other components well known to those skilled in the art, such as a communication bus and a communication interface, the arrangement and function of which are known in the art and therefore are not described in detail herein.
In the context of this patent, the foregoing memory may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. For example, the computer-readable storage medium may be any suitable magnetic or magneto-optical storage medium, such as, for example, resistance change Memory RRAM (Resistive Random Access Memory), dynamic Random Access Memory DRAM (Dynamic Random Access Memory), static Random Access Memory SRAM (Static Random-Access Memory), enhanced dynamic Random Access Memory EDRAM (ENHANCED DYNAMIC Random Access Memory), high-Bandwidth Memory HBM (High-Bandwidth Memory), hybrid storage cube HMC (Hybrid Memory Cube), or the like, or any other medium that may be used to store the desired information and that may be accessed by an application, a module, or both. Any such computer storage media may be part of, or accessible by, or connectable to, the device.
While various embodiments of the present application have been shown and described herein, it will be obvious to those skilled in the art that such embodiments are provided by way of example only. Many modifications, changes, and substitutions will now occur to those skilled in the art without departing from the spirit and scope of the application. It should be understood that various alternatives to the embodiments of the application described herein may be employed in practicing the application.
The above embodiments are not intended to limit the scope of the present application, so: all equivalent changes in structure, shape and principle of the application should be covered in the scope of protection of the application.

Claims (7)

1. The uniformity detection method of the crushed particles based on image recognition is characterized by comprising the following steps of:
step one, acquiring a gray level image of a crushed fertilizer particle image, and performing binarization treatment on the gray level image to obtain a binary image;
Step two, taking the number of connected domains in the binary image as an initial superpixel segmentation number, and performing superpixel segmentation on the image according to the initial superpixel segmentation number to obtain an initial superpixel segmentation result, wherein the initial superpixel segmentation result is a plurality of superpixel block areas;
Step three, carrying out edge detection on the gray level image to obtain an edge detection result, obtaining an initial superpixel block ratio, an initial superpixel segmentation result and an initial structure similarity index of the edge detection result according to the initial superpixel segmentation result, and taking the product of the initial superpixel block ratio and the initial structure similarity index as an initial superpixel segmentation effect evaluation index;
Judging the super-pixel segmentation condition according to the initial super-pixel segmentation effect evaluation index, and obtaining the adjusted super-pixel segmentation quantity according to the super-pixel segmentation condition;
step five, comparing the sizes of the super-pixel segmentation effect evaluation indexes corresponding to the super-pixel segmentation numbers before and after adjustment, and selecting the super-pixel segmentation number corresponding to a larger value as a new super-pixel segmentation number;
step six, repeating the step two to the step five to obtain adjusted super-pixel segmentation effect evaluation indexes, continuing to compare until the super-pixel segmentation effect evaluation indexes before and after adjustment are equal, and stopping iteration to obtain the optimal super-pixel segmentation quantity;
Step seven, obtaining an optimal crushed fertilizer granule superpixel segmentation result according to the optimal superpixel segmentation quantity;
And step eight, calculating the dead moment standard deviation of the superpixel block according to the optimal crushed fertilizer particle superpixel segmentation result, and obtaining the uniformity of crushed fertilizer particles.
2. The method for detecting uniformity of pulverized particles based on image recognition according to claim 1, wherein the initial super pixel block ratio expression is:
Wherein, For the initial superpixel block ratio,/>For a number of superpixel blocks similar in shape to a single whole crushed fertilizer granule,For the number of background superpixel blocks,/>The number is split for the initial superpixel.
3. The method for detecting uniformity of pulverized particles based on image recognition according to claim 2, wherein the initial structural similarity index expression is:
Wherein, For initial structural similarity index,/>Representing the number of pixel points in the target window,/>The target window is counted as the sum of pixels which are not boundary points nor edge pixels and are not boundary points nor edge pixels in the target window and the matched windowThe boundary points are the/>, corresponding to the target boundary pointsA window, wherein the matching window is a window with the same size as the target window by taking the pixel point with the same position as the target boundary point in the edge detection result as the center, and the window is a window with the same size as the target windowIs the first/>, on the boundary line of the super pixel block areaMinimum value of distance from each pixel point to each pixel point on edge line in edge detection result,/>Sampling the number of total pixel points on an image for smashing fertilizer particles,/>For the initial superpixel partition number,/>Approximating a square diagonal length for a super pixel block,/>Represents the/>Degree of similarity of pixel locations,/>The total pixel point number on the boundary line of the super pixel block area.
4. A method for detecting uniformity of pulverized particles based on image recognition as set forth in claim 3, wherein the super-pixel division case includes:
First case: when the undersection degree is larger than the oversection degree, the initial superpixel segmentation number is adjusted to obtain a first superpixel segmentation number;
second case: when the over-segmentation degree is larger than the under-segmentation degree, the initial super-pixel segmentation number is adjusted to obtain a second super-pixel segmentation number;
third case: when the under-segmentation degree is equal to the over-segmentation degree, a first super-pixel segmentation effect evaluation index and a second super-pixel segmentation effect evaluation index are respectively obtained according to the first super-pixel segmentation number and the second super-pixel segmentation number obtained in the first case and the second case, the magnitudes of the first super-pixel segmentation effect evaluation index and the second super-pixel segmentation effect evaluation index are compared, the super-pixel segmentation number corresponding to a larger value is selected as a third super-pixel segmentation number, and the third super-pixel segmentation number is equal to the first super-pixel segmentation number or the second super-pixel segmentation number.
5. The method for detecting uniformity of pulverized particles based on image recognition according to claim 4, wherein the undersize satisfies the following relation:
in the method, in the process of the invention, Under-segmentation degree for initial superpixel segmentation result,/>For the/>, in the initial superpixel segmentation resultThe number of pixel points belonging to the edge in the pixel point set in the super pixel block area,/>For/>The total number of pixel points in the super pixel block areas;
the degree of over-segmentation satisfies the following relationship:
in the method, in the process of the invention, Over-segmentation for initial superpixel segmentation result,/>For the/>, in the initial superpixel segmentation resultThe number of pixel points which do not belong to edge pixel points on the boundary line of each super pixel block area,/>For/>The total number of pixel points on the boundary line of the super pixel block area.
6. The method for detecting uniformity of crushed particles based on image recognition according to claim 5, wherein the specific expression of the adjusted number of superpixel divisions according to the superpixel division condition is:
Wherein, For the adjusted number of superpixel divisions,/>Dividing the number for the first superpixel,/>Dividing the number for the second superpixel,/>For the initial superpixel block ratio,/>For initial structural similarity index,/>Representing an initial superpixel segmentation effect evaluation index;
When (when) When the initial super-pixel segmentation number is adjusted, an expression for obtaining a third super-pixel segmentation number is as follows:
Wherein, Dividing the number for the first superpixel,/>Dividing the number for the second superpixel,/>Dividing the number for the third superpixel,/>、/>A first superpixel block ratio and a first structural similarity index corresponding to the first superpixel division number,Is an evaluation index of the first super-pixel segmentation effect, i/(>、/>A second superpixel block ratio and a second structural similarity index corresponding to the second superpixel division number, respectively,/>And the evaluation index is the evaluation index of the second super-pixel segmentation effect.
7. Uniformity detection device of crushing granule based on image recognition, its characterized in that includes: a processor and a memory storing computer program instructions which, when executed by the processor, implement the method of uniformity detection of pulverized particles based on image recognition as claimed in any one of claims 1 to 6.
CN202410370836.4A 2024-03-29 2024-03-29 Method and device for detecting uniformity of crushed particles based on image recognition Active CN117974651B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410370836.4A CN117974651B (en) 2024-03-29 2024-03-29 Method and device for detecting uniformity of crushed particles based on image recognition

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410370836.4A CN117974651B (en) 2024-03-29 2024-03-29 Method and device for detecting uniformity of crushed particles based on image recognition

Publications (2)

Publication Number Publication Date
CN117974651A true CN117974651A (en) 2024-05-03
CN117974651B CN117974651B (en) 2024-05-28

Family

ID=90863346

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410370836.4A Active CN117974651B (en) 2024-03-29 2024-03-29 Method and device for detecting uniformity of crushed particles based on image recognition

Country Status (1)

Country Link
CN (1) CN117974651B (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106780485A (en) * 2017-01-12 2017-05-31 西安电子科技大学 SAR image change detection based on super-pixel segmentation and feature learning
US20190164009A1 (en) * 2017-11-29 2019-05-30 Tata Consultancy Services Limited Method and system for visual change detection using multi-scale analysis
CN110188763A (en) * 2019-05-28 2019-08-30 江南大学 A kind of image significance detection method based on improvement graph model
US20200034972A1 (en) * 2018-07-25 2020-01-30 Boe Technology Group Co., Ltd. Image segmentation method and device, computer device and non-volatile storage medium
CN110807742A (en) * 2019-11-21 2020-02-18 西安工业大学 Low-light-level image enhancement method based on integrated network
CN112164087A (en) * 2020-10-13 2021-01-01 北京无线电测量研究所 Super-pixel segmentation method and device based on edge constraint and segmentation boundary search
US20210224990A1 (en) * 2016-06-03 2021-07-22 Koninklijke Philips N.V. Biological object detection
CN115272311A (en) * 2022-09-26 2022-11-01 江苏亚振钻石有限公司 Wolframite image segmentation method based on machine vision
CN116188423A (en) * 2023-02-22 2023-05-30 哈尔滨工业大学 Super-pixel sparse and unmixed detection method based on pathological section hyperspectral image

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20210224990A1 (en) * 2016-06-03 2021-07-22 Koninklijke Philips N.V. Biological object detection
CN106780485A (en) * 2017-01-12 2017-05-31 西安电子科技大学 SAR image change detection based on super-pixel segmentation and feature learning
US20190164009A1 (en) * 2017-11-29 2019-05-30 Tata Consultancy Services Limited Method and system for visual change detection using multi-scale analysis
US20200034972A1 (en) * 2018-07-25 2020-01-30 Boe Technology Group Co., Ltd. Image segmentation method and device, computer device and non-volatile storage medium
CN110188763A (en) * 2019-05-28 2019-08-30 江南大学 A kind of image significance detection method based on improvement graph model
CN110807742A (en) * 2019-11-21 2020-02-18 西安工业大学 Low-light-level image enhancement method based on integrated network
CN112164087A (en) * 2020-10-13 2021-01-01 北京无线电测量研究所 Super-pixel segmentation method and device based on edge constraint and segmentation boundary search
CN115272311A (en) * 2022-09-26 2022-11-01 江苏亚振钻石有限公司 Wolframite image segmentation method based on machine vision
CN116188423A (en) * 2023-02-22 2023-05-30 哈尔滨工业大学 Super-pixel sparse and unmixed detection method based on pathological section hyperspectral image

Also Published As

Publication number Publication date
CN117974651B (en) 2024-05-28

Similar Documents

Publication Publication Date Title
CN115861135B (en) Image enhancement and recognition method applied to panoramic detection of box body
Lakshmanan A separable filter for directional smoothing
CN109635733B (en) Parking lot and vehicle target detection method based on visual saliency and queue correction
CN109801295B (en) Image segmentation method based on secondary limited region growing method
CN110580705B (en) Method for detecting building edge points based on double-domain image signal filtering
CN110070545B (en) Method for automatically extracting urban built-up area by urban texture feature density
CN106780503A (en) Remote sensing images optimum segmentation yardstick based on posterior probability information entropy determines method
CN114998198A (en) Injection molding surface defect identification method
CN106127258A (en) A kind of target matching method
CN115880586A (en) Satellite remote sensing image cloud and snow detection method based on mixed feature network
CN104732230A (en) Pathology image local-feature extracting method based on cell nucleus statistical information
CN113409332B (en) Building plane segmentation method based on three-dimensional point cloud
CN112164087B (en) Super-pixel segmentation method and device based on edge constraint and segmentation boundary search
CN106324708B (en) Digitizing solution, the device of rainfall record drawing
CN112949657B (en) Forest land distribution extraction method and device based on remote sensing image texture features
CN114612315A (en) High-resolution image missing region reconstruction method based on multi-task learning
CN117974651B (en) Method and device for detecting uniformity of crushed particles based on image recognition
Shire et al. A review paper on: agricultural plant leaf disease detection using image processing
CN117292272A (en) Method for identifying large-range cultivation measures by combining high-resolution remote sensing image and open source DEM
Mani et al. Design of a novel shape signature by farthest point angle for object recognition
CN115690439A (en) Feature point aggregation method and device based on image plane and electronic equipment
CN101477538A (en) Three-dimensional object retrieval method and apparatus
CN110852352B (en) Data enhancement method for training deep neural network model for target detection
CN110276260B (en) Commodity detection method based on depth camera
CN114972453A (en) Improved SAR image region registration method based on LSD and template matching

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
GR01 Patent grant