CN116612470A - Bread detection method and system based on visual characteristics - Google Patents

Bread detection method and system based on visual characteristics Download PDF

Info

Publication number
CN116612470A
CN116612470A CN202310869010.8A CN202310869010A CN116612470A CN 116612470 A CN116612470 A CN 116612470A CN 202310869010 A CN202310869010 A CN 202310869010A CN 116612470 A CN116612470 A CN 116612470A
Authority
CN
China
Prior art keywords
bread
sliding window
index
pixel point
crack
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
CN202310869010.8A
Other languages
Chinese (zh)
Other versions
CN116612470B (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.)
Linyi Vocational College Of Agricultural Science And Technology
Original Assignee
Linyi Vocational College Of Agricultural Science And Technology
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 Linyi Vocational College Of Agricultural Science And Technology filed Critical Linyi Vocational College Of Agricultural Science And Technology
Priority to CN202310869010.8A priority Critical patent/CN116612470B/en
Publication of CN116612470A publication Critical patent/CN116612470A/en
Application granted granted Critical
Publication of CN116612470B publication Critical patent/CN116612470B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/60Type of objects
    • G06V20/68Food, e.g. fruit or vegetables
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/44Local feature extraction by analysis of parts of the pattern, e.g. by detecting edges, contours, loops, corners, strokes or intersections; Connectivity analysis, e.g. of connected components
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/46Descriptors for shape, contour or point-related descriptors, e.g. scale invariant feature transform [SIFT] or bags of words [BoW]; Salient regional features
    • G06V10/467Encoded features or binary features, e.g. local binary patterns [LBP]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/54Extraction of image or video features relating to texture
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/56Extraction of image or video features relating to colour
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/77Processing image or video features in feature spaces; using data integration or data reduction, e.g. principal component analysis [PCA] or independent component analysis [ICA] or self-organising maps [SOM]; Blind source separation
    • G06V10/80Fusion, i.e. combining data from various sources at the sensor level, preprocessing level, feature extraction level or classification level
    • G06V10/809Fusion, i.e. combining data from various sources at the sensor level, preprocessing level, feature extraction level or classification level of classification results, e.g. where the classifiers operate on the same input data
    • G06V10/811Fusion, i.e. combining data from various sources at the sensor level, preprocessing level, feature extraction level or classification level of classification results, e.g. where the classifiers operate on the same input data the classifiers operating on different input data, e.g. multi-modal recognition
    • 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

Abstract

The application relates to the field of image processing, and provides a bread detection method and system based on visual characteristics, wherein the bread detection method comprises the following steps: acquiring a gray level image of bread; determining a crack gradient index, an oversaturation index and an LBP value of each pixel point based on the gray image, and further obtaining a crack characteristic map, an oversaturation characteristic map and a texture characteristic map; constructing an supercomplex quaternion matrix based on the gray level image, the crack characteristic diagram, the oversaturation characteristic diagram and the texture characteristic diagram, and determining a bread defect saliency diagram based on the supercomplex quaternion matrix; the appearance of the bread was examined based on the bread defect saliency map. The method can make the target of visual saliency extraction more definite and improve the detection precision.

Description

Bread detection method and system based on visual characteristics
Technical Field
The application relates to the field of image processing, in particular to a bread detection method and system based on visual characteristics.
Background
With the improvement of living standard, people pay more attention to the quality problem of food. High-quality food is often favored by people, and the requirements of people are greatly met. However, various foods are introduced into the market, and the quality thereof is different. For example, in the conventional bread food, however, in the bread production process, the appearance quality of the bread changes due to the different factors such as dough fermentation, dough moisture, baking temperature and baking time, and the taste of the bread changes accordingly.
With the development of computer technology, changes in appearance quality are often recognized by image processing technology today. For example, by using an image segmentation technique based on visual saliency, the area of the bread surface with quality change is identified and segmented, so that the efficiency of computer vision is greatly improved. However, the change of the appearance quality of the bread is complex, different changes can occur on the surface of the bread, and the appearance defect of the bread food cannot be accurately identified by the traditional visual saliency segmentation technology.
Disclosure of Invention
The application provides a bread detection method and a system based on visual characteristics, which can make the visual saliency extraction target more definite and improve the detection precision.
In a first aspect, the present application provides a bread detection method based on visual characteristics, comprising:
acquiring a gray level image of bread;
determining a crack gradient index, an oversaturation index and an LBP value of each pixel point based on the gray image, and further obtaining a crack characteristic map, an oversaturation characteristic map and a texture characteristic map;
constructing an supercomplex quaternion matrix based on the gray level image, the crack characteristic diagram, the oversaturation characteristic diagram and the texture characteristic diagram, and determining a bread defect saliency diagram based on the supercomplex quaternion matrix;
the appearance of the bread was examined based on the bread defect saliency map.
In one embodiment, determining the crack growth size index for each pixel includes:
setting a first sliding window with a first preset size, and randomly sampling pixel points in the first sliding window to obtain a first gray value sampling sequence corresponding to each first sliding window;
calculating a cracking degree index of a central pixel point in each first sliding window based on a first gray value sampling sequence corresponding to each first sliding window, wherein the central pixel point is the center of the first sliding window;
and calculating a crack gradient index of the central pixel point based on the crack degree index of the central pixel point in the first sliding window.
In an embodiment, calculating the cracking degree index of the center pixel point in each first sliding window based on the first gray value sampling sequence corresponding to each first sliding window includes:
obtaining a fitting function based on the first gray value sampling sequence by utilizing a least square nonlinear fitting method, and obtaining an extreme point set based on the fitting function;
based on the number of extreme points in the extreme point set, the discrete coefficient of the sampling sequence and the first of the abscissa sequenceFirst, theAnd calculating the abscissa of each extreme point to obtain the cracking degree index of the central pixel point in each first sliding window.
In an embodiment, calculating the crack propagation size index of the center pixel point based on the crack extent index of the center pixel point in the first sliding window includes:
and calculating based on the crack gradient index of the central pixel point of the first sliding window, the number of the edge pixel points in the first sliding window and the curvature and curvature mean value of the edge pixel points in the first sliding window to obtain the crack gradient index of the central pixel point.
In one embodiment, the crack growth size index for the center pixel is calculated using the following formula:
wherein ,for normalizing the exponential function, if the center pixel belongs to the edge pixelThe value is 1, if the center pixel point does not belong to the edge pixel point, the pixel point is a pixel pointThe value of the water-based paint is 0,is the cracking degree index of the pixel point x,for the number of edge pixels in the first sliding window,for the curvature of the jth edge pixel point in the first sliding window,and representing the curvature average value of the edge pixel points in the first sliding window.
In one embodiment, determining the oversaturation index for each pixel comprises:
setting a second sliding window with a second preset size, and randomly sampling pixel points in the second sliding window to obtain a second gray value sampling sequence corresponding to each second sliding window;
processing the second gray value sampling sequence by using a segmentation algorithm, and determining mutation points in the second gray value sampling sequence;
calculating a spot intensity index of a central pixel point in the second sliding window based on the distance between two mutation points in the second sliding window and the number of the mutation points in the second sliding window, and calculating based on the spot intensity index;
an oversaturation index for each center pixel is calculated based on the blob-intensive coefficients.
In one embodiment, calculating the spot intensity index and the spot intensity coefficient of the center pixel point in the second sliding window includes:
wherein q is the number of mutation points in the second sliding window,as a function of the euclidean distance,andrespectively representing the positions of the g-th and f-th abrupt pixel points in the second sliding window,andthe maximum and minimum speckle density indices in all pixels are represented, respectively.
In an embodiment, calculating an oversaturation index for each center pixel based on the blob-intensive coefficients comprises:
an oversaturation index for each center pixel is calculated based on the spot intensity coefficient within the second sliding window and the saturation within the sliding window.
In one embodiment, the oversaturation index of each center pixel is calculated using the following formula:
wherein ,for the normalization of the exponential function,representing the mean value of the spot intensity coefficients within the second sliding window of pixel x,in order to be an oversaturation characteristic value,representing the number of pixels within a neighborhood window of pixel x,representing the saturation of the kth pixel in the neighborhood of pixel x,representing the saturation of pixel x.
In a second aspect, the present application provides a bread detection system based on visual features, comprising:
the image acquisition module is used for acquiring a gray image of the bread;
the computing module is used for determining a crack gradient index, an oversaturation index and an LBP value of each pixel point based on the gray image so as to obtain a crack characteristic diagram, an oversaturation characteristic diagram and a texture characteristic diagram;
the processing module is used for constructing an hypercomplex quaternion matrix based on the gray level image, the crack characteristic diagram, the oversaturation characteristic diagram and the texture characteristic diagram, and determining a bread defect significance diagram based on the hypercomplex quaternion matrix;
and the detection module is used for detecting the appearance of the bread based on the bread defect saliency map.
The application has the beneficial effects that the bread detection method and the system based on the visual characteristics are different from the prior art, and comprise the following steps: acquiring a gray level image of bread; determining a crack gradient index, an oversaturation index and an LBP value of each pixel point based on the gray image, and further obtaining a crack characteristic map, an oversaturation characteristic map and a texture characteristic map; constructing an supercomplex quaternion matrix based on the gray level image, the crack characteristic diagram, the oversaturation characteristic diagram and the texture characteristic diagram, and determining a bread defect saliency diagram based on the supercomplex quaternion matrix; the appearance of the bread was examined based on the bread defect saliency map. The method can make the target of visual saliency extraction more definite and improve the detection precision.
Drawings
FIG. 1 is a flow chart of a bread detection method based on visual characteristics according to an embodiment of the present application;
FIG. 2 is a flowchart illustrating an embodiment of calculating a crack propagation size index for each pixel;
FIG. 3 is a flowchart illustrating an embodiment of determining an oversaturation index of each pixel;
fig. 4 is a schematic structural view of an embodiment of the bread detection system based on visual characteristics of the present 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 only 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.
According to the method, a crack characteristic diagram is obtained by constructing characteristic indexes according to the phenomenon that bread cracks to enable bread in the part close to the epidermis to be displayed and the phenomenon that the bread epidermis cracks to form a plurality of irregular edges. Meanwhile, according to spots and local over-deep color phenomena which are frequently generated on the surface of the bread when the bread is baked, and the saturation of one of three attributes of color is combined, an over-saturation characteristic diagram is obtained. And a significant figure of bread defects is obtained through a phase spectrum model PQRT algorithm of quaternion Fourier transform, and further the bread defect areas are segmented, so that the appearance quality detection of bread foods is completed. The present application will be described in detail with reference to the accompanying drawings and examples.
Referring to fig. 1, fig. 1 is a flow chart of an embodiment of a bread detection method based on visual characteristics according to the present application, including:
step S11: a grayscale image of the bread is acquired.
The application needs to identify the position of the bread quality defect, and then divide the target area. And acquiring an image of the bread by using a CMOS camera, wherein the shooting mode is overlooking shooting, and obtaining a bread image in RGB space. Preprocessing the acquired bread image, eliminating noise and influence caused by partial external interference, and enhancing the accuracy of subsequent analysis. The application uses Gaussian filtering to denoise the image, and an implementer can adopt other denoising methods. After denoising the bread image, converting the bread image in RGB space by gray scale to obtain the bread gray scale image.
Step S12: and determining a crack gradient index, an oversaturation index and an LBP value of each pixel point based on the gray image, so as to obtain a crack characteristic map, an oversaturation characteristic map and a texture characteristic map.
Specifically, a crack progression size index for each pixel is determined based on the gray scale image. Referring to fig. 2, fig. 2 is a flowchart of an embodiment of calculating a crack growth index of each pixel, which specifically includes:
step S21: setting a first sliding window with a first preset size, and randomly sampling pixel points in the first sliding window to obtain a first gray value sampling sequence corresponding to each first sliding window.
The appearance defects reflect the defects in the bread making process to a certain extent and can affect the taste of the bread. In the bread making process, dough is excessively fermented, the baking temperature is too high, and the bread is cooled too quickly after being discharged from a furnace, so that the influence factors are likely to cause cracking of the bread surface, and the quality of the bread is greatly influenced. Under normal conditions, the baked bread surface is heated uniformly, and the bread surface with good appearance is in uniform golden yellow. However, the surface skin of the bread is highly likely to crack due to the above-mentioned influencing factors.
The surface of the bread is cracked, and the structure of the cracked surface area is greatly changed. The surface of the bread is cracked, so that the bread is displayed in the inner part of the bread, which is close to the surface, and the inner part of the bread is baked, so that the bread generally has more pores. The pores in the bread are normal, so that the bread has a fluffy effect and is more comfortable to eat. However, such a phenomenon that the surface appears belongs to an abnormal phenomenon.
Thus, based on the above analysis, the surface skin cracking of the bread is shown on the bread image as having many pinholes in the cracked region, i.e., the change in the gradation value is also more disordered. Thereby, a first sliding window of a first preset size, e.g. 7×7, is set centered around the pixel point. According to the gray values of all the pixel points in the first sliding window, marking the sequence formed by the gray values of all the pixel points in the first sliding window according to the position order as a sequenceThe method comprises the following steps:
step S22: and calculating a cracking degree index of a central pixel point in each first sliding window based on a first gray value sampling sequence corresponding to each first sliding window, wherein the central pixel point is the center of the first sliding window.
In an embodiment, a least square nonlinear fitting method is used to obtain a fitting function based on the first gray value sampling sequence, and an extremum point set is obtained based on the fitting function. Specifically, the elements within the sequence are gray values for each position within the first sliding window. Based on the analysis, since the surface of the bread is cracked to show a small pore structure in the bread, the gray level gradient rule in the first sliding window is larger when the first sliding window is positioned at the cracking position. Thus, according to the first gray value sampling sequenceThe element values in the sequence are used as dependent variables, and the right lower label is used asObtaining a fitting function by a least square nonlinear fitting method as an independent variable. Fitting function toExtreme point calculation, i.e. commandThe set of all the extreme points can be obtained, the obtained extreme point abscissas are arranged in the order from small to large, and the abscissa sequence of the extreme points is obtained and is marked as b. To reduce the amount of computation, a first gray value sampling sequenceIs a pair of sequencesRandomly sampling to obtain the product.
Based on the number of extreme points in the extreme point set, the discrete coefficient of the sampling sequence and the first of the abscissa sequenceFirst, theAnd calculating the abscissa of each extreme point to obtain the cracking degree index of the central pixel point in each first sliding window. When the first sliding window is positioned at the cracking position, the gray level gradient rule in the first sliding window is larger, and the position of the first sliding window is measured through the sequence fluctuation and the density of the extreme points. Calculating the cracking degree index of the central pixel point in each first sliding window based on the abscissa sequence of the extreme pointsThe method comprises the following steps:
in the formula (I), the total number of the components,representing a fitting functionThe number of the extreme points in the middle,representing a sampling sequenceIs used for the discrete coefficients of (a),andrespectively represent the first in the abscissa sequenceFirst, theThe abscissa of the respective extreme points,the error term prevents the denominator from being 0 and takes a value of 1.
Specifically, the larger n can reflect the more frequent the gray level change of the neighboring point of the central pixel point, and can indicate that the more pores in the bread are contained in the first sliding window, namely the greater the cracking degree, the cracking degree indexThe larger. Discrete coefficientsThe larger the gray value in the first sliding window, the larger the gray value dispersion degree, the cracking degree indexThe larger. Difference between abscissa of two adjacent extreme pointsThe smaller the extreme point, the higher the density of the extreme point, namely the more small holes contained in the first sliding window, the cracking degree indexThe larger.
Step S23: and calculating a crack gradient index of the central pixel point based on the crack degree index of the central pixel point in the first sliding window.
In an embodiment, the crack gradient index of the center pixel point is calculated based on the crack gradient index of the center pixel point of the first sliding window, the number of edge pixel points in the first sliding window, and the curvature average value of the edge pixel points in the first sliding window.
In particular, in the peripheral area of the cracking of the bread crust, the cracking of the bread crust is highly likely to occur. Because the factors affecting the cracking of the bread also affect the cracking of the bread crust, and the cracking position has a high possibility of excessively high temperature or excessively high cooling speed, the cracking phenomenon is likely to occur near the cracking area. The surface cracking of the bread can form a plurality of irregular edges, so that 15 multiplied by 15 sliding windows are arranged by taking pixel points as the center, edge detection is carried out on each sliding window by using a canny operator, a sliding window binary image is obtained, the number of edge pixel points in a first sliding window is determined, and the curvature of the edges is calculated by using a finite difference algorithm, so that the curvature of each edge pixel point is obtained. And calculating based on the crack gradient index of the central pixel point of the first sliding window, the number of the edge pixel points in the first sliding window and the curvature and curvature mean value of the edge pixel points in the first sliding window to obtain the crack gradient index of the central pixel point.
In one embodiment, the crack growth size index for the center pixel is calculated using the following formula:
wherein ,for normalizing the exponential function, if the center pixel belongs to the edge pixelThe value is 1, if the center pixel point does not belong to the edge pixel point, the pixel point is a pixel pointThe value of the water-based paint is 0,is the cracking degree index of the pixel point x,for the number of edge pixels in the first sliding window,for the curvature of the jth edge pixel point in the first sliding window,representing the mean value of curvature of the edge pixels in the first sliding window,the error term is represented by a value of 1 to prevent the denominator from being 0.
The formula is used for normalizing the crack gradient size index and the cracking degree indexThe larger the crack is, the crack gradient size indexThe larger. Degree of dispersion between edge pixel point curvaturesThe larger the crack, the more irregular edges are formed, i.e. the degree of curvature dispersion on the edges is greater, the crack gradient size indexThe larger.
So far, for any pixel point in the bread gray level image, a normalized crack gradient size index of the pixel point is obtained, the gray level value of the pixel point is replaced by the crack gradient size index, all the pixel points in the gray level image are traversed for replacement, and the replaced result is recorded as a normalized crack characteristic diagram.
In an embodiment of the present application, it is also necessary to determine the oversaturation index of each pixel. Referring to fig. 3, fig. 3 is a flowchart illustrating an embodiment of determining an oversaturation index of each pixel, which specifically includes:
step S31: setting a second sliding window with a second preset size, and randomly sampling pixel points in the second sliding window to obtain a second gray value sampling sequence corresponding to each second sliding window.
In the bread production process, the surface of the bread is larger and more bad spots are likely to occur due to the fact that the raw materials are not uniformly stirred, sugar adheres to the surface of the bread before baking, and the like. Meanwhile, when bread is made, excessive sugar consumption, excessive baking and other reasons are likely to cause excessive deep color of the baked bread surface. Both are abnormal bad phenomena, and bad spots generated on the surface of the bread can form larger visual difference with the surroundings, so that the bad spots can be regarded as blemishes, and the surface of the bread is over-deep in color and is generally used for areas. However, when the sugar content is too high, there is a high possibility that the skin of the bread is too dark due to uneven stirring, and the skin of the bread has a blemish. The saturation of each pixel point is generally used to reflect the color depth of the pixel point, so that the bread image in the RGB space is converted into the color image in the HSV space, and the saturation of each pixel point is extracted.
Specifically, a second sliding window of a second preset size, for example, 15×15, is set with each pixel point as the center. Completely sampling gray values in a second sliding window to form a second gray value sampling sequence, and marking the second gray value sampling sequence as a sequence
Step S32: and processing the second gray value sampling sequence by using a segmentation algorithm, and determining mutation points in the second gray value sampling sequence.
Specifically, the second gray value sampling sequence is processed by utilizing the BG segmentation algorithm to obtain the number of mutation points in the second gray value sampling sequence, and the number is recorded as
Step S33: and calculating the spot intensity index of the central pixel point in the second sliding window based on the distance between the two mutation points in the second sliding window and the number of the mutation points in the second sliding window, and calculating the spot intensity coefficient based on the spot intensity index.
Calculating the spot intensity index of each central pixel point based on the abrupt change points in the sliding windowThe specific calculation mode is as follows:
computing a blob-density coefficient based on the blob-density index
Wherein q is the number of mutation points in the second sliding window,as a function of the euclidean distance,andrespectively represent the second slidingThe position of the g and f abrupt change pixel points in the window,andthe maximum and minimum speckle density indices in all pixels are represented, respectively. Thus, a value range ofIs the spot density coefficient of (2)
The Euclidean distance between every two mutation points in the sliding window is calculated, and the spot density index is obtained in an accumulation mode, so that the spot density coefficient is obtained. Euclidean distance between mutation pointsThe smaller the position distance between the mutation points is, the closer the mutation points are, namely the denser the mutation points are, the larger the spot density coefficient of the central pixel point is.
Step S34: an oversaturation index for each center pixel is calculated based on the blob-intensive coefficients.
In particular, when the sugar content is too high, there is a high possibility that the color of the skin of the bread is too deep due to uneven stirring, and the skin of the bread has a flaw, that is, the flaw is extremely likely to be located on the skin which is too deep. Because the magnitude of the saturation reflects the shade of the color, the oversaturation index of each center pixel is calculated based on the spot intensity coefficient in the second sliding window and the saturation in the sliding windowThe method comprises the following steps:
wherein ,for the normalization of the exponential function,representing the mean value of the spot intensity coefficients within the second sliding window of pixel x,in order to be an oversaturation characteristic value,representing the number of pixels within a neighborhood window of pixel x,representing the saturation of the kth pixel in the neighborhood of pixel x,representing the saturation of pixel x.
Mean value of speckle density coefficientThe larger the amount, the more sugar is attached to the surface, i.e., the more likely the sugar amount of the sugar is too high, the oversaturation indexThe larger, i.e. the more likely the pixel points are in the region of the bread crust that is too dark. Saturation within sliding windowThe larger the saturation reflects the vividness of the color, i.e. the larger the saturation the darker the color, the oversaturation indexThe larger, i.e. the more likely the pixel points are in the region of the bread crust that is too dark. Saturation difference in sliding windowThe larger the oversaturation index, the more intense the local color will be due to oversoakingThe larger, i.e. possibly also pixel points on the edge of the over-baked area.
So far, for any pixel point in the bread gray level image, obtaining a normalized oversaturation index of the pixel point, replacing the gray level value of the pixel point by the oversaturation index, traversing all the pixel points in the gray level image, replacing, and marking the replaced result as a normalized oversaturation characteristic diagram.
For the bread gray level image, the LBP value of each pixel point is calculated by using an LBP feature extraction algorithm. Thus, according to the LBP value and the gray level value of each pixel point, the normalized LBP value and the normalized gray level value of each pixel point are obtained through normalization operation and respectively marked asAndand further obtaining a normalized texture feature map and a normalized gray scale map.
Step S13: and constructing an supercomplex quaternion matrix based on the gray level image, the crack characteristic diagram, the oversaturation characteristic diagram and the texture characteristic diagram, and determining a bread defect saliency diagram based on the supercomplex quaternion matrix.
Further, the normalized gray level map is used as parameters in a hypercomplex quaternion matrix Q in a phase spectrum model PQRT of quaternion Fourier transformThe method comprises the steps of carrying out a first treatment on the surface of the Taking the normalized crack characteristic diagram as a parameter in a hyper-complex quaternion matrix QThe method comprises the steps of carrying out a first treatment on the surface of the Taking the normalized oversaturation characteristic diagram as a parameter in a hypercomplex quaternion matrix QThe method comprises the steps of carrying out a first treatment on the surface of the Taking the normalized texture feature map as a parameter in a hyper-complex quaternion matrix Q. Thereby, an supercomplex quaternion matrix Q is obtained, namely:
in the formula (I), the total number of the components,for four parameters in the supercomplex quaternion matrix,respectively are imaginary unitsThe calculation of (2) is a well-known technique and will not be described in detail.
After the construction of the hyper-complex quaternion matrix Q is completed, performing hyper-complex Fourier transform on the matrix Q, calculating an amplitude spectrum A and a phase spectrum P of the matrix Q, obtaining a scale space of the amplitude spectrum by using Gaussian function kernels of different scales, performing inverse quaternion Fourier transform, calculating an inverse transformation result and a Gaussian filter to obtain a saliency map, and marking the obtained saliency map as a bread defect saliency map.
Step S14: the appearance of the bread was examined based on the bread defect saliency map.
According to the bread defect significance map, since the bread defect area has a large difference from other areas, i.e., the pixel value of the bread defect area is large as seen from the bread defect significance map. Thus, by using the oxford threshold segmentation technique, the segmentation threshold is obtained by using the oxford threshold algorithm, and the region above the segmentation threshold is the bread defect region, and is segmented.
Dividing the defective area on the surface of the bread, transmitting the information of the defective area of the bread and the position information of the bread to a control module in a questioning system, and controlling the sucking disc to pick up the defective bread to a defective area when the bread is defective. Thus, the visual characteristic-based bread detection is completed.
The application provides a method for obtaining a crack characteristic diagram by constructing characteristic indexes based on the phenomenon that bread cracks cause the internal bread adjacent to the epidermis to appear and the phenomenon that the surface of the bread cracks to form a plurality of irregular edges. Meanwhile, according to spots and local over-deep color phenomena which are frequently generated on the surface of the bread when the bread is baked, and the saturation of one of three attributes of color is combined, an over-saturation characteristic diagram is obtained. And obtaining a bread defect saliency map through a phase spectrum model PQRT algorithm of quaternion Fourier transform. The visual saliency detection method has the beneficial effects that the visual saliency extraction target is clearer, and the defect that the background area is mistakenly regarded as the target area by the traditional visual saliency detection algorithm is avoided. Meanwhile, the subsequent analysis is more accurate and the reliability is higher.
Referring to fig. 4, a schematic structural diagram of an embodiment of a visual characteristic-based bread detection system according to the present application is shown, and the visual characteristic-based bread detection system according to the present embodiment is used to implement the visual characteristic-based bread detection method shown in any of the above embodiments. The bread detection system based on visual characteristics specifically comprises: an image acquisition module 41, a calculation module 42, a processing module 43 and a detection module 44.
The image acquisition module 41 is used for acquiring a gray image of bread. The calculation module 42 is configured to determine a crack gradient magnitude index, an oversaturation index, and an LBP value of each pixel based on the gray level image, so as to obtain a crack feature map, an oversaturation feature map, and a texture feature map. The processing module 43 is configured to construct an hypercomplex quaternion matrix based on the gray level image, the crack feature map, the oversaturation feature map, and the texture feature map, and determine the bread defect saliency map based on the hypercomplex quaternion matrix. The detection module 44 is used for detecting the appearance of the bread based on the bread defect saliency map.
The foregoing is only the embodiments of the present application, and therefore, the patent scope of the application is not limited thereto, and all equivalent structures or equivalent processes using the descriptions of the present application and the accompanying drawings, or direct or indirect application in other related technical fields, are included in the scope of the application.

Claims (10)

1. A bread detection method based on visual characteristics, comprising:
acquiring a gray level image of bread;
determining a crack gradient index, an oversaturation index and an LBP value of each pixel point based on the gray image, and further obtaining a crack characteristic map, an oversaturation characteristic map and a texture characteristic map;
constructing an supercomplex quaternion matrix based on the gray level image, the crack characteristic diagram, the oversaturation characteristic diagram and the texture characteristic diagram, and determining a bread defect saliency diagram based on the supercomplex quaternion matrix;
the appearance of the bread was examined based on the bread defect saliency map.
2. The visual characteristic-based bread detection method according to claim 1, wherein determining a crack progression size index for each pixel point comprises:
setting a first sliding window with a first preset size, and randomly sampling pixel points in the first sliding window to obtain a first gray value sampling sequence corresponding to each first sliding window;
calculating a cracking degree index of a central pixel point in each first sliding window based on a first gray value sampling sequence corresponding to each first sliding window, wherein the central pixel point is the center of the first sliding window;
and calculating a crack gradient index of the central pixel point based on the crack degree index of the central pixel point in the first sliding window.
3. The bread detection method according to claim 2, wherein calculating the cracking degree index of the center pixel point in each first sliding window based on the first gray value sampling sequence corresponding to each first sliding window comprises:
obtaining a fitting function based on the first gray value sampling sequence by utilizing a least square nonlinear fitting method, and obtaining an extreme point set based on the fitting function;
based on the number of extreme points in the extreme point set, the discrete coefficient of the sampling sequence and the first of the abscissa sequenceFirst->And calculating the abscissa of each extreme point to obtain the cracking degree index of the central pixel point in each first sliding window.
4. The visual characteristic-based bread detection method according to claim 2, wherein calculating the crack progression size index of the center pixel point based on the crack degree index of the center pixel point in the first sliding window includes:
and calculating based on the crack gradient index of the central pixel point of the first sliding window, the number of the edge pixel points in the first sliding window and the curvature and curvature mean value of the edge pixel points in the first sliding window to obtain the crack gradient index of the central pixel point.
5. The visual characteristic-based bread detection method according to claim 4, wherein:
calculating a crack gradient index of the center pixel point by using the following formula:
wherein ,for normalizing the exponential function, if the center pixel belongs to the edge pixel, then +.>The value is 1, if the center pixel point does not belong to the edge pixel point, the pixel point is +.>The value is 0, & lt + & gt>Is the cracking degree index of the pixel point x, < >>For the number of edge pixels in the first sliding window, and (2)>For the curvature of the jth edge pixel point in the first sliding window,/for the j>And representing the curvature average value of the edge pixel points in the first sliding window.
6. The visual characteristic-based bread detection method according to claim 1, wherein determining an oversaturation index of each pixel point comprises:
setting a second sliding window with a second preset size, and randomly sampling pixel points in the second sliding window to obtain a second gray value sampling sequence corresponding to each second sliding window;
processing the second gray value sampling sequence by using a segmentation algorithm, and determining mutation points in the second gray value sampling sequence;
calculating a spot density index of a central pixel point in the second sliding window based on the distance between two mutation points in the second sliding window and the number of the mutation points in the second sliding window, and calculating a spot density coefficient based on the spot density index;
an oversaturation index for each center pixel is calculated based on the blob-intensive coefficients.
7. The visual characteristic-based bread detection method according to claim 6, wherein calculating the spot intensity index and the spot intensity coefficient of the center pixel point in the second sliding window includes:
wherein q is the number of mutation points in the second sliding window,is a Euclidean distance function, "> and />Respectively representing the positions of the g-th and f-th abrupt pixels in the second sliding window,/> and />Respectively representing the maximum spot intensity index and the minimum spot intensity index in all pixel points, +.>Representing the spot-intensity coefficient, +.>Representing half-pel density of pixel points xAn index.
8. The visual characteristic-based bread detection method according to claim 6, wherein calculating an oversaturation index of each center pixel based on said spot intensity coefficient comprises:
an oversaturation index for each center pixel is calculated based on the spot intensity coefficient within the second sliding window and the saturation within the sliding window.
9. The visual characteristic-based bread detection method according to claim 8, wherein the oversaturation index of each center pixel is calculated using the following formula:
wherein ,for normalizing the exponential function, ++>Mean value of the spot intensity coefficient in the second sliding window representing pixel x, +.>For the characteristic value of oversaturation, +.>Representing the number of pixels in a neighborhood window of pixel x, < >>Representing the saturation of the kth pixel in the neighborhood of pixel x,/for>Representing the saturation of pixel x.
10. A visual characteristic-based bread detection system, comprising:
the image acquisition module is used for acquiring a gray image of the bread;
the computing module is used for determining a crack gradient index, an oversaturation index and an LBP value of each pixel point based on the gray image so as to obtain a crack characteristic diagram, an oversaturation characteristic diagram and a texture characteristic diagram;
the processing module is used for constructing an hypercomplex quaternion matrix based on the gray level image, the crack characteristic diagram, the oversaturation characteristic diagram and the texture characteristic diagram, and determining a bread defect significance diagram based on the hypercomplex quaternion matrix;
and the detection module is used for detecting the appearance of the bread based on the bread defect saliency map.
CN202310869010.8A 2023-07-17 2023-07-17 Bread detection method and system based on visual characteristics Active CN116612470B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310869010.8A CN116612470B (en) 2023-07-17 2023-07-17 Bread detection method and system based on visual characteristics

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310869010.8A CN116612470B (en) 2023-07-17 2023-07-17 Bread detection method and system based on visual characteristics

Publications (2)

Publication Number Publication Date
CN116612470A true CN116612470A (en) 2023-08-18
CN116612470B CN116612470B (en) 2023-09-26

Family

ID=87680332

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310869010.8A Active CN116612470B (en) 2023-07-17 2023-07-17 Bread detection method and system based on visual characteristics

Country Status (1)

Country Link
CN (1) CN116612470B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116993716A (en) * 2023-09-22 2023-11-03 山东力加力钢结构有限公司 Visual inspection method for concrete stirring process
CN117455221A (en) * 2023-12-25 2024-01-26 青岛可颂食品有限公司 Processing flow management system suitable for baking cream
CN117557572A (en) * 2024-01-12 2024-02-13 大连傲盈科技有限公司 Highway construction quality detection method based on computer vision

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1563891A (en) * 2004-04-20 2005-01-12 长安大学 System and method for discriminating road gap
KR100761797B1 (en) * 2006-05-12 2007-09-28 엠텍비젼 주식회사 Method and apparatus for storing location address of defective pixel
CN103364410A (en) * 2013-07-23 2013-10-23 三峡大学 Crack detection method of hydraulic concrete structure underwater surface based on template search
CN115311262A (en) * 2022-10-09 2022-11-08 南通如东依航电子研发有限公司 Printed circuit board defect identification method
CN115496918A (en) * 2022-11-16 2022-12-20 山东高速股份有限公司 Method and system for detecting abnormal highway conditions based on computer vision
CN115731195A (en) * 2022-11-23 2023-03-03 深圳市研祥金码软件有限公司 Defect detection method, device, equipment and system
CN115937204A (en) * 2023-01-09 2023-04-07 江苏惠汕新能源集团有限公司 Welded pipe production quality detection method
CN116012384A (en) * 2023-03-28 2023-04-25 梁山水泊胶带股份有限公司 Method for detecting surface defects of whole-core flame-retardant conveying belt
CN116030061A (en) * 2023-03-29 2023-04-28 深圳市捷超行模具有限公司 Silica gel molding effect detection method based on vision
CN116258716A (en) * 2023-05-15 2023-06-13 青岛宇通管业有限公司 Plastic pipe quality detection method based on image processing
CN116363133A (en) * 2023-06-01 2023-06-30 无锡斯达新能源科技股份有限公司 Illuminator accessory defect detection method based on machine vision

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1563891A (en) * 2004-04-20 2005-01-12 长安大学 System and method for discriminating road gap
KR100761797B1 (en) * 2006-05-12 2007-09-28 엠텍비젼 주식회사 Method and apparatus for storing location address of defective pixel
CN103364410A (en) * 2013-07-23 2013-10-23 三峡大学 Crack detection method of hydraulic concrete structure underwater surface based on template search
CN115311262A (en) * 2022-10-09 2022-11-08 南通如东依航电子研发有限公司 Printed circuit board defect identification method
CN115496918A (en) * 2022-11-16 2022-12-20 山东高速股份有限公司 Method and system for detecting abnormal highway conditions based on computer vision
CN115731195A (en) * 2022-11-23 2023-03-03 深圳市研祥金码软件有限公司 Defect detection method, device, equipment and system
CN115937204A (en) * 2023-01-09 2023-04-07 江苏惠汕新能源集团有限公司 Welded pipe production quality detection method
CN116012384A (en) * 2023-03-28 2023-04-25 梁山水泊胶带股份有限公司 Method for detecting surface defects of whole-core flame-retardant conveying belt
CN116030061A (en) * 2023-03-29 2023-04-28 深圳市捷超行模具有限公司 Silica gel molding effect detection method based on vision
CN116258716A (en) * 2023-05-15 2023-06-13 青岛宇通管业有限公司 Plastic pipe quality detection method based on image processing
CN116363133A (en) * 2023-06-01 2023-06-30 无锡斯达新能源科技股份有限公司 Illuminator accessory defect detection method based on machine vision

Non-Patent Citations (5)

* Cited by examiner, † Cited by third party
Title
Y. JIANG ET AL: "Attention M-net for Automatic Pixel-Level Micro-crack Detection of Photovoltaic Module Cells in Electroluminescence Images", 《2020DDCLS》, pages 1415 - 1421 *
宋文洋: "应用多光谱图像融合的电力设备故障点检测方法", 《中国优秀硕士学位论文全文数据库信息科技辑》, vol. 2014, no. 10, pages 138 - 740 *
徐威等: "基于图像显著性的路面裂缝检测", 《中国图象图形学报》, vol. 18, no. 1, pages 69 - 77 *
苑玮琦等: "基于机器视觉的隧道衬砌裂缝检测算法综述", 《仪器仪表学报》, vol. 38, no. 12, pages 3100 - 3111 *
鱼鹏飞: "基于图像分析的高速铁路桥梁裂缝特征识别技术研究", 《中国优秀硕士学位论文全文数据库工程科技Ⅱ辑》, vol. 2019, no. 12, pages 034 - 57 *

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116993716A (en) * 2023-09-22 2023-11-03 山东力加力钢结构有限公司 Visual inspection method for concrete stirring process
CN116993716B (en) * 2023-09-22 2023-12-19 山东力加力钢结构有限公司 Visual inspection method for concrete stirring process
CN117455221A (en) * 2023-12-25 2024-01-26 青岛可颂食品有限公司 Processing flow management system suitable for baking cream
CN117455221B (en) * 2023-12-25 2024-03-26 青岛可颂食品有限公司 Processing flow management system suitable for baking cream
CN117557572A (en) * 2024-01-12 2024-02-13 大连傲盈科技有限公司 Highway construction quality detection method based on computer vision
CN117557572B (en) * 2024-01-12 2024-03-19 大连傲盈科技有限公司 Highway construction quality detection method based on computer vision

Also Published As

Publication number Publication date
CN116612470B (en) 2023-09-26

Similar Documents

Publication Publication Date Title
CN116612470B (en) Bread detection method and system based on visual characteristics
Yiyang The design of glass crack detection system based on image preprocessing technology
CN110286124B (en) Machine vision-based refractory brick measuring system
CN108564124A (en) A kind of magnaporthe grisea spore microimage detection recognition methods based on support vector machines
CN116452598B (en) Axle production quality rapid detection method and system based on computer vision
CN114838664B (en) In-situ pileus size measuring method based on black-skin termitomyces albuminosus
CN115578660B (en) Land block segmentation method based on remote sensing image
CN115953409B (en) Injection molding surface defect detection method based on image processing
CN107657620A (en) A kind of method and system of textured metal freezing region recognition
CN116645429A (en) Visual-aided paint production sample color analysis and detection method
CN109903275B (en) Fermented grain mildewing area detection method based on self-adaptive multi-scale filtering and histogram comparison
CN116912260B (en) Broiler chicken breeding health state detection method based on artificial intelligence
CN116612112B (en) Visual inspection method for surface defects of bucket
CN116485787B (en) Method for detecting appearance defects of data line molding outer die
Fazli et al. A novel retinal vessel segmentation based on local adaptive histogram equalization
CN114820597B (en) Smelting product defect detection method, device and system based on artificial intelligence
CN114881984A (en) Detection method and device for rice processing precision, electronic equipment and medium
CN111915564B (en) Frozen meat product optical characteristic detection method combining machine vision and OCT technology
Di et al. The research on the feature extraction of sunflower leaf rust characteristics based on color and texture feature
CN115868814B (en) Intelligent regulation and control method and system for pancake machine with visual perception
CN116843582B (en) Denoising enhancement system and method of 2CMOS camera based on deep learning
Jian et al. Identification and grading of tea using computer vision
CN117315289B (en) Aeroengine blade contour edge detection method based on image processing
CN117036354B (en) Intelligent finger ring display screen detection method
CN116958136B (en) Lead screw thread production defect detection method based on image processing

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