CN115661667A - Method for identifying impurities of descurainia sophia seeds based on computer vision - Google Patents
Method for identifying impurities of descurainia sophia seeds based on computer vision Download PDFInfo
- Publication number
- CN115661667A CN115661667A CN202211592140.3A CN202211592140A CN115661667A CN 115661667 A CN115661667 A CN 115661667A CN 202211592140 A CN202211592140 A CN 202211592140A CN 115661667 A CN115661667 A CN 115661667A
- Authority
- CN
- China
- Prior art keywords
- value
- region
- type
- seeds
- descurainia sophia
- 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
Links
Images
Landscapes
- Image Analysis (AREA)
Abstract
The invention relates to the technical field of image processing, in particular to a method for identifying impurities in physalis pubescens seeds based on computer vision, which comprises the following steps: acquiring a descurainia sophia seed image, and performing K-means clustering segmentation on the descurainia sophia seed image to obtain K-type regions; acquiring a segmentation effect value of a descurainia sophia seed image; arranging a plurality of rectangular frames in the images of the seeds of the descurainia sophia, acquiring the number of lower connected domains of each type of regions in each rectangular frame, and acquiring the segmentation effect value of each type of regions; clustering each type of region to obtain a normal region and an impurity region, and obtaining a segmentation effect value of the impurity region according to a mean value of segmentation effects of each type of region corresponding to the normal region and the impurity region and a segmentation effect value of a descurainia sophia image; and obtaining an optimal impurity region according to the maximum value of the segmentation effect value of the impurity region, and removing impurities from the descurainia sophia seeds according to the optimal impurity region. The method improves the accuracy of identifying the impurities of the descurainia sophia seeds.
Description
Technical Field
The invention relates to the technical field of image processing, in particular to a method for identifying impurities in physalis pubescens seeds based on computer vision.
Background
The descurainia sophia is an herbaceous plant, the whole descurainia sophia has high medicinal value, and meanwhile, the descurainia sophia seeds have high oil content, so that oil pressing from the descurainia sophia seeds is often collected. When the descurainia sophia seeds are collected and used as oil, the impurities in the descurainia sophia seeds can influence the oil yield and the oil quality, so that the impurities in the descurainia sophia seeds need to be identified, and the impurities need to be removed when the impurity content is too high.
For identification of the impurities in the seeds of the myrtle, the regions of the normal seeds of the myrtle and the impurities are segmented by a K-means clustering segmentation method according to the difference of the pixel values of the impurities and the normal seeds of the myrtle in an image, but the K value is required to be set to determine the type of the divided regions when the K-means clustering segmentation is carried out, and the impurities corresponding to different images of the myrtle seeds are different, so that the images of the myrtle seeds are segmented according to the same K value, the regions of the normal seeds of the myrtle and the regions of the impurities in each image cannot be accurately obtained, the regions of the impurities in the seeds of the myrtle are inaccurately identified, and the final impurity removal effect is influenced.
Disclosure of Invention
The invention provides a method for identifying impurities in seeds of descurainia sophia based on computer vision, which aims to solve the problem that the identification of impurity regions in the seeds of descurainia sophia is inaccurate in the prior art.
The invention relates to a method for identifying impurities in descurainia sophia seeds based on computer vision, which adopts the following technical scheme:
s1, acquiring a descurainia sophia seed image, setting an initial K value of K-means clustering segmentation, and performing K-means clustering segmentation on the descurainia sophia seed image by using a pixel value of each pixel point in the descurainia sophia seed image and the initial K value to obtain all classification areas;
s2, obtaining a standard deviation of pixel value mean values of pixels between all the types of regions according to pixel value mean values of all the pixels in the connected regions under each type of regions, and obtaining a segmentation effect value of the sowing artemisia annua seed image by using the standard deviation of the pixel value mean values of the pixels between all the types of regions and the mean value of the standard deviation of the pixel values of the pixels in all the connected regions under each type of regions;
s3, setting a plurality of rectangular frames in the sowing artemisia seed image, obtaining the number of connected domains under each type of region in each rectangular frame, obtaining the distribution uniformity of each type of region according to the number of connected domains under each type of region in each rectangular frame, and obtaining the segmentation effect value of each type of region according to the distribution uniformity of each type of region, the pixel value mean value of all the connected domain pixel points under each type of region and the pixel value mean value of the sowing artemisia seed image;
s4, clustering all the similar regions to obtain a normal region and an impurity region, and obtaining a segmentation effect value of the impurity region according to a mean value of the segmentation effect values of each region contained in the normal region and the impurity region and the segmentation effect value of the image of the descurainia sophia seed;
and S5, adjusting the initial K value to obtain an adjusted K value, repeating the steps S1-S4 according to the adjusted K value to obtain a segmentation effect value of the impurity region, sequentially iterating until the segmentation effect value of the impurity region is maximum, taking the impurity region corresponding to the maximum value of the segmentation effect value of the impurity region as an optimal impurity region, and judging whether the descurainia sophia seeds corresponding to the descurainia sophia seed image need to be purified according to the optimal impurity region.
Further, the method for obtaining the segmentation effect value of the descurainia sophia image comprises the following steps:
and taking the standard deviation of the mean values of the pixel points between each type of regions as a numerator, taking the mean value of the standard deviation of the pixel values of the pixel points in each connected domain under each type of region as a denominator to obtain a ratio, and taking the ratio as a segmentation effect value of the descurainia sophia seed image.
Further, the degree of uniformity of the distribution of each type of region is determined as follows:
and obtaining the standard deviation of the number of each type of region in the images of the seeds of the descurainia sophia according to the number of the connected regions under each type of region in each rectangular frame, and taking the standard deviation of the number of each type of region as the distribution uniformity degree of each type of region.
Further, the segmentation effect value of each type of region is determined as follows:
and acquiring the absolute value of the difference value between the pixel value mean value of all connected domain pixel points in each type of region and the pixel value mean value of the descurainia sophia seed image, taking the absolute value of the difference value as a molecule, taking the distribution uniformity degree of the type of region as a molecule to obtain a ratio, and obtaining the segmentation effect value of each type of region by using the ratio.
Further, the method for obtaining the normal region and the impurity region comprises the following steps:
performing K-means clustering segmentation on each type of region in the descurainia sophia image, wherein the K value is set to be 2, and obtaining two types of regions after secondary segmentation;
respectively calculating the mean value of the segmentation effect of each type of region in the two types of regions after the secondary segmentation;
and taking the area after the secondary division corresponding to the average value with the larger numerical value in the two average values as a normal area, and taking the area after the secondary division corresponding to the average value with the smaller numerical value in the two average values as an impurity area.
Further, the value of the effect of dividing the impurity region is determined as follows:
acquiring an absolute value of a difference value between the mean value of the segmentation effect values of each type of region in the normal region and the mean value of the segmentation effect values of each type of region in the impurity region;
and taking the absolute value of the difference value as an index of an exponential function to obtain the exponential function, and adding the exponential function and the segmentation effect value of the sowing wormwood seed image to obtain the segmentation effect value of the impurity region.
Further, the method for removing impurities from the seeds of the descurainia sophia comprises the following steps:
obtaining the impurity content in the images of the seeds of the physalis pubescens according to the ratio of the area of the optimal impurity region in the images of the seeds of the physalis pubescens to the area of the images of the seeds of the physalis pubescens;
and setting an allowable impurity content value in each image of the physalis pubescens seeds, and when the impurity content in each image of the physalis pubescens seeds is greater than the allowable impurity content value in each image of the physalis pubescens seeds, removing impurities from the physalis pubescens seeds corresponding to the image of the physalis pubescens seeds.
The invention has the beneficial effects that: the method comprises the steps of segmenting a descurainia sophia seed image by utilizing K-means clustering segmentation to obtain K types of regions, obtaining a standard deviation of pixel value mean values of pixels between all types of regions according to the mean values of pixels in all connected regions under each type of region, obtaining a segmentation effect value of the descurainia sophia seed image according to the standard deviation of the pixel value mean values of the pixels between all types of regions and the mean value of the standard deviation of the pixel values of the pixels in all connected regions under each type of region, wherein the segmentation effect value of the descurainia sophia seed image represents the integral effect of the K-means clustering segmentation, and the integral effect of the clustering segmentation combines the pixel values of the same type of regions to be close, and the pixel values of different regions have larger difference, so that the integral effect of the obtained means clustering segmentation is more accurate; obtaining a segmentation effect value of each type of region according to the distribution uniformity of each type of region, the pixel value mean values of all connected domain pixel points under each type of region and the pixel value mean value of the descurainia sophia image, wherein the segmentation effect value of each type of region represents the independent effect of segmentation of each type of region of the descurainia sophia image; therefore, the impurity region obtained by the K-means clustering segmentation is analyzed by utilizing the integral effect and the single effect, so that the finally obtained impurity region is more accurate.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
Fig. 1 is a flowchart of an embodiment of a method for identifying impurities in seeds of descurainia sophia based on computer vision.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be obtained by a person skilled in the art without making any creative effort based on the embodiments in the present invention, belong to the protection scope of the present invention.
An embodiment of a method for identifying impurities in descurainia sophia seed based on computer vision according to the present invention is shown in fig. 1, and comprises:
s1, obtaining a Descurainia sophia (L.) Webb. Ex Prantl) seed image, setting an initial K value of K-means clustering segmentation, and carrying out K-means clustering segmentation on the Descurainia sophia seed image by using a pixel value of each pixel point in the Descurainia sophia seed image and the initial K value to obtain all kinds of regions.
The method for acquiring the images of the seeds of the physalis pubescens comprises the following specific steps: in order to ensure the quality of the descurainia sophia seeds, the impurities in the descurainia sophia seeds need to be detected, in the method, a camera is installed above a horizontal transmission device of the descurainia sophia seeds by shooting images of the descurainia sophia seeds in the transmission device (the descurainia sophia seeds are flatly paved on the transmission device and are thinly paved), the images of the descurainia sophia seeds are shot, after the images are shot by the camera, in order to reduce the interference of a background, the images need to be preprocessed, namely, a semantic segmentation technology is utilized, after an original image is input, the images of the descurainia sophia region are obtained by segmentation, and all images of the descurainia sophia seeds mentioned in subsequent processing are images of the descurainia sophia region.
Since the seeds of the descurainia sophia to be detected are moved in the conveyor, in order to obtain images of all the seeds of the descurainia sophia in the conveyor, it is necessary to set the shooting time interval of the camera according to the moving speed of the conveyor belt. Given that the running speed of the conveyor is v and the length of the conveyor where an image is taken is L, the camera takes an intervalAt this time, different seeds of the descurainia sophia are obtained by each image shooting, and the seeds of the descurainia sophia in all the conveying devices can be obtained by shooting.
The method comprises the steps of detecting the impurities of the seeds of the physalis pubescens to be detected, and removing impurities for the second time according to a detection result.
Setting an initial K value, and carrying out K-means clustering segmentation on the descurainia sophia image according to the pixel value of each pixel point in the descurainia sophia image and the initial K value to obtain K-type regions (all-type regions).
S2, obtaining the standard deviation of the pixel value mean values of the pixels between the various regions according to the pixel value mean values of all the pixels in the connected regions under the various regions, and obtaining the segmentation effect value of the sowing artemisia annua seed image by using the standard deviation of the pixel value mean values of the pixels between the various regions and the mean value of the standard deviation of the pixel values of the pixels in the various connected regions under the various regions.
The specific steps for obtaining the mean values of the pixel points in all the connected domains under each type of region are as follows: and obtaining the pixel value of the pixel point in each connected domain under each type of region, adding the pixel values of the pixel points in each connected domain under each type of region, and dividing the sum by the number of all the pixel points in each type of region to obtain the average value of the pixel points in all the connected domains under each type of region.
The specific steps of obtaining the standard deviation of the pixel value mean value of the pixel points between each type of area are as follows: obtaining the mean value of the pixel points in all the connected domains under each type of region according to the number of all the pixel points in each type of region to obtain the standard deviation, namely the standard deviation of the mean value of the pixel values of the pixel points between each type of region。
The specific steps for obtaining the segmentation effect value of the descurainia sophia image are as follows: obtaining the standard deviation of the pixel values of the pixel points in each connected domain under each type of regionAnd summing the standard deviations of the pixel values of the pixels in each connected domain under each type of region to obtain an accumulated sumDividing the accumulated sum by the class number K of the region to obtain the mean value of the standard deviation of the pixel values of the pixel points in each connected domain in all the class regionsTaking the standard deviation of the mean values of the pixel points between the regions of all kinds as a numerator, taking the mean value of the standard deviation of the pixel values of the pixel points in each connected domain under all the regions of all kinds as a denominator to obtain a ratio, and taking the ratio as a segmentation effect value of the sowing blighted wormwood seed image。
It should be noted that, in the following description,the larger the difference of the pixel values of the same region is, the poorer the segmentation effect of the images of the seeds of the physalis pubescens is, namelyThe larger the image size is, the poorer the segmentation effect of the images of the descurainia sophia seeds is,represents the standard deviation of the mean of the pixel values of the current K classification regions,the larger the difference between different classification regions is, the better the segmentation effect is, and therefore,the smaller the size of the hole is,the larger the M is, the better the segmentation effect of the images of the descurainia sophia seeds is.
The characteristic of obtaining the pixel values of different regions after the K-means clustering segmentation is that the pixel values of the same region have similarity, and the pixel values of different regions have difference, so that the current image segmentation effect is judged, and the segmentation of the descurainia sophia seeds and impurities is facilitated.
S3, setting a plurality of rectangular frames in the sowing artemisia seed image, obtaining the number of the lower connected domains of each type of region in each rectangular frame, obtaining the distribution uniformity of each type of region according to the number of the lower connected domains of each type of region in each rectangular frame, and obtaining the segmentation effect value of each type of region according to the distribution uniformity of each type of region, the pixel value mean value of all the pixels of the connected domains of each type of region and the pixel value mean value of the sowing artemisia seed image.
After the K-means clustering segmentation is utilized, the images of the seeds of the physalis pubescens are segmented into K-type regions according to the difference of pixel values, and the normal physalis pubescens have gray level difference in the images, so that the normal physalis pubescens seeds are easily clustered into multiple types in the K-means clustering process, normal and impurity judgment needs to be further performed on the multiple types of segmented regions, and the calculated amount is large.
The specific steps for obtaining the uniformity degree of the distribution of each type of area are as follows: the method comprises the steps of setting a plurality of rectangles by taking the center of a descurainia sophia seed image as the center of the rectangle, setting the expansion step length of the rectangles as r, setting according to specific conditions, not giving a specific reference value, expanding the rectangles from the center to the periphery, obtaining the number of connected domains under each type of region in each rectangular frame, obtaining the standard deviation of the number of each type of region in the descurainia sophia seed image according to the number of connected domains under each type of region in each rectangular frame, wherein the standard deviation represents the distribution density of each type of region, and therefore, taking the standard deviation of the number of each type of regions as the uniform degree of distribution of each type of region。
The specific steps for obtaining the segmentation effect value of each type of region are as follows: the method comprises the following steps of obtaining the pixel value mean values of all connected domain pixel points and the pixel value mean values of a descurainia sophia image under each type of region, and obtaining the segmentation effect value of each type of region according to the uniformity degree of distribution of each type of region, the pixel value mean values of all connected domain pixel points under each type of region and the pixel value mean values of the descurainia sophia image, wherein the specific expression is as follows:
in the formula:denotes the firstThe value of the segmentation effect of the class region,is shown asThe mean value of pixel values in all connected domain pixel points under the class region,the mean of the pixel values representing an image of a plant seed of physalis alkekengi,is shown asThe degree of uniformity of the distribution of the class regions.
Wherein the content of the first and second substances,is shown asThe degree of deviation of the pixel values of the class regions,the smaller, theThe smaller the degree of deviation of the pixel values of the similar region, the more likely it is to represent the normal flimsy region, and therefore,mainly reflecting the first obtained by the divisionThe taxonomic region indicates the extent of normal physalis pubescens seed region,the larger the size, the firstThe more likely the quads are to represent the normal region of the seed of the plant descurainia sophia,is shown asThe value of the segmentation effect of the class region,the larger the size, the more the expressionThe classified area is the area of normal sowing mother plant seeds,the smaller the size, the more the expressionThe seed region is an impurity region in the seeds of the physalis pubescens; so as to pass throughThe method shows the same characteristics of normal descurainia sophia seeds, and avoids the influence of different types of segmentation areas existing in the K-means clustering segmentation on the impurity recognition of the descurainia sophia seeds caused by the difference of the normal descurainia sophia seeds.
And S4, clustering all the similar regions to obtain a normal region and an impurity region, and obtaining the segmentation effect value of the impurity region according to the mean value of the segmentation effect values of each region contained in the normal region and the impurity region and the segmentation effect value of the descurainia sophia seed image.
After the K-means clustering segmentation, judging that images of different types of regions respectively represent normal according to the difference between the segmented K types of regionsSeed and impurities of Descurainia sophia, i.e. analysisIndicating the difference between the normal seed region of physalis pubescens and the impurity region.
Because one or more types of images of the segmented seed of the physalis pubescens can respectively represent normal physalis pubescens seeds and impurities, the normal physalis pubescens seeds are represented at the momentHaving similarities and representing impuritiesAlso having similarities, when all are obtainedClustering is carried out, namely, K-means clustering is also utilized, the number of clusters is set to be 2, and all clusters are clusteredThe two types are respectively expressed in the areas corresponding to the normal descurainia sophia seeds and impurities. At this time according to two categoriesAnd (4) judging the clustering and segmenting effect of the images of the descurainia sophia seeds.
Performing K-means clustering segmentation on each type of region in the descurainia sophia image, wherein the K value is set to be 2, and obtaining two types of regions after secondary segmentation; respectively calculating the mean value of the segmentation effect of each type of region in the two types of regions after the secondary segmentation; and taking the area after the secondary division corresponding to the average value with the larger numerical value in the two average values as a normal area, and taking the area after the secondary division corresponding to the average value with the smaller numerical value in the two average values as an impurity area.
Thus, a normal region and an impurity region are obtained, and a segmentation effect value of the impurity region is obtained according to the mean value of the segmentation effect of each type of region corresponding to the normal region and the impurity region and the segmentation effect value of the descurainia sophia image, wherein the specific expression is as follows:
in the formula (I), the compound is shown in the specification,a value indicating the effect of division of the impurity region,representing the segmentation effect value of the images of the seeds of the physalis pubescens,、and average values respectively representing the segmentation effect of each type of region corresponding to the normal region and the impurity region, wherein a secondarily-segmented region corresponding to the average value with a larger numerical value in the two average values is taken as the normal region, and a secondarily-segmented region corresponding to the average value with a smaller numerical value in the two average values is taken as the impurity region.
Wherein the content of the first and second substances,shows the integral image segmentation effect corresponding to the area number K when the K-means is used for carrying out the segmentation of the images of the descurainia sophia seeds,the larger the image size is, the better the integral segmentation effect of the descurainia sophia image is, and the more the normal differentiation between descurainia sophia and impurities is facilitated;showing normal and impurity regionsThe difference between the difference and the reference value,the larger the area of normal seed of Lepidium meyenii which corresponds to impuritiesThe larger the difference is, the better the corresponding segmentation effect of the current region number K, i.e. the better the segmentation effect of the impurity region is represented, because the identification of the impurity region is mainly based on the normal region and the impurity regionDifference, thereforeHas a large influence on the segmentation effect, so the method adoptsWill be provided withAnd (4) amplifying.
And S5, adjusting the initial K value to obtain an adjusted K value, repeating the steps S1-S4 according to the adjusted K value to obtain a segmentation effect value of the impurity region, sequentially iterating until the segmentation effect value of the impurity region is maximum, taking the impurity region corresponding to the maximum value of the segmentation effect value of the impurity region as an optimal impurity region, and judging whether the descurainia sophia seeds corresponding to the descurainia sophia seed image need to be decontaminated according to the optimal impurity region.
Firstly, setting the initial value of K during K-means cluster segmentation when starting detection, and setting the initial value of K to be 2 (which can be adjusted according to actual scenes) in the invention to obtain the segmentation effect of the corresponding impurity regionObtaining the effect of dividing the impurity region onceAdd 1 to the value of K, so that each playWhen the Artemisia ordosica seed image is subjected to K-means clustering segmentation, corresponding images can be obtained under multiple K valuesDividing effect value of impurity regionThe maximum value of (A) is obtained as an optimum impurity region, and the value of the effect of dividing the impurity region is obtained as a valueThe maximum value of (a) corresponds to a K value, and accordingly, the optimal impurity area in each sowing ordnance seed image can be obtained through the self-adaptive K value for each sowing ordnance seed image.
Obtaining the content of impurities in the images of the seeds of the physalis pubescens according to the ratio of the area of the optimal impurity region in the images of the seeds of the physalis pubescens to the area of the images of the seeds of the physalis pubescensSetting the allowable content of impurities in each image of the seeds of the physalis pubescens as(can be adjusted according to actual scenes) whenThe impurity content is allowed;during, impurity influences the quality of the descurainia sophia seeds, the descurainia sophia seeds corresponding to the image at the t moment need to be additionally purified, the descurainia sophia seeds corresponding to the t moment need to be separated out in the conveyor belt at the moment, and the concrete process is as follows: the distance between the position of the conveyor belt corresponding to the image at the time t and the tail end of the conveyor belt is L0, and the time when the descurainia sophia reaches the tail end of the conveyor belt is calculated as,Indicates the speed of the conveyor belt, thereforeWhen the time is up, the mother plant seeds corresponding to the t-time images reach the tail end of the conveyor belt, the receiving device at the tail end of the conveyor belt is converted, namely the mother plant seeds corresponding to the t-time images are converted into other collecting containers, and the mother plant seeds are subjected to impurity removal again.
The invention has the beneficial effects that: the method comprises the steps of segmenting a descurainia sophia seed image by utilizing K-means clustering segmentation to obtain K types of regions, obtaining a standard deviation of pixel value mean values of pixels between all types of regions according to the mean values of pixels in all connected regions under each type of region, obtaining a segmentation effect value of the descurainia sophia seed image according to the standard deviation of the pixel value mean values of the pixels between all types of regions and the mean value of the standard deviation of the pixel values of the pixels in all connected regions under each type of region, wherein the segmentation effect value of the descurainia sophia seed image represents the integral effect of the K-means clustering segmentation, and the integral effect of the clustering segmentation combines the pixel values of the same type of regions to be close, and the pixel values of different regions have larger difference, so that the integral effect of the obtained means clustering segmentation is more accurate; obtaining a segmentation effect value of each type of region according to the distribution uniformity of each type of region, the pixel value mean values of all connected domain pixel points under each type of region and the pixel value mean value of the descurainia sophia image, wherein the segmentation effect value of each type of region represents the independent effect of segmentation of each type of region of the descurainia sophia image; therefore, the impurity region obtained by K-means clustering segmentation is analyzed by using the overall effect and the single effect, so that the finally obtained impurity region is more accurate.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and should not be taken as limiting the scope of the present invention, which is intended to cover any modifications, equivalents, improvements, etc. within the spirit and scope of the present invention.
Claims (7)
1. A method for identifying impurities in descurainia sophia seeds based on computer vision is characterized by comprising the following steps:
s1, acquiring a descurainia sophia seed image, setting an initial K value of K-means clustering segmentation, and performing K-means clustering segmentation on the descurainia sophia seed image by using a pixel value of each pixel point in the descurainia sophia seed image and the initial K value to obtain all classification areas;
s2, obtaining the standard deviation of the pixel value mean values of the pixels in all the connected domains in each class of regions according to the pixel value mean values of the pixels in all the connected domains in each class of regions, and obtaining the segmentation effect value of the descurainia sophia seed image by using the standard deviation of the pixel value mean values of the pixels in each class of regions and the standard deviation mean value of the pixel value mean values of the pixels in each connected domain in each class of regions;
s3, setting a plurality of rectangular frames in the sowing artemisia seed image, obtaining the number of connected domains under each type of region in each rectangular frame, obtaining the distribution uniformity of each type of region according to the number of connected domains under each type of region in each rectangular frame, and obtaining the segmentation effect value of each type of region according to the distribution uniformity of each type of region, the pixel value mean value of all the connected domain pixel points under each type of region and the pixel value mean value of the sowing artemisia seed image;
s4, clustering all the similar regions to obtain a normal region and an impurity region, and obtaining a segmentation effect value of the impurity region according to a mean value of segmentation effect values of each region contained in the normal region and the impurity region and a segmentation effect value of the descurainia sophia image;
and S5, adjusting the initial K value to obtain an adjusted K value, repeating the steps S1-S4 according to the adjusted K value to obtain a segmentation effect value of the impurity region, sequentially iterating until the segmentation effect value of the impurity region is maximum, taking the impurity region corresponding to the maximum value of the segmentation effect value of the impurity region as an optimal impurity region, and judging whether the descurainia sophia seeds corresponding to the descurainia sophia seed image need to be decontaminated according to the optimal impurity region.
2. The method for identifying the impurities in the seeds of the physalis pubescens based on the computer vision as claimed in claim 1, wherein the method for obtaining the segmentation effect value of the image of the physalis pubescens seeds comprises the following steps:
and taking the standard deviation of the mean values of the pixel points between each type of regions as a numerator, taking the mean value of the standard deviation of the pixel values of the pixel points in each connected domain under each type of regions as a denominator to obtain a ratio, and taking the ratio as a segmentation effect value of the descurainia sophia seed image.
3. The method for identifying impurities in physalis pubescens seeds based on computer vision as claimed in claim 1, wherein the uniformity of distribution of each type of region is determined as follows:
and obtaining the standard deviation of the number of each type of region in the images of the descurainia sophia seeds according to the number of the lower connected regions of each type of region in each rectangular frame, and taking the standard deviation of the number of each type of region as the uniformity degree of the distribution of each type of region.
4. The method for identifying impurities in descurainia sophia seed based on computer vision as claimed in claim 1, wherein the segmentation effect value of each type of region is determined as follows:
and acquiring the absolute value of the difference value between the pixel value mean value of all connected domain pixel points in each type of region and the pixel value mean value of the descurainia sophia seed image, taking the absolute value of the difference value as a molecule, taking the distribution uniformity degree of the type of region as a molecule to obtain a ratio, and obtaining the segmentation effect value of each type of region by using the ratio.
5. The method for identifying impurities in descurainia sophia seed based on computer vision as claimed in claim 1, wherein the method for obtaining the normal region and the impurity region is:
performing K-means clustering segmentation on each type of region in the descurainia sophia image, wherein the K value is set to be 2, and obtaining two types of regions after secondary segmentation;
respectively calculating the mean value of the segmentation effect of each type of region in the two types of regions after the secondary segmentation;
and taking the area after the secondary division corresponding to the average value with the larger numerical value in the two average values as a normal area, and taking the area after the secondary division corresponding to the average value with the smaller numerical value in the two average values as an impurity area.
6. The method for identifying the impurities in the seeds of the physalis pubescens based on the computer vision as claimed in claim 1, wherein the segmentation effect value of the impurity region is determined as follows:
acquiring an absolute value of a difference value between the mean value of the segmentation effect values of each type of region in the normal region and the mean value of the segmentation effect values of each type of region in the impurity region;
and taking the absolute value of the difference value as an index of an exponential function to obtain the exponential function, and adding the exponential function and the segmentation effect value of the sowing wormwood seed image to obtain the segmentation effect value of the impurity region.
7. The method for identifying the impurities of the seeds of the physalis pubescens based on the computer vision as claimed in claim 1, wherein the method for removing the impurities of the seeds of the physalis pubescens is as follows:
obtaining the impurity content in the images of the seeds of the physalis pubescens according to the ratio of the area of the optimal impurity region in the images of the seeds of the physalis pubescens to the area of the images of the seeds of the physalis pubescens;
and setting an allowable impurity content value in each image of the descurainia sophia seeds, and when the impurity content in each image of the descurainia sophia seeds is greater than the allowable impurity content value in each image of the descurainia sophia seeds, removing impurities from the descurainia sophia seeds corresponding to the image of the descurainia sophia seeds.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211592140.3A CN115661667B (en) | 2022-12-13 | 2022-12-13 | Method for identifying impurities in descurainia sophia seeds based on computer vision |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211592140.3A CN115661667B (en) | 2022-12-13 | 2022-12-13 | Method for identifying impurities in descurainia sophia seeds based on computer vision |
Publications (2)
Publication Number | Publication Date |
---|---|
CN115661667A true CN115661667A (en) | 2023-01-31 |
CN115661667B CN115661667B (en) | 2023-04-07 |
Family
ID=85017287
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211592140.3A Active CN115661667B (en) | 2022-12-13 | 2022-12-13 | Method for identifying impurities in descurainia sophia seeds based on computer vision |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115661667B (en) |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2010271987A (en) * | 2009-05-22 | 2010-12-02 | Mitsubishi Electric Corp | Area classification device, image quality improvement device, image display apparatus, and methods therefor |
CN105405145A (en) * | 2015-11-17 | 2016-03-16 | 四川飞拓信息技术有限公司 | Image segmentation technology based granule counting method |
CN110110807A (en) * | 2019-05-16 | 2019-08-09 | 福州大学 | A kind of leucocyte extraction and classification method based on improvement K-means and convolutional neural networks |
CN111912850A (en) * | 2020-08-04 | 2020-11-10 | 南京文采工业智能研究院有限公司 | Slice cigarette debris detecting system based on artificial intelligence |
US20210019876A1 (en) * | 2019-06-13 | 2021-01-21 | Tata Consultancy Services Limited | Method and system for impurity detection using multi-modal imaging |
CN112883797A (en) * | 2021-01-19 | 2021-06-01 | 红云红河烟草(集团)有限责任公司 | Tobacco shred sundry detection method based on Yolo V3 model |
CN113066047A (en) * | 2021-02-23 | 2021-07-02 | 青岛科技大学 | Method for detecting impurity defects of tire X-ray image |
CN115311277A (en) * | 2022-10-11 | 2022-11-08 | 南通美乐柯材料科技有限公司 | Pit defect identification method for stainless steel product |
-
2022
- 2022-12-13 CN CN202211592140.3A patent/CN115661667B/en active Active
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2010271987A (en) * | 2009-05-22 | 2010-12-02 | Mitsubishi Electric Corp | Area classification device, image quality improvement device, image display apparatus, and methods therefor |
CN105405145A (en) * | 2015-11-17 | 2016-03-16 | 四川飞拓信息技术有限公司 | Image segmentation technology based granule counting method |
CN110110807A (en) * | 2019-05-16 | 2019-08-09 | 福州大学 | A kind of leucocyte extraction and classification method based on improvement K-means and convolutional neural networks |
US20210019876A1 (en) * | 2019-06-13 | 2021-01-21 | Tata Consultancy Services Limited | Method and system for impurity detection using multi-modal imaging |
CN111912850A (en) * | 2020-08-04 | 2020-11-10 | 南京文采工业智能研究院有限公司 | Slice cigarette debris detecting system based on artificial intelligence |
CN112883797A (en) * | 2021-01-19 | 2021-06-01 | 红云红河烟草(集团)有限责任公司 | Tobacco shred sundry detection method based on Yolo V3 model |
CN113066047A (en) * | 2021-02-23 | 2021-07-02 | 青岛科技大学 | Method for detecting impurity defects of tire X-ray image |
CN115311277A (en) * | 2022-10-11 | 2022-11-08 | 南通美乐柯材料科技有限公司 | Pit defect identification method for stainless steel product |
Non-Patent Citations (2)
Title |
---|
P. DIVYA: "Segmentation of Defected Regions in Leaves using K- Means and OTSU\'s Method" * |
范杰: "基于改进聚类的机体损伤识别方法研究" * |
Also Published As
Publication number | Publication date |
---|---|
CN115661667B (en) | 2023-04-07 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109636824B (en) | Multi-target counting method based on image recognition technology | |
CN115018838B (en) | Method for identifying pitting defects on surface of oxidized steel pipe material | |
CN109978822B (en) | Banana maturity judging modeling method and judging method based on machine vision | |
CN115100199B (en) | Method for detecting wafer low-texture defects | |
CN110120042B (en) | Crop image pest and disease damage area extraction method based on SLIC super-pixel and automatic threshold segmentation | |
CN115018828A (en) | Defect detection method for electronic component | |
CN116092013B (en) | Dangerous road condition identification method for intelligent monitoring | |
CN112508090A (en) | External package defect detection method | |
CN115063430B (en) | Electric pipeline crack detection method based on image processing | |
CN114820625B (en) | Automobile top block defect detection method | |
CN114511568B (en) | Expressway bridge overhauling method based on unmanned aerial vehicle | |
CN114359288B (en) | Medical image cerebral aneurysm detection and positioning method based on artificial intelligence | |
CN112560941A (en) | Coal and gangue identification method based on image detection | |
CN116309577A (en) | Intelligent detection method and system for high-strength conveyor belt materials | |
CN110866547B (en) | Automatic classification system and method for traditional Chinese medicine decoction pieces based on multiple features and random forests | |
CN114139618A (en) | Signal dependent noise parameter estimation method based on improved density peak clustering | |
CN111950498A (en) | Lane line detection method and device based on end-to-end instance segmentation | |
CN115661143A (en) | Rapid detection system for MiniLED wafer defects | |
CN115661667B (en) | Method for identifying impurities in descurainia sophia seeds based on computer vision | |
CN109636794B (en) | Machine learning-based subway height adjusting valve fastening nut positioning method | |
CN112750119B (en) | Detection and measurement method for weak defects on surface of white glass cover plate | |
CN111046876B (en) | License plate character rapid recognition method and system based on texture detection technology | |
CN114283319A (en) | Locomotive wheel set tread stripping identification method | |
CN103679170A (en) | Method for detecting salient regions based on local features | |
CN115272872B (en) | Sensor interference signal detection method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |