Fritillaria cirrhosa wall-broken decoction piece quality detection and analysis method based on artificial intelligence

Through the detection method based on artificial intelligence, the grayscale characteristics and morphological characteristics are used to distinguish the shallow cracks and deep cracks of Fritillaria citrus broken wall decoctions, which solves the problem of time-consuming, labor-intensive and low accuracy of traditional detection methods, and improves the detection accuracy and reliability.

CN119090882AInactive Publication Date: 2024-12-06SHAANXI AOSHAN YAOGU PHARMACEUTICAL TECHNOLOGY SERVICE CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411580092.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-07
Publication Date
2024-12-06
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The traditional quality detection method for the broken wall of Fritillaria kebayashi relies on manual inspection, which is time-consuming and labor-intensive, and the accuracy and consistency are difficult to guarantee. It is impossible to effectively distinguish superficial cracks from deep cracks, affecting the efficacy of the drug.

Method used

Using an artificial intelligence-based detection method, the surface image of the broken wall decoction of Fritillaria is preprocessed, the gray scale characteristic value and morphological characteristic value are calculated, and the degree of bending and number of sub-branches are combined to determine whether the suspected deep crack area is a deep crack area.

Benefits of technology

It improves the accuracy and reliability of deep crack detection with quality problems on the surface of broken walled melons, can effectively distinguish shallow cracks and deep cracks, reduce detection difficulty, and ensure the quality of drug efficacy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119090882A_ABST
    Figure CN119090882A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of image processing, in particular to a bulbus fritillariae cirrhosae wall-broken decoction piece quality detection and analysis method based on artificial intelligence. The method comprises the following steps: detecting a to-be-detected image to obtain a crack area; calculating a gray feature value of the crack region according to the gray feature so as to obtain a suspected deep crack region; establishing a two-dimensional coordinate system based on two farthest points in the edge points of the suspected deep crack area; horizontal coordinates and fitting vertical coordinates corresponding to the horizontal coordinates are obtained in the two-dimensional coordinate system, and then curve fitting is carried out to obtain a main axis curve; calculating the bending degree of the main axis curve; acquiring branch end points of the suspected deep crack area according to pixel points in neighborhoods of all edge points of the suspected deep crack area; obtaining the number of sub-branches based on branch endpoints of the suspected deep crack area; and judging whether the suspected deep crack region is a deep crack region or not according to the bending degree of the suspected deep crack region and the number of the sub-branches. The method can accurately detect the quality of the bulbus fritillariae cirrhosae wall-broken decoction pieces.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing, and in particular to a quality detection and analysis method for Fritillaria cirrhosa wall-broken decoction pieces based on artificial intelligence. Background Art

[0002] As a traditional Chinese medicinal material, the quality of Fritillaria cirrhosa wall-broken slices directly affects the efficacy and market value. In the production and quality inspection of Fritillaria cirrhosa wall-broken slices, surface cracks are an important indicator for evaluating their quality. Therefore, accurate detection of surface cracks becomes particularly important.

[0003] Traditional quality inspection methods often rely on manual inspection, but this method is not only time-consuming and labor-intensive, but also difficult to guarantee accuracy and consistency. With the advancement of image processing technology, automated detection methods have gradually become mainstream. Among them, Canny edge detection, as a classic edge detection method, is widely used in crack detection. Canny edge detection calculates the intensity and direction of the gradient, determines the high and low thresholds to identify strong and weak edges, and finally connects the strong and weak edges to obtain the outline of the crack. Although traditional Canny edge detection can identify cracks, it cannot distinguish cracks with problems. For example, superficial cracks may only be caused by drying and there is no quality problem, but deep cracks may be formed due to different ingredients, resulting in the rupture of the internal structure of the broken wall slices, thereby affecting its efficacy. Summary of the invention

[0004] In order to solve the above technical problems, the purpose of the present invention is to provide a quality detection and analysis method for Chuanbei Mu broken wall slices based on artificial intelligence, and the technical scheme adopted is as follows: One embodiment of the present invention provides a method for quality detection and analysis of Fritillaria cirrhosa wall-broken decoction pieces based on artificial intelligence, the method comprising: The surface image of the broken wall slices of Fritillaria is processed to obtain an image to be detected; the image to be detected is detected to obtain a crack area; The grayscale characteristic value of the crack area is calculated according to the grayscale values ​​of the pixel points in the crack area, the background area and the edge points of the crack area; the crack area is screened according to the grayscale characteristic value to obtain the suspected deep crack area; Get the two points with the farthest distance from the edge points of the suspected deep crack area, connect the two points as the main axis, and record the two points as the starting point and the end point of the main axis respectively; establish a two-dimensional coordinate system with the main axis as the horizontal axis and the straight line perpendicular to the starting point of the main axis as the vertical axis; The distance between the pixel point on the horizontal axis and the starting point of the main axis is used as the horizontal coordinate, and the distance between the pixel point in the suspected deep crack area and the horizontal axis is used as the vertical coordinate; the average of the maximum and minimum values ​​in the vertical coordinate corresponding to an abscissa is used as the fitting vertical coordinate of the abscissa; the main axis curve is obtained by curve fitting based on the abscissa and its corresponding fitting vertical coordinate; Calculate the curvature of the main axis curve; obtain the branch endpoints of the suspected deep crack area according to the pixel points in the neighborhood of each edge point of the suspected deep crack area; obtain the number of sub-branches based on the branch endpoints of the suspected deep crack area; Whether the suspected deep crack region is a deep crack region is determined based on the degree of curvature and the number of sub-branches in the suspected deep crack region.

[0005] Preferably, the surface image of the Fritillaria wall-broken slices is processed to obtain the image to be detected, including: The surface image of the Fritillaria wall-broken slices is subjected to noise removal, grayscale transformation, geometric correction, contrast adjustment and sharpening processing to obtain an enhanced image; the enhanced image is subjected to brightness and color standardization processing to obtain an image to be detected.

[0006] Preferably, detecting the image to be detected to obtain the crack area includes: The preprocessed image to be detected is subjected to edge detection, and the crack region in the image to be detected is obtained according to the detected edge.

[0007] Preferably, the calculation formula of the grayscale eigenvalue is specifically: , Wherein, H represents the grayscale characteristic value of a crack area; N represents the number of pixels in the crack area; represents the gray value of the nth pixel in the crack area; M represents the number of pixels in the background area; represents the gray value of the mth pixel in the background area; K represents the number of edge points in the crack area; represents the gray value of the kth edge point in the edge points of the crack area; α and β represent the first weighting coefficient and the second weighting coefficient respectively; Norm() represents normalization; | | represents the absolute value symbol.

[0008] Preferably, the crack region is screened according to the grayscale characteristic value to obtain the suspected deep crack region, including: The grayscale feature threshold is set. If the grayscale feature value of the crack area is less than the grayscale feature threshold, the crack area is a suspected deep crack area.

[0009] Preferably, the calculation formula for the curvature of the main axis curve is specifically: , Wherein, TY represents the curvature of the main axis curve of the suspected crack area; λ and μ represent the third weighting coefficient and the fourth weighting coefficient respectively; C represents the number of points on the main axis curve; Represents the second-order derivative value of the c-th point on the principal axis curve; represents the first-order derivative function value of the cth point on the main axis curve; Norm() represents normalization; | | represents the absolute value sign; D represents the length of the main axis; Represents the first derivative function of the principal axis curve; and The horizontal coordinates representing the starting point and end point of the main axis curve respectively.

[0010] Preferably, obtaining the branch endpoints of the suspected deep crack region according to the pixel points in the neighborhood of each edge point of the suspected deep crack region includes: The number of pixel points belonging to the suspected crack area within the eight neighborhoods of each edge point of the suspected crack area is obtained. If the number of pixel points belonging to the suspected crack area is less than or equal to a preset number, the edge point is a branch endpoint.

[0011] Preferably, judging whether the suspected deep crack region is a deep crack region according to the bending degree of the suspected deep crack region and the number of sub-branches includes: The morphological characteristic value of the suspected deep crack area is calculated according to the bending degree and the number of sub-branches of the suspected deep crack area; if the morphological characteristic value of the suspected deep crack area is greater than the morphological threshold, the suspected deep crack area is a deep crack area; if the morphological characteristic value of the suspected deep crack area is less than or equal to the morphological threshold, the suspected deep crack area is a superficial crack area.

[0012] Preferably, the morphological characteristic values ​​of the suspected deep crack region are specifically: , Among them, ZH represents the morphological characteristic value of the suspected deep crack area; γ and δ represent the fifth weighting coefficient and the sixth weighting coefficient respectively; TY represents the degree of curvature of the suspected deep crack area; e represents the natural constant; T represents the number of branch endpoints of the suspected deep crack area; d represents the scaling factor.

[0013] The embodiments of the present invention have at least the following beneficial effects: the present invention obtains the broken wall Fritillaria slices, that is, the crack area, by detecting the image to be detected, and then calculates the grayscale characteristic value of the crack area according to the grayscale values ​​of the pixel points in the crack area, the background area and the edge points of the crack area, and screens the crack area according to the grayscale characteristic value to obtain the suspected deep crack area, and can first analyze the deep cracks and superficial cracks from the grayscale characteristics, and then obtain the suspected deep crack area, thereby reducing the difficulty of subsequent detection; further, the two farthest points among the edge points of the suspected deep crack area are connected, and a two-dimensional coordinate system is established based on this, and the degree of curvature of the suspected deep crack area is analyzed in the two-dimensional coordinate system, and the branch endpoints are obtained from the edge points, and then the sub-branches of the suspected deep crack area are obtained, and the degree of curvature of the suspected deep crack area and the number of sub-branches are combined to judge whether the suspected deep crack area is a deep crack area from a morphological perspective, which can effectively improve the detection accuracy and reliability of deep cracks with quality problems on the surface of the broken wall slices. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0015] Figure 1 A method flow chart of a method for quality detection and analysis of Fritillaria cirrhosa wall-broken slices based on artificial intelligence provided by an embodiment of the present invention; Figure 2 A two-dimensional coordinate system diagram of a quality detection and analysis method for Fritillaria cirrhosa wall-broken slices based on artificial intelligence provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0016] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the following is a detailed description of the quality detection and analysis method of Fritillaria cirrhosa wall-broken slices based on artificial intelligence proposed by the present invention, its specific implementation method, structure, characteristics and effects as follows. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures, or characteristics in one or more embodiments may be combined in any suitable form.

[0017] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.

[0018] The specific scheme of the quality detection and analysis method of Fritillaria cirrhosa wall-broken slices based on artificial intelligence provided by the present invention is described in detail below with reference to the accompanying drawings.

[0019] Example: The main application scenarios of the present invention are: the present invention is mainly used to detect cracks on the surface of Fritillaria cirrhosa broken wall slices, wherein the cracks on the surface of Fritillaria cirrhosa broken wall slices are divided into superficial cracks and deep cracks. Superficial cracks generally do not affect the efficacy of Fritillaria broken wall slices, but deep cracks are likely to be caused by changes in the raw materials or internal structure of Fritillaria broken wall slices, which may affect the efficacy. Therefore, it is necessary to distinguish between superficial cracks and deep cracks.

[0020] See also Figure 1 , which shows a method flow chart of a method for quality detection and analysis of Fritillaria cirrhosa wall-broken slices based on artificial intelligence provided by an embodiment of the present invention, the method comprising the following steps: Step S1, processing the surface image of the Fritillaria wall-broken slices to obtain an image to be detected; detecting the image to be detected to obtain a crack area.

[0021] In the surface image of the broken wall slices of Fritillaria, the characteristics of superficial cracks and deep cracks are similar, but deep cracks are caused by the rupture of the internal structure, so its medicinal components will be affected, so it is particularly important to distinguish the deep cracks. In order to reduce the impact of the original data on the effect of image detection, the surface image of the collected broken wall slices of Fritillaria cirrhosa needs to be preprocessed first.

[0022] Specifically, a high-resolution image acquisition device is used to capture multi-directional surface images of the broken wall slices of Fritillaria cirrhosa. When acquiring the surface images, it is necessary to ensure uniform illumination. The collected surface images are subjected to noise removal, grayscale transformation, and geometric correction to reduce the impact of illumination differences and noise on the detection results and improve the accuracy of subsequent detection. Image enhancement technology is then used to adjust the contrast and sharpen the above processed images to obtain enhanced images, enhance the crack details on the surface of the slices, and make the surface cracks more obvious, so that the subsequent algorithm can accurately identify deep cracks. Finally, the enhanced images are standardized in brightness and color to increase the adaptability of the model to different image conditions and ensure that the image processing effects under various acquisition conditions are consistent. Thus, an image to be detected can be obtained, wherein the image to be detected is a grayscale image.

[0023] Furthermore, the Canny algorithm is used to perform edge detection on the preprocessed image to be detected, and then the crack area in the image to be detected is obtained based on the detected edge. The Canny algorithm accurately extracts the connected domain of the crack through multi-stage processing, including noise removal, gradient calculation, non-maximum suppression and double threshold detection. The purpose of this step is to clearly depict the crack area from the complex image to be detected, capture the specific shape and boundary of the crack, and locate it on the preprocessed image to be detected, connect the edges of the crack, and the area surrounded by the crack edge can be regarded as the crack area, which can also be called the connected domain of the crack.

[0024] Specifically, first use Gaussian filtering to smooth the image to be detected to reduce the impact of noise on edge detection. Then calculate the gradient strength and direction of each pixel in the image, mark possible edge points, and retain the pixels with the local maximum gradient through non-maximum suppression to remove inconspicuous edges. Then use high and low thresholds to perform secondary edge detection. Points above the high threshold are marked as strong edges, and points between the two are connected according to the strong edges to form a continuous edge. Finally, the edge detected by the Canny operator is located in the preprocessed image to be detected, and the area surrounded by the edge area is the connected domain of the crack, that is, the crack area. After using Canny edge detection to find the edge of the crack, the crack area is separated by the connected area. Each crack can be regarded as an independent connected area, that is, an independent crack area.

[0025] Step S2, calculating the grayscale characteristic value of the crack area according to the grayscale values ​​of the pixel points in the crack area, the background area and the edge points of the crack area; screening the crack area according to the grayscale characteristic value to obtain the suspected deep crack area.

[0026] The connected domain surrounded by the crack edge is regarded as the crack area. When conducting a preliminary analysis of the crack, the average grayscale value in the crack area and the grayscale difference at the crack edge are analyzed as the first feature. The depth and shallowness of the crack will affect the reflection and absorption of light in the area, thus presenting different brightness levels in the grayscale image. Shallow cracks have relatively high grayscale values ​​due to more reflected light, while deep cracks have low grayscale values ​​due to light absorption. At the same time, grayscale changes can reflect the changing trend of the crack edge. By observing the drastic changes in grayscale values ​​around the crack, the depth and morphology of the crack can be further judged. The deeper the crack, the more significant the change in grayscale value and the clearer its edge. In this step of analysis, the grayscale value and its changes provide preliminary information about the crack, laying the foundation for subsequent more complex morphological analysis.

[0027] Thus, the grayscale values ​​of the pixels in the crack area, the grayscale values ​​of the pixels in the background area, and the grayscale values ​​of the edge points of the crack area are analyzed, and the grayscale features are used to distinguish whether the crack area is a superficial crack or a deep crack. Specifically, the grayscale characteristic value of the crack area is calculated according to the grayscale values ​​of the pixels in the crack area, the background area, and the edge points of the crack area. The calculation formula of the grayscale characteristic value is: , Wherein, H represents the grayscale characteristic value of a crack area; N represents the number of pixels in the crack area; represents the gray value of the nth pixel in the crack area; M represents the number of pixels in the background area (the area excluding the crack area); represents the gray value of the mth pixel in the background area; K represents the number of edge points in the crack area; represents the gray value of the kth edge point in the edge points of the crack area; α and β represent the first weighting coefficient and the second weighting coefficient respectively; Norm() represents normalization; | | represents the absolute value symbol.

[0028] In the above calculation formula, It represents the result after the average gray value in the crack area is normalized. The average gray value of the crack area belonging to the superficial crack is larger; represents the average gray value of the background area, Represents the average gray value of the edge points of the crack area, It represents the normalized value of the grayscale difference between the edge points of the crack area and the background area. The grayscale difference between the edge points of the shallow crack and the background area is relatively small, so it is necessary to unify the trend after normalization. α and β can be 0.6 and 0.4 respectively. For H, the proportion of the overall average grayscale value in distinguishing deep and shallow cracks is slightly higher than the grayscale difference at the edge, so α is slightly higher than β.

[0029] Thus, the grayscale characteristic value of each crack area can be obtained, and the grayscale characteristic value can distinguish between shallow cracks and deep cracks to a certain extent; further, a grayscale characteristic threshold is set. Preferably, in the embodiment of the present invention, the grayscale characteristic threshold is 0.4. If the grayscale characteristic value of the crack area is less than the grayscale characteristic threshold, it is considered that the crack may be a deep crack with quality problems, and the crack area is a suspected deep crack area; if the grayscale characteristic value of the crack area is greater than or equal to the grayscale characteristic threshold, it is considered that the crack is a shallow crack, and the crack area is a shallow crack area. After analyzing the grayscale features, areas suspected of deep cracks can be screened out, that is, suspected deep crack areas, which need to be further analyzed in combination with other features to determine whether they are deep cracks.

[0030] Step S3, obtain the two points with the farthest distance from the edge points of the suspected deep crack area, connect the two points as the principal axis, and record the two points as the starting point and the end point of the principal axis respectively; establish a two-dimensional coordinate system with the principal axis as the horizontal axis and the straight line perpendicular to the starting point of the principal axis as the vertical axis.

[0031] Generally, the grayscale value of a shallow crack is close to that of the surrounding area, the crack area is brighter, the grayscale contrast is smaller, and the crack appears as a shallower, brighter line in the image. The grayscale value of a deep crack is significantly lower than that of the surrounding area, the crack area is darker, and the grayscale contrast is larger. The crack appears as a dark, significant line or area in the image. Due to changes in lighting conditions, the grayscale value feature may fluctuate or distort under different lighting conditions, making it difficult to keep the grayscale feature of the crack consistent. Therefore, the grayscale feature alone cannot fully and effectively distinguish the depth of the crack, especially in the presence of shadows, reflections, or uneven lighting.

[0032] In step S2, a suspected deep crack region is obtained, so it is also necessary to analyze it in combination with the morphological features of the suspected deep crack region to further determine whether it is a deep crack. The reason why the suspected deep crack region may contain shallow cracks is that the complex morphology of the cracks and environmental factors such as lighting may lead to misjudgment. Shallow cracks and deep cracks may have similarities in image features (such as grayscale values), especially when the lighting conditions are not ideal or the surface reflection has a large impact, shallow cracks may be mistakenly identified as deep cracks. Therefore, the use of morphological features (the number of crack branches and the degree of crack curvature) can more accurately distinguish the depth of cracks on the basis of first distinguishing them using grayscale values, and further determine their type to ensure the reliability and accuracy of the analysis.

[0033] After screening the grayscale features, the number of sub-branches and the degree of curvature of the crack are used as morphological features for final judgment. Usually, shallow cracks are caused by drying, so the number of sub-branches on the surface is large, and the main crack does not appear relatively straight like a deep crack, so the number of sub-branches and the degree of curvature can be used as the second feature for more complex judgment.

[0034] For suspected crack areas, it is difficult to calculate their curvature due to the irregularity of their edges, so they need to be transformed in a two-dimensional coordinate system and a curve can be used to represent the curvature of the suspected crack area to a certain extent.

[0035] Specifically, the edge points of the suspected crack area are extracted, and the two branch endpoints farthest apart among the edge points are taken as the two ends of the main axis, which are respectively recorded as the starting point and the end point of the main axis. The line connecting the two points is taken as the main axis, and the direction of the main axis from the starting point of the main axis to the end point of the main axis is regarded as the horizontal x-axis direction, that is, the main axis is used as the horizontal axis of the two-dimensional coordinate system, and the direction perpendicular to the x-axis and along the starting point of the main axis is regarded as the vertical y-axis direction, that is, the straight line perpendicular to the starting point of the main axis is used as the vertical axis of the two-dimensional coordinate system. In this way, the suspected deep crack area can be placed in the two-dimensional coordinate system for subsequent morphological feature analysis.

[0036] Step S4, taking the distance between the pixel point on the horizontal axis and the starting point of the main axis as the horizontal coordinate, and taking the distance between the pixel point in the suspected deep crack area and the horizontal axis as the vertical coordinate; taking the average of the maximum and minimum values ​​in the vertical coordinate corresponding to a horizontal coordinate as the fitting vertical coordinate of the horizontal coordinate; performing curve fitting according to the horizontal coordinate and its corresponding fitting vertical coordinate to obtain the main axis curve.

[0037] The edge of the suspected deep crack area is a randomly generated crack, and the shape of the edge is relatively complex. If the morphological analysis is performed based on the edge morphology, it is very complicated and difficult to obtain its morphological characteristics. Therefore, the pixel points in the suspected deep crack area can be fitted to represent the morphology of the suspected deep crack area to a certain extent.

[0038] Specifically, the distance between the pixel point on the horizontal axis in the two-dimensional coordinate system and the starting point of the main axis is the horizontal coordinate, that is, the distance between the pixel point on the main axis and the starting point of the main axis is the horizontal coordinate, for example, the horizontal coordinate of the starting point of the main axis is 0; further, the distance between the pixel point in the suspected deep crack area and the horizontal axis is obtained, and the distance is the vertical coordinate. In general, each pixel point in the suspected deep crack area is a point in the two-dimensional coordinate system; wherein each horizontal coordinate on the horizontal axis corresponds to multiple vertical coordinates; the maximum value and the minimum value of the multiple vertical coordinates corresponding to a horizontal coordinate are obtained, and the average of the maximum value and the minimum value is taken as the fitting vertical coordinate corresponding to the horizontal coordinate, thereby obtaining the fitting vertical coordinate corresponding to each horizontal coordinate.

[0039] Furthermore, a point can be obtained according to each horizontal coordinate and its corresponding fitting vertical coordinate, and a curve fitting method (known technology) is used based on these points to obtain the main axis curve. Figure 2 The curve between the two curves in the figure is shown in Figure 1. This is done to prevent the main axis from being unable to be determined when the crack width is not uniform, which results in the inability to better display the morphological characteristics. Fitting the main axis into a curve can facilitate the calculation of its curvature, thereby obtaining a main axis curve that can represent the morphology of the suspected deep crack area to a certain extent.

[0040] Step S5, calculate the curvature of the main axis curve; obtain the branch endpoints of the suspected deep crack area according to the pixel points in the neighborhood of each edge point of the suspected deep crack area; obtain the number of sub-branches based on the branch endpoints of the suspected deep crack area.

[0041] In step S4, the main axis curve of each suspected crack area is obtained. Further, the main axis curve needs to be analyzed to obtain the curvature of the main axis curve to indicate the curvature of the suspected crack area. The curvature of the main axis curve is specifically: , Wherein, TY represents the curvature of the main axis curve of the suspected crack area; λ and μ represent the third weighting coefficient and the fourth weighting coefficient respectively, preferably, in the embodiment of the present invention, both are taken as 0.5; C represents the number of points on the main axis curve, and may also represent the number of pixel points on the main axis curve; Represents the second-order derivative value of the c-th point on the principal axis curve; represents the first-order derivative function value of the cth point on the main axis curve; Norm() represents normalization; | | represents the absolute value sign; D represents the length of the main axis; Represents the first derivative function of the principal axis curve; and They represent the horizontal coordinates of the starting point and end point of the main axis curve, that is, the horizontal coordinates of the main axis starting point and the main axis end point.

[0042] In the above calculation formula, represents the normalized curvature of the cth point on the principal axis curve, represents the mean curvature of the principal axis curve; It represents the arc length from the starting point to the end point of the main axis curve. represents the length of the main axis, It can reflect the tortuosity of the main axis curve. The closer the value is to 1, the more tortuous the crack is. Shallow cracks are usually caused by surface drying, so the direction of the crack will not be affected by the internal structure to produce wide and straight grooves. The shape of shallow cracks is often more curved, and the value of the curvature is generally larger. Deep cracks are often caused by different internal components or internal tissue damage. The crack shape is wide and straight, and the value of its curvature is generally smaller. The values ​​of λ and μ are both 0.5 because they are equally important in affecting the curvature, so both are taken as 0.5.

[0043] Superficial cracks are usually caused by drying, so the number of sub-branches on the surface is larger. Deep cracks may be formed due to different components, resulting in the rupture of the internal structure of the broken wall medicinal pieces. Therefore, the number of sub-branches appearing on the surface is smaller. Therefore, this feature can be used as a distinguishing feature between superficial cracks and deep cracks.

[0044] Calculate how many crack pixels are connected to each edge point in its neighborhood. If the point is connected to multiple crack pixels, it is considered to be an intermediate point of the crack, not a branch endpoint. If the point has weak connectivity (only one or two crack pixels are connected to it), it is considered to be a branch endpoint. Because the branch endpoint is characterized by low local connectivity, it is often at the end of the crack and the surrounding points are sparse.

[0045] Specifically, the number of pixel points belonging to the suspected crack area within the eight neighborhoods of an edge point of the suspected crack area is obtained. If the number of pixel points belonging to the suspected crack area is less than or equal to the preset number, the edge point is a branch endpoint. If the number of pixel points is greater than the preset number, the edge point is not a branch endpoint. Thus, the number of branch endpoints T of the suspected deep crack area can be obtained. Since the main axis starting point and the main axis endpoint can be regarded as pixel points in the main crack area, the number of sub-branches is T-2. Thus, the number of sub-branches of each suspected deep crack area can be obtained, and subsequent analysis can be performed. Preferably, the value of the preset number is 2.

[0046] Step S6, judging whether the suspected deep crack region is a deep crack region according to the bending degree and the number of sub-branches of the suspected deep crack region.

[0047] Step S5 obtains the degree of curvature and the number of sub-branches of each suspected deep crack region, and then the morphological characteristic value of each suspected deep crack region can be obtained by combining the number of sub-branches and the degree of curvature for comprehensive analysis. Specifically, the morphological characteristic value of the suspected deep crack region is calculated according to the degree of curvature and the number of sub-branches of the suspected deep crack region. The calculation formula of the morphological characteristic value is specifically: , Wherein, ZH represents the morphological characteristic value of the suspected deep crack area; γ and δ represent the fifth weighting coefficient and the sixth weighting coefficient respectively; TY represents the curvature of the suspected deep crack area; e represents the natural constant; T represents the number of branch endpoints of the suspected deep crack area; d represents the scaling factor; In the above calculation formula, γ and δ are taken as 0.5. The number of sub-branches and the degree of bending have the same proportion in the crack morphology analysis, so both are taken as 0.5; T-2 represents the number of sub-branches in the suspected deep crack area, and the value of d is 0.1. The number of sub-branches can be scaled to the interval [0,1] to make the dimensionality of the morphological characteristic value formula consistent, where the larger the T and TY are, the greater the degree of curvature, the more branches there are, the greater the possibility that the suspected deep crack area is a shallow crack, and the smaller the value of ZH is.

[0048] Furthermore, a morphological threshold XT is set. Preferably, in the embodiment of the present invention, the value of the morphological threshold is 0.6. If the morphological characteristic value of the suspected deep crack area is greater than the morphological threshold, the suspected deep crack area is a deep crack area; if the morphological characteristic value of the suspected deep crack area is less than or equal to the morphological threshold, the suspected deep crack area is a superficial crack area. Combining the formula of the number of sub-branches and the degree of curvature, the cracks are distinguished from different dimensions, which greatly enhances the detection accuracy and the robustness of the formula.

[0049] After screening in the above steps, the superficial cracks and deep cracks on the surface of the medicinal pieces can be distinguished, and the deep cracks with quality problems can be screened out. These deep cracks often bring greater potential harm to product quality, so they need special attention and screening. Deep cracks often indicate that the integrity of the medicinal material structure has been severely damaged, which may cause further breakage or fragmentation of the medicinal material during subsequent processing or storage, affecting the stability of the product. In addition, the presence of deep cracks will increase the risk of microorganisms or other external contaminants entering the interior of the medicinal material, which may cause the efficacy of the medicinal material to be reduced or ineffective, and even cause safety hazards. More seriously, the formation of deep cracks is usually accompanied by greater stress concentration, so the physical properties of the medicinal material (such as hardness and toughness) are reduced, which significantly reduces its pressure resistance and anti-breakage ability. This may cause further damage in transportation, storage and other links, and ultimately cause the medicinal material to lose its due quality and value. Therefore, by detecting and screening deep cracks, it is possible to identify the medicinal pieces that may have quality problems in a timely manner, avoid the losses caused by these hidden dangers, and ensure that the selected medicinal pieces can meet the quality standards of the medicinal materials.

[0050] It should be noted that the sequence of the above embodiments of the present invention is only for description and does not represent the advantages and disadvantages of the embodiments. The above is a description of a specific embodiment of this specification. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0051] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.

[0052] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A quality detection and analysis method for Fritillaria cirrhosae wall-broken slices based on artificial intelligence, characterized in that: The method includes: The surface image of the broken wall slices of Fritillaria is processed to obtain an image to be detected; the image to be detected is detected to obtain a crack area; The grayscale characteristic value of the crack area is calculated according to the grayscale values ​​of the pixel points in the crack area, the background area and the edge points of the crack area; the crack area is screened according to the grayscale characteristic value to obtain the suspected deep crack area; Get the two points with the farthest distance from the edge points of the suspected deep crack area, connect the two points as the main axis, and record the two points as the starting point and the end point of the main axis respectively; establish a two-dimensional coordinate system with the main axis as the horizontal axis and the straight line perpendicular to the starting point of the main axis as the vertical axis; The distance between the pixel point on the horizontal axis and the starting point of the main axis is used as the horizontal coordinate, and the distance between the pixel point in the suspected deep crack area and the horizontal axis is used as the vertical coordinate; the average of the maximum and minimum values ​​in the vertical coordinate corresponding to an abscissa is used as the fitting vertical coordinate of the abscissa; the main axis curve is obtained by curve fitting based on the abscissa and its corresponding fitting vertical coordinate; Calculate the curvature of the main axis curve; obtain the branch endpoints of the suspected deep crack area according to the pixel points in the neighborhood of each edge point of the suspected deep crack area; obtain the number of sub-branches based on the branch endpoints of the suspected deep crack area; Whether the suspected deep crack region is a deep crack region is determined based on the degree of curvature and the number of sub-branches in the suspected deep crack region.

2. The method for quality detection and analysis of Fritillaria cirrhosae wall-broken slices based on artificial intelligence according to claim 1, characterized in that: The processing of the surface image of the Fritillaria wall-broken pieces to obtain the image to be detected comprises: The surface image of the Fritillaria wall-broken slices is subjected to noise removal, grayscale transformation, geometric correction, contrast adjustment and sharpening processing to obtain an enhanced image; the enhanced image is subjected to brightness and color standardization processing to obtain an image to be detected.

3. The method for quality detection and analysis of Fritillaria cirrhosae wall-broken slices based on artificial intelligence according to claim 1, characterized in that: The detecting the image to be detected to obtain the crack area includes: The preprocessed image to be detected is subjected to edge detection, and the crack region in the image to be detected is obtained according to the detected edge.

4. The method for quality detection and analysis of Fritillaria cirrhosae wall-broken slices based on artificial intelligence according to claim 1, characterized in that: The calculation formula of the grayscale eigenvalue is specifically: , Wherein, H represents the grayscale characteristic value of a crack area; N represents the number of pixels in the crack area; represents the gray value of the nth pixel in the crack area; M represents the number of pixels in the background area; represents the gray value of the mth pixel in the background area; K represents the number of edge points in the crack area; represents the gray value of the kth edge point in the edge points of the crack area; α and β represent the first weighting coefficient and the second weighting coefficient respectively; Norm() represents normalization; | | represents the absolute value symbol.

5. The method for quality detection and analysis of Fritillaria cirrhosae wall-broken slices based on artificial intelligence according to claim 1, characterized in that: The method of screening the crack region according to the grayscale characteristic value to obtain the suspected deep crack region includes: The grayscale feature threshold is set. If the grayscale feature value of the crack area is less than the grayscale feature threshold, the crack area is a suspected deep crack area.

6. The method for quality detection and analysis of Fritillaria cirrhosae wall-broken slices based on artificial intelligence according to claim 1, characterized in that: The calculation formula of the curvature of the main axis curve is specifically: , Wherein, TY represents the curvature of the main axis curve of the suspected crack area; λ and μ represent the third weighting coefficient and the fourth weighting coefficient respectively; C represents the number of points on the main axis curve; Represents the second-order derivative value of the c-th point on the principal axis curve; represents the first-order derivative function value of the cth point on the main axis curve; Norm() represents normalization; | | represents the absolute value sign; D represents the length of the main axis; Represents the first derivative function of the principal axis curve; and The horizontal coordinates representing the starting point and end point of the main axis curve respectively.

7. The method for quality detection and analysis of Fritillaria cirrhosae wall-broken slices based on artificial intelligence according to claim 1, characterized in that: The step of obtaining the branch endpoints of the suspected deep crack region according to the pixel points in the neighborhood of each edge point of the suspected deep crack region includes: The number of pixel points belonging to the suspected crack area within the eight neighborhoods of each edge point of the suspected crack area is obtained. If the number of pixel points belonging to the suspected crack area is less than or equal to a preset number, the edge point is a branch endpoint.

8. The method for quality detection and analysis of Fritillaria cirrhosae wall-broken slices based on artificial intelligence according to claim 1, characterized in that: The step of judging whether the suspected deep crack region is a deep crack region according to the bending degree and the number of sub-branches of the suspected deep crack region comprises: The morphological characteristic value of the suspected deep crack area is calculated according to the bending degree and the number of sub-branches of the suspected deep crack area; if the morphological characteristic value of the suspected deep crack area is greater than the morphological threshold, the suspected deep crack area is a deep crack area; if the morphological characteristic value of the suspected deep crack area is less than or equal to the morphological threshold, the suspected deep crack area is a superficial crack area.

9. The method for quality detection and analysis of Fritillaria cirrhosae wall-broken slices based on artificial intelligence according to claim 8, characterized in that: The morphological characteristic values ​​of the suspected deep crack area are specifically: , Among them, ZH represents the morphological characteristic value of the suspected deep crack area; γ and δ represent the fifth weighting coefficient and the sixth weighting coefficient respectively; TY represents the degree of curvature of the suspected deep crack area; e represents the natural constant; T represents the number of branch endpoints of the suspected deep crack area; d represents the scaling factor.

Citation Information

Cited By

  • Marine metal corrosion degree detection method based on image processing

    CN119313656A

  • Tea wall breaking rate detection method, equipment and system

    CN120807490A