CN118096545B - Dough kneading impurity detection method and system - Google Patents

Dough kneading impurity detection method and system Download PDF

Info

Publication number
CN118096545B
CN118096545B CN202410496796.8A CN202410496796A CN118096545B CN 118096545 B CN118096545 B CN 118096545B CN 202410496796 A CN202410496796 A CN 202410496796A CN 118096545 B CN118096545 B CN 118096545B
Authority
CN
China
Prior art keywords
impurity
gray level
image
gray
dough
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.)
Active
Application number
CN202410496796.8A
Other languages
Chinese (zh)
Other versions
CN118096545A (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.)
Baoji Yuansheng Industrial Co ltd
Original Assignee
Baoji Yuansheng Industrial 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 Baoji Yuansheng Industrial Co ltd filed Critical Baoji Yuansheng Industrial Co ltd
Priority to CN202410496796.8A priority Critical patent/CN118096545B/en
Publication of CN118096545A publication Critical patent/CN118096545A/en
Application granted granted Critical
Publication of CN118096545B publication Critical patent/CN118096545B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing systems specially adapted for manufacturing

Landscapes

  • Image Analysis (AREA)

Abstract

The invention relates to the technical field of image processing, in particular to a dough kneading impurity detection method and a dough kneading impurity detection system, comprising the following steps: acquiring a target gray level image of the current dough; acquiring a first gray level image of the dough after the previous dough kneading corresponding to the current dough; classifying the target gray level image and the first gray level image by adopting a DBSCAN algorithm to obtain a plurality of categories, and forming a region by pixel points belonging to the same category; and calculating to obtain the predicted value of each category as impurity in the target gray level image according to the pixel point number and the average gray level value of each category. According to the method, the frequency distribution of the impurity corresponding to the gray level after weighting is obtained, the accumulated distribution of each gray level is further obtained, then an optimized histogram equalization method is adopted to strengthen the target gray level image, so that the image enhancement effect is better, and finally the OTSU algorithm is utilized to conduct threshold segmentation on the enhanced target gray level image, so that the impurity region is obtained.

Description

Dough kneading impurity detection method and system
Technical Field
The invention relates to the technical field of image processing. More particularly, the present invention relates to a dough impurity detection method and system.
Background
Flour food is a food which is not separated in daily life, flour is obtained by kneading flour, and after wheat is ground into flour, impurities such as wheat hulls and the like exist in the dough in the kneading process due to insufficient grinding or other reasons, so that the flour is not sanitary, and the quality and the taste of the dough are also affected. Therefore, it is necessary to detect impurities in the dough during kneading to determine whether the dough contains impurities.
The existing image enhancement methods are all based on the whole image for enhancement, but because the wheat husk impurity particles are smaller, distributed and dispersed, and the quantity is smaller, the effect of enhancing the whole image is possibly not obvious, and the impurity region and the dough region cannot be well distinguished.
Disclosure of Invention
The invention provides a dough kneading impurity detection method and a dough kneading impurity detection system, and aims to solve the problems that in the related art, wheat husk impurity particles are smaller, distributed and dispersed, the quantity of the wheat husk impurity particles is smaller, the possible effect of enhancing the whole image is not obvious, and an impurity region and a dough region cannot be well distinguished.
In a first aspect, the present invention provides a dough impurity detection method comprising: acquiring a target gray level image of the current dough; acquiring a first gray level image of the dough after the previous dough kneading corresponding to the current dough; classifying the target gray level image and the first gray level image by adopting a DBSCAN algorithm to obtain a plurality of categories, and forming a region by pixel points belonging to the same category; according to the pixel point number and the average gray value of each category, calculating to obtain a predicted value of impurity of each category in the target gray image, wherein a calculation formula is as follows; Wherein,For the/>, in the target gray imageThe categories are predicted values of impurities,/>For the/>, in the target gray imageAverage gray value of individual categories,/>For the/>, in the target gray imageNumber of pixel points of each category,/>For the/>, in the first gray imageThe/>, in the category and target gray level imagesThe difference in the average gray values of the individual classes,For the/>, in the first gray imageThe/>, in the category and target gray level imagesThe number of the pixel points of each category is different; for each category, taking the maximum predicted value as the probability value of the category, further acquiring the probability values corresponding to all the categories in the target gray level image, dividing the region into two categories according to the size of the probability value by using a K-means clustering algorithm, and judging the category with the larger probability value as an impurity region; the target grayscale image is enhanced to partition the impurity region.
In one embodiment, enhancing the target grayscale image includes: performing histogram equalization on the target gray level image; calculating a difference value between an average value of the gray values of the pixel points in the impurity region and an average value of the gray values of other pixel points except the impurity region; optimizing a histogram equalization process in response to the difference value being below a preset threshold; and enhancing the target gray level image by adopting an optimized histogram equalization method, and dividing the enhanced image to obtain an impurity region.
In one embodiment, optimizing the histogram equalization process includes: calculating to obtain the weight of the impurity pixel point and the weight of the gray level corresponding to the impurity; according to the weight of the gray level corresponding to the impurity, calculating the frequency of occurrence of the gray level corresponding to the impurity after weighting; and acquiring the cumulative distribution of each gray level after weighting, and carrying out histogram equalization treatment on the cumulative distribution to obtain an enhanced image.
In an embodiment, the weight of the impurity pixel point is calculated, and the calculation formula is as follows: ; wherein/> Is the weight of impurity pixel points,/>Is the probability value of pixel point as impurity,/>And the difference value between the average value of the pixel gray values of the impurity region and the average value of the pixel gray values of other regions after the target gray image is equalized.
In one embodiment, calculating the weight of the gray level corresponding to the impurity includes: acquiring one of gray levels corresponding to the impurity, acquiring all pixel points in the gray level, and calculating the average value of the weights of all the pixel points in the gray level; and carrying out normalization processing on the average value, wherein the normalized value is expressed as the weight of the gray level.
In one embodiment, the frequency of occurrence of the gray level weighting corresponding to the impurity is calculated by the following formula: ; wherein/> For the frequency of occurrence of the t-th gray level corresponding to the impurity after weighting,/>For the number of pixel points corresponding to the t-th gray level,/>For the total number of pixels of the whole image,/>Is the weight of the t-th gray level.
In one embodiment, the difference value is calculated by the following formula: ; wherein/> For the difference value between the average value of the pixel gray values of the impurity region and the average value of the pixel gray values of other regions after the target gray image is equalized,/>Represents the average value of gray values of pixel points of impurity regions,/>The average value of the pixel gray values of the other regions except the impurity region is represented.
In one embodiment, the method comprises the steps of: in response to the difference value being above a preset threshold, no optimization of the histogram equalization process is required.
In one embodiment, the method comprises the steps of: and (5) carrying out threshold segmentation on the enhanced image by using an OTSU algorithm to obtain an impurity region.
In a second aspect of the present invention, there is also provided a kneading impurity detection system comprising a processor and a memory, the memory storing a computer program, the processor executing the computer program to implement any one of the above kneading impurity detection methods.
The beneficial effects are that: the frequency distribution of the impurity corresponding to the gray level after weighting is obtained, the accumulated distribution of each gray level is further obtained, then the optimized histogram equalization method is adopted to strengthen the target gray level image, the image enhancement effect is better, and finally the OTSU algorithm is utilized to conduct threshold segmentation on the enhanced target gray level image, so that the impurity region is obtained.
Drawings
The above, as well as additional purposes, features, and advantages of exemplary embodiments of the present invention will become readily apparent from the following detailed description when read in conjunction with the accompanying drawings. In the drawings, embodiments of the invention 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 flow chart schematically illustrating calculation of probability values for each category according to an embodiment of the present invention;
FIG. 2 is a flow chart schematically illustrating enhancement of an image according to an embodiment of the present invention;
FIG. 3 is a flow chart schematically illustrating optimized histogram equalization according to an embodiment of the present invention;
Fig. 4 is a system structural diagram schematically showing an embodiment according to the present invention.
Detailed Description
The following description of the embodiments of the present invention 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 invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Specific embodiments of the present invention are described in detail below with reference to the accompanying drawings.
In one embodiment, the gray value is relatively high due to the off-white color of the dough during kneading, while the gray value is relatively low due to the off-yellow and brown color of the wheat hull impurity. However, because the impurities of the wheat hulls are smaller, the quantity of the impurities is possibly smaller, the color distinction between the impurities and the surface of the dough is not obvious, and the gray value deviation of the impurities and the surface of the dough is smaller, the gray value of the surface of the dough is larger as a whole, and the brightness is brighter. Therefore, in order to accurately detect impurities on the surface of the dough, it is necessary to first obtain possible impurity regions on the surface of the dough for analysis of impurities in the dough. Since the impurity of the wheat hull on the surface of the dough has small area and small gray value, if the impurity appears after kneading, the impurity area can be different in position but approximate in size and gray value, and according to the characteristic, the impurity area on the surface of the dough can be judged.
As shown in fig. 1, step S101: and acquiring a target gray level image of the current dough, and acquiring a first gray level image of the dough after the previous kneading corresponding to the current dough.
In one embodiment, two images are obtained by continuously acquiring two kneaded images by using a camera, and after semantic segmentation and graying processing are performed on the two images, a target gray image and a first gray image are obtained. The current shot dough image is a target gray image, and the previous dough image corresponding to the current dough is a first gray image. It should be noted that, semantic segmentation is used to separate the image into a background and a dough surface, so that the subsequent image processing is facilitated.
Illustratively, the i-th kneaded image and the i+1-th kneaded image are acquired using a camera. Then, the i+1st image after kneading is subjected to semantic segmentation and graying treatment to form a target gray image; the image after the ith kneading is subjected to semantic segmentation and graying treatment to form a first gray image.
Regarding step S102: and classifying the target gray level image and the first gray level image by adopting a DBSCAN algorithm to obtain a plurality of categories, and forming a region by pixel points belonging to the same category.
In one embodiment, the target gray level image and the first gray level image are respectively classified by adopting a DBSCAN algorithm to obtain a plurality of categories, and each pixel point in the same category is assigned with the same number, so that the target gray level image and the first gray level image are conveniently processed by a subsequent computer. And the pixel points belonging to the same category are formed into a region.
In one embodiment, since the average gray value of the impurity region is smaller, the area of the region is smaller (the pixel point composition is smaller), and the area of the region such as the pit formed on the surface of the dough during the dough kneading process is larger, when the average gray value of a certain region is smaller, and the area per se is smaller (the number of the pixel points is smaller), the region is more likely to be impurity, and after one kneading process, the impurity on the surface of the dough may disappear, and may appear at other positions on the surface of the dough, but the gray value of the impurity region and the area size of the whole image are basically unchanged, so that according to the characteristics, the probability value of the impurity region can be calculated, and the probability value is larger when the probability value is larger.
Step S103: and calculating to obtain the predicted value of each category as impurity in the target gray level image according to the pixel point number and the average gray level value of each category.
In one embodiment, the predictive value is calculated as follows:
Wherein, For the/>, in the target gray imageThe categories are predicted values of impurities,/>For the/>, in the target gray imageAverage gray value of individual categories,/>For the/>, in the target gray imageNumber of pixel points of each category,/>For the/>, in the first gray imageThe/>, in the category and target gray level imagesDifferences in average gray values of the individual categories,/>For the/>, in the first gray imageThe/>, in the category and target gray level imagesThe number of individual class pixels varies.
When the target gray level image is the firstThe gray value of each category is smaller, the area is smaller, the predicted value of the impurity region in the target gray image obtained after the i+1th kneading is larger, and the closer the gray value of the target gray image is to the gray value of a certain region in the first gray image obtained by the last kneading of the machine, the closer the gray value is to the gray value of the region, the more the area is to the region, the more the two regions are possibly the same region, the more the region accords with the gray and area characteristics of the impurity and the change characteristics before and after the kneading, and the larger the predicted value of the impurity in the region is calculated.
In one embodiment, the reference toThe calculation formula of (2) is as follows: /(I)
Wherein,For the/>, in the first gray imageThe/>, in the category and target gray level imagesDifferences in average gray values of the individual categories,/>Average gray value representing kth class in first gray image,/>The average gray value of the p-th class in the target gray image is represented.
The smaller the difference between the average gray value of the kth region in the first gray level image and the average gray value of the p-th region in the target gray level image, the closer the gray values of the two regions are, the greater the possibility that the p-th region in the target gray level image and the kth region in the first gray level image are the same type of region is, and the more consistent the characteristic that the gray levels of the impurity regions are close before and after rubbing is.
In one embodiment, the reference toThe calculation formula of (2) is as follows: /(I)
Wherein,For the/>, in the first gray imageThe/>, in the category and target gray level imagesDifference in number of pixel points of each category,/>Representing the number of pixel points of the kth category in the first gray image,/>And the number of the pixel points of the p-th category in the target gray level image is represented.
Wherein,The smaller the area of the p-th region in the target gray image is, the closer the area of the p-th region in the target gray image is to the area of the k-th region in the first gray image, the higher the possibility that the two regions are the same type of region is, and the more the characteristic that the areas of the impurity regions are close before and after kneading is met.
Step S104: and for each category, taking the maximum predicted value as the probability value of the category, further acquiring the probability values corresponding to all the categories in the target gray level image, dividing the region into two categories according to the size of the probability value by using a K-means clustering algorithm, and judging the category with the larger probability value as the impurity region.
For example, 5W classes are obtained after the target gray level image is classified by using the DBSCAN algorithm, and then predicted values of the 5W classes are calculated, and are sequentially arranged from large to small, and are respectively:>/>>/> then taking the largest predictive value/> Predicted value/>As the probability value for the W-th category.
Regarding the category having a large probability value, the impurity region is determined: dividing the region into two types by using a K-means clustering algorithm, then respectively averaging probability values in the two types to obtain the class with the largest average value, and judging the class with the largest average value as an impurity region. For example, the regions are classified into a first type and a second type by using a K-means clustering algorithm, wherein the average value of probability values in the first type is calculated as Y1, the average value of probability values in the second type is calculated as Y2, and if Y2 is greater than Y1, the category in the second type is determined as an impurity region.
Step S105: the target grayscale image is enhanced to partition the impurity region.
As shown in fig. 2, in one embodiment, a histogram equalization method is adopted to enhance a target gray image, so as to obtain an equalized second gray image, if the effect of the histogram equalization method on enhancing the target gray image is higher than a preset threshold, the second gray image is directly segmented, so as to obtain an impurity region, and the steps for enhancing the target gray image are as follows:
step S1051: and carrying out histogram equalization on the target gray level image.
In one embodiment, a histogram equalization method is used to process the target gray scale image to obtain an enhanced second gray scale image.
Step S1052: and calculating a difference value between the average value of the gray values of the pixel points in the impurity region and the average value of the gray values of other pixel points except the impurity region.
In one embodiment, an average value of gray values of pixel points in the impurity region in the second gray image is calculated, an average value of gray values of other pixel points except the impurity region in the second gray image is calculated, and finally a difference value between the two gray values is calculated, wherein a calculation formula of the difference value is as follows: . Wherein/> For the difference value between the average value of the pixel gray values of the impurity region and the average value of the pixel gray values of other regions after the target gray image is equalized,/>Represents the average value of gray values of pixel points of impurity regions,/>The average value of the pixel gray values of the other regions except the impurity region is represented.
Step S1053: and in response to the difference value being lower than a preset threshold value, optimizing a histogram equalization process.
In one embodiment of the present invention, in one embodiment,The larger the difference between the average gray value representing the impurity in the second gray image and the average gray value of other regions is, the larger the contrast between the impurity and the other regions is, and the better the image enhancement effect is. When the difference value is higher than a preset threshold value, the histogram equalization effect is good, and the histogram equalization process does not need to be optimized; when the difference value is lower than the preset threshold value, the histogram equalization effect is poor, and the histogram equalization process needs to be optimized.
Step S1054: and enhancing the target gray level image by adopting an optimized histogram equalization method, and dividing the enhanced image to obtain an impurity region.
In one embodiment, the target gray level image is enhanced by adopting an optimized histogram equalization method, and the enhanced image is subjected to threshold segmentation by using an OTSU algorithm to obtain an impurity region.
As shown in fig. 3, in one embodiment, the method for optimizing the histogram equalization process is as follows: and acquiring a gray level histogram of the target gray level image. And acquiring a certain gray level in the gray level histogram according to the sequence from small to large of the gray level, simultaneously counting the number of pixels corresponding to the gray level and the number of pixels of the whole image, wherein the ratio of the number of pixels to the number of pixels is the frequency of occurrence of the gray level, and represents the importance degree duty ratio of the gray level in all gray levels, and the more the number of pixels corresponding to the gray level is, the larger the importance degree of the gray level is, and the larger the corresponding gray level is after final equalization. In order to make the equalization effect better, the contrast needs to be further increased, and the gray level difference between the impurity region and other regions needs to be further increased, so that the smaller the gray level difference between the impurity region and other regions is, the less obvious the image enhancement effect is, the larger the weight is, and the next image enhancement effect is better. The specific optimization steps are as follows:
Step S201: and calculating to obtain the weight of the impurity pixel point and the weight of the gray level corresponding to the impurity.
In one embodiment, the weight of the impurity pixel points is calculated as follows: ; wherein/> Is the weight of impurity pixel points,/>Is the probability value of pixel point as impurity,/>And the difference value between the average value of the pixel gray values of the impurity region and the average value of the pixel gray values of other regions after the target gray image is equalized. The larger the probability value, the greater the probability that the pixel points in this class are impurities, while/>The smaller the image enhancement effect is, the less obvious the image enhancement effect is, and the larger the weight corresponding to the impurity pixel point is.
In one embodiment, one of gray levels corresponding to the impurity is acquired, all pixel points in the gray level are acquired, and the average value of the weights of all the pixel points in the gray level is calculated; and carrying out normalization processing on the average value, wherein the normalized value is expressed as the weight of the gray level.
Step S202: and calculating the frequency of the gray level corresponding to the impurity after weighting according to the gray level weight corresponding to the impurity.
In one embodiment, the frequency of occurrence of the gray level weighting corresponding to the impurity is calculated by the following formula: ; wherein/> For the frequency of occurrence of the t-th gray level corresponding to the impurity after weighting,/>For the number of pixel points corresponding to the t-th gray level,/>For the total number of pixels of the whole image,/>Is the weight of the t-th gray level. The greater the weight of the t-th gray level normalized is, the greater the corresponding frequency value after weighting is.
Step S203: and acquiring the cumulative distribution of each gray level after weighting, and carrying out histogram equalization treatment on the cumulative distribution to obtain an enhanced image.
In one embodiment, the frequency distribution of the impurity corresponding to the gray level after weighting is obtained, then the accumulated distribution of each gray level is obtained, then the optimized histogram equalization method is adopted to enhance the target gray level image, so that the image enhancement effect is better, and finally the OTSU algorithm is utilized to conduct threshold segmentation on the enhanced target gray level image, so as to obtain the impurity region.
Through the steps, the possible impurity area is judged according to the gray value of the impurity in the dough kneading process and the change characteristics of the impurity before and after the dough kneading, then the histogram equalization method is adopted for image enhancement, the image enhancement effect is judged, and the histogram equalization process is optimized, so that the image enhancement effect is better, a better impurity detection result is obtained, and the dough kneading impurity detection result is more accurate.
The invention also provides a dough kneading impurity detection system. As shown in fig. 4, the system comprises a processor and a memory storing computer program instructions which, when executed by the processor, implement a method of detecting a dough impurity according to the first aspect of the present invention.
In one embodiment, the present invention provides a computer device whose internal structure may be as shown in FIG. 4. The computer device includes a processor, a memory, a communication interface, a display screen, and an input device connected by a system bus. The processor of the computer equipment is used for providing calculation and control capability, and various varieties such as CPU, singlechip, DSP or FPGA can be selected. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. When the computer program is executed, the steps described in the above method embodiments, e.g. S101-S105, may be completed. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The communication interface of the computer device is used for carrying out wired or wireless communication with an external terminal, and the wireless mode can be realized through WIFI, an operator network, NFC (near field communication) or other technologies. The computer program, when executed by a processor, implements a method of detecting a dough impurity. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, can also be keys, a track ball or a touch pad arranged on the shell of the computer equipment, and can also be an external keyboard, a touch pad or a mouse and the like.
It will be appreciated by those skilled in the art that the structure shown in FIG. 4 is a block diagram of only some of the structures associated with the aspects of the present invention and is not limiting of the computer device of the present invention, and that a particular computer device may include more or fewer components than shown, or may combine some of the components, or have a different arrangement of components.
The system further comprises other components 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 are therefore 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. Any of the applications or modules described herein may be implemented using computer-readable/executable instructions that may be stored or otherwise maintained by such computer-readable media.
In the description of the present specification, the meaning of "a plurality", "a number" or "a plurality" is at least two, for example, two, three or more, etc., unless explicitly defined otherwise.
The technical features of the above-described embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above-described embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The above examples illustrate only a few embodiments of the invention, which are described in detail and are not to be construed as limiting the scope of the claims. It should be noted that it will be apparent to those skilled in the art that several variations and modifications can be made without departing from the spirit of the invention, which are all within the scope of the invention.

Claims (10)

1. A method for detecting dough impurities, comprising:
Acquiring a target gray level image of the current dough;
Acquiring a first gray level image of the dough after the previous dough kneading corresponding to the current dough;
Classifying the target gray level image and the first gray level image by adopting a DBSCAN algorithm to obtain a plurality of categories, and forming a region by pixel points belonging to the same category;
According to the pixel point number and the average gray value of each category, calculating to obtain a predicted value of impurity of each category in the target gray image, wherein the calculation formula is as follows:
Wherein, For the/>, in the target gray imageThe categories are predicted values of impurities,/>For the/>, in the target gray imageAverage gray value of individual categories,/>For the/>, in the target gray imageNumber of pixel points of each category,/>For the/>, in the first gray imageThe/>, in the category and target gray level imagesDifferences in average gray values of the individual categories,/>For the/>, in the first gray imageThe/>, in the category and target gray level imagesThe number of the pixel points of each category is different;
For each category, taking the maximum predicted value as the probability value of the category, further acquiring the probability values corresponding to all the categories in the target gray level image, dividing the region into two categories according to the size of the probability value by using a K-means clustering algorithm, and judging the category with the larger probability value as an impurity region;
the target grayscale image is enhanced to partition the impurity region.
2. The dough-impurity detection method according to claim 1, wherein the enhancement of the target gradation image includes:
Performing histogram equalization on the target gray level image;
calculating a difference value between an average value of the gray values of the pixel points in the impurity region and an average value of the gray values of other pixel points except the impurity region;
Optimizing a histogram equalization process in response to the difference value being below a preset threshold;
and enhancing the target gray level image by adopting an optimized histogram equalization method, and dividing the enhanced image to obtain an impurity region.
3. The dough-impurity detection method according to claim 2, wherein optimizing the histogram equalization process comprises:
Calculating to obtain the weight of the impurity pixel point and the weight of the gray level corresponding to the impurity;
according to the weight of the gray level corresponding to the impurity, calculating the frequency of occurrence of the gray level corresponding to the impurity after weighting;
And acquiring the cumulative distribution of each gray level after weighting, and carrying out histogram equalization treatment on the cumulative distribution to obtain an enhanced image.
4. The method for detecting impurities in a dough as recited in claim 3, wherein the weights of the impurity pixels are calculated by the following formula:
Wherein, Is the weight of impurity pixel points,/>Is the probability value of pixel point as impurity,/>And the difference value between the average value of the pixel gray values of the impurity region and the average value of the pixel gray values of other regions after the target gray image is equalized.
5. The method of detecting a kneading impurity according to claim 4, wherein calculating a weight of a gray level corresponding to the impurity comprises:
Acquiring one of gray levels corresponding to the impurity, acquiring all pixel points in the gray level, and calculating the average value of the weights of all the pixel points in the gray level;
And carrying out normalization processing on the average value, wherein the normalized value is expressed as the weight of the gray level.
6. The method of claim 5, wherein the frequency of occurrence of the gray level weight corresponding to the impurity is calculated by the following formula:
Wherein, For the frequency of occurrence of the t-th gray level corresponding to the impurity after weighting,/>For the number of pixel points corresponding to the t-th gray level,/>For the total number of pixels of the whole image,/>Is the weight of the t-th gray level.
7. The method of detecting dough impurities according to claim 2, wherein the difference value is calculated by the formula:
Wherein, For the difference value between the average value of the pixel gray values of the impurity region and the average value of the pixel gray values of other regions after the target gray image is equalized,/>Represents the average value of gray values of pixel points of impurity regions,/>The average value of the pixel gray values of the other regions except the impurity region is represented.
8. The method of detecting dough impurities according to claim 2, comprising:
In response to the difference value being above a preset threshold, no optimization of the histogram equalization process is required.
9. The method of detecting a dough-like impurity according to claim 2, wherein the segmentation of the enhanced image includes:
and (5) carrying out threshold segmentation on the enhanced image by using an OTSU algorithm to obtain an impurity region.
10. A kneading impurity detection system comprising a processor and a memory, said memory storing a computer program, wherein said processor executes said computer program to implement the kneading impurity detection method according to any of claims 1-9.
CN202410496796.8A 2024-04-24 2024-04-24 Dough kneading impurity detection method and system Active CN118096545B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410496796.8A CN118096545B (en) 2024-04-24 2024-04-24 Dough kneading impurity detection method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410496796.8A CN118096545B (en) 2024-04-24 2024-04-24 Dough kneading impurity detection method and system

Publications (2)

Publication Number Publication Date
CN118096545A CN118096545A (en) 2024-05-28
CN118096545B true CN118096545B (en) 2024-06-21

Family

ID=91153331

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410496796.8A Active CN118096545B (en) 2024-04-24 2024-04-24 Dough kneading impurity detection method and system

Country Status (1)

Country Link
CN (1) CN118096545B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102175693A (en) * 2011-03-08 2011-09-07 中南大学 Machine vision detection method of visual foreign matters in medical medicament
CN116071351A (en) * 2023-03-06 2023-05-05 山东金利康面粉有限公司 Flour quality visual detection system based on flour bran star identification

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH06281595A (en) * 1993-03-29 1994-10-07 Nippon Steel Corp Apparatus for detecting flaw on surface of object
KR100189922B1 (en) * 1996-06-20 1999-06-01 윤종용 Circuit and method for improving contrast by using histogram equalization
CN117173158B (en) * 2023-10-25 2024-01-30 深圳市德海威实业有限公司 Intelligent detection method and system for quality of precise connector

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102175693A (en) * 2011-03-08 2011-09-07 中南大学 Machine vision detection method of visual foreign matters in medical medicament
CN116071351A (en) * 2023-03-06 2023-05-05 山东金利康面粉有限公司 Flour quality visual detection system based on flour bran star identification

Also Published As

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

Similar Documents

Publication Publication Date Title
CN112241699B (en) Object defect type identification method, object defect type identification device, computer equipment and storage medium
CN103544506B (en) A kind of image classification method and device based on convolutional neural networks
US10891521B2 (en) Adjusting training set combination based on classification accuracy
Szczypiński et al. Identifying barley varieties by computer vision
CN106203521B (en) The SAR image change detection learnt based on disparity map from step
WO2022000861A1 (en) Image tampering area locating method and apparatus, and storage medium
CN109525994A (en) High energy efficiency frequency spectrum sensing method based on support vector machines
WO2022199710A1 (en) Image fusion method and apparatus, computer device, and storage medium
CN113065593A (en) Model training method and device, computer equipment and storage medium
CN113034387B (en) Image denoising method, device, equipment and medium
CN118096545B (en) Dough kneading impurity detection method and system
CN111985439A (en) Face detection method, device, equipment and storage medium
US20230386023A1 (en) Method for detecting medical images, electronic device, and storage medium
CN108182684B (en) Image segmentation method and device based on weighted kernel function fuzzy clustering
CN113239944B (en) Image feature extraction method and device, electronic equipment and medium
CN112598663B (en) Grain pest detection method and device based on visual saliency
CN111597934A (en) System and method for processing training data for statistical applications
CN110852167A (en) Remote sensing image classification method based on optimal activation model
US11941871B2 (en) Control method of image signal processor and control device for performing the same
CN115881304B (en) Risk assessment method, device, equipment and medium based on intelligent detection
CN116012649B (en) Integrated learning voting classification method, system and terminal for medical images
TWI755774B (en) Loss function optimization system, method and the computer-readable record medium
CN116542942A (en) Thyroid anechoic nodule determination method, system, equipment and medium
TWI573078B (en) Method and computer program product for recognizing road material and detecting holes
CN110517274A (en) A kind of carrying out image threshold segmentation method, terminal device and storage medium

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