CN108961251A - A kind of raw cotton fault and defects inspecting and recognition methods and system - Google Patents

A kind of raw cotton fault and defects inspecting and recognition methods and system Download PDF

Info

Publication number
CN108961251A
CN108961251A CN201810818716.0A CN201810818716A CN108961251A CN 108961251 A CN108961251 A CN 108961251A CN 201810818716 A CN201810818716 A CN 201810818716A CN 108961251 A CN108961251 A CN 108961251A
Authority
CN
China
Prior art keywords
image
gray
fault
obtains
unit
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
Application number
CN201810818716.0A
Other languages
Chinese (zh)
Inventor
邓中民
黄嘉俊
柯薇
王克作
李敏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wuhan Textile University
Original Assignee
Wuhan Textile University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Wuhan Textile University filed Critical Wuhan Textile University
Priority to CN201810818716.0A priority Critical patent/CN108961251A/en
Publication of CN108961251A publication Critical patent/CN108961251A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T5/70
    • G06T5/94
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/136Segmentation; Edge detection involving thresholding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20024Filtering details
    • G06T2207/20032Median filtering

Abstract

The present invention relates to a kind of raw cotton fault and defects inspecting and recognition methods and systems, and wherein method includes: irradiation sample cotton upper and lower surface, the color image of the sample cotton upper and lower surface after acquisition irradiation;The color image is pre-processed, gray level image is obtained;Image procossing is carried out to the gray level image, obtains target image;The characteristic value of the target image is extracted, and the characteristic value of the target image is compared with presetting database, obtains the recognition result of fault and impurity and display.Identification and classification by computer to the acquisition of cotton image, the enhancing of target image and improvement, image segmentation, edge detection and target image, extract validity feature value, realize the detection and identification to fault contained by raw cotton and impurity, improve detection and accuracy of identification, it can identify a plurality of types of raw cotton faults and impurity, the drawbacks of eliminating manual sorting reduces detection and identification cost.

Description

A kind of raw cotton fault and defects inspecting and recognition methods and system
Technical field
The present invention relates to fiber check and measure technical field more particularly to a kind of raw cotton fault and defects inspecting and recognition methods and System.
Background technique
Raw cotton Harmful Defect and impurity mainly include mote, rope silk, soft seed epidermis, bearded mote, stiff piece, cotton knot with And chemical fibre, silk, hair, plastic ties, fiber crops, colored fibre etc..Most of rejecting in China, for raw cotton impurity and fault Cotton spinning enterprise at present still by the way of manual sorting, need to carry out cotton packet fractionation one by one by worker and pick, not only work Work amount is heavy, takes time and effort, inefficiency, and detects effect and be affected by human factors quite greatly.In general, manual sorting's raw cotton Impurity fault requires that a biggish place is specially arranged, and quantity and the qualification of worker will tie in, allow in this way Financial resources investment increases;And worker, because of the high-intensitive same movement of repetition, subjective emotion can generate the fluctuation of certain amplitude simultaneously There is different degrees of visual fatigue;Cotton after sorting simultaneously, which also needs to be packaged again, could put into spinning link use, this The relatively complicated complexity of one process.For large-scale Cotton Textile Enterprises, the cotton that need to be sorted daily is innumerable, so Huge workload is even more so that manual sorting is difficult.
There are many research method at present about raw coal nature context of detection, and the method and technique means of use mainly include light Spectral analysis technology, ultraviolet light detection, ultrasonic technology, near-infrared imaging technology, sensor technology, X-ray transmission, machine view Feel technology and Visible-light CCD imaging etc..For artificial vision's sorting, the range that machine can perceive is broader, Whether detect speed or effect it is reasonable rapidly compared with manual sorting, in this respect the technology of American-European some countries just more at It is ripe perfect, have developed relevant raw coal nature detector, such as the different fine detection machine of Jossi System company of Switzerland Vision Shield Inspect4 and MagicEye M1, Te Lvcile Textile Co., Ltd. of Germany foreign matter ejector SECUROMAT SCFO, Loptex company of Italy photoelectricity ultrasonic wave raw cotton de-burring machine Single, Tandem and H.P. tri- Series, the relatively good different fiber removing machine Fibre i for mainly having Bremen Corporation of India that furthermore Asia is done, Chinese longitude and latitude are spun Knit the foreign fiber sorter JWF0011 and foreign fiber and micro-dust separator JWF1051 of Machinery Co., Ltd..
Though ultrasonic technology can identify various different fibres, it is slower that it detects speed, and it is lesser different to detect area Property fiber;It may recognize that foreign fiber of different sizes using optical sensor technology, but be limited only to foreign pigment, for saturating Bright or white different fibre can not but identify;External mechanical vision inspection technology is to very thin raw cotton impurity and white fault Detection effect be not obvious, be not suitable for China cotton contain miscellaneous situation.
In terms of academic research, Jin Shoufeng et al. utilizes high performance CCD video camera in the base of MATLAB image processing techniques Completion realizes the detection and identification of cotton foreign fiber on plinth.Computer is former according to the collected foreign fiber in raw cotton of CCD camera Beginning picture extracts relevant parameter, carries out edge detection to the different fibre in raw cotton using the method that Canny algorithm and dual threshold combine, And the approximate location of foreign fiber in raw cotton is obtained using center of gravity positioning mode;Tae etc. chooses colourful CCD video camera and acquires moits figure Piece selects the smoits in suitable threshold value identification raw cotton, mostly broken leaf or kind skin according to 8 neighborhood processings, and can calculate The quantity and distribution of impurity.Although the above scholar can substantially position to raw cotton impurity and quantity statistics, in raw cotton defect The aspect that accurately identifies of point and impurity also needs to continue deeper into research.
Summary of the invention
The technical problem to be solved by the present invention is to solve the above shortcomings of the prior art and to provide a kind of raw cotton faults and miscellaneous Quality detection and recognition methods and system.
The technical scheme to solve the above technical problems is that a kind of raw cotton fault and defects inspecting and identification side Method, comprising the following steps:
Step 1: irradiation sample cotton upper and lower surface, the color image of the sample cotton upper and lower surface after acquisition irradiation;
Step 2: the color image being pre-processed, gray level image is obtained;
Step 3: image procossing being carried out to the gray level image, obtains target image;
Step 4: extract the characteristic value of the target image, and by the characteristic value of the target image and presetting database into Row compares, and obtains the recognition result of fault and impurity and display.
The beneficial effects of the present invention are: color image is pre-processed by acquisition of the computer to cotton image, it is right Pretreated gray level image carries out image procossing, obtains clearly target image, extracts the validity feature value in target image Fault contained by raw cotton and impurity are identified, fast to the detection and recognition speed of raw cotton fault and impurity, Detection accuracy is high, The drawbacks of capable of identifying a plurality of types of raw cotton faults and impurity, eliminating manual sorting, reduces detection and identification cost.
Based on the above technical solution, the present invention can also be improved as follows:
Further, pretreated specific steps in the step 2 are as follows:
Step 21: gray processing processing being carried out to the color image in step 1 using weighted average method, described in extraction Tri- channel components of R, G, B of color image, and tri- channel components of described R, G, B are weighted and averaged, obtain initial ash It spends image Gray (i, j);
Step 22: enhancing the contrast of the initial gray image Gray (i, j) using histogram enhancement processing method, obtain To Continuous Tone Image Z (i, j);
Step 23: noise removal process being carried out to the Continuous Tone Image Z (i, j) using median filtering, is obtained described Gray level image.
The beneficial effect of above-mentioned further scheme is: being weighted and averaged using weighted average method to R, G, B three-component More reasonable gray level image can be obtained, global histogram is formed using histogram enhancement processing method, enhances gray level image Local contrast makes image become clear, highlights the gray level of target image, facilitate subsequent image procossing.
Further, the step 22 specifically:
Step 221: a histogram equalization processing being carried out to the initial gray image Gray (i, j), draws gray scale Histogram;
Step 222: the grey level histogram being modified using histogram specification method, obtains the middle gray Image Z (i, j).
The beneficial effect of above-mentioned further scheme is: forming the overall situation using histogram equalization and histogram specification method Histogram, enhance the local contrast of gray level image, so that image is become clear, highlight the gray level of target image, facilitate Subsequent image procossing.
Further, the specific steps of the step 3 are as follows:
Step 31: image segmentation being carried out using gray level image described in adaptive threshold image segmentation, obtains segmentation gray scale Image T (i, j);
Step 32: edge detection being carried out to the segmentation gray level image T (i, j) using edge detection operator, obtains edge Gray level image Y (i, j);
Step 33: the edge gray table being obtained as Y (i, j) progress Morphological scale-space using corrosion and expansive working The target image.
The beneficial effect of above-mentioned further scheme is: examining to the enhancing of image degree of comparing and improvement, image segmentation, edge The filling and repairing of survey and target image, it is ensured that obtain the clearly image of raw cotton fault and impurity.
Further, using the adaptive threshold image segmentation based on Mean Shift algorithm in the step 31.
The beneficial effect of above-mentioned further scheme is: the motion profile of Mean Shift algorithm is one and is intended to convergence point Smooth route, by Mean Shift algorithm carry out mould point search, mould point cluster and annex zonule, in target image not With target area accurately divided, and the processing arithmetic speed of image segmentation is fast, it is available it is smoother clearly Image, and it is possible to prevente effectively from the result of segmentation is excessively fine crushing, guarantee obtains the target of more visible raw cotton fault and impurity Image.
Further, step 32 specific steps are as follows:
Step 321: noise removal process is carried out to the segmentation gray level image T (i, j) using 2-d gaussian filters template, Obtain smoothed image;
Step 322: the gray scale for calculating the smoothed image using first-order difference local derviation is obtained in the partial derivative in the direction x, y The gradient magnitude and gradient direction of the gray scale of the smoothed image;
Step 323: using non-maxima suppression method, the marginal point of the smoothed image is accurately positioned and refines side Edge obtains non-maxima suppression image N (i, j);
Step 324: detecting the edge of the non-maxima suppression image N (i, j) using dual threashold value-based algorithm, obtain the side Edge gray level image Y (i, j).
The beneficial effect of above-mentioned further scheme is: being calculated using gaussian filtering, first-order difference local derviation, non-maxima suppression The step of method and dual threashold value-based algorithm, carries out edge detection, and arithmetic speed is fast, is not limited by directionality and noise, precision Height can also refine edge, the operation without additional refinement edge, so that it may obtain more visible in addition to enhancing edge strength Accurate edge gray table is as Y (i, j).
Further, the characteristic value in the step 4 includes the eccentricity of the target image and the face of the target image Product perimeter ratio, the presetting database are stored with the area perimeter of the eccentricity comprising fault and impurity and the fault and impurity The relation table of ratio.
The beneficial effect of above-mentioned further scheme is: learnt by many experiments, the eccentricity of different faults and impurity with There are certain rules for the correlation of area perimeter ratio, by fault and the eccentricity of impurity and area perimeter than one-to-one Relation table, calculates the eccentricity and area perimeter ratio of target image, and is compared with relation table, available fault and The recognition result of impurity.Since cotton fault and dopant species are more, complex shape, the feature of different types of fault and impurity is not Together, traditional identification method to fault and impurity needs to set different identification sides for different types of fault and impurity Formula, or identified using different threshold values, and identification method of the invention is without setting different identification method or threshold value Different types of fault and impurity are identified well, and detection is high with recognition accuracy, and speed is fast, and practicability is high.
In order to solve technical problem of the invention, a kind of raw cotton fault and defects inspecting and identifying system, packet are additionally provided Include image acquisition units, image processing unit, image extraction unit, recognition unit and display unit;
Described image acquisition unit for being irradiated to sample cotton upper and lower surface, and acquires on the sample cotton after irradiation The color image of lower surface;
Described image processing unit obtains gray level image, also for pre-processing the collected color image For the gray level image to be carried out image procossing, target image is obtained;
The extraction unit, for extracting the characteristic value of the target image;
The recognition unit obtains fault and miscellaneous for the characteristic value of the target image to be compared with database The recognition result of matter;
The display unit, for showing the recognition result of the fault and impurity.
The beneficial effects of the present invention are: the color image on sample cotton surface is acquired by image acquisition units, it will be collected Image is sent to image processing unit, obtains target image after treatment, and the spy of target image is extracted by extraction unit Value indicative identified by recognition unit, finally shows obtained recognition result by display unit, complete detection to fault with Identification, detection and recognition speed are fast, and Detection accuracy is high, can identify a plurality of types of raw cotton faults and impurity, eliminate artificial point The drawbacks of picking reduces detection and identification cost.
Further, described image acquisition unit includes illumination unit, transmission units and Image Acquisition subelement;
The illumination unit is used to irradiate the upper surface of the sample cotton;
The transmission units are used to irradiate the lower surface of the sample cotton;
Described image acquisition subelement is used to acquire the upper surface of the sample cotton after irradiation and the lower surface of the sample cotton The color image;
The beneficial effect of above-mentioned further scheme is: upper surface of the light to sample cotton of different wave length is generated by illumination unit It is irradiated, and the lower surface of sample cotton is irradiated as supplement light source by transmission units, guarantee all sites of sample cotton It can be irradiated to, avoid occurring dash area in image, then following table on sample cotton is irradiated to by the acquisition of Image Acquisition subelement The color image in face, obtained color image screen are more complete, clear.
Further, described image processing unit includes gray processing unit, contrast enhancement unit, filter unit, image point Cut unit, edge detection unit and Morphological scale-space unit;
The gray processing unit obtains initial for carrying out gray processing to the color image using weighted average method Gray level image Gray (i, j);
The contrast enhancement processing unit, for using histogram enhancement processing method to the initial gray image The processing enhancing of Gray (i, j) degree of comparing, obtains Continuous Tone Image Z (i, j);
The filter unit, for being carried out at noise remove using median filtering method to the Continuous Tone Image Z (i, j) Reason, obtains the gray level image;
Described image cutting unit is obtained for carrying out image segmentation to the gray level image using Mean Shift algorithm To segmentation gray level image T (i, j);
The edge detection unit, for carrying out edge to the segmentation gray level image T (i, j) using edge detection operator Detection, obtains edge gray table as Y (i, j);
The Morphological scale-space unit, for using corrosion and expansive working to the edge gray table as Y (i, j) is carried out Filling and repairing obtains the target image.
The beneficial effect of above-mentioned further scheme is: being enhanced by the gray processing unit in image processing unit, contrast Unit, filter unit, image segmentation unit, edge detection unit and Morphological scale-space unit carry out gray processing, histogram to image One systems such as figure enhancing processing, median filtering, the image segmentation based on Mean shift algorithm, edge detection and corrosion expansive working Column processing, it is ensured that obtain clear smooth target image, be convenient for subsequent identification work, improve detection and accuracy of identification.
Detailed description of the invention
Fig. 1 is the flow diagram of a kind of raw cotton fault of the invention and defects inspecting and recognition methods;
Fig. 2-1 is that the filtered image effect figure of 3*3 neighborhood averaging is used in one embodiment of the present of invention;
Fig. 2-2 is in one embodiment of the present of invention using the image effect figure after 3*3 neighborhood Wiener filtering;
Fig. 2-3 is in one embodiment of the present of invention using the image effect figure after 3*3 neighborhood median filtering;
Fig. 3-1 is that the filtered image effect figure of 7*7 neighborhood averaging is used in one embodiment of the present of invention;
Fig. 3-2 is in one embodiment of the present of invention using the image effect figure after 7*7 neighborhood Wiener filtering;
Fig. 3-3 is in one embodiment of the present of invention using the image effect figure after 7*7 neighborhood median filtering;
Fig. 4 is the structural schematic diagram of one embodiment of a kind of raw cotton fault of the present invention and defects inspecting and identifying system.
In attached drawing, parts list represented by the reference numerals are as follows:
1, Image Acquisition subelement, 2, illumination unit, 3, transmission units, 4, sample stage, 5, light-transmitting plate, 6, sample cotton, 7, mirror Head, 8, display, 9, processor, 10, data line.
Specific embodiment
The principle and features of the present invention will be described below with reference to the accompanying drawings, and the given examples are served only to explain the present invention, and It is non-to be used to limit the scope of the invention.
With reference to the accompanying drawing, the present invention will be described.
Embodiment one, as shown in Figure 1, showing for a kind of raw cotton fault of the invention and defects inspecting and the process of recognition methods It is intended to, comprising the following steps:
S1: irradiation sample cotton upper and lower surface, the color image of the sample cotton upper and lower surface after acquisition irradiation;
S2: the color image is pre-processed, gray level image is obtained;
S3: image procossing is carried out to the gray level image, obtains target image;
S4: the characteristic value of the target image is extracted, and the characteristic value of the target image and presetting database are carried out It compares, obtains the recognition result of fault and impurity and display.
By acquisition of the computer to cotton image in the present embodiment, the color image is pre-processed, to pre- place Gray level image after reason carries out image procossing, obtains clearly target image, extracts the validity feature value pair of the target image Fault and impurity contained by raw cotton are identified, fast to the detection and recognition speed of raw cotton fault and impurity, and Detection accuracy is high, energy The drawbacks of identifying a plurality of types of raw cotton faults and impurity, eliminating manual sorting reduces detection and identification cost.
Preferably, pretreated specific steps in the S2 are as follows:
S21: gray processing processing is carried out to the color image in step 1 using weighted average method, extracts the coloured silk The component in tri- channels R, G, B of chromatic graph picture, and tri- channel components of described R, G, B are weighted and averaged, obtain initial ash It spends image Gray (i, j), wherein used weighted average formula are as follows:
Gray (i, j)=0.3R (i, j)+0.59G (i, j)+0.11B (i, j)
Wherein, R (i, j) is the R channel components of the color image, and G (i, j) is the G channel components of the color image, B (i, j) is the channel B component of the color image;
Based on experience value, R, G, B three-component are weighted and averaged using weighted average method can obtain it is relatively reasonable just Beginning gray level image Gray (i, j).
S22: enhancing the overall contrast of the initial gray image Gray (i, j) using histogram enhancement processing method, Obtain Continuous Tone Image Z (i, j);
S23: noise removal process is carried out to the Continuous Tone Image Z (i, j) using median filtering, obtains the gray scale Image.
Median filtering is a kind of nonlinear signal processing technology that can effectively inhibit noise based on sequencing statistical theory, it The intermediate value of all pixels point gray value in the gray value of pixel each in the image point neighborhood is replaced, allows surrounding Pixel value is close to true value, to eliminate isolated noise spot, and median filtering has preferable protection to make at the edge of image With solving most linear filterings blurred picture this disadvantage while denoising, obtain preferable image restoration effect.
The present embodiment uses the two dimension pattern plate of 7*7 neighborhood, obtains two dimension median filter output image, the as described grayscale image Picture:
F (i, j)=med { Z (i-k, j-l), (k, l ∈ W) }
Wherein, using the optimal value that the two dimension pattern plate of 7*7 neighborhood is after test of many times, referring to fig. 2-1,2-2,2-3, Shown in 3-1,3-2,3-3.The two dimension pattern plate of 3*3 neighborhood and the two dimension pattern plate of 7*7 neighborhood have been respectively adopted in an experiment, has made respectively It is filtered experiment with average filter, Wiener filtering and median filtering, Fig. 2-1 is using the filtered image of 3*3 neighborhood averaging Effect picture, Fig. 2-2 be using the image effect figure after 3*3 neighborhood Wiener filtering, Fig. 2-3 be using 3*3 neighborhood median filtering after Image effect figure, Fig. 3-1 is using the filtered image effect figure of 7*7 neighborhood averaging, and Fig. 3-2 is using 7*7 neighborhood wiener Filtered image effect figure, Fig. 3-3 are using the image effect figure after 7*7 neighborhood median filtering.Experimental result is shown in 3*3 In neighborhood, there are still noises for image after average filter, and the effect of median filtering is fine, not only eliminates noise, but also smooth Image;In the neighborhood of 7*7, there is the phenomenon that having obscured image in average filter, but the effect of median filtering is splendid;Again to intermediate value Two neighborhoods of filtering compare, and can intuitively see very much, and when using 7*7 neighborhood, de-noising and smooth effect are compared with 3*3 neighbour Domain will be got well, so carrying out denoising to cotton image using 7*7 neighborhood median filtering.
Preferably, the S22 specifically:
S221: a histogram equalization processing is carried out to the initial gray image Gray (i, j), after being equalized The gray value S of each pixelk, to SkRounding treatment is carried out, the grey level after determining equalization, and calculate corresponding each SkPicture Prime number mesh draws grey level histogram;Wherein, the gray value S of each pixelkFormula are as follows:
Wherein, rjFor the gray level of the initial gray image Gray (i, j), njFor each gray-scale number of pixels, Pr (rj) it is each gray-scale probability density after equalization;
Because after histogram equalization processing, originally the gray scale of fewer pixel can be assigned to other gray scale and go, as Plain Relatively centralized, tonal range becomes larger after processing, and contrast becomes larger, and clarity becomes larger, so can effectively enhance image.Pass through this Kind method, brightness can be preferably distributed on the histogram, can be used for enhancing local contrast without influencing whole pair Degree of ratio.
S222: the grey level histogram is modified using histogram specification method, obtains the middle gray figure As Z (i, j);
Histogram specification operation is carried out to image, so as to purposefully to certain grey level distribution models in image Image in enclosing is enhanced, and the histogram of original image and the histogram of desired image are known, PrIt (r) is the present embodiment The probability density function for the intensity profile that middle original image is once equalized, PzIt (z) is the intensity profile of desired image Probability density function is modified gained grey level histogram in S221, with Pz(z) shape represented by, it is specific real It is now as follows:
S2221: the formula of each gray scale in S221 is write as functional integration functional form:
S2222: to desired image histogram equalization processing method described in S221, transforming function transformation function is obtained:
Its inverse process are as follows:
Z=G-1(u)
S2223: due to it is above-mentioned be the equalization to same image, the probability density function of treated original image and phase Hope the probability density function of image be it is equal, so s=u, and z=G-1(u)=G-1(T (r)), the figure of resulting each gray scale As the as described Continuous Tone Image Z (i, j).
Preferably, the specific steps of S3 are as follows:
S31: carrying out image segmentation using gray level image described in adaptive threshold image segmentation, obtains segmentation gray level image T(i,j);
S32: edge detection is carried out to the segmentation gray level image T (i, j) using edge detection operator, obtains edge gray scale Image Y (i, j);
S33: the edge gray table is obtained described as Y (i, j) progress Morphological scale-space using corrosion and expansive working Target image.
To the enhancing of image degree of comparing and improvement, image segmentation, edge detection and target image filling and repairing, can be with Guarantee to obtain the clearly image of raw cotton fault and impurity.
The adaptive threshold image segmentation based on Mean Shift algorithm is used in the S31.
To obtain more visible gray level image, need to be split image processing.The characteristic point of one sub-picture at least may be used To extract five dimensions (x, y, r, g, b), including the space two-dimensional coordinate space (x, y) and three-dimensional color space (r, g, b), and use Practical Mean shift algorithm is exactly the mould point for finding this quintuple space, since different points can finally converge to different peaks Value completes the purpose of image segmentation so these points are formed one kind.Mean shift algorithm has the advantages that uniqueness, Its vector has constringency performance, its motion profile is the smooth route for being intended to extreme point, in Mean shift algorithm When searching for mould point (extreme point), two are generally all not more than 90 ° with the angle between continuous vector, it can be promoted to move Stability enhancing, smoothly movement can promote the processing arithmetic speed of image segmentation to accelerate to Mean shift algorithm relatively, obtain Steady and audible target area information required for iamge description and analysis.Meanwhile Mean shift algorithm not only can be to not With target area accurately divided, it is often more important that this algorithm it is possible to prevente effectively from divide result it is excessively fine crushing, It can obtain relatively clear raw cotton fault and impurity image.Specific implementation step is the prior art, and which is not described herein again.
Preferably, the S32 specific steps are as follows:
S321: noise removal process is carried out to the segmentation gray level image T (i, j) using 2-d gaussian filters template, is obtained To smoothed image;
Since the image border property after adaptive threshold fuzziness is bad, and image border generally comprises some related images Characteristics extraction and target identification important information, it is therefore desirable to enhance the intensity of image border.Since noise also focuses on High-frequency signal, it is easy to be identified as pseudo-edge, therefore remove noise using gaussian filtering first, reduce the identification of pseudo-edge. Gaussian filtering is the prior art, is specifically repeated no more.
S322: calculating partial derivative of the gray scale in the direction x, y of the smoothed image using first-order difference local derviation, obtains described The gradient magnitude and gradient direction of the gray scale of smoothed image:
Wherein, GxAnd GyThe partial derivative of the gray scale of the respectively described smoothed image in the x and y direction;
S323: using non-maxima suppression method, edge be accurately positioned and refined to the marginal point of the smoothed image, Obtain non-maxima suppression image N (i, j);
Since gradient magnitude is located substantially at four direction, respectively represent horizontal, vertical and two diagonal lines (0 °, 45 °, 90 °, 135 °), by the gradient of the gray scale of the pixel on the gradient magnitude of the gray scale of current pixel point and its positive and negative gradient direction Amplitude is compared, if the gradient magnitude of current pixel point is maximum, is retained its value, as image border point, is otherwise inhibited, will Its shade of gray value sets 0, as image background.
S324: detecting the edge of the non-maxima suppression image N (i, j) using dual threashold value-based algorithm, if high threshold is τ1, Low threshold is τ2, the gradient magnitude of the pixel in the non-maxima suppression image N (i, j) is compared with dual threshold and is sentenced It is fixed, the edge gray table is obtained as Y (i, j).
It is as follows specifically to compare to determine method:
The gradient magnitude of pixel in the non-maxima suppression image N (i, j) is compared judgement with dual threshold, Then gradient magnitude is greater than τ1Pixel be image border (strong edge point), gradient magnitude be less than τ2Pixel be image background, When in the non-maxima suppression image N (i, j) pixel between τ1And τ2Between, then check that the gradient magnitude of its adjacent pixels is It is no to exist greater than τ1Pixel, if it exists then be image weak marginal point, if it does not exist then be image background, to be had There is the image at the edge of registration.It is the prior art that accumulative histogram, which calculates dual threshold, is specifically repeated no more.
Preferably, after the step S324 further include:
S325: hysteresis bounds tracking is implemented as follows:
S3251: 8 connection area images of all weak marginal points are obtained;
S3252: 8 connection area images of the weak marginal point are carried out using breadth first algorithm or depth-priority-searching method Search, if there are a pixels and strong edge point at the weak edge of a connection in 8 connection area images of the weak marginal point Connection, then retain the weak edge of the connection, otherwise inhibit.
Since weak marginal point may be genuine edge, it is also possible to accurate to obtain caused by noise or color change Edge needs to curb weak marginal point caused by noise or color change, be tracked by hysteresis bounds, can obtain edge more It is accurate edge gray table as Y (i, j).Breadth first algorithm and depth-priority-searching method are the prior art, are specifically repeated no more.
Preferably, the characteristic value in the S4 includes the eccentricity of the target image and the area week of the target image Long ratio, the presetting database are stored with the eccentricity comprising fault and impurity and the area of the corresponding fault and impurity week The relation table of long ratio.
The relation table is obtained by many experiments, referring specifically to table 1:
The relation table of the eccentricity and area/perimeter of 1 fault of table and impurity
Eccentricity is mathematically to state ellipse to the departure degree with it with the positive round of reference point, geometric Concept is just expressed as height fat or thin degree of the closed curved section on its major axes orientation by image, and iconology is arrived in reflection In indicate the oblate state of body form, and do the resulting numerical value of division arithmetic using the area of target image and perimeter and exist Certain range rule.It is learnt by many experiments, the eccentricity and the correlation of the ratio between area perimeter of different faults and impurity There are certain rules, therefore the present embodiment establishes the ratio between eccentricity and area perimeter of fault and impurity one according to experimental result One-to-one correspondence table, calculates the eccentricity and the ratio between area and perimeter of target image, and is compared with relation table, can be with Obtain the recognition result of fault and impurity.Since cotton fault and dopant species are more, complex shape, different types of fault and miscellaneous The feature of matter is different, and traditional identification method to fault and impurity needs different for different types of fault and impurity setting Identification method, or identified using different threshold values, and the identification method of the present embodiment is without setting different identification methods Or threshold value, different types of fault and impurity can be identified well, and detection is high with recognition accuracy, and speed is fast, practicability It is high.
Etching operation is used to edge gray level image in the present embodiment S3, is to eliminate the edge in edge gray table picture Burr, the boundary of smoothed image, and use expansive working, be in order to by edge gray table picture edge or inside hole It fills out, smooth boundary, therefore using corrosion and expansive working, more smooth target image can be obtained, operating method is The prior art specifically repeats no more.
Embodiment two, as shown in figure 4, for a kind of raw cotton fault of the present invention and defects inspecting and identifying system an implementation The structural schematic diagram of example, including detection case and terminal;The detection case upper end is equipped with Image Acquisition subelement 1, and described image is adopted Collection subelement 1 is used to acquire the color image of the sample cotton upper and lower surface after irradiation, is equipped with illumination unit 2 in the middle part of the detection case, The transmission units illumination unit 2 is used to irradiate the upper surface of the sample cotton, and the detection case bottom is equipped with transmission units 3, institute Transmission units 3 are stated for irradiating the lower surface of the sample cotton, the lower part of the detection case is equipped with sample stage 5, on the sample stage 4 Equipped with light-transmitting plate 5, sample cotton 6 is placed on the light-transmitting plate 5;
The terminal includes display 8 and processor 9, and the processor 9 is used to pre-process the color image, Gray level image is obtained, the processor 9 is also used to carry out image procossing to the gray level image, obtains target image, the place Reason device 9 is also used to extract the characteristic value of the target image, and the characteristic value of the target image and presetting database are carried out It compares, obtains the recognition result of fault and impurity;The display 8 is used to show the recognition result of the fault and impurity;
The display 8 is electrically connected with the processor 9, described image acquire subelement 1 by data line 10 with it is described Processor 9 is electrically connected, and the illumination unit 2 and the transmission units 3 are electrically connected with the processor 9.
Sample cotton is irradiated by the light that the illumination unit in detection case generates different wave length, and passes through detection case bottom Transmission units as supplement light source, guarantee that all sites of sample cotton can be irradiated to, avoid occurring shadow part in image Divide, then is irradiated to the color image on sample cotton surface by the Image Acquisition subelement acquisition of detection upper box part, it will by data line Collected colo r image transmission after terminal carries out processing analysis to image, obtains fault corresponding to target image to terminal Type, to realize the detection and identification to raw cotton fault and impurity, detection and recognition speed are fast, and Detection accuracy is high, can know The drawbacks of not a plurality of types of raw cotton faults and impurity, elimination manual sorting, reduces detection and identification cost.
Preferably, described image acquisition subelement 1 is CCD camera, and the CCD camera is equipped with camera lens.
Small in size using CCD camera high sensitivity, the service life is long, anti-vibration excellent, the distortion of institute's acquired image It is small, picture is clear.
Preferably, the illumination unit 2 is two groups of LED light, and two groups of LED light are separately positioned in the middle part of the detection case Two sides.
The two sides of sample cotton oblique upper are arranged in two groups of LED light, be subject to its light source energy maximum magnitude covering sample cotton, by setting Two groups of LED light in detection case on both sides of the middle are set, guarantee that LED light can be irradiated to all sites on sample cotton surface to the maximum extent, So that acquired image is more comprehensively.
Preferably, the transmission units 3 are evenly distributed and are arranged described using the central axes of the light-transmitting plate 5 as benchmark line Detection case bottom.
The transmission units being evenly distributed by detection case bottom irradiate the supplement of sample cotton, to cover sample to the maximum extent Whole positions on cotton surface avoid dash area occur in the collected color image of institute.
Raw cotton fault and defects inspecting in the present embodiment and identifying system include power supply, described image acquire subelement 1, The illumination unit 2, the transmission units 3, the display 8 and the processor 9 with the power electric connection.Pass through electricity Source is Image Acquisition subelement, illumination unit, transmission units, display and processor continued power.
The foregoing is merely presently preferred embodiments of the present invention, is not intended to limit the invention, it is all in spirit of the invention and Within principle, any modification, equivalent replacement, improvement and so on be should all be included in the protection scope of the present invention.

Claims (10)

1. a kind of raw cotton fault and defects inspecting and recognition methods, which comprises the following steps:
Step 1: irradiation sample cotton upper and lower surface, and acquire the color image of the sample cotton upper and lower surface after irradiation;
Step 2: the color image being pre-processed, gray level image is obtained;
Step 3: image procossing being carried out to the gray level image, obtains target image;
Step 4: extracting the characteristic value of the target image, and the characteristic value of the target image and presetting database are compared It is right, obtain the recognition result of fault and impurity and display.
2. a kind of raw cotton fault according to claim 1 and defects inspecting and recognition methods, which is characterized in that the step Pretreated specific steps in 2 are as follows:
Step 21: using weighted average method to the color image carry out gray processing processing, extract the color image R, G, tri- channel components of B, and tri- channel components of described R, G, B are weighted and averaged, obtain initial gray image Gray (i, j);
Step 22: using histogram enhancement processing method to initial gray image Gray (i, j) degree of the comparing enhancing at Reason, obtains Continuous Tone Image Z (i, j);
Step 23: noise removal process being carried out to the Continuous Tone Image Z (i, j) using median filtering, obtains the gray scale Image.
3. a kind of raw cotton fault according to claim 2 and defects inspecting and recognition methods, which is characterized in that the step 22 specifically:
Step 221: a histogram equalization processing being carried out to the initial gray image Gray (i, j), and it is straight to draw gray scale Fang Tu;
Step 222: the grey level histogram being modified using histogram specification method, obtains the Continuous Tone Image Z(i,j)。
4. a kind of raw cotton fault according to claim 1 and defects inspecting and recognition methods, which is characterized in that the step 3 specific steps are as follows:
Step 31: image segmentation being carried out to the gray level image using adaptive threshold image segmentation, obtains segmentation grayscale image As T (i, j);
Step 32: edge detection being carried out to the segmentation gray level image T (i, j) using edge detection operator, obtains edge gray scale Image Y (i, j);
Step 33: the edge gray table being obtained described as Y (i, j) progress Morphological scale-space using corrosion and expansive working Target image.
5. a kind of raw cotton fault according to claim 4 and defects inspecting and recognition methods, which is characterized in that the step The adaptive threshold image segmentation based on Mean Shift algorithm is used in 31.
6. a kind of raw cotton fault according to claim 4 and defects inspecting and recognition methods, which is characterized in that the step 32 specific steps are as follows:
Step 321: noise remove being carried out to the gray level image T (i, j) after dividing processing using 2-d gaussian filters template Processing, obtains smoothed image;
Step 322: calculating partial derivative of the gray scale in the direction x, y of the smoothed image using first-order difference local derviation, obtain described The gradient magnitude and gradient direction of the gray scale of smoothed image;
Step 323: being accurately positioned using marginal point of the non-maxima suppression method to the smoothed image and refine edge, obtained To non-maxima suppression image N (i, j);
Step 324: detecting the edge of the non-maxima suppression image N (i, j) using dual threashold value-based algorithm, obtain the edge ash It spends image Y (i, j).
7. a kind of raw cotton fault according to claim 1-6 and defects inspecting and recognition methods, which is characterized in that Characteristic value in the step 4 includes the eccentricity of the target image and the area perimeter ratio of the target image, described pre- If database purchase has the relationship of the eccentricity comprising fault and impurity with the corresponding fault and the area perimeter ratio of impurity Table.
8. a kind of raw cotton fault and defects inspecting and identifying system, which is characterized in that including image acquisition units, image procossing list Member, image extraction unit, recognition unit and display unit;Described image acquisition unit, for shining sample cotton upper and lower surface It penetrates, and acquires the color image of the sample cotton upper and lower surface after irradiation;Described image processing unit is used for collected institute It states color image to be pre-processed, obtains gray level image, be also used to the gray level image carrying out image procossing, obtain target figure Picture;
The extraction unit, for extracting the characteristic value of the target image;
The recognition unit obtains fault and miscellaneous for the characteristic value of the target image to be compared with presetting database The recognition result of matter;
The display unit, for showing the recognition result of the fault and impurity.
9. a kind of raw cotton fault according to claim 8 and defects inspecting and identifying system, which is characterized in that described image Acquisition unit includes illumination unit, transmission units and Image Acquisition subelement;
The illumination unit is used to irradiate the upper surface of the sample cotton;
The transmission units are used to irradiate the lower surface of the sample cotton;
Described image acquisition subelement is used to acquire the institute of the upper surface of the sample cotton after irradiation and the lower surface of the sample cotton State color image.
10. a kind of raw cotton fault according to claim 9 and defects inspecting and identifying system, which is characterized in that the figure As processing unit includes gray processing unit, contrast enhancement processing unit, filter unit, image segmentation unit, edge detection list Member and Morphological scale-space unit;
The gray processing unit obtains initial gray for carrying out gray processing to the color image using weighted average method Image Gray (i, j);
The contrast enhancement processing unit, for using histogram enhancement processing method to the initial gray image Gray (i, j) degree of comparing enhancing processing, obtains Continuous Tone Image Z (i, j);
The filter unit, for carrying out noise removal process to the Continuous Tone Image Z (i, j) using median filtering method, Obtain the gray level image;
Described image cutting unit is divided for carrying out image segmentation to the gray level image using Mean Shift algorithm Cut gray level image T (i, j);
The edge detection unit, for carrying out edge inspection to the segmentation gray level image T (i, j) using edge detection operator It surveys, obtains edge gray table as Y (i, j);
The Morphological scale-space unit, for using corrosion and expansive working to the edge gray table as Y (i, j) is filled Repairing, obtains the target image.
CN201810818716.0A 2018-07-24 2018-07-24 A kind of raw cotton fault and defects inspecting and recognition methods and system Pending CN108961251A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810818716.0A CN108961251A (en) 2018-07-24 2018-07-24 A kind of raw cotton fault and defects inspecting and recognition methods and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810818716.0A CN108961251A (en) 2018-07-24 2018-07-24 A kind of raw cotton fault and defects inspecting and recognition methods and system

Publications (1)

Publication Number Publication Date
CN108961251A true CN108961251A (en) 2018-12-07

Family

ID=64464214

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810818716.0A Pending CN108961251A (en) 2018-07-24 2018-07-24 A kind of raw cotton fault and defects inspecting and recognition methods and system

Country Status (1)

Country Link
CN (1) CN108961251A (en)

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109738436A (en) * 2018-12-28 2019-05-10 安徽财经大学 A kind of unginned cotton impurity quantifies rapid detection system and method
CN110009603A (en) * 2019-03-14 2019-07-12 广州供电局有限公司 High-voltage cable insulating detection method and high-tension cable maintaining method
CN111476795A (en) * 2020-02-27 2020-07-31 浙江工业大学 Binary icon notation method based on breadth-first search
CN111537519A (en) * 2020-04-11 2020-08-14 嘉兴市昊鸣纺织有限公司 Automatic detection and supervision system for cloth
CN111665199A (en) * 2019-03-06 2020-09-15 东莞中科蓝海智能视觉科技有限公司 Wire and cable color detection and identification method based on machine vision
CN112586539A (en) * 2020-11-08 2021-04-02 泰州市华仕达机械制造有限公司 Self-adaptive belt return control platform
CN113182214A (en) * 2021-04-21 2021-07-30 江南大学 Sorting device for foreign fibers of raw cotton and using method
CN113261428A (en) * 2021-06-18 2021-08-17 湖北省农业科学院经济作物研究所 Whole-process quality control method for machine-harvested cotton
CN114638827A (en) * 2022-05-18 2022-06-17 卡松科技股份有限公司 Visual detection method and device for impurities of lubricating oil machinery
CN117011550A (en) * 2023-10-08 2023-11-07 超创数能科技有限公司 Impurity identification method and device in electron microscope photo
CN117522281A (en) * 2024-01-05 2024-02-06 山东通广电子股份有限公司 Tool and instrument warehouse-in and warehouse-out management method and system based on visual identification

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0491954A4 (en) * 1990-05-28 1993-09-08 Kanebo Ltd. Method of inspecting cleanliness of top and device used therefor
CN101587079A (en) * 2009-05-08 2009-11-25 清华大学 Multispectral chromatic polarization detection method of foreign impurity in the textile raw material
CN103698341A (en) * 2013-12-31 2014-04-02 中华全国供销合作总社郑州棉麻工程技术设计研究所 System for detecting cotton rolling quality and method for detecting cotton rolling quality based on image
CN104751443A (en) * 2014-12-12 2015-07-01 郑州轻工业学院 Cotton fault detecting and identifying method based on multi-spectrum technology

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0491954A4 (en) * 1990-05-28 1993-09-08 Kanebo Ltd. Method of inspecting cleanliness of top and device used therefor
CN101587079A (en) * 2009-05-08 2009-11-25 清华大学 Multispectral chromatic polarization detection method of foreign impurity in the textile raw material
CN103698341A (en) * 2013-12-31 2014-04-02 中华全国供销合作总社郑州棉麻工程技术设计研究所 System for detecting cotton rolling quality and method for detecting cotton rolling quality based on image
CN104751443A (en) * 2014-12-12 2015-07-01 郑州轻工业学院 Cotton fault detecting and identifying method based on multi-spectrum technology

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
赵小川: "《MATLAB图像处理能力提高与应用案例》", 31 January 2014, 北京航空航天大学出版 *
赵西娜: "基于图像处理技术的原棉疵点及杂质特征识别的研究", 《中国优秀硕士学位论文全文数据库 工程科技Ⅰ辑》 *

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109738436A (en) * 2018-12-28 2019-05-10 安徽财经大学 A kind of unginned cotton impurity quantifies rapid detection system and method
CN111665199A (en) * 2019-03-06 2020-09-15 东莞中科蓝海智能视觉科技有限公司 Wire and cable color detection and identification method based on machine vision
CN110009603A (en) * 2019-03-14 2019-07-12 广州供电局有限公司 High-voltage cable insulating detection method and high-tension cable maintaining method
CN111476795A (en) * 2020-02-27 2020-07-31 浙江工业大学 Binary icon notation method based on breadth-first search
CN111537519B (en) * 2020-04-11 2023-02-28 嘉兴市昊鸣纺织有限公司 Automatic detection and supervision system for cloth
CN111537519A (en) * 2020-04-11 2020-08-14 嘉兴市昊鸣纺织有限公司 Automatic detection and supervision system for cloth
CN112586539A (en) * 2020-11-08 2021-04-02 泰州市华仕达机械制造有限公司 Self-adaptive belt return control platform
CN113182214A (en) * 2021-04-21 2021-07-30 江南大学 Sorting device for foreign fibers of raw cotton and using method
CN113261428B (en) * 2021-06-18 2022-04-12 湖北省农业科学院经济作物研究所 Whole-process quality control method for machine-harvested cotton
CN113261428A (en) * 2021-06-18 2021-08-17 湖北省农业科学院经济作物研究所 Whole-process quality control method for machine-harvested cotton
CN114638827A (en) * 2022-05-18 2022-06-17 卡松科技股份有限公司 Visual detection method and device for impurities of lubricating oil machinery
CN117011550A (en) * 2023-10-08 2023-11-07 超创数能科技有限公司 Impurity identification method and device in electron microscope photo
CN117011550B (en) * 2023-10-08 2024-01-30 超创数能科技有限公司 Impurity identification method and device in electron microscope photo
CN117522281A (en) * 2024-01-05 2024-02-06 山东通广电子股份有限公司 Tool and instrument warehouse-in and warehouse-out management method and system based on visual identification
CN117522281B (en) * 2024-01-05 2024-04-16 山东通广电子股份有限公司 Tool and instrument warehouse-in and warehouse-out management method and system based on visual identification

Similar Documents

Publication Publication Date Title
CN108961251A (en) A kind of raw cotton fault and defects inspecting and recognition methods and system
CN109934802B (en) Cloth defect detection method based on Fourier transform and image morphology
CN108765402B (en) Non-woven fabric defect detection and classification method
CN104597057B (en) A kind of column Diode facets defect detecting device based on machine vision
CN107610104A (en) Crack detecting method at a kind of elevator compensation chain R based on machine vision
CN108320280A (en) The crater image method for detecting abnormality of view-based access control model clarity and contours extract
CN109685766A (en) A kind of Fabric Defect detection method based on region fusion feature
CN109668909A (en) A kind of glass defect detection method
CN113252568A (en) Lens surface defect detection method, system, product and terminal based on machine vision
Dixit et al. Image texture analysis-survey
CN109345524A (en) A kind of bearing open defect detection system of view-based access control model
CN106780464A (en) A kind of fabric defect detection method based on improvement Threshold segmentation
CN103473776A (en) Method and system for comparing image definition and automatic focusing control method
CN105426843A (en) Single-lens palm vein and palmprint image acquisition apparatus and image enhancement and segmentation method
Feng et al. A separating method of adjacent apples based on machine vision and chain code information
CN102860814A (en) OCT (Optical Coherence Tomography) synthetic fundus image optic disc center positioning method and equipment
CN110335233A (en) Express-way guard-rail plates defect detecting system and method based on image processing techniques
CN104123731A (en) Method for dividing low-contrast-ratio ginned cotton mulching film image
CN109949294A (en) A kind of fracture apperance figure crack defect extracting method based on OpenCV
CN115100104A (en) Defect detection method, device and equipment for glass ink area and readable storage medium
CN106093051A (en) Paper roll tangent plane burr detection method based on machine vision and device
WO2018046407A1 (en) Particle boundary identification
CN110648312A (en) Method for identifying wool and cashmere fibers based on scale morphological characteristic analysis
CN109870730A (en) A kind of method and system for X-ray machine image analytic degree test body regular inspection
CN109387524A (en) Thread defect detection method and device based on linearly polarized photon

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination