CN107516331A - A kind of bamboo cane method for sorting colors and system - Google Patents
A kind of bamboo cane method for sorting colors and system Download PDFInfo
- Publication number
- CN107516331A CN107516331A CN201710686593.5A CN201710686593A CN107516331A CN 107516331 A CN107516331 A CN 107516331A CN 201710686593 A CN201710686593 A CN 201710686593A CN 107516331 A CN107516331 A CN 107516331A
- Authority
- CN
- China
- Prior art keywords
- bamboo cane
- sample
- image
- queue
- aberration
- 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
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/90—Determination of colour characteristics
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/24—Classification techniques
- G06F18/241—Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/136—Segmentation; Edge detection involving thresholding
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/194—Segmentation; Edge detection involving foreground-background segmentation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/10—Image acquisition modality
- G06T2207/10024—Color image
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/30—Subject of image; Context of image processing
- G06T2207/30181—Earth observation
- G06T2207/30188—Vegetation; Agriculture
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Computer Vision & Pattern Recognition (AREA)
- General Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Artificial Intelligence (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Bioinformatics & Computational Biology (AREA)
- Evolutionary Biology (AREA)
- Evolutionary Computation (AREA)
- Life Sciences & Earth Sciences (AREA)
- General Engineering & Computer Science (AREA)
- Spectrometry And Color Measurement (AREA)
Abstract
The present invention relates to a kind of bamboo cane method for sorting colors and system, method to include:Gather bamboo cane image to be measured and per multiple sample bamboo cane images corresponding to class color, generate sample bamboo cane image queue;The aberration of bamboo cane to be measured and each sample bamboo cane in all kinds of color card bamboo cane image queues is determined, obtains aberration queue corresponding with sample bamboo cane image queue;Bamboo cane to be measured and the final aberration Δ E per class color card bamboo cane image queue are asked for according to aberration queue, bamboo cane to be measured is ranged into the minimum color categories of final aberration Δ E.System is to establish sample queue per class color, when carrying out Colorimetry, aberration queue is established according to sample queue, and calculated according to aberration queue and ask for final aberration, bamboo cane to be measured and the difference of color category are weighed using final aberration, considerably increase the robustness of this method, reduce using single sample carry out aberration differentiation when due to the less and caused error in classification of sample set.
Description
Technical field
The present invention relates to technical field of image processing, specially a kind of bamboo cane method for sorting colors and system.
Background technology
Chinese Bamboos aboundresources, area, yield rank first in the world, and national bamboo grove area is up to more than 520 ten thousand hectares.Bamboo
Important component of the son as terrestrial forest ecosystem, lumber consumption is being reduced, improve ecological functions and is developing rural area warp
Ji etc. effect is fairly obvious.Bamboo industry has become one of four big rising industries of China Forest.Bamboo wood is widely used in system
Make the products such as bamboo chopping block, bamboo furniture, bamboo flooring.Bamboo cane bamboo cane color meeting depth after carbonization technique is handled is different, but color
It is uniformly an important factor for weighing product quality, it is therefore necessary to bamboo cane color grading.At present in China mainly by artificial
Naked eyes know method for distinguishing and bamboo cane color are classified.Artificial naked eyes classification relies primarily on personal subjective experience, easily by ring
The factors such as border, personal mood influence.And artificial naked eyes classification labor intensity is big, and efficiency is low.
The content of the invention
The present invention is directed to problems of the prior art, there is provided a kind of bamboo cane method for sorting colors and system, collection are each
The sample bamboo cane image queue of class color, calculate in the sample bamboo cane queue of bamboo cane to be measured and every class color between each sample bamboo cane
Aberration, and then bamboo cane to be measured is ranged by immediate colour type according to the size of value of chromatism.
The present invention solves above-mentioned technical problem, on the one hand provides a kind of bamboo cane method for sorting colors, comprises the following steps:
Gather bamboo cane image to be measured and per multiple sample bamboo cane images corresponding to class color, generation sample bamboo cane image team
Row;
The aberration of each sample bamboo cane in bamboo cane to be measured and all kinds of color card bamboo cane image queues is determined, is obtained and sample
Aberration queue corresponding to bamboo cane image queue;Element in the aberration queue is sample bamboo in corresponding sample bamboo cane image queue
Bar and the value of chromatism of bamboo cane to be measured;
According to aberration queue, bamboo cane to be measured and the final aberration Δ E per class color card bamboo cane image queue are asked for, will be treated
Survey bamboo cane and range the minimum color categories of final aberration Δ E.
The beneficial effects of the invention are as follows:Sample queue is established for every class color, when carrying out Colorimetry, according to sample team
Row establish aberration queue, and are calculated according to aberration queue and ask for final aberration, and bamboo cane and face to be measured are weighed using final aberration
The difference of color species, considerably increase the robustness of this method, reduce using single sample carry out aberration differentiation when due to sample
The less and caused error of this collection.
On the basis of above-mentioned technical proposal, the present invention can also do following improvement:
Further, the generation of the sample bamboo cane image queue, including:
Multiple sample bamboo cane images per class color are gathered successively, and sample bamboo cane image is filtered and obtains sample bamboo cane
The rgb space image ImgFileted of image;
The rgb space image ImgFileted of sample bamboo cane image is converted into gray-scale map, and using between local maxima class
Variance method is the binary map ImgBinary that Threshold segmentation obtains sample bamboo cane image;
The rgb space image ImgFileted of sample bamboo cane image is converted into Lab space image ImgLab, and with two-value
Figure ImgBinary is mask, asks for Lab space image ImgLab tri- passages of L, a, b of sample bamboo cane image respectively most
Greatest, and according in colour type sample bamboo cane image queue corresponding to the sequencing deposit of IMAQ;It is described most
Greatest is the most numerical value of occurrence number in the two-dimensional array of each passage of Lab space image.
Specifically, described be converted into gray-scale map by the rgb space image ImgFileted of sample bamboo cane image, and use office
Portion's maximum variance between clusters are the binary map ImgBinary that Threshold segmentation obtains sample bamboo cane image, including:
The rgb space image ImgFileted of sample bamboo cane image is converted into gray-scale map, and it is split along cut-off rule
Into polylith subgraph, the cut-off rule is vertical with bamboo cane direction in sample bamboo cane image;
For each piece of subgraph, using bamboo cane as prospect, all pixels point in traversing graph picture, and respectively using each gray value as
The segmentation threshold of the block subgraph prospect and background, optimal segmenting threshold is calculated using formula (1);
G (t)=w0×(u0-u)2+w1×(u1-u)2 (1)
When function g (t) takes maximum, t is the optimal segmenting threshold of the block subgraph;Wherein, foreground point area accounts for
The block subgraph total area ratio is w0, foreground point gray average is u0, background dot area accounts for the block subgraph total area ratio and is
w1, background dot gray average is u1, the gray average of monoblock subgraph is u=w0×u0+w1×u1;
All pixels point in traversing graph picture again, by the gray scale of pixel of all gray values more than optimal segmenting threshold t
Value puts 255, and the gray value of pixel of all gray values less than or equal to optimal segmenting threshold t is set to 0, obtains sample bamboo cane figure
The binary map ImgBinary of picture.
Beneficial effect using above-mentioned further scheme is to do Threshold segmentation using local maxima inter-class variance to obtain two-value
Figure, the most probable value of Lab space image tri- passages of L, a, b is then asked for using binary map as mask, can effectively extract figure
Bamboo cane part as in, is greatly lowered influence of the other factors to bamboo cane color classification in image.
Further, the color for determining bamboo cane to be measured and each sample bamboo cane in all kinds of color card bamboo cane image queues
Difference, obtaining aberration queue corresponding with sample bamboo cane image queue includes:
Using the Lab space image ImgLab' that bamboo cane image to be measured is obtained with sample bamboo cane image identical processing method
With binary map ImgBinary', using binary map ImgBinary' as mask, the Lab space image of bamboo cane image to be measured is asked for respectively
The most probable value of ImgLab' tri- passages of L, a, b, bamboo cane to be measured and all kinds of face are calculated by CIEDE2000 colour difference formulas
The aberration of sample bamboo cane in colo(u)r atlas collection queue, obtains aberration queue corresponding with color sample set queue.
Beneficial effect using above-mentioned further scheme is that CIEDE2000 colour difference formulas are to be regarded at present with people in theory
Feel the formula most matched, aberration can be carried out accurately measuring and controlling, bamboo to be measured is calculated by CIEDE2000 colour difference formulas
Bar and the aberration of each sample bamboo cane, effectively prevent because bamboo cane color classification is inaccurate caused by personal subjective experience,
Efficiency is low, it is affected by environment big the problems such as.
Further, it is described to ask for bamboo cane to be measured and the final aberration Δ E per class color card bamboo cane image queue, will be to be measured
Bamboo cane ranges the minimum color categories of final aberration Δ E, including:
The average c and standard deviation sigma of aberration queue are calculated, and average c and standard deviation sigma and value of chromatism x are brought into described
Average and standard deviation and value of chromatism obtain the corresponding coefficient sequence of the aberration queue for the Gauss formula (2) of variable;
Coefficient sequence is normalized, obtains Gauss amendment weight coefficient queue;
Summation is mutually multiplied accumulating successively with corresponding Gauss amendment weight coefficient to sample aberration sequence, asks for such sample
This queue and the final aberration Δ E of bamboo cane to be measured;
Bamboo cane to be measured is ranged into color category corresponding to the minimum aberration queues of final aberration Δ E.
Beneficial effect using above-mentioned further scheme is to reduce the influence of aberration singular value as far as possible, introduces Gauss and adds
The mode of power calculates the weight of each sample aberration, is weighted and corrected by Gauss, the robustness of effective strengthening system, prevented different
Normal sample causes misclassification.
Further, after this method is additionally included in the color category that bamboo cane to be measured is ranged to final aberration Δ E minimums, to original
Sample queue is adjusted, including:
Judge whether Δ E ∈ [- σ, σ] set up;Wherein σ is the standard deviation of aberration queue;
If so, then sample queue is updated, by the most probable value of tri- passages of L, a, b of bamboo cane to be measured, with
And in sample queue tri- passage values of L, a, b of all sample bamboo canes arithmetic average Lavg、aavg、bavgAs new samples plus
Enter the sample queue of corresponding classification and remove queue the first two sample;Otherwise, next bamboo cane to be measured is handled, do not updated
Sample.
Beneficial effect using above-mentioned further scheme is that sample queue is updated in time so that each in sample queue
Error between sample progressively reduces.
A kind of bamboo cane color classification system based on CIEDE2000 colour difference formulas is provided as another aspect of the present invention,
Including:
Image capture module, for gathering bamboo cane image to be measured and per multiple sample bamboo cane images corresponding to class color,
Generate sample bamboo cane image queue;
Image procossing and aberration queue generation module, for determining bamboo cane to be measured and all kinds of color card bamboo cane image queues
In each sample bamboo cane aberration, obtain aberration queue corresponding with sample bamboo cane image queue;Member in the aberration queue
Element is the value of chromatism of sample bamboo cane and bamboo cane to be measured in corresponding sample bamboo cane image queue;
Bamboo cane classifying module, for asking for bamboo cane to be measured and the final aberration Δ E per class color card bamboo cane image queue,
For bamboo cane to be measured to be ranged into the minimum color categories of final aberration Δ E..
Brief description of the drawings
Fig. 1 is a kind of flow chart of bamboo cane method for sorting colors provided in an embodiment of the present invention;
Fig. 2 is obtained per sample bamboo cane image queue method flow diagram corresponding to class color to be provided in an embodiment of the present invention;
Fig. 3 is Threshold segmentation flow chart provided in an embodiment of the present invention;
Fig. 4 is Gauss amendment flow chart provided in an embodiment of the present invention;
Fig. 5 is a kind of bamboo cane color classification system structure diagram provided in an embodiment of the present invention.
Embodiment
The principle and feature of the present invention are described below in conjunction with example, the given examples are served only to explain the present invention, and
It is non-to be used to limit the scope of the present invention.
Fig. 1 is a kind of flow chart of bamboo cane method for sorting colors provided in an embodiment of the present invention, as shown in figure 1, of the invention
On the one hand embodiment provides a kind of bamboo cane method for sorting colors, comprise the following steps:
S1, gather bamboo cane image to be measured and per multiple sample bamboo cane images corresponding to class color, generate sample bamboo cane figure
As queue;
S2, determine the aberration of each sample bamboo cane in bamboo cane to be measured and all kinds of color card bamboo cane image queues, obtain with
Aberration queue corresponding to sample bamboo cane image queue;Element in the aberration queue is sample in corresponding sample bamboo cane image queue
The value of chromatism of this bamboo cane and bamboo cane to be measured;
S3, according to aberration queue, bamboo cane to be measured and the final aberration Δ E per class color card bamboo cane image queue are asked for,
Bamboo cane to be measured is ranged into the minimum color categories of final aberration Δ E.
In above-described embodiment, it is to establish sample queue per class color, when carrying out Colorimetry, is established according to sample queue
Aberration queue, and calculated according to aberration queue and ask for final aberration, bamboo cane to be measured and color category are weighed using final aberration
Difference, considerably increase the robustness of this method, reduce when carrying out aberration differentiation using single sample due to sample set compared with
Caused error in classification less.
As shown in Fig. 2 the generating process of sample bamboo cane image queue, including:
S11, gathers multiple sample bamboo cane images per class color successively, and medium filtering and height are carried out to sample bamboo cane image
This filtering, due to more in workshop dust, it is easy to produce salt-pepper noise, filter to avoid influence of noise, obtain sample
The rgb space image ImgFileted of bamboo cane image;Sample bamboo cane image uses no-reflection black background, avoids reflective and bamboo
The interference of bar shade, to reduce photographing request;Sample collection quantity is not easy excessively, the specific sample bamboo cane image per class color
Number should beWherein t the average of Colorimetry between bamboo cane to be measured and single sample bamboo cane takes, and f is phase
Machine frame per second, preferably take 10 sample bamboo cane images per class color.
S12, the rgb space image ImgFileted of sample bamboo cane image is converted into gray-scale map, and uses local maxima
Ostu method is the binary map ImgBinary that Threshold segmentation obtains sample bamboo cane image;
S13, the rgb space image ImgFileted of sample bamboo cane image is converted into Lab space image ImgLab, and with
Binary map ImgBinary is mask, asks for the Lab space image ImgLab of sample bamboo cane image tri- passages of L, a, b respectively
Most probable valueAnd it is stored in sample set queue according to the sequencing of IMAQ
(i represents it is the i-th class color bamboo cane, and j is j-th of sample of the i-th class of input).
Specifically, described be converted into gray-scale map by the rgb space image ImgFileted of sample bamboo cane image, and use office
Portion's maximum variance between clusters are the binary map ImgBinary that Threshold segmentation obtains sample bamboo cane image, as shown in figure 3, including:
S121, the rgb space image ImgFileted of sample bamboo cane image is converted into gray-scale map, and by it along cut-off rule
It is divided into polylith subgraph, the cut-off rule is vertical with bamboo cane direction in sample bamboo cane image;
S122, for each piece of subgraph, using bamboo cane as prospect, all pixels point in traversing graph picture, and respectively with each ash
Angle value is the segmentation threshold of the block subgraph prospect and background, and optimal segmenting threshold is calculated using formula (1);
G (t)=w0×(u0-u)2+w1×(u1-u)2 (1)
When function g (t) takes maximum, t is the optimal segmenting threshold of the block subgraph;Wherein, foreground point area accounts for
The block subgraph total area ratio is w0, foreground point gray average is u0, background dot area accounts for the block subgraph total area ratio and is
w1, background dot gray average is u1, the gray average of monoblock subgraph is u=w0×u0+w1×u1;
S123, all pixels point in traversing graph picture, all gray values is more than optimal segmenting threshold t pixel again
Gray value puts 255, and the gray value of pixel of all gray values less than or equal to optimal segmenting threshold t is set to 0, obtains sample bamboo
The binary map ImgBinary of bar image.
In above-described embodiment, using local maxima inter-class variance do Threshold segmentation obtain binary map, then using binary map as
Mask asks for the most probable value of Lab space image tri- passages of L, a, b, can accurately extract the bamboo cane part in image, greatly
Influence of the other factors to bamboo cane color classification in amplitude reduction image.
And the aberration for determining bamboo cane to be measured and each sample bamboo cane in all kinds of color card bamboo cane image queues, specifically
Refer to:Using the Lab space image ImgLab' and two that bamboo cane image to be measured is obtained with sample bamboo cane image identical processing method
Value figure ImgBinary', using binary map ImgBinary' as mask, asks for the Lab space image of bamboo cane image to be measured respectively
The most probable value of ImgLab' tri- passages of L, a, b:Calculated by CIEDE2000 colour difference formulas
The aberration of bamboo cane to be measured and sample bamboo cane in all kinds of color sample set queuesObtain color corresponding with color sample set queue
Poor queueElement in the aberration queue is sample bamboo cane and bamboo cane to be measured in corresponding color sample set queue
Value of chromatism.
As shown in figure 4, bamboo cane to be measured and the final aberration Δ E per class color card bamboo cane image queue are asked for, will be to be measured
Bamboo cane ranges the minimum color categories of final aberration Δ E, including:
S31, calculates the average c and standard deviation sigma of aberration queue, and by average c and standard deviation sigma and value of chromatism x bring into
The average and standard deviation and value of chromatism obtain the corresponding coefficient sequence of the aberration queue for the Gauss formula (2) of variable;
S32, coefficient sequence is normalized, obtains Gauss amendment weight coefficient queue;
S33, summation is mutually multiplied accumulating successively with corresponding Gauss amendment weight coefficient to sample aberration sequence, asks for this
Class sample queue and the final aberration Δ E of bamboo cane to be measured;
S34, bamboo cane to be measured is ranged into color category corresponding to the minimum aberration queues of final aberration Δ E.
Assuming that bamboo cane to be measured and a certain group of 10 master sample values of chromatism for x=(3.3,3.9,2.7,3.5,3.2,
1.2,3.1,3.7,3.8,4.9), specific calculation procedure is as follows:
1st, sample average c=3.33, standard deviation sigma=0.9534 are calculated;
2nd, substitute into x, average and standard deviation can obtain coefficient sequence (0.7801,0.6760,0.8715,0.7465,
0.7905,0.9973,0.8124,0.7114,0.6939,0.4954);
3rd, to coefficient ordered series of numbers normalization can obtain Gauss amendment weight coefficient for B=(0.1029,0.0892,0.1150,
0.0985,0.1051,0.1315,0.1072,0.0939,0.0915,0.0654);
4th, sample aberration sequence x mutually multiplies accumulating with Gauss amendment weight coefficient and is such and bamboo cane aberration Δ E to be measured
=∑ wx=3.1839.
In above-described embodiment, in order to reduce the influence of aberration singular value as far as possible, the mode that introducing Gauss weights calculates each
The weight of sample aberration, weighted and corrected by Gauss, the robustness of effective strengthening system, prevent exceptional sample from causing to divide by mistake
Class.
Further, it is right after this method is additionally included in the color category that bamboo cane to be measured is ranged to final aberration Δ E minimums
Original sample queue is adjusted, including:
Judge whether Δ E ∈ [- σ, σ] set up;Wherein σ is the standard deviation of aberration queue;
If so, then sample queue is updated, by the most probable value of tri- passages of L, a, b of bamboo cane to be measuredAnd in sample queue tri- passage values of L, a, b of all sample bamboo canes arithmetic average Lavg、
aavg、bavgThe sample queue of corresponding classification is added as new samples and removes queue the first two sample;Otherwise, it is to be measured to next
Bamboo cane is handled, not more new samples.
In above-described embodiment, sample queue is updated in time so that error in sample queue between each sample by
Step reduces.
A kind of bamboo cane color classification system is provided as another aspect of the present invention, including:
Image capture module, for gathering bamboo cane image to be measured and per multiple sample bamboo cane images corresponding to class color,
Generate sample bamboo cane image queue;
Image procossing and aberration queue generation module, for determining bamboo cane to be measured and all kinds of color card bamboo cane image queues
In each sample bamboo cane aberration, obtain aberration queue corresponding with sample bamboo cane image queue;Member in the aberration queue
Element is the value of chromatism of sample bamboo cane and bamboo cane to be measured in corresponding sample bamboo cane image queue;
Bamboo cane classifying module, for asking for bamboo cane to be measured and every class color card bamboo cane image queue according to aberration queue
Final aberration Δ E, for bamboo cane to be measured to be ranged into the minimum color categories of final aberration Δ E.
In above-described embodiment, system is to establish sample queue per class color, when carrying out Colorimetry, according to sample queue
Aberration queue is established, and is calculated according to aberration queue and asks for final aberration, bamboo cane and color to be measured are weighed using final aberration
The difference of species, considerably increase the robustness of this method, reduce using single sample carry out aberration differentiation when due to sample
Collect less and caused error.
Described image acquisition module, is specifically used for:
Multiple sample bamboo cane images per class color are gathered successively, and sample bamboo cane image is filtered and obtains sample bamboo cane
The rgb space image ImgFileted of image;
The rgb space image ImgFileted of sample bamboo cane image is converted into gray-scale map, and using between local maxima class
Variance method is the binary map ImgBinary that Threshold segmentation obtains sample bamboo cane image;
The rgb space image ImgFileted of sample bamboo cane image is converted into Lab space image ImgLab, and with two-value
Figure ImgBinary is mask, asks for Lab space image ImgLab tri- passages of L, a, b of sample bamboo cane image respectively most
Greatest, and according in colour type sample bamboo cane image queue corresponding to the sequencing deposit of IMAQ.
Specifically, described be converted into gray-scale map by the rgb space image ImgFileted of sample bamboo cane image, and use office
Portion's maximum variance between clusters are the binary map ImgBinary that Threshold segmentation obtains sample bamboo cane image, including:
The rgb space image ImgFileted of sample bamboo cane image is converted into gray-scale map, and it is split along cut-off rule
Into polylith subgraph, the cut-off rule is vertical with bamboo cane direction in sample bamboo cane image;
For each piece of subgraph, using bamboo cane as prospect, all pixels point in traversing graph picture, and respectively using each gray value as
The segmentation threshold of the block subgraph prospect and background, optimal segmenting threshold is calculated using formula (1);
G (t)=w0×(u0-u)2+w1×(u1-u)2 (1)
When function g (t) takes maximum, t is the optimal segmenting threshold of the block subgraph;Wherein, foreground point area accounts for
The block subgraph total area ratio is w0, foreground point gray average is u0, background dot area accounts for the block subgraph total area ratio and is
w1, background dot gray average is u1, the gray average of monoblock subgraph is u=w0×u0+w1×u1;
All pixels point in traversing graph picture again, by the gray scale of pixel of all gray values more than optimal segmenting threshold t
Value puts 255, and the gray value of pixel of all gray values less than or equal to optimal segmenting threshold t is set to 0, obtains sample bamboo cane figure
The binary map ImgBinary of picture.
Threshold segmentation is done using local maxima inter-class variance and obtains binary map, then asks for Lab skies by mask of binary map
Between tri- passages of image L, a, b most probable value, can accurately extract the bamboo cane part in image, be greatly lowered in image
Influence of the other factors to bamboo cane color classification.
Described image processing and aberration queue generation module, specific for:
Using the Lab space image ImgLab' that bamboo cane image to be measured is obtained with sample bamboo cane image identical processing method
With binary map ImgBinary', using binary map ImgBinary' as mask, the Lab space image of bamboo cane image to be measured is asked for respectively
The most probable value of ImgLab' tri- passages of L, a, b, bamboo cane to be measured and all kinds of face are calculated by CIEDE2000 colour difference formulas
The aberration of sample bamboo cane in colo(u)r atlas collection queue, obtains aberration queue corresponding with color sample set queue.
CIEDE2000 colour difference formulas are the formula most matched with the vision of people at present in theory, and aberration can be carried out
Accurately measure and control, the aberration of bamboo cane to be measured and each sample bamboo cane is calculated by CIEDE2000 colour difference formulas, effectively
Avoid because bamboo cane color classification is inaccurate caused by personal subjective experience, efficiency is low, it is affected by environment big the problems such as.
The bamboo cane classifying module, is specifically used for:
The average c and standard deviation sigma of aberration queue are calculated, and average c and standard deviation sigma and value of chromatism x are brought into described
Average and standard deviation and value of chromatism obtain the corresponding coefficient sequence of the aberration queue for the Gauss formula (2) of variable;
Coefficient sequence is normalized, obtains Gauss amendment weight coefficient queue;
Summation is mutually multiplied accumulating successively with corresponding Gauss amendment weight coefficient to sample aberration sequence, asks for such sample
This queue and the final aberration Δ E of bamboo cane to be measured;
Bamboo cane to be measured is ranged into color category corresponding to the minimum aberration queues of final aberration Δ E.
In order to reduce the influence of aberration singular value as far as possible, the mode for introducing Gauss weighting calculates the power of each sample aberration
Weight, weighted and corrected by Gauss, the robustness of effective strengthening system, prevent exceptional sample from causing misclassification.
The bamboo cane classifying module is additionally operable to after bamboo cane to be measured to be ranged to the minimum color categories of final aberration Δ E,
Original sample queue is adjusted, specifically:
Judge whether Δ E ∈ [- σ, σ] set up;Wherein σ is the standard deviation of aberration queue;
If so, then sample queue is updated, by the most probable value of tri- passages of L, a, b of bamboo cane to be measured, with
And in sample queue tri- passage values of L, a, b of all sample bamboo canes arithmetic average Lavg、aavg、bavgAs new samples plus
Enter the sample queue of corresponding classification and remove queue the first two sample;Otherwise, next bamboo cane to be measured is handled, do not updated
Sample.
In the embodiment, sample queue is updated in time so that the error in sample queue between each sample is progressively
Reduce.
The foregoing is only presently preferred embodiments of the present invention, be not intended to limit the invention, it is all the present invention spirit and
Within principle, any modification, equivalent substitution and improvements made etc., it should be included in the scope of the protection.
Claims (10)
- A kind of 1. bamboo cane method for sorting colors, it is characterised in that:Comprise the following steps:The bamboo cane image to be measured of bamboo cane to be measured and the sample bamboo cane image per multiple sample bamboo canes corresponding to class color are gathered, it is raw Into sample bamboo cane image queue;The aberration of bamboo cane to be measured and each sample bamboo cane in all kinds of color card bamboo cane image queues in bamboo cane image to be measured is determined, Obtain aberration queue corresponding with sample bamboo cane image queue;Element in the aberration queue is corresponding sample bamboo cane image team The value of chromatism of sample bamboo cane and bamboo cane to be measured in row;Bamboo cane to be measured and the final aberration Δ E per class color card bamboo cane image queue are asked for according to aberration queue, by bamboo to be measured Bar ranges the minimum color categories of final aberration Δ E.
- A kind of 2. bamboo cane method for sorting colors according to claim 1, it is characterised in that:The generation sample bamboo cane image team Row include:Multiple sample bamboo cane images per class color are gathered successively, processing is filtered to sample bamboo cane image, obtain sample bamboo The rgb space image ImgFileted of bar image;The rgb space image ImgFileted of sample bamboo cane image is converted into gray-scale map, and uses local maxima inter-class variance Method is the binary map ImgBinary that Threshold segmentation obtains sample bamboo cane image;The rgb space image ImgFileted of sample bamboo cane image is converted into Lab space image ImgLab, and with binary map ImgBinary is mask, asks for the maximum of the Lab space image ImgLab of sample bamboo cane image tri- passages of L, a, b respectively Probable value, and according in colour type sample bamboo cane image queue corresponding to the sequencing deposit of IMAQ;The maximum Probable value is the most numerical value of occurrence number in the two-dimensional array of each passage.
- A kind of 3. bamboo cane method for sorting colors according to claim 2, it is characterised in that:The sample bamboo cane image is carried out Medium filtering and gaussian filtering obtain the rgb space image ImgFileted of sample bamboo cane image.
- A kind of 4. bamboo cane method for sorting colors according to claim 3, it is characterised in that:It is described by sample bamboo cane image Rgb space image ImgFileted is converted into gray-scale map, and does Threshold segmentation using local maxima Ostu method and obtain sample The binary map ImgBinary of bamboo cane image, including:The rgb space image ImgFileted of sample bamboo cane image is converted into gray-scale map, and it is divided into along cut-off rule more Block subgraph, the cut-off rule are vertical with bamboo cane direction in sample bamboo cane image;For each piece of subgraph, using bamboo cane as prospect, all pixels point in traversing graph picture, and respectively using each gray value as the block The segmentation threshold of subgraph prospect and background, optimal segmenting threshold is calculated using formula (1);G (t)=w0×(u0-u)2+w1×(u1-u)2 (1)When function g (t) takes maximum, t is the optimal segmenting threshold of the block subgraph;Wherein, foreground point area accounts for the block Subgraph total area ratio is w0, foreground point gray average is u0, it is w that background dot area, which accounts for the block subgraph total area ratio,1, Background dot gray average is u1, the gray average of monoblock subgraph is u=w0×u0+w1×u1;All pixels point in traversing graph picture again, the gray value of pixel of all gray values more than optimal segmenting threshold t is put 255, the gray value of pixel of all gray values less than or equal to optimal segmenting threshold t is set to 0, obtains sample bamboo cane image Binary map ImgBinary.
- A kind of 5. bamboo cane method for sorting colors according to claim 4, it is characterised in that:It is described determine bamboo cane to be measured with it is all kinds of The aberration of each sample bamboo cane in color card bamboo cane image queue, obtain aberration queue corresponding with sample bamboo cane image queue Including:Using the Lab space image ImgLab' and two that bamboo cane image to be measured is obtained with sample bamboo cane image identical processing method Value figure ImgBinary', using binary map ImgBinary' as mask, asks for the Lab space image of bamboo cane image to be measured respectively The most probable value of ImgLab' tri- passages of L, a, b, bamboo cane to be measured and all kinds of face are calculated by CIEDE2000 colour difference formulas The aberration of sample bamboo cane in colo(u)r atlas collection queue, obtains aberration queue corresponding with color sample set queue.
- A kind of 6. bamboo cane method for sorting colors according to claim 5, it is characterised in that:It is described to ask for bamboo cane to be measured and every class The final aberration Δ E of color card bamboo cane image queue, bamboo cane to be measured is ranged into the minimum color categories of final aberration Δ E, Including:The average c and standard deviation sigma of aberration queue are calculated, and average c and standard deviation sigma and value of chromatism x are brought into the average With standard deviation and value of chromatism the corresponding coefficient sequence of the aberration queue is obtained for the Gauss formula (2) of variable;<mrow> <mi>f</mi> <mrow> <mo>(</mo> <mi>x</mi> <mo>,</mo> <mi>&sigma;</mi> <mo>,</mo> <mi>c</mi> <mo>)</mo> </mrow> <mo>=</mo> <msup> <mi>e</mi> <mfrac> <mrow> <mo>-</mo> <msup> <mrow> <mo>(</mo> <mi>x</mi> <mo>-</mo> <mi>c</mi> <mo>)</mo> </mrow> <mn>2</mn> </msup> </mrow> <mrow> <mn>2</mn> <msup> <mi>&sigma;</mi> <mn>2</mn> </msup> </mrow> </mfrac> </msup> <mo>-</mo> <mo>-</mo> <mo>-</mo> <mrow> <mo>(</mo> <mn>2</mn> <mo>)</mo> </mrow> </mrow>Coefficient sequence is normalized, obtains Gauss amendment weight coefficient queue;Summation is mutually multiplied accumulating successively with corresponding Gauss amendment weight coefficient to sample aberration sequence, asks for such sample team Row and the final aberration Δ E of bamboo cane to be measured;Bamboo cane to be measured is ranged into color category corresponding to the minimum aberration queues of final aberration Δ E.
- A kind of 7. bamboo cane method for sorting colors according to claim 6, it is characterised in that:This method is additionally included in bamboo to be measured After bar ranges the minimum color categories of final aberration Δ E, original sample queue is adjusted, including:Judge whether Δ E ∈ [- σ, σ] set up;Wherein σ is the standard deviation of aberration queue;If so, then sample queue is updated, by the most probable value of tri- passages of L, a, b of bamboo cane to be measured, and sample The arithmetic average L of tri- passage values of L, a, b of all sample bamboo canes in this queueavg、aavg、bavgAs new samples addition pair Answer the sample sequence of classification and remove queue the first two sample;Otherwise, next bamboo cane to be measured is handled, does not update sample This.
- 8. according to a kind of any one of claim 1-7 bamboo cane method for sorting colors, it is characterised in that:The sample bamboo cane and Bamboo cane to be measured, IMAQ is carried out using no-reflection black background.
- A kind of 9. bamboo cane method for sorting colors according to claim 8, it is characterised in that:Sample corresponding to every class color The number span of sample bamboo cane image is in bamboo cane image queueWherein t be bamboo cane to be measured with it is single Colorimetry is average time-consuming between sample bamboo cane, and f is camera frame per second.
- A kind of 10. bamboo cane color classification system, it is characterised in that:Including:Image capture module, for gathering bamboo cane image to be measured and per multiple sample bamboo cane images corresponding to class color, generation Sample bamboo cane image queue;Image procossing and aberration queue generation module, it is every in bamboo cane to be measured and all kinds of color card bamboo cane image queues for determining The aberration of one sample bamboo cane, obtain aberration queue corresponding with sample bamboo cane image queue;Element in the aberration queue is The value of chromatism of sample bamboo cane and bamboo cane to be measured in corresponding sample bamboo cane image queue;Bamboo cane classifying module, for according to aberration queue ask for bamboo cane to be measured with it is final per class color card bamboo cane image queue Aberration Δ E, for bamboo cane to be measured to be ranged into the minimum color categories of final aberration Δ E.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710686593.5A CN107516331A (en) | 2017-08-11 | 2017-08-11 | A kind of bamboo cane method for sorting colors and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710686593.5A CN107516331A (en) | 2017-08-11 | 2017-08-11 | A kind of bamboo cane method for sorting colors and system |
Publications (1)
Publication Number | Publication Date |
---|---|
CN107516331A true CN107516331A (en) | 2017-12-26 |
Family
ID=60722027
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710686593.5A Pending CN107516331A (en) | 2017-08-11 | 2017-08-11 | A kind of bamboo cane method for sorting colors and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107516331A (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110728318A (en) * | 2019-10-09 | 2020-01-24 | 安徽萤瞳科技有限公司 | Hair color identification method based on deep learning |
CN111160476A (en) * | 2019-12-31 | 2020-05-15 | 佛山喀视科技有限公司 | Color difference detection model generation method, tile color separation method and device |
CN111563536A (en) * | 2020-04-17 | 2020-08-21 | 福建帝视信息科技有限公司 | Bamboo strip color self-adaptive classification method based on machine learning |
CN112200242A (en) * | 2020-10-09 | 2021-01-08 | 陕西科技大学 | Color classification method for drawing Thangka image, computer equipment, terminal and medium |
-
2017
- 2017-08-11 CN CN201710686593.5A patent/CN107516331A/en active Pending
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110728318A (en) * | 2019-10-09 | 2020-01-24 | 安徽萤瞳科技有限公司 | Hair color identification method based on deep learning |
CN111160476A (en) * | 2019-12-31 | 2020-05-15 | 佛山喀视科技有限公司 | Color difference detection model generation method, tile color separation method and device |
CN111563536A (en) * | 2020-04-17 | 2020-08-21 | 福建帝视信息科技有限公司 | Bamboo strip color self-adaptive classification method based on machine learning |
CN111563536B (en) * | 2020-04-17 | 2023-04-14 | 福建帝视信息科技有限公司 | Bamboo strip color self-adaptive classification method based on machine learning |
CN112200242A (en) * | 2020-10-09 | 2021-01-08 | 陕西科技大学 | Color classification method for drawing Thangka image, computer equipment, terminal and medium |
CN112200242B (en) * | 2020-10-09 | 2023-06-20 | 陕西科技大学 | Color classification method, computer equipment, terminal and medium for drawing Thangka image |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107516331A (en) | A kind of bamboo cane method for sorting colors and system | |
CN109269951B (en) | Image-based flotation tailing ash content, concentration and coarse particle content detection method | |
CN105427275B (en) | Crop field environment wheat head method of counting and device | |
CN101153851B (en) | Apple detection classification method based on machine vision | |
CN105046700B (en) | Fruit surface defect detection method and system based on gamma correction and color classification | |
CN101692037B (en) | Method for analyzing chlorophyll distribution on surface of leaves of plant by hyperspectral image and independent component | |
CN103778611B (en) | Utilize the switch weight vectors median filter method of rim detection | |
CN101162503A (en) | Method for extracting and recognizing human ear characteristic by improved Hausdorff distance | |
CN103955109B (en) | Method and device for real-time adjustment of lens installation flatness | |
CN105320970B (en) | A kind of potato disease diagnostic device, diagnostic system and diagnostic method | |
CN109727233A (en) | A kind of LCD defect inspection method | |
CN102782481A (en) | Method for calculating weight ratio by quality in grain appearance quality discrimination device | |
CN104597052A (en) | High-speed lossless potato grading detection method and system based on multi-characteristic fusion | |
CN106960221A (en) | A kind of hyperspectral image classification method merged based on spectral signature and space characteristics and system | |
CN108416814A (en) | Quick positioning and recognition methods and the system on a kind of pineapple head | |
CN106645180A (en) | Method for checking defects of substrate glass, field terminal and server | |
CN106934770A (en) | A kind of method and apparatus for evaluating haze image defog effect | |
CN110108362A (en) | The adaptive online test method of color difference and device based on SLIC super-pixel segmentation | |
Ali et al. | Low cost solution for rice quality analysis using morphological parameters and its comparison with standard measurements | |
CN110044485B (en) | Image type fabric color measuring method | |
CN107807126A (en) | A kind of flour bran speck detection method based on PCNN | |
CN208059993U (en) | A kind of crab multi objective grading plant | |
EP2487650B1 (en) | Bioinspired system for processing and characterising colour attributes of a digital image | |
CN110428374A (en) | A kind of small size pest automatic testing method and system | |
CN102735340A (en) | Fruit color grading method based on compressive sensing |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20171226 |