CN116434206A - Cotton quality character detection method based on machine vision technology - Google Patents
Cotton quality character detection method based on machine vision technology Download PDFInfo
- Publication number
- CN116434206A CN116434206A CN202310267728.XA CN202310267728A CN116434206A CN 116434206 A CN116434206 A CN 116434206A CN 202310267728 A CN202310267728 A CN 202310267728A CN 116434206 A CN116434206 A CN 116434206A
- Authority
- CN
- China
- Prior art keywords
- cotton
- image
- shooting
- sample
- model
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 229920000742 Cotton Polymers 0.000 title claims abstract description 86
- 238000001514 detection method Methods 0.000 title claims abstract description 45
- 238000005516 engineering process Methods 0.000 title claims abstract description 16
- 238000012549 training Methods 0.000 claims abstract description 16
- 238000000605 extraction Methods 0.000 claims abstract description 14
- 238000011156 evaluation Methods 0.000 claims abstract description 12
- 238000007781 pre-processing Methods 0.000 claims abstract description 7
- 238000010801 machine learning Methods 0.000 claims abstract description 6
- 238000012545 processing Methods 0.000 claims abstract description 6
- 238000000034 method Methods 0.000 claims description 36
- 239000000835 fiber Substances 0.000 claims description 9
- 230000009466 transformation Effects 0.000 claims description 6
- 230000000877 morphologic effect Effects 0.000 claims description 5
- 238000012706 support-vector machine Methods 0.000 claims description 5
- 238000006243 chemical reaction Methods 0.000 claims description 4
- 238000005286 illumination Methods 0.000 claims description 3
- 238000005457 optimization Methods 0.000 claims description 3
- 230000008569 process Effects 0.000 claims description 3
- 230000011218 segmentation Effects 0.000 claims description 3
- 238000012360 testing method Methods 0.000 claims description 3
- 238000012795 verification Methods 0.000 claims description 3
- 238000002790 cross-validation Methods 0.000 claims description 2
- 230000010339 dilation Effects 0.000 claims description 2
- 238000003708 edge detection Methods 0.000 claims description 2
- 230000003628 erosive effect Effects 0.000 claims description 2
- 230000006870 function Effects 0.000 claims description 2
- 238000003709 image segmentation Methods 0.000 claims description 2
- 238000004458 analytical method Methods 0.000 description 3
- 239000004753 textile Substances 0.000 description 2
- 230000004075 alteration Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000018109 developmental process Effects 0.000 description 1
- 239000000463 material Substances 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000010606 normalization Methods 0.000 description 1
- 238000011160 research Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V20/00—Scenes; Scene-specific elements
- G06V20/60—Type of objects
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/20—Image preprocessing
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/40—Extraction of image or video features
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/70—Arrangements for image or video recognition or understanding using pattern recognition or machine learning
- G06V10/77—Processing image or video features in feature spaces; using data integration or data reduction, e.g. principal component analysis [PCA] or independent component analysis [ICA] or self-organising maps [SOM]; Blind source separation
- G06V10/774—Generating sets of training patterns; Bootstrap methods, e.g. bagging or boosting
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/70—Arrangements for image or video recognition or understanding using pattern recognition or machine learning
- G06V10/77—Processing image or video features in feature spaces; using data integration or data reduction, e.g. principal component analysis [PCA] or independent component analysis [ICA] or self-organising maps [SOM]; Blind source separation
- G06V10/778—Active pattern-learning, e.g. online learning of image or video features
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02P—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
- Y02P90/00—Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
- Y02P90/30—Computing systems specially adapted for manufacturing
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Multimedia (AREA)
- Databases & Information Systems (AREA)
- Artificial Intelligence (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Computing Systems (AREA)
- Health & Medical Sciences (AREA)
- Evolutionary Computation (AREA)
- General Health & Medical Sciences (AREA)
- Medical Informatics (AREA)
- Software Systems (AREA)
- Treatment Of Fiber Materials (AREA)
Abstract
The invention discloses a cotton quality character detection method based on a machine vision technology, which comprises the following steps: data acquisition, data preprocessing, feature extraction, model training, cotton quality character detection and performance evaluation. Compared with the traditional manual detection method, the automatic detection method adopts the machine vision technology to carry out automatic detection, so that the subjectivity and error problems of the traditional manual detection method are avoided, and the detection accuracy and reliability are improved. Through image processing and a machine learning algorithm, the characteristics of cotton fibers are extracted and classified, so that the rapid and accurate detection of a plurality of quality traits of cotton can be realized, and the detection efficiency is improved.
Description
Technical Field
The invention relates to the technical field of machine vision detection, in particular to a cotton quality character detection method based on a machine vision technology.
Background
Cotton is one of the important commercial crops and has wide application in the textile industry. The quality character of cotton directly affects the quality of textile, so that the quality detection of cotton is very important.
Currently, the cotton quality trait detection mainly adopts a manual detection method, namely detection is carried out by means of visual detection, hand touch detection and the like. The method has the problems of low detection efficiency, poor accuracy, high labor cost and the like, and can be influenced by human subjective factors, so that the detection efficiency and the accuracy are low. With the rapid development of machine vision technology, more and more researches begin to explore the use of computer vision and machine learning algorithms to realize cotton quality trait detection, but some current methods still have the problems of low recognition accuracy, low operation speed and the like.
Disclosure of Invention
In order to solve the problems of the background technology, the invention provides the following technical scheme:
a cotton quality character detection method based on a machine vision technology comprises the following steps:
s1, data acquisition: shooting a cotton sample by using a high-resolution camera, and recording relevant information of the sample;
s2, preprocessing data: preprocessing the collected image, including operations such as image denoising, graying, binarization and the like, then dividing the cotton image, and separating cotton fibers from the background;
s3, extracting features: each cotton fiber is subjected to feature extraction, wherein the features comprise length, width, aspect ratio and the like, and the extracted features are required to have better distinction and can accurately reflect the quality characters of the cotton fibers;
s4, training a model: training a machine learning model by using the acquired image data and characteristic data, dividing a data set into a training set and a testing set when training the model, and performing operations such as cross verification, parameter adjustment and the like to improve generalization capability and accuracy of the model;
s5, cotton quality character detection: performing quality character detection on a new cotton sample by using the trained model, inputting an image of the cotton sample into the model, extracting fiber characteristics and classifying, and finally outputting the quality character of cotton fibers;
s6, performance evaluation: and performing performance evaluation on the cotton quality character detection system, wherein the performance evaluation comprises indexes such as accuracy, recall rate, F1 score and the like, and performing parameter adjustment and optimization on the system according to requirements so as to improve detection efficiency and accuracy.
Preferably, the S1 data acquisition information includes color, size, fiber length, and the like.
Preferably, the S1 data acquisition includes the following steps:
(1) Preparing an image pickup apparatus: the use of high resolution cameras to capture images of cotton samples, typically selected from industrial cameras or smart phone cameras with higher resolution,
(2) Preparing a cotton sample: selecting a representative cotton sample, taking note that the cotton quality should be uniform and not have too great difference, preparing the cotton sample and placing the cotton sample on a shooting table, and ensuring the stable position of the sample during shooting;
(3) Adjusting shooting parameters: selecting proper shooting parameters including exposure time, light source brightness, focal length and the like, wherein generally, a shorter exposure time should be selected to avoid movement and shaking of a cotton sample during shooting, and meanwhile, the light source brightness is ensured to be sufficient to improve the definition of an image;
(4) Shooting: shooting a cotton sample by using a high-resolution camera, and recording relevant information of the sample, such as shooting time, shooting position, shooting angle and the like;
(5) Storing image data: and storing the image data obtained by shooting in a computer or a cloud server, and storing corresponding information such as file names, shooting time, shooting positions and the like.
Preferably, the S2 image denoising method includes the following steps:
graying: converting the color image into a gray image for subsequent image binarization and segmentation operations, the gray conversion operation may use a gray conversion method, such as a weighted average method or a maximum value method;
image binarization: the gray level image is converted into a binary image, cotton fibers are separated from the background, and a global threshold method, a local self-adaptive threshold method and a threshold method based on an Otsu algorithm can be adopted.
Image segmentation: the binarized image is segmented, cotton fibers are separated from the background, and various segmentation algorithms, such as an edge detection algorithm, a region growing algorithm, and a level set algorithm, can be adopted.
Morphological treatment: morphological processing such as erosion, dilation, open operation, close operation, etc. is performed on the segmented image to eliminate noise and to join broken cotton fibers.
Preferably, the S3 feature extraction is a feature extraction method adopting scale-invariant feature transformation, and is a local feature extraction method, which can extract local features of fibers under different scales and rotation angles, has better robustness for transformation such as illumination, rotation, scaling and the like, and can accurately match the similarity between different cotton fibers.
Preferably, the training of the S4 model adopts a support vector machine model, wherein the type of kernel function, regularization parameters and other super parameters need to be determined, parameter tuning can be generally performed by adopting a grid search or random search method, appropriate super parameters are selected to obtain better model performance, the support vector machine model is trained by using a training set, in the training process, care needs to be taken to avoid the occurrence of over-fitting problem, and a cross-validation method can be adopted to perform model evaluation and tuning.
Compared with the prior art, the invention has the beneficial effects that: compared with the traditional manual detection method, the automatic detection method adopts the machine vision technology to carry out automatic detection, so that the subjectivity and error problems of the traditional manual detection method are avoided, and the detection accuracy and reliability are improved.
Through image processing and a machine learning algorithm, the characteristics of cotton fibers are extracted and classified, so that the rapid and accurate detection of a plurality of quality traits of cotton can be realized, and the detection efficiency is improved.
The method has universality and can be applied to quality character detection of other materials.
Drawings
FIG. 1 is a schematic flow chart of the method of the present invention;
FIG. 2 is a schematic flow chart of a data acquisition process.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are only some, but not all embodiments of the invention. All other embodiments, based on the embodiments of the invention, which would be apparent to one of ordinary skill in the art without making any inventive effort, are intended to be within the scope of the invention.
Referring to fig. 1, the present invention provides a technical solution: a cotton quality character detection method based on a machine vision technology comprises the following steps:
and (3) data acquisition: a high resolution camera is used to capture a cotton sample and record information about the sample, such as color, size, fiber length, etc. It is recommended to collect using multiple types of cotton samples of different grades to cover cotton of different varieties and quality grades.
Data preprocessing: preprocessing the acquired image, including image denoising, graying, binarization and other operations. The cotton image is then segmented and the cotton fibers are separated from the background. It is suggested to use an image processing tool.
Feature extraction: each cotton fiber is subjected to feature extraction such as length, width, aspect ratio, etc. It is suggested to use various feature extraction methods, such as morphological analysis, texture analysis, color analysis, etc., and perform normalization processing on the extracted features, and this embodiment is a feature extraction method using scale-invariant feature transformation, which is a local feature extraction method, and can extract local features of fibers under different scales and rotation angles, so that the method has better robustness for transformation such as illumination, rotation, scaling, etc., and can accurately match the similarity between different cotton fibers.
Model training: a machine learning model, such as a support vector machine, is trained using the acquired image data and the feature data. When the model is trained, the data set is divided into a training set and a testing set, and operations such as cross verification and parameter adjustment are performed to improve the generalization capability and accuracy of the model.
Cotton quality character detection: and detecting the quality character of the new cotton sample by using the trained model. Inputting the image of the cotton sample into a model, extracting fiber characteristics, classifying, and finally outputting the quality character of cotton fibers. It is suggested to set appropriate thresholds and decision rules to improve the accuracy of the detection.
Performance evaluation: and performing performance evaluation on the cotton quality character detection system, wherein the performance evaluation comprises indexes such as accuracy, recall rate, F1 score and the like. And (3) carrying out parameter adjustment and optimization on the system according to the requirement so as to improve the detection efficiency and accuracy.
Referring to fig. 2, the data acquisition in the present embodiment includes the following steps:
(1) Preparing an image pickup apparatus: the use of high resolution cameras to capture images of cotton samples, typically selected from industrial cameras or smart phone cameras with higher resolution,
(2) Preparing a cotton sample: selecting a representative cotton sample, taking note that the cotton quality should be uniform and not have too great difference, preparing the cotton sample and placing the cotton sample on a shooting table, and ensuring the stable position of the sample during shooting;
(3) Adjusting shooting parameters: selecting proper shooting parameters including exposure time, light source brightness, focal length and the like, wherein generally, a shorter exposure time should be selected to avoid movement and shaking of a cotton sample during shooting, and meanwhile, the light source brightness is ensured to be sufficient to improve the definition of an image;
(4) Shooting: shooting a cotton sample by using a high-resolution camera, and recording relevant information of the sample, such as shooting time, shooting position, shooting angle and the like;
(5) Storing image data: and storing the image data obtained by shooting in a computer or a cloud server, and storing corresponding information such as file names, shooting time, shooting positions and the like.
Although embodiments of the present invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made therein without departing from the principles and spirit of the invention, the scope of which is defined in the appended claims and their equivalents.
Claims (6)
1. The cotton quality character detection method based on the machine vision technology is characterized by comprising the following steps of:
s1, data acquisition: shooting a cotton sample by using a high-resolution camera, and recording relevant information of the sample;
s2, preprocessing data: preprocessing the acquired image, including image denoising, graying and binarization operation, then dividing the cotton image, and separating cotton fibers from the background;
s3, extracting features: each cotton fiber is subjected to feature extraction, wherein the features comprise length, width and aspect ratio, and the extracted features need to have better distinction and can accurately reflect the quality characters of the cotton fibers;
s4, training a model: training a machine learning model by using the acquired image data and characteristic data, dividing a data set into a training set and a testing set when training the model, and performing cross verification and parameter adjustment operation to improve generalization capability and accuracy of the model;
s5, cotton quality character detection: performing quality character detection on a new cotton sample by using the trained model, inputting an image of the cotton sample into the model, extracting fiber characteristics and classifying, and finally outputting the quality character of cotton fibers;
s6, performance evaluation: and performing performance evaluation on the cotton quality character detection system, wherein the performance evaluation comprises accuracy, recall rate and F1 score index, and performing parameter adjustment and optimization on the system according to the requirements so as to improve detection efficiency and accuracy.
2. The method for detecting cotton quality traits based on machine vision technology according to claim 1, wherein the method comprises the following steps: the S1 data acquisition information comprises color, size and fiber length.
3. The method for detecting cotton quality traits based on machine vision technology according to claim 1, wherein the method comprises the following steps: the S1 data acquisition comprises the following steps:
(1) Preparing an image pickup apparatus: the use of high resolution cameras to capture images of cotton samples, typically selected from industrial cameras or smart phone cameras with higher resolution,
(2) Preparing a cotton sample: selecting a representative cotton sample, taking note that the cotton quality should be uniform and not have too great difference, preparing the cotton sample and placing the cotton sample on a shooting table, and ensuring the stable position of the sample during shooting;
(3) Adjusting shooting parameters: selecting proper shooting parameters including exposure time, light source brightness and focal length, and selecting shorter exposure time to avoid movement and shaking of a cotton sample during shooting, and ensuring sufficient light source brightness to improve the definition of an image;
(4) Shooting: shooting a cotton sample by using a high-resolution camera, and recording related information of the sample, such as shooting time, shooting position and shooting angle;
(5) Storing image data: and storing the image data obtained by shooting in a computer or a cloud server, and storing corresponding information such as file names, shooting time and shooting positions.
4. The method for detecting cotton quality traits based on machine vision technology according to claim 1, wherein the method comprises the following steps: the S2 image denoising method comprises the following steps:
graying: converting the color image into a gray image for subsequent image binarization and segmentation operations, the gray conversion operation may use a gray conversion method, such as a weighted average method or a maximum value method;
image binarization: converting the gray level image into a binary image, separating cotton fibers from the background, and adopting a global threshold method, a local self-adaptive threshold method and a threshold method based on an Otsu algorithm;
image segmentation: dividing the binarized image, separating cotton fiber from background, and adopting various dividing algorithms such as edge detection algorithm, region growing algorithm and level set algorithm;
morphological treatment: morphological processing such as erosion, dilation, open operation, and close operation is performed on the segmented image to eliminate noise and to join broken cotton fibers.
5. The method for detecting cotton quality traits based on machine vision technology according to claim 1, wherein the method comprises the following steps: the S3 feature extraction is a feature extraction method adopting scale-invariant feature transformation, is a local feature extraction method, can extract local features of fibers under different scales and rotation angles, has better robustness for transformation such as illumination, rotation, scaling and the like, and can accurately match the similarity among different cotton fibers.
6. The method for detecting cotton quality traits based on machine vision technology according to claim 1, wherein the method comprises the following steps: the S4 model is trained by adopting a support vector machine model, wherein the type of a kernel function, regularization parameters and other super parameters are required to be determined, parameter tuning is performed by adopting a grid search or random search method, proper super parameters are selected to obtain good model performance, the support vector machine model is trained by using a training set, in the training process, the occurrence of the over-fitting problem is required to be avoided, and the model evaluation and parameter tuning can be performed by adopting a cross-validation method and the like.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310267728.XA CN116434206A (en) | 2023-03-20 | 2023-03-20 | Cotton quality character detection method based on machine vision technology |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310267728.XA CN116434206A (en) | 2023-03-20 | 2023-03-20 | Cotton quality character detection method based on machine vision technology |
Publications (1)
Publication Number | Publication Date |
---|---|
CN116434206A true CN116434206A (en) | 2023-07-14 |
Family
ID=87078806
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310267728.XA Pending CN116434206A (en) | 2023-03-20 | 2023-03-20 | Cotton quality character detection method based on machine vision technology |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116434206A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117152161A (en) * | 2023-11-01 | 2023-12-01 | 山东迪特智联信息科技有限责任公司 | Shaving board quality detection method and system based on image recognition |
CN117474912A (en) * | 2023-12-27 | 2024-01-30 | 浪潮软件科技有限公司 | Road section gap analysis method and model based on computer vision |
CN118297914A (en) * | 2024-04-12 | 2024-07-05 | 乐昌市恒发纺织企业有限公司 | Detection system for quality of cotton web in cotton carding process |
-
2023
- 2023-03-20 CN CN202310267728.XA patent/CN116434206A/en active Pending
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117152161A (en) * | 2023-11-01 | 2023-12-01 | 山东迪特智联信息科技有限责任公司 | Shaving board quality detection method and system based on image recognition |
CN117152161B (en) * | 2023-11-01 | 2024-03-01 | 山东迪特智联信息科技有限责任公司 | Shaving board quality detection method and system based on image recognition |
CN117474912A (en) * | 2023-12-27 | 2024-01-30 | 浪潮软件科技有限公司 | Road section gap analysis method and model based on computer vision |
CN118297914A (en) * | 2024-04-12 | 2024-07-05 | 乐昌市恒发纺织企业有限公司 | Detection system for quality of cotton web in cotton carding process |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10671833B2 (en) | Analyzing digital holographic microscopy data for hematology applications | |
CN108562589B (en) | Method for detecting surface defects of magnetic circuit material | |
CN116434206A (en) | Cotton quality character detection method based on machine vision technology | |
US8600143B1 (en) | Method and system for hierarchical tissue analysis and classification | |
CN113592845A (en) | Defect detection method and device for battery coating and storage medium | |
Yogesh et al. | Computer vision based analysis and detection of defects in fruits causes due to nutrients deficiency | |
Wang et al. | Assisted diagnosis of cervical intraepithelial neoplasia (CIN) | |
CN106290392A (en) | A kind of little micro-bearing surface pitting defects online test method and system thereof | |
CN111242899A (en) | Image-based flaw detection method and computer-readable storage medium | |
CN113222062A (en) | Method, device and computer readable medium for tobacco leaf classification | |
CN117197092A (en) | Underground coal mine image quality assessment method | |
CN111353992B (en) | Agricultural product defect detection method and system based on textural features | |
CN114662594B (en) | Target feature recognition analysis system | |
CN100593172C (en) | Microorganism recognition system and method based on microscopic image | |
CN115439456A (en) | Method and device for detecting and identifying object in pathological image | |
CN116704526B (en) | Staff scanning robot and method thereof | |
CN110335240A (en) | The method that automatic batch grabs alimentary canal inner tissue or foreign matter feature image | |
CN113628252A (en) | Method for detecting gas cloud cluster leakage based on thermal imaging video | |
CN117058089A (en) | Cigarette appearance detection method | |
CN116523851A (en) | File report scanning image definition identification method, device and system | |
Nie et al. | Machine vision-based apple external quality grading | |
CN115937143A (en) | Fabric defect detection method | |
Guo et al. | Fault diagnosis of power equipment based on infrared image analysis | |
CN115471494A (en) | Wo citrus quality inspection method, device, equipment and storage medium based on image processing | |
Yang et al. | Fisher’s tobacco leaf grading method based on image multi-features |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination |