A system and method for quality detection and analysis of Chinese herbal medicine slices based on machine vision

Using machine vision technology to collect and process images of traditional Chinese medicine pieces, calculate evaluation coefficients and status evaluation values, it solves the problems of low efficiency and high misjudgment rate of traditional manual selection, achieves high-precision quality inspection and classification of traditional Chinese medicine pieces, and ensures product quality and production efficiency.

CN118045773BActive Publication Date: 2024-08-30JIANGSU HERITAGE TRADITIONAL CHINESE MEDICINE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410402349.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-04-03
Publication Date
2024-08-30
Estimated Expiration
2044-04-03

AI Technical Summary

Technical Problem

The traditional Chinese herbal medicine piece production line relies on manual selection, which has low efficiency, high subjectivity, and high misjudgment rate. It cannot meet the needs of large-scale production and affects quality stability and market competitiveness.

Method used

Using a machine vision-based quality inspection and analysis system for traditional Chinese medicine pieces, through image collection and processing, parameters such as morphological characteristics, brightness ratio, and clarity are extracted, and the image evaluation coefficient and initial appearance state evaluation value are calculated to achieve screening and classification of traditional Chinese medicine pieces. , distinguish between high-quality, low-quality, high-quality, good-quality and inferior-quality products.

Benefits of technology

It achieves high-precision quality detection and classification of traditional Chinese medicine pieces, reduces manual misjudgments, ensures that product quality meets standards, and improves production efficiency and market competitiveness.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118045773B
    Figure CN118045773B
Patent Text Reader

Abstract

The invention relates to the technical field of quality inspection of Chinese herbal medicine slices. Aiming at the problem that traditional production lines rely on manual selection, are inefficient and have a high misjudgment rate, a system and method for quality inspection and analysis of Chinese herbal medicine slices based on machine vision are proposed. The invention realizes automatic inspection and classification by collecting image status, initial appearance and detailed appearance status information of Chinese herbal medicine slices. Firstly, high-quality and low-quality images are screened, and low-quality images are eliminated to obtain a preferred image set. Then, a preliminary appearance analysis is performed based on the preferred image set to obtain an evaluation value and perform preliminary classification. Chinese herbal medicine slices that do not meet the requirements are sent to corresponding workshops for processing. Finally, images of Chinese herbal medicine slices that meet the requirements are extracted for detailed inspection and analysis, and are subdivided into high-quality products, good-quality products and inferior products, and are respectively sent to corresponding workshops, thereby improving the accuracy and efficiency of inspection, reducing the misjudgment rate, and providing strong support for the production and sales of Chinese herbal medicine slices.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of quality detection of Chinese herbal medicine slices, and in particular to a system and method for quality detection and analysis of Chinese herbal medicine slices based on machine vision. Background Art

[0002] Chinese herbal medicine slices are made by grinding, boiling, soaking, drying and other processes on the raw materials, and then pressing them into tablets.

[0003] With the growing market demand for Chinese herbal medicine slices, they have been widely recognized as medicinal materials for treating diseases. At the same time, due to their unique pharmacological effects and cultural value, Chinese herbal medicine slices have gradually become a gift with special significance and are deeply loved by consumers. However, on traditional Chinese herbal medicine slice production lines, the quality classification of Chinese herbal medicine slices mainly relies on manual sorting operations. This method is not only inefficient and cannot meet the needs of large-scale production, but also has a high degree of subjectivity and misjudgment rate, which seriously affects the quality stability and market competitiveness of Chinese herbal medicine slices.

[0004] In order to solve the above-mentioned defects, a technical solution is now provided. Summary of the Invention

[0005] The purpose of the present invention is to solve the problem that the quality classification of Chinese herbal medicines in the existing traditional Chinese herbal medicine production line mainly relies on manual selection operations, cannot meet the needs of large-scale production, and is prone to high subjectivity and misjudgment rate. A system and method for quality detection and analysis of Chinese herbal medicines based on machine vision is proposed.

[0006] The purpose of the present invention can be achieved through the following technical solutions:

[0007] A method for detecting and analyzing the quality of Chinese herbal medicine slices based on machine vision comprises the following steps:

[0008] Step 1: Collect image status information, initial appearance status information and detailed appearance status information of Chinese herbal medicine pieces on the target production line;

[0009] Step 2: Detect and analyze the image status information of the Chinese herbal medicine pieces on the target production line to obtain an image evaluation coefficient, thereby screening and analyzing the images of the Chinese herbal medicine pieces on the target production line to obtain high-quality images and low-quality images, and eliminate the images of the same batch of unit number of images that are marked as low-quality images. At the same time, the images of the same batch of high-quality images are re-sorted according to the time frame order and grouped together to obtain a preferred image set;

[0010] Step 3: Based on the preferred image set, the initial apparent state information of each Chinese herbal medicine slice on the target production line is detected and analyzed to obtain the initial apparent state evaluation value of each Chinese herbal medicine slice on the target production line, thereby performing a preliminary classification analysis on each Chinese herbal medicine slice on the target production line to obtain Chinese herbal medicine slices that are judged to be non-compliant and those that meet the requirements, and the Chinese herbal medicine slices that are judged to be non-compliant are transported to the corresponding workshop for operation and processing, and the Chinese herbal medicine slices that are judged to meet the requirements are executed in step 4;

[0011] Step 4: Extract the images of Chinese herbal medicine pieces judged to meet the requirements on the target production line from the preferred image set to obtain the detailed inspection images of each detailed inspection Chinese herbal medicine piece on the target production line, thereby detecting and analyzing the detailed apparent state information of each detailed inspection Chinese herbal medicine piece on the target production line to obtain the detailed apparent state evaluation value of each detailed inspection Chinese herbal medicine piece on the target production line, and accordingly perform detailed classification analysis on each detailed inspection Chinese herbal medicine piece on the target production line to obtain high-quality products, good-quality products and substandard products, and transport the detailed inspection Chinese herbal medicine pieces judged to be high-quality products, good-quality products and substandard products to the corresponding workshops for corresponding operation and processing.

[0012] Furthermore, the image status information of the Chinese herbal medicine pieces on the target production line is detected and analyzed. The specific analysis is as follows:

[0013] Perform TCM decoction piece capture frame recognition on the image and calculate the area of ​​the TCM decoction piece capture frame and mark it as the frame face value, perform morphological feature recognition on the TCM decoction piece within the TCM decoction piece capture frame, the morphological features include shape, size, length, color and texture, etc. Each morphological feature corresponds to a preset morphological value, match all recognized morphological features to the corresponding preset morphological values ​​and sum them to obtain the total morphological value, extract the numerical values ​​of the frame face value and the total morphological value and multiply them by the corresponding weight coefficients respectively and then sum them to obtain the complete value;

[0014] The image is divided into several regions, the brightness of each region is identified, the regions with brightness greater than a preset brightness threshold are marked as bright regions, and the regions with brightness less than or equal to the preset brightness threshold are marked as dark regions; the number of bright regions and dark regions are counted respectively, and then marked as the total number of bright regions and the total number of dark regions; the total number of bright regions is divided by the total number of dark regions to obtain the brightness ratio;

[0015] Obtain the clarity, contrast, noise and resolution in the image status information, construct a rectangle with the contrast value and the resolution value as the length and width respectively, then use the center point of the rectangle as the starting point and the clarity value as the length to make the height of the rectangle, construct a cuboid with the rectangle and the height of the rectangle, select the center point of the cuboid, convert the noise value into a radius according to a preset ratio, use the center point of the rectangle as the starting point and the radius to make a sphere inside the cuboid and cut it to obtain a hollow sphere, calculate the volume of the cuboid and extract the volume value to record it as the image quality value.

[0016] Furthermore, the images of Chinese herbal medicine pieces on the target production line are screened and analyzed. The specific analysis is as follows:

[0017] Extract the values ​​of integrity, brightness ratio and image quality, and calibrate them as wzz, l dz and tuz respectively, according to the formula: The image evaluation coefficient TPZ is obtained, where e represents a natural constant, and δ1, δ2, and δ3 represent the proportional coefficients of the integrity value, brightness ratio, and image quality value, respectively;

[0018] The image evaluation coefficient is compared and analyzed with the set image evaluation threshold. When the image evaluation coefficient is greater than or equal to the image evaluation threshold, the corresponding image is calibrated as a high-quality image. When the image evaluation coefficient is less than the image evaluation threshold, the corresponding image is calibrated as a low-quality image.

[0019] Furthermore, a preliminary classification analysis was conducted on each Chinese herbal medicine slice on the target production line. The specific analysis is as follows:

[0020] By obtaining the shape value, area value and thickness value in the initial apparent state information of each Chinese herbal medicine slice on the target production line, and calibrating them as xyz, mjz and hdz respectively, the values ​​of the three are extracted for normalization processing according to the formula: Get the initial apparent state evaluation value CSP of each Chinese herbal medicine slice on the target production line, where xyz * 、mjz * and hdz * Represents the reference shape value, reference area value and reference thickness value respectively, |xyz-xyz * |、|mjz-mjz * |、|hdz-hdz * | respectively represent the shape deviation value, area deviation value and thickness deviation value, η1, η2 and η3 respectively represent the weight coefficients of the shape deviation degree, area deviation degree and thickness deviation degree;

[0021] The initial apparent state evaluation value of each Chinese herbal medicine on the target production line is compared and analyzed with the initial apparent state evaluation threshold. If the initial apparent state evaluation value of each Chinese herbal medicine on the target production line is greater than or equal to the initial apparent state evaluation threshold, the Chinese herbal medicine on the target production line is judged as not meeting the requirements. When the initial apparent state evaluation value of each Chinese herbal medicine on the target production line is less than the initial apparent state evaluation threshold, the Chinese herbal medicine on the target production line is judged as meeting the requirements.

[0022] Furthermore, the detailed apparent state information of each finely inspected Chinese herbal medicine slice on the target production line was detected and analyzed, and the specific analysis is as follows:

[0023] The detection points of the fine inspection images of each fine inspection piece of Chinese herbal medicine on the target production line are evenly distributed, and the chromaticity of each detection point of the fine inspection image of each fine inspection piece of Chinese herbal medicine on the target production line is obtained, and compared with the preset reference chromaticity for analysis. If the chromaticity is greater than the preset reference chromaticity, the detection point is recorded as a high-quality point; if the chromaticity is equal to the preset reference chromaticity, the detection point is recorded as a medium-quality point; if the chromaticity is less than the preset reference chromaticity, the detection point is recorded as a low-quality point. The number of high-quality points, medium-quality points and low-quality points in the fine inspection images of each fine inspection piece of Chinese herbal medicine on the target production line are counted and calibrated as smn1, smn2 and smn3 respectively. The values ​​of the three are extracted for normalization processing according to the formula: Get the color value sdz, where μ1, μ2 and μ3 are preset scaling factors;

[0024] The number of cracks, total crack length and damaged area are extracted from the detailed inspection images of each finely inspected Chinese herbal medicine slice on the target production line, and marked as the crack value wsz, total crack length value zcz and damaged surface value psz respectively. At the same time, the values ​​of the three are extracted and normalized according to the formula: The aesthetic evaluation index mgz is obtained, where lwz represents the crack evaluation index, a1 and a2 represent the proportional coefficients of the crack value and the total crack length value, respectively, and a3 and a4 represent the weight factors corresponding to the set crack evaluation index and damaged surface value, respectively;

[0025] Extract the color value sdz and the aesthetic evaluation index mgz and normalize them according to the formula: The detailed appearance evaluation value XPG of each finely inspected Chinese herbal medicine slice on the target production line is obtained, where γ1 and γ2 represent the weight coefficients of the color value and the aesthetic evaluation index, respectively, and γ1>γ2.

[0026] Furthermore, a detailed classification analysis was conducted on each finely inspected Chinese herbal medicine slice on the target production line. The specific analysis is as follows:

[0027] Set three gradient comparison intervals for the fine apparent state evaluation values ​​of each finely inspected Chinese herbal medicine slice on the target production line, namely the first gradient evaluation interval, the second gradient evaluation interval and the third gradient evaluation interval;

[0028] When the fine appearance state evaluation value of each finely inspected Chinese herbal medicine slice on the target production line is in the preset first gradient evaluation interval, the finely inspected Chinese herbal medicine slice on the target production line is judged as a high-quality product; when the fine appearance state evaluation value of each finely inspected Chinese herbal medicine slice on the target production line is in the preset second gradient evaluation interval, the finely inspected Chinese herbal medicine slice on the target production line is judged as a good-quality product; when the fine appearance state evaluation value of each finely inspected Chinese herbal medicine slice on the target production line is in the preset third gradient evaluation interval, the finely inspected Chinese herbal medicine slice on the target production line is judged as a substandard product.

[0029] Furthermore, a machine vision-based Chinese herbal medicine quality detection and analysis system includes:

[0030] A data acquisition unit is used to collect image status information, preliminary appearance status information and detailed appearance status information of the Chinese herbal medicine pieces on the target production line, and send the information to the image screening unit, preliminary inspection classification analysis unit and detailed inspection classification analysis unit respectively through the server;

[0031] An image screening unit is used to detect image status information of the Chinese herbal medicine pieces on the target production line to obtain an image evaluation coefficient, thereby screening and analyzing the images of the Chinese herbal medicine pieces on the target production line to obtain high-quality images and low-quality images, eliminating images of a unit number of images of the same batch that are marked as low-quality images, and re-sorting the high-quality images of the same batch according to the time frame order to obtain a preferred image set;

[0032] An initial inspection and classification analysis unit detects and analyzes the initial apparent state information of each Chinese herbal medicine slice on the target production line based on the preferred image set to obtain an initial apparent state evaluation value of each Chinese herbal medicine slice on the target production line, thereby performing an initial classification analysis on each Chinese herbal medicine slice on the target production line, obtaining Chinese herbal medicine slices that are judged to be non-compliant and those that meet the requirements, and transporting the Chinese herbal medicine slices that are judged to be non-compliant to the requirements to the corresponding workshop for operation and processing, and performing detailed inspection and classification analysis on the Chinese herbal medicine slices that are judged to meet the requirements;

[0033] The detailed inspection, classification and analysis unit extracts the images of the Chinese herbal medicine pieces on the target production line that are judged to meet the requirements from the preferred image set to obtain the detailed inspection images of each detailed inspection Chinese herbal medicine piece on the target production line, thereby detecting and analyzing the detailed apparent state information of each detailed inspection Chinese herbal medicine piece on the target production line to obtain the detailed apparent state evaluation value of each detailed inspection Chinese herbal medicine piece on the target production line, and accordingly performing detailed classification analysis on each detailed inspection Chinese herbal medicine piece on the target production line to obtain high-quality products, good-quality products and substandard products, and transporting the detailed inspection Chinese herbal medicine pieces judged to be high-quality products, good-quality products and substandard products to the corresponding workshops for corresponding operation processing, and displaying the instructions on the display terminal.

[0034] Compared with the prior art, the present invention has the following beneficial effects:

[0035] The present invention fully utilizes machine vision technology by collecting image status information, initial appearance status information, and detailed appearance status information of Chinese herbal medicine slices on the target production line. By using high-precision image acquisition equipment, images of Chinese herbal medicine slices on the production line are captured in real time, thereby providing raw data support for subsequent quality inspection and analysis.

[0036] By detecting and analyzing the image status information of the Chinese herbal medicine slices on the target production line, the image evaluation coefficient is obtained. The collected images of the Chinese herbal medicine slices are screened and judged using image processing and analysis algorithms to distinguish high-quality images from low-quality images. At the same time, images judged as low-quality images in the same batch are eliminated to ensure the accuracy and reliability of subsequent analysis. The high-quality images of the same batch are re-sorted according to the time frame sequence and grouped together to form a preferred image set, thereby providing high-quality image data for subsequent quality evaluation, thereby ensuring that the quality of the Chinese herbal medicine slices on the production line meets the standards and preventing unqualified products from entering the subsequent links.

[0037] The initial appearance state evaluation value is obtained by detecting and analyzing the initial appearance state information of each Chinese herbal medicine slice on the target production line based on the preferred image set. At the same time, the preferred image set is deeply analyzed to extract the initial appearance features of the Chinese herbal medicine slices, and then the initial classification analysis is performed on them. The Chinese herbal medicine slices that do not meet the requirements are promptly transported to the corresponding workshop for processing to ensure that the quality of the Chinese herbal medicine slices on the production line meets the standards. The Chinese herbal medicine slices that are judged to meet the requirements enter the next step of the analysis and processing process;

[0038] By extracting images of Chinese herbal medicines that are judged to meet the requirements on the target production line from the preferred image set, detailed inspection images of each detailed inspection Chinese herbal medicine are obtained, and these detailed inspection images are further analyzed to extract more subtle apparent state information, thereby obtaining a detailed apparent state evaluation value. Based on this evaluation value, the Chinese herbal medicines are subdivided and analyzed to distinguish between high-quality, good-quality and low-quality products, thereby achieving a more accurate grasp of the quality status of Chinese herbal medicines and providing strong guarantees for subsequent market sales and use. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] In order to facilitate understanding by those skilled in the art, the present invention will be further described below with reference to the accompanying drawings;

[0040] Figure 1 Flow chart of the method of the present invention

[0041] Figure 2 This is the overall system block diagram of the present invention. DETAILED DESCRIPTION

[0042] The technical solutions of the present invention will be clearly and completely described below with reference to the embodiments. Obviously, the embodiments described are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making any creative efforts shall fall within the scope of protection of the present invention.

[0043] like Figure 1As shown, a method for detecting and analyzing the quality of Chinese herbal medicine slices based on machine vision comprises the following steps:

[0044] Step 1: Data collection: Collect the image status information, initial appearance status information and detailed appearance status information of the Chinese herbal medicine pieces on the target production line;

[0045] Step 2: Image screening: Detect the image status information of the Chinese herbal medicine pieces on the target production line, and then screen and analyze the images of the Chinese herbal medicine pieces on the target production line. The specific analysis process is as follows:

[0046] Perform TCM decoction piece capture frame recognition on the image and calculate the area of ​​the TCM decoction piece capture frame and mark it as the frame face value, perform morphological feature recognition on the TCM decoction piece within the TCM decoction piece capture frame, the morphological features include shape, size, length, color and texture, etc. Each morphological feature corresponds to a preset morphological value, match all recognized morphological features to the corresponding preset morphological values ​​and sum them to obtain the total morphological value, extract the numerical values ​​of the frame face value and the total morphological value and multiply them by the corresponding weight coefficients respectively and then sum them to obtain the complete value;

[0047] The image is divided into several regions, the brightness of each region is identified, the regions with brightness greater than a preset brightness threshold are marked as bright regions, and the regions with brightness less than or equal to the preset brightness threshold are marked as dark regions; the number of bright regions and dark regions are counted respectively, and then marked as the total number of bright regions and the total number of dark regions; the total number of bright regions is divided by the total number of dark regions to obtain the brightness ratio;

[0048] Obtain the clarity, contrast, noise, and resolution in the image status information, construct a rectangle with the contrast value and the resolution value as the length and width respectively, then use the center point of the rectangle as the starting point and the clarity value as the length to make the height of the rectangle, construct a cuboid with the rectangle and the height of the rectangle, select the center point of the cuboid, convert the noise value into a radius according to a preset ratio, use the center point of the rectangle as the starting point and the radius to make a sphere inside the cuboid, cut it to obtain a hollow sphere, calculate the volume of the cuboid, extract the volume value and record it as the image quality value;

[0049] Extract the values ​​of integrity, brightness ratio and image quality, and calibrate them as wzz, l dz and tuz respectively, according to the formula: The image evaluation coefficient TPZ is obtained, where e represents a natural constant, δ1, δ2, and δ3 represent the proportional coefficients of the integrity value, brightness ratio, and image quality value, respectively, and δ1>δ2>δ3. The proportional coefficient is used to balance the weight of each data in the formula calculation, thereby improving the accuracy of the calculation result;

[0050] The image evaluation threshold of the image evaluation coefficient is set to TPY, and the image evaluation coefficient TPZ is compared and analyzed with the set image evaluation threshold TPY. When the image evaluation coefficient TPZ is greater than or equal to the image evaluation threshold TPY, the corresponding image is calibrated as a high-quality image. When the image evaluation coefficient TPZ is less than the image evaluation threshold TPY, the corresponding image is calibrated as a low-quality image. The images of the same batch of images that are calibrated as low-quality images are eliminated, and the images of the same batch of high-quality images are re-sorted according to the time frame order and grouped together to obtain a preferred image set.

[0051] Step 3: Initial inspection and classification: Based on the preferred image set, the initial appearance state information of each Chinese herbal medicine slice on the target production line is detected, and then the initial classification analysis of each Chinese herbal medicine slice on the target production line is performed. The specific analysis process is as follows:

[0052] By obtaining the shape value, area value and thickness value in the initial apparent state information of each Chinese herbal medicine slice on the target production line, and calibrating them as xyz, mjz and hdz respectively, the values ​​of the three are extracted for normalization processing according to the formula: Get the initial apparent state evaluation value CSP of each Chinese herbal medicine slice on the target production line, where xyz * 、mjz * and hdz * Represents the reference shape value, reference area value and reference thickness value respectively, |xyz-xyz * |、|mjz-mjz * |、|hdz-hdz * | respectively represent the shape deviation value, area deviation value and thickness deviation value, η1, η2 and η3 respectively represent the weight coefficients of the shape deviation degree, area deviation degree and thickness deviation degree, and η1>η2>η3. The weight coefficient is used to balance the proportion of each data in the formula calculation, thereby improving the accuracy of the calculation result;

[0053] It should be noted that the shape value represents the shape characteristic value of each Chinese herbal medicine slice on the target production line, and the specific solution is: the shape characteristics of each Chinese herbal medicine slice on the target production line are matched and analyzed with the shape characteristic state table stored in the cloud database, thereby obtaining the shape characteristic state level of each Chinese herbal medicine slice on the target production line, and each shape feature obtained corresponds to a shape characteristic state level, and at the same time, it is matched with the shape characteristic value corresponding to the shape characteristic state level, thereby obtaining the shape characteristic value of each Chinese herbal medicine slice on the target production line; the area value represents the area size of each Chinese herbal medicine slice on the target production line; the thickness value represents the thickness of each Chinese herbal medicine slice on the target production line;

[0054] Set the initial apparent state assessment threshold of each Chinese herbal medicine slice on the target production line as CSY, compare and analyze the initial apparent state assessment value CSP of each Chinese herbal medicine slice on the target production line with the initial apparent state assessment threshold CSY, if the initial apparent state assessment value CSP of each Chinese herbal medicine slice on the target production line is greater than or equal to the initial apparent state assessment threshold CSY, then the Chinese herbal medicine slice on the target production line is judged as not meeting the requirements, when the initial apparent state assessment value CSP of each Chinese herbal medicine slice on the target production line is less than the initial apparent state assessment threshold CSY, then the Chinese herbal medicine slice on the target production line is judged as meeting the requirements;

[0055] The Chinese herbal medicine pieces judged as not meeting the requirements on the target production line are transported to the Q1 workshop for operation and processing, and the instructions are displayed on the display terminal;

[0056] The Chinese herbal medicine pieces determined to meet the requirements on the target production line are executed in step 4;

[0057] Step 4: Detailed inspection and classification: Extract the images of Chinese herbal medicine pieces that are judged to meet the requirements on the target production line from the preferred image set to obtain detailed inspection images of each detailed inspection Chinese herbal medicine piece on the target production line, thereby detecting the detailed appearance state information of each detailed inspection Chinese herbal medicine piece on the target production line, and based on this, perform detailed classification analysis on each detailed inspection Chinese herbal medicine piece on the target production line. The specific analysis process is as follows:

[0058] The detection points of the fine inspection images of each fine inspection piece of Chinese herbal medicine on the target production line are evenly distributed, and the chromaticity of each detection point of the fine inspection image of each fine inspection piece of Chinese herbal medicine on the target production line is obtained, and compared with the preset reference chromaticity for analysis. If the chromaticity is greater than the preset reference chromaticity, the detection point is recorded as a high-quality point; if the chromaticity is equal to the preset reference chromaticity, the detection point is recorded as a medium-quality point; if the chromaticity is less than the preset reference chromaticity, the detection point is recorded as a low-quality point. The number of high-quality points, medium-quality points and low-quality points in the fine inspection images of each fine inspection piece of Chinese herbal medicine on the target production line are counted and calibrated as smn1, smn2 and smn3 respectively. The values ​​of the three are extracted for normalization processing according to the formula: Get the color value sdz, where μ1, μ2 and μ3 are preset scaling factors;

[0059] The number of cracks, total crack length and damaged area are extracted from the detailed inspection images of each finely inspected Chinese herbal medicine slice on the target production line, and marked as the crack value wsz, total crack length value zcz and damaged surface value psz respectively. At the same time, the values ​​of the three are extracted and normalized according to the formula: The aesthetic evaluation index mgz is obtained, where lwz represents the crack evaluation index, a1 and a2 represent the proportional coefficients of the crack value and the total crack length value, respectively, and a3 and a4 represent the weight factors corresponding to the set crack evaluation index and damaged surface value, respectively;

[0060] Extract the color value sdz and the aesthetic evaluation index mgz and normalize them according to the formula: Obtain the detailed appearance evaluation value XPG of each finely inspected Chinese herbal medicine slice on the target production line, where γ1 and γ2 represent the weight coefficients of color value and aesthetic evaluation index, respectively, and γ1>γ2. The weight coefficient is used to balance the proportion of each data in the formula calculation, thereby improving the accuracy of the calculation result;

[0061] Set three gradient comparison intervals of the fine apparent state evaluation value of each finely inspected Chinese herbal medicine slice on the target production line, namely the first gradient evaluation interval AQ1, the second gradient evaluation interval AQ2 and the third gradient evaluation interval AQ3, and AQ1 = ζAQ2 = 2ζAQ3, wherein AQ1> AQ2> AQ3, ζ represents the multiple of the gradient, and the specific value of ζ is set by those skilled in the art in the specific Chinese herbal medicine slice quality inspection example.

[0062] When the fine apparent state evaluation value XPG of each finely inspected Chinese herbal medicine slice on the target production line is in the preset first gradient evaluation interval AQ1, the finely inspected Chinese herbal medicine slice on the target production line is determined to be a high-quality product; when the fine apparent state evaluation value XPG of each finely inspected Chinese herbal medicine slice on the target production line is in the preset second gradient evaluation interval AQ2, the finely inspected Chinese herbal medicine slice on the target production line is determined to be a good-quality product; when the fine apparent state evaluation value XPG of each finely inspected Chinese herbal medicine slice on the target production line is in the preset third gradient evaluation interval AQ3, the finely inspected Chinese herbal medicine slice on the target production line is determined to be a substandard product;

[0063] The finely inspected Chinese herbal medicine pieces that are judged as high-quality products on the target production line are transported to the Q2 workshop for operation and processing, and the instructions are displayed on the display terminal;

[0064] The finely inspected Chinese herbal medicines that are judged as good quality products on the target production line are transported to the Q3 workshop for operation and processing, and the instructions are displayed on the display terminal;

[0065] The carefully inspected Chinese herbal medicine pieces that are judged as inferior products on the target production line are transported to the Q4 workshop for operation and processing, and the instructions are displayed on the display terminal.

[0066] See also Figure 2 As shown, a machine vision-based Chinese herbal medicine quality detection and analysis system includes a server, which is communicatively connected to a data acquisition unit, an image screening unit, a preliminary inspection and classification analysis unit, a detailed inspection and classification analysis unit, and a display terminal;

[0067] The data acquisition unit is used to collect image status information, initial appearance status information and detailed appearance status information of the Chinese herbal medicine pieces on the target production line, and send them to the image screening unit, the initial inspection classification analysis unit and the detailed inspection classification analysis unit respectively through the server;

[0068] The image screening unit is used to detect the image status information of the Chinese herbal medicine pieces on the target production line to obtain the complete value, brightness ratio and image quality value, and extract the numerical values ​​of the complete value, brightness ratio and image quality value, and calibrate them as wzz, ldz and tuz respectively, according to the formula: The image evaluation coefficient TPZ is obtained, wherein e represents a natural constant, δ1, δ2 and δ3 represent the proportional coefficients of the complete value, the brightness ratio and the image quality value respectively, and δ1>δ2>δ3, thereby performing screening and judgment analysis on the images of the Chinese herbal medicine pieces on the target production line. The specific judgment analysis is as follows: the image evaluation threshold of the image evaluation coefficient is set to TPY, and the image evaluation coefficient TPZ is compared with the set image evaluation threshold TPY for analysis. When the image evaluation coefficient TPZ is greater than or equal to the image evaluation threshold TPY, the corresponding image is calibrated as a high-quality image. When the image evaluation coefficient TPZ is less than the image evaluation threshold TPY, the corresponding image is calibrated as a low-quality image. The images of the unit number of images in the same batch that are calibrated as low-quality images are eliminated, and the images of the high-quality images of the same batch are re-sorted according to the time frame order and classified together to obtain a preferred image set.

[0069] The initial inspection and classification analysis unit detects the initial apparent state information of each Chinese herbal medicine slice on the target production line based on the preferred image set, thereby performing initial classification analysis on each Chinese herbal medicine slice on the target production line. The specific analysis process is as follows:

[0070] By obtaining the shape value, area value and thickness value in the initial apparent state information of each Chinese herbal medicine slice on the target production line, and calibrating them as xyz, mjz and hdz respectively, the values ​​of the three are extracted for normalization processing according to the formula: Get the initial apparent state evaluation value CSP of each Chinese herbal medicine slice on the target production line, where xyz * 、mjz * and hdz * Represents the reference shape value, reference area value and reference thickness value respectively, |xyz-xyz * |、|mjz-mjz * |、|hdz-hdz * | respectively represent the shape deviation value, area deviation value and thickness deviation value, η1, η2 and η3 respectively represent the weight coefficients of the shape deviation degree, area deviation degree and thickness deviation degree, and η1>η2>η3;

[0071] Set the initial apparent state assessment threshold of each Chinese herbal medicine slice on the target production line as CSY, compare and analyze the initial apparent state assessment value CSP of each Chinese herbal medicine slice on the target production line with the initial apparent state assessment threshold CSY, if the initial apparent state assessment value CSP of each Chinese herbal medicine slice on the target production line is greater than or equal to the initial apparent state assessment threshold CSY, then the Chinese herbal medicine slice on the target production line is judged as not meeting the requirements, when the initial apparent state assessment value CSP of each Chinese herbal medicine slice on the target production line is less than the initial apparent state assessment threshold CSY, then the Chinese herbal medicine slice on the target production line is judged as meeting the requirements;

[0072] The Chinese herbal medicine pieces judged as not meeting the requirements on the target production line are transported to the Q1 workshop for operation and processing, and the instructions are displayed on the display terminal;

[0073] The Chinese herbal medicine pieces that are judged to meet the requirements on the target production line are subjected to detailed inspection, classification and analysis;

[0074] The fine inspection classification analysis unit extracts the images of the Chinese herbal medicine pieces that are judged to meet the requirements on the target production line from the preferred image set to obtain the fine inspection images of each fine inspection Chinese herbal medicine piece on the target production line, thereby detecting the fine appearance state information of each fine inspection Chinese herbal medicine piece on the target production line to obtain the color value and the aesthetic evaluation index, and at the same time extracts the numerical values ​​of the color value and the aesthetic evaluation index for normalization calculation processing to obtain the fine appearance state evaluation value of each fine inspection Chinese herbal medicine piece on the target production line, and sets three gradient comparison intervals of the fine appearance state evaluation value of each fine inspection Chinese herbal medicine piece on the target production line, which are the first gradient evaluation interval , the second gradient evaluation interval and the third gradient evaluation interval; when the fine apparent state evaluation value of each finely inspected Chinese herbal medicine slice on the target production line is in the preset first gradient evaluation interval, the finely inspected Chinese herbal medicine slice on the target production line is determined to be a high-quality product; when the fine apparent state evaluation value of each finely inspected Chinese herbal medicine slice on the target production line is in the preset second gradient evaluation interval, the finely inspected Chinese herbal medicine slice on the target production line is determined to be a good-quality product; when the fine apparent state evaluation value of each finely inspected Chinese herbal medicine slice on the target production line is in the preset third gradient evaluation interval, the finely inspected Chinese herbal medicine slice on the target production line is determined to be a substandard product;

[0075] The finely inspected Chinese herbal medicine pieces that are judged as high-quality products on the target production line are transported to the Q2 workshop for operation and processing, and the instructions are displayed on the display terminal;

[0076] The finely inspected Chinese herbal medicines that are judged as good quality products on the target production line are transported to the Q3 workshop for operation and processing, and the instructions are displayed on the display terminal;

[0077] The carefully inspected Chinese herbal medicine pieces that are judged as inferior products on the target production line are transported to the Q4 workshop for operation and processing, and the instructions are displayed on the display terminal.

[0078] The preferred embodiments of the present invention disclosed above are intended only to help illustrate the present invention. These preferred embodiments do not exhaustively describe all details, nor do they limit the present invention to specific embodiments. Obviously, many modifications and variations are possible based on the contents of this specification. These embodiments are selected and described in detail in this specification to better explain the principles and practical applications of the present invention, thereby enabling those skilled in the art to better understand and utilize the present invention. The present invention is limited only by the claims and their full scope and equivalents.

Claims

1. A method for quality detection and analysis of Chinese herbal medicine slices based on machine vision, characterized in that: The following steps are involved: Step 1: Collect image status information, initial appearance status information and detailed appearance status information of Chinese herbal medicine pieces on the target production line; Step 2: Detect and analyze the image status information of the Chinese herbal medicine pieces on the target production line to obtain the image evaluation coefficient, thereby screening and analyzing the images of the Chinese herbal medicine pieces on the target production line to obtain high-quality images and low-quality images, and eliminate the images of the same batch of unit number images that are marked as low-quality images, and at the same time, re-sort the images of the same batch of high-quality images according to the time frame order to obtain a preferred image set; Step 3: Based on the preferred image set, the initial apparent state information of each Chinese herbal medicine slice on the target production line is detected and analyzed to obtain the initial apparent state evaluation value of each Chinese herbal medicine slice on the target production line, thereby performing a preliminary classification analysis on each Chinese herbal medicine slice on the target production line to obtain Chinese herbal medicine slices that are judged to be unqualified and qualified, and the Chinese herbal medicine slices that are judged to be unqualified are transported to the corresponding workshop for operation and processing, and the Chinese herbal medicine slices that are judged to be qualified are executed in step 4; Step 4: extracting the images of the Chinese herbal medicine pieces judged to meet the requirements on the target production line from the preferred image set to obtain the detailed inspection images of each detailed inspection Chinese herbal medicine piece on the target production line, thereby detecting and analyzing the detailed appearance state information of each detailed inspection Chinese herbal medicine piece on the target production line to obtain the detailed appearance state evaluation value of each detailed inspection Chinese herbal medicine piece on the target production line, and accordingly performing detailed classification analysis on each detailed inspection Chinese herbal medicine piece on the target production line to obtain high-quality products, good-quality products and inferior products, and respectively transporting the detailed inspection Chinese herbal medicine pieces judged to be high-quality products, good-quality products and inferior products to the corresponding workshops for corresponding operation processing; The Chinese herbal medicine pieces on the target production line were initially classified and analyzed, and the specific analysis is as follows: By obtaining the shape value, area value and thickness value in the initial apparent state information of each Chinese herbal medicine slice on the target production line, and calibrating them as xyz, mjz and hdz respectively, the values ​​of the three are extracted for normalization processing, according to the formula: , and obtain the initial apparent state evaluation value CSP of each Chinese herbal medicine slice on the target production line, where xyz * 、mjz * and hdz * Respectively represent the reference shape value, reference area value and reference thickness value, |xyz-xyz * |、|mjz-mjz * |、|hdz-hdz * | respectively represent the shape deviation value, area deviation value and thickness deviation value, η1, η2 and η3 respectively represent the weight coefficients of the shape deviation degree, area deviation degree and thickness deviation degree; The detailed apparent state information of each finely inspected Chinese herbal medicine slice on the target production line was tested and analyzed. The specific analysis is as follows: The detection points of the fine inspection images of each fine inspection piece of Chinese herbal medicine on the target production line are evenly arranged, and the chromaticity of each detection point corresponding to the fine inspection image of each fine inspection piece of Chinese herbal medicine on the target production line is obtained, and compared and analyzed with the preset reference chromaticity. If the chromaticity is greater than the preset reference chromaticity, the detection point is recorded as a high-quality point. If the chromaticity is equal to the preset reference chromaticity, the detection point is recorded as a medium-quality point. If the chromaticity is less than the preset reference chromaticity, the detection point is recorded as a low-quality point. The number of high-quality points, the number of medium-quality points and the number of low-quality points in the fine inspection images of each fine inspection piece of Chinese herbal medicine on the target production line are counted, and the color value is calculated according to the formula; The numerical values ​​of the number of cracks, total crack length and damaged area are extracted from the detailed inspection images of each detailed inspection Chinese herbal medicine slice on the target production line, and normalized and calculated to obtain the aesthetic evaluation index; The color value and aesthetic evaluation index are extracted and normalized and calculated to obtain the detailed appearance evaluation value of each finely inspected Chinese herbal medicine slice on the target production line.

2. The method for quality detection and analysis of Chinese herbal medicine slices based on machine vision according to claim 1, characterized in that: The image status information of Chinese herbal medicine pieces on the target production line is detected and analyzed. The specific analysis is as follows: The Chinese herbal medicine capture frame of the image is identified and the area of ​​the Chinese herbal medicine capture frame is calculated and marked as the frame face value. The morphological features of the Chinese herbal medicines within the Chinese herbal medicine capture frame are identified. The morphological features include shape, size, length, color and texture. Each morphological feature corresponds to a preset morphological value. All identified morphological features are matched to the corresponding preset morphological values ​​and summed up to obtain the total morphological value. The values ​​of the frame face value and the total morphological value are extracted and multiplied by the corresponding weight coefficients respectively and then summed up to obtain the complete value.

3. The method for quality detection and analysis of Chinese herbal medicine slices based on machine vision according to claim 2, characterized in that: The image is divided into several regions, the brightness of each region is identified, the region whose brightness is greater than a preset brightness threshold is marked as a bright region, and the region whose brightness is less than or equal to the preset brightness threshold is marked as a dark region; The numbers of bright areas and dark areas are counted separately and then marked as the total number of bright areas and the total number of dark areas; the brightness ratio is obtained by dividing the total number of bright areas by the total number of dark areas.

4. The method for quality detection and analysis of Chinese herbal medicine slices based on machine vision according to claim 3, characterized in that: Obtain the clarity, contrast, noise and resolution in the image status information, construct a rectangle with the contrast value and the resolution value as the length and width respectively, then use the center point of the rectangle as the starting point and the clarity value as the length to make the height of the rectangle, construct a cuboid with the rectangle and the height of the rectangle, select the center point of the cuboid, convert the noise value into a radius according to a preset ratio, use the center point of the rectangle as the starting point and the radius to make a sphere inside the cuboid and cut it to get a hollow sphere, calculate the volume of the cuboid and extract the volume value to record it as the image quality value.

5. The method for quality detection and analysis of Chinese herbal medicine slices based on machine vision according to claim 4, characterized in that: Screening and analysis of the images of Chinese herbal medicine pieces on the target production line are performed. The specific analysis is as follows: Extract the values ​​of the complete value, brightness ratio and image quality value, and calibrate them as wzz, ldz and tuz respectively, according to the formula: The image evaluation coefficient TPZ is obtained, where e represents a natural constant, and δ1, δ2, and δ3 represent proportional coefficients of the complete value, brightness ratio, and image quality value, respectively; The image evaluation coefficient is compared and analyzed with the set image evaluation threshold. When the image evaluation coefficient is greater than or equal to the image evaluation threshold, the corresponding image is calibrated as a high-quality image. When the image evaluation coefficient is less than the image evaluation threshold, the corresponding image is calibrated as a low-quality image.

6. The method for quality detection and analysis of Chinese herbal medicine slices based on machine vision according to claim 1, characterized in that: The initial apparent state evaluation value of each Chinese herbal medicine on the target production line is compared and analyzed with the initial apparent state evaluation threshold. If the initial apparent state evaluation value of each Chinese herbal medicine on the target production line is greater than or equal to the initial apparent state evaluation threshold, the Chinese herbal medicine on the target production line is judged as not meeting the requirements; when the initial apparent state evaluation value of each Chinese herbal medicine on the target production line is less than the initial apparent state evaluation threshold, the Chinese herbal medicine on the target production line is judged as meeting the requirements.

7. The method for quality detection and analysis of Chinese herbal medicine slices based on machine vision according to claim 6, characterized in that: A detailed classification analysis was conducted on each finely inspected Chinese herbal medicine slice on the target production line. The specific analysis is as follows: Set three gradient comparison intervals of the fine surface state evaluation values ​​of each finely inspected Chinese herbal medicine slice on the target production line, which are the first gradient evaluation interval, the second gradient evaluation interval and the third gradient evaluation interval; When the fine apparent state evaluation value of each finely inspected Chinese medicinal slice on the target production line is in the preset first gradient evaluation interval, the finely inspected Chinese medicinal slice on the target production line is judged as a high-quality product; when the fine apparent state evaluation value of each finely inspected Chinese medicinal slice on the target production line is in the preset second gradient evaluation interval, the finely inspected Chinese medicinal slice on the target production line is judged as a good-quality product; when the fine apparent state evaluation value of each finely inspected Chinese medicinal slice on the target production line is in the preset third gradient evaluation interval, the finely inspected Chinese medicinal slice on the target production line is judged as a substandard product.

8. A machine vision-based Chinese medicine slice quality detection and analysis system, the system implements the method as claimed in claim 1, characterized in that: include: A data acquisition unit is used to collect image status information, initial appearance status information and detailed appearance status information of the Chinese herbal medicine pieces on the target production line, and send the information to the image screening unit, the initial inspection classification analysis unit and the detailed inspection classification analysis unit through the server; An image screening unit is used to detect the image status information of the Chinese herbal medicine pieces on the target production line to obtain an image evaluation coefficient, thereby screening, judging and analyzing the images of the Chinese herbal medicine pieces on the target production line to obtain high-quality images and low-quality images, and eliminating the images marked as low-quality images from the unit number of images of the same batch, and at the same time re-sorting the images of the high-quality images of the same batch according to the time frame order to obtain a preferred image set; The initial inspection classification and analysis unit detects and analyzes the initial apparent state information of each Chinese herbal medicine slice on the target production line based on the preferred image set to obtain the initial apparent state evaluation value of each Chinese herbal medicine slice on the target production line, thereby performing initial classification and analysis on each Chinese herbal medicine slice on the target production line to obtain Chinese herbal medicine slices that are judged to be non-compliant and that meet the requirements, and the Chinese herbal medicine slices that are judged to be non-compliant are transported to the corresponding workshop for operation and processing, and the Chinese herbal medicine slices that are judged to meet the requirements are subjected to detailed inspection and classification analysis; The detailed inspection, classification and analysis unit extracts the images of Chinese herbal medicines judged to meet the requirements on the target production line from the preferred image set to obtain the detailed inspection images of each detailed inspection Chinese herbal medicine on the target production line, thereby detecting and analyzing the detailed apparent state information of each detailed inspection Chinese herbal medicine on the target production line to obtain the detailed apparent state evaluation value of each detailed inspection Chinese herbal medicine on the target production line, and based on this, performing detailed classification and analysis on each detailed inspection Chinese herbal medicine on the target production line to obtain high-quality products, good-quality products and inferior products, and the detailed inspection Chinese herbal medicines judged to be high-quality products, good-quality products and inferior products are respectively transported to the corresponding workshops for corresponding operation processing, and displayed on the display terminal.

Citation Information

Patent Citations

  • Traditional Chinese medicine decoction piece quality inspection method, device and equipment and storage medium

    CN114266740A

  • Underground personnel border crossing identification alarm system based on image analysis

    CN116912759A