CN109035289A - Purple soil image segmentation extracting method based on Chebyshev inequality H threshold value - Google Patents

Purple soil image segmentation extracting method based on Chebyshev inequality H threshold value Download PDF

Info

Publication number
CN109035289A
CN109035289A CN201810848438.3A CN201810848438A CN109035289A CN 109035289 A CN109035289 A CN 109035289A CN 201810848438 A CN201810848438 A CN 201810848438A CN 109035289 A CN109035289 A CN 109035289A
Authority
CN
China
Prior art keywords
point
image
matrix
value
adjoint
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.)
Granted
Application number
CN201810848438.3A
Other languages
Chinese (zh)
Other versions
CN109035289B (en
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.)
CHONGQING AGRICULTURAL TECHNOLOGY EXTENSION STATION
Chongqing Normal University
Original Assignee
CHONGQING AGRICULTURAL TECHNOLOGY EXTENSION STATION
Chongqing Normal 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 CHONGQING AGRICULTURAL TECHNOLOGY EXTENSION STATION, Chongqing Normal University filed Critical CHONGQING AGRICULTURAL TECHNOLOGY EXTENSION STATION
Priority to CN201810848438.3A priority Critical patent/CN109035289B/en
Publication of CN109035289A publication Critical patent/CN109035289A/en
Application granted granted Critical
Publication of CN109035289B publication Critical patent/CN109035289B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/194Segmentation; Edge detection involving foreground-background segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/23Clustering techniques
    • G06F18/232Non-hierarchical techniques
    • G06F18/2321Non-hierarchical techniques using statistics or function optimisation, e.g. modelling of probability density functions
    • G06F18/23213Non-hierarchical techniques using statistics or function optimisation, e.g. modelling of probability density functions with fixed number of clusters, e.g. K-means clustering
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N7/00Computing arrangements based on specific mathematical models
    • G06N7/01Probabilistic graphical models, e.g. probabilistic networks
    • 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
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Data Mining & Analysis (AREA)
  • Probability & Statistics with Applications (AREA)
  • Artificial Intelligence (AREA)
  • Evolutionary Computation (AREA)
  • General Engineering & Computer Science (AREA)
  • Mathematical Optimization (AREA)
  • Pure & Applied Mathematics (AREA)
  • Computing Systems (AREA)
  • Mathematical Analysis (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Computational Mathematics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Algebra (AREA)
  • Evolutionary Biology (AREA)
  • Image Analysis (AREA)

Abstract

The present invention provides a kind of purple soil image segmentation extracting method based on Chebyshev inequality H threshold value, including step S1: converting the color image containing purple soil region to the image I of HSI color space;S2: adaptivenon-uniform sampling is carried out to image I, obtains bianry image II;S3: the isolated pixel region of bianry image II is eliminated, bianry image III is obtained;S4: the cavity in filling bianry image III obtains bianry image IV;S6: the Hadamard of bianry image IV and the color image containing purple soil region product is sought, purple soil image is obtained;The present invention has good aggregation properties in HSI color space H component in view of the soil region of purple soil color image, adaptive to obtain H component segmentation threshold, and the soil region of image is quick from background area, accurate, full segmentation comes out.

Description

Purple soil image segmentation extracting method based on Chebyshev inequality H threshold value
Technical field
The present invention relates to image segmentation extracting methods, and in particular to a kind of purple based on Chebyshev inequality H threshold value Native image segmentation extracting method.
Background technique
Machine Vision Recognition soil has important practical value in agricultural production.In agricultural production, soil is identified It is very important.It is raw due to soil classification system complexity, only expert's ability accurate recognition soil of only a few scientific research institutions The professional of agriculture for producing a line wants entirely accurate local soil identification is clearly and very difficult, to derived from differently It is an international general character problem that the soil types in area, which carries out identification,.The development of artificial intelligence technology, makes Machine Vision Recognition Soil is possibly realized.
Machine vision, which recognizes soil, to be known to the soil image with complex background shot under the natural conditions of field Not.In machine vision identification soil, we are only interested in the soil part of image, if we can be by the soil portion of image Divide and split from background, on the one hand only studies, handles the soil part of our interested images, on the other hand can arrange Except background area interferes further image analysis, feature extraction, identification.Purple soil, which is that Southwestern China area is main, to be ploughed Ground, purple soil are the research emphasis of machine vision soil identification.How that the purple soil image of color image is accurate from background, Completely splitting is current technology problem.Currently, existing image segmentation algorithm accuracy is low, error is big, the time opens Pin is big, and adaptive segmentation cannot be realized in cutting procedure.
Summary of the invention
In view of this, the object of the present invention is to provide a kind of purple soil images based on Chebyshev inequality H threshold value point Extracting method is cut, the soil region for fully taking into account purple soil color image has good aggregation special in HSI color space H component Property, and there were significant differences with background area, and purple soil color image is converted to HSI color space, it is adaptive to obtain H component point Threshold value is cut, purple soil image is quick from the color image containing background area, accurate, full segmentation extracts.
The present invention provides a kind of purple soil image segmentation extracting method based on Chebyshev inequality H threshold value, including step Suddenly
S1: the color image containing purple soil region is obtained, converts HSI face for the color image containing purple soil region The image I of the colour space;
S2: obtaining adaptive segmentation threshold, carries out adaptivenon-uniform sampling to image I, obtains bianry image II;
S3: the isolated pixel region of bianry image II is eliminated, bianry image III is obtained;
S4: the cavity in filling bianry image III obtains bianry image IV;
S5: the Hadamard of bianry image IV and the color image containing purple soil region product is sought, only purple soil area is obtained The image in domain.
Further, the step S2 includes
S201: the Chebyshev inequality of the probability measure in the purple soil region of image I is established, according to the purple of image I The Chebyshev inequality of the probability measure in native region determines the threshold value that adaptivenon-uniform sampling is carried out to image I;
S202: according to the threshold value for carrying out adaptivenon-uniform sampling to image I, the adjoint matrix of image I is updated, obtains two It is worth image II.
Further, the step S202 includes
S2021: matrix H is converted by image II, matrix HIMiddle each element value is equal in image I with each element in matrix HIThe H component value of the identical pixel in middle position;
S2022: matrix H is establishedIAdjoint matrix H ', according to the update of the adjoint matrix H ' of image I rule to image I The element value of adjoint matrix H ' is updated, and obtains matrix I, and matrix I is converted to bianry image, obtains bianry image II;
The update rule of the adjoint matrix H ' of described image I are as follows:
If T1≤H(x,y)≤T2, then H ' (x, y)=1 is set, if H (x, y) < T1Or H (x, y) > T2, then set H ' (x, y)= 0;
Wherein, H (x, y) is matrix HIMiddle position is the element value of (x, y), and H ' (x, y) is that the middle position adjoint matrix H ' is The element value of (x, y), T1、T2Lower threshold, the upper limit threshold of adaptivenon-uniform sampling are respectively carried out to image I.
Further, the Chebyshev inequality of the probability measure in the purple soil region of image I is in the step S201
Wherein, P is the probability measure in the purple soil region of image I, and μ indicates the mean value of the H component value of image I, and σ indicates figure As the standard deviation of I H component value, ε indicates the segmentation threshold of Chebyshev inequality (1).
T is obtained according to (1) formula1、T2Calculation formula is
Further, in the step S201 probability measure P in the purple soil region of image I calculation formula are as follows:
Wherein, N3×3It is the total number of 3 × 3 small submatrixs, NsoilIt is the small submatrix number of the 1st class, σTTo make the 1st class submatrix With the maximum standard deviation segmentation threshold of inter-class variance and variance within clusters ratio of the H component of the 2nd class submatrix.
Further, the σTBy establishing and solving σTMathematical model obtain, the σTMathematical model include target letter Several and constraint condition,
So that the inter-class variance and variance within clusters ratio maximum of the H component of the 1st class submatrix and the 2nd class submatrix are as target Function, the objective function are
Wherein, BCV is the inter-class variance of the H component of the 1st class submatrix and the 2nd class submatrix;ICV is the 1st class submatrix and the 2nd The variance within clusters of the H component of class submatrix;
The constraint condition is
σmin< σT< σmax (6)
Wherein, wherein σminPoor, the σ for the minimum sandards in the region of interest standard deviation histogram of image ImaxFor image I Maximum standard deviation in the histogram of region of interest standard deviation.
Further, σ is determinedmin、σmax, the 1st class submatrix and the 2nd class submatrix comprising steps of
S2011: at the center of image I, extracting the region of N number of M × M pixel, obtains H points of the region of each M × M pixel The mean value of magnitude, and the region of the minimum and maximum M × M pixel of the mean value of rejecting H component value, by N-2 M × M picture of reservation Region of interest of the region merging technique as image I of element, calculate the mean μ of the H component value of region of interest ';Wherein, N is 5 or 7, institute The region for stating N number of M × M pixel does not overlap each other, and the multiple that M is 3;
The region of interest of image I: being divided into the child window of several 3 × 3 pixels by S2012, set the child window as 3 × 3 small submatrixs;3 × 3 small submatrix is not overlapped between each other, and is paved with region of interest;
S2013: each 3 × 3 small submatrix is calculated for the standard deviation sigma of μ 'i, count and obtain the histogram of region of interest standard deviation Figure, by σiSize sequence is carried out, the minimum sandards difference σ in histogram is obtainedminWith maximum standard deviation σmax, wherein i is indicated I-th of 3 × 3 small submatrixs;
S2014: σT3 × 3 small submatrixs are divided into the small submatrix of two classes, the i.e. small submatrix of the 1st class and the 2nd small submatrix of class, wherein The 1st small submatrix of class meets σi≤σT, the 2nd small submatrix of class meets σi> σT
S2015: BCV and ICV is obtained, (5) formula and (6) formula is brought into, can be obtained σT
Further, the step S3 includes
S301: converting two values matrix A for bianry image II, and the element value in the two values matrix A is equal in binary map As pixel point value identical with element position in two values matrix A in II;
S302: the element for establishing the label matrix A of two values matrix A in ', and will mark matrix A ' is initialized as 0;
S303: taking one 3 × 3 submatrix at the center of two values matrix A at random, by 3 × 3 submatrix and 3 × 3 unit Matrix carries out convolution, if taking another 3 × 3 submatrix at random at the center of two values matrix A when convolution value≤1;Until convolution value > 1, by 3 × 3 submatrix copy to label matrix A ' in 3 × 3 submatrix in two values matrix A identical position, enter Step S304;
S304: to label matrix A ' carries out spiral traversal;The spiral traverses
A. to mark matrix A ' central point as spiral traverse starting point, and using spiral traversal starting point as currently traverse position;
B. to label matrix A ' current traversal place value judges: if currently traversal place value is 0, enter step c;If current Traversing place value is 1, then uses in two values matrix A and the value of 8 connected domains of current traversal bit element, replacement are marking matrix A ' and should 8 connected domains identical element value in position in two values matrix A;Enter step c;
Whether c. judge mark matrix A ' spiral traversal terminates, if terminating, will mark matrix A ' it is converted into bianry image and obtains To bianry image III;If being not finished, d is entered step;
D. in label matrix A the central point of ' in, current to traverse position with step-length for 1, around label matrix A ' clockwise, It is moved to the next point of spiral traversal, enters step b.
Further, the step S4 includes
S401: converting two values matrix B for bianry image III, and the element value in the two values matrix B is equal in binary map The identical pixel point value of element position in picture III in two values matrix B;
S402: establishing size Matrix C identical with two values matrix B, and the element value for initializing two values matrix C is 0;It establishes Null set HS, for storing empty point;Null set SS is established, for storing search starting point;
S403: the point in search two values matrix B judges whether the point is boundary when searching element value a little is 1 Point, for example boundary point then will set 2 in the identical element value of two values matrix B location with the boundary point in Matrix C, until two-value square Point in battle array B has all been searched;
S404: skipping the point searched for, and the point in searching matrix C is 0 until searching element value a little, and the point The element value of left adjoint point and upper adjoint point is 2, and the point is not stored in set SS, using the point as search starting point, is entered Step S405;If not searching such point, S408 is entered step;
S405: it is 2 that in judgment matrix C, search starting point is left and right, whether upper and lower four direction has element value Point;Such point if it does not exist, then return step S404;Such point if it exists, then enter step S406;
S406: by search starting point deposit set HS and set SS, and starting point will be searched for as current search point, entered Step S407;
S407: 4 connected domains of current search point are successively searched for according to the sequence of right adjoint point, lower adjoint point, left adjoint point, upper adjoint point Adjoint point, judge whether adjoint point value is 0 and whether the adjoint point is stored in set HS;
Once searching element goes out the adjoint point that existence value in adjoint point is 0 and is not stored in set HS, then stop to the 4 of current search point The search of other adjoint points of connected domain, and judge whether left and right, the upper and lower four direction of the adjoint point has element value for 2 Point;
If the point that it is in one direction 2 without element value that left and right, the upper and lower four direction of the adjoint point, which is at least deposited, is returned Return step S404;
If left and right, the upper and lower four direction of the adjoint point has the point that element value is 2, which is stored in and is gathered In HS, and using the adjoint point as new current search point, return step S407;
If the adjoint point that value is 0 and is not stored in set HS is not present in the adjoint point of 4 connected domains of current search point, return Step S404;
S408: skipping the point searched for, in Matrix C, by right adjoint point, lower adjoint point, left adjoint point, upper adjoint point sequence successively The adjoint point for searching for 4 connected domains of the point (x, y) in HS set, judges whether adjoint point value is 0 and whether the adjoint point is stored in set HS In;
Once searching element to go out is 0 there are adjoint point value and the adjoint point is not stored in point (x, y) in set HS, then stopping is to currently searching The search of other adjoint points of 4 connected domains of rope point, and it regard the point (x, y) as current search point, enter step S407;
Adjoint point value is 0 if it does not exist and the adjoint point is not stored in the point (x, y) in set HS, then enters step S409;
S409: in Matrix C, by HS gather in each point in element corresponding in Matrix C set 1;
S410: setting 1 for the element that Matrix C intermediate value is 2, obtain updated Matrix C, Matrix C is converted into bianry image, Obtain bianry image IV.
Further, to judge whether it is boundary point in the step S403 specific as follows:
The unit matrix progress convolutional calculation for being connected to domain matrix and 3 × 3 for the 8 of the point for the boundary point of being judged whether it is, Indicate that the adjoint point is boundary point when convolution results are not 9, the convolutional calculation formula are as follows:
Wherein, Con (x, y) be a little 8 connection domain matrixs and 3 × 3 unit matrix convolution results B3×3(x, y) is two Position is 8 connection domain matrixs of the point of (x, y), E in value matrix B3×3For the unit matrix of 3 × 3 ranks.
Beneficial effects of the present invention: the soil region that the present invention fully takes into account purple soil color image is empty in HSI color Between H component have good aggregation properties, and there were significant differences with background area, and purple soil color image is converted to HSI color Space, it is adaptive to obtain H component segmentation threshold, purple soil image is quick from the color image containing background area, accurate, Full segmentation extracts.
Detailed description of the invention
The invention will be further described with reference to the accompanying drawings and examples:
Fig. 1 is flow chart of the method for the present invention;
Fig. 2 is the H histogram of component of standard picture I;
Fig. 3 is the H histogram of component of the sample image of HSI color space;
Fig. 4 is the S histogram of component of the sample image of HSI color space;
Fig. 5 is the I component histogram of the sample image of HSI color space;
Fig. 6 is the segmentation schematic diagram of the H component value of image I;
Fig. 7 is the gray level image for the experimental image not being split;
Fig. 8 is the gray level image in the purple soil region that experimental image is extracted by the segmentation of K mean algorithm;
Fig. 9 is the gray level image in the purple soil region that experimental image is extracted by the segmentation of Otsu algorithm;
Figure 10 is the gray level image in the purple soil region that experimental image is extracted by the segmentation of algorithm 1;
Figure 11 is the gray level image in the purple soil region that experimental image is extracted by the segmentation of algorithm 2;
Figure 12 is the gray level image in the purple soil region that Figure 11 is extracted by the segmentation of algorithm 3;
Figure 13 is the gray level image in the purple soil region that Figure 12 is extracted by the segmentation of algorithm 4;
Figure 14 is that Figure 12 passes through the gray level image for manually dividing the purple soil region of extraction.
Specific embodiment
As shown in Figure 1, the present invention provides a kind of purple soil image segmentation extraction side based on Chebyshev inequality H threshold value Method, including step
S1: the color image containing purple soil region is obtained, converts HSI face for the color image containing purple soil region The image I of the colour space;
S2: obtaining adaptive segmentation threshold, carries out adaptivenon-uniform sampling to image I, obtains bianry image II;
S3: the isolated pixel region of bianry image II is eliminated, bianry image III is obtained;
S4: the cavity in filling bianry image III obtains bianry image IV;
S5: the Hadamard of bianry image IV and the color image containing purple soil region product is sought, only purple soil area is obtained The image in domain.Pass through the above method, it is contemplated that the soil region of purple soil color image has well in HSI color space H component Aggregation properties, and there were significant differences with background area, and purple soil color image is converted to HSI color space, is adaptively obtained H component segmentation threshold is taken, purple soil image is quick from the color image containing background area, accurate, full segmentation extracts Out.
In the present embodiment, the color catalog image containing purple soil region is acquired under the natural environment of field, is used Photoshop software manually divides the color catalog image containing purple soil region, by the coloured silk containing purple soil region Background area in colo(u)r atlas image is rejected, and is only stayed soil region, is obtained standard picture I, as shown in Figure 2.By purple soil region Color catalog image be converted to the sample image in hsv color space, obtain image H histogram of component, S histogram of component and I component histogram, as shown in Figures 3 to 5, from three histograms it can be seen that H component histogram in figure purple soil region with The difference of the wave crest of background area is the most obvious compared to S histogram of component and I component histogram, the H component with standard picture I Purple soil region in histogram is similar to the wave crest trend of background area.By for a long time to shooting under the natural environment of field Color image containing purple soil region carries out above-mentioned analysis, and discovery purple soil region has well in HSI color space H component Aggregation properties, and there were significant differences with background area.For the characteristic of purple soil image, point based on H threshold value is proposed Cut the thinking for extracting purple soil image.
In the present embodiment, color image of the acquisition containing purple soil region in step S1 is manually to be placed in purple soil What the near center location of camera lens was acquired, guarantee that the center position of the color image containing purple soil region to be mentioned In the purple soil region taken.
In the present embodiment, the step S2 includes
S201: the Chebyshev inequality of the probability measure in the purple soil region of image I is established, according to the purple of image I The Chebyshev inequality of the probability measure in native region determines the threshold value that adaptivenon-uniform sampling is carried out to image I;
In the present embodiment, the threshold value for carrying out adaptivenon-uniform sampling to image I includes carrying out adaptivenon-uniform sampling to image I Lower threshold, upper limit threshold.
S202: according to the threshold value for carrying out adaptivenon-uniform sampling to image I, the adjoint matrix of image I is updated, obtains two It is worth image II.
The step S202 includes
S2021: matrix H is converted by image II, matrix HIMiddle each element value is equal in image I with each element in matrix HIThe H component value of the identical pixel in middle position;
S2022: matrix H is establishedIAdjoint matrix H ', according to the update of the adjoint matrix H ' of image I rule to image I The element value of adjoint matrix H ' is updated, and obtains matrix I, and matrix I is converted to bianry image, obtains bianry image II;
The update rule of the adjoint matrix H ' of described image I are as follows:
If T1≤H(x,y)≤T2, then H ' (x, y)=1 is set, if H (x, y) < T1Or H (x, y) > T2, then set H ' (x, y)= 0;
Wherein, H (x, y) is matrix HIMiddle position is the element value of (x, y), and H ' (x, y) is that the middle position adjoint matrix H ' is The element value of (x, y), T1、T2Lower threshold, the upper limit threshold of adaptivenon-uniform sampling are respectively carried out to image I.
As shown in fig. 6, carrying out the threshold value packet of adaptivenon-uniform sampling to including lower threshold T to image I1With upper limit threshold T2, wherein H component value is more than or equal to T in image I1And it is less than or equal to T2Region be purple soil region, H component value be less than T1, or be greater than T2Region be background area.
The Chebyshev inequality of the probability measure in the purple soil region of image I is in the step S201
Wherein, P is the probability measure in the purple soil region of image I, and μ indicates the mean value of the H component value of image I, and σ indicates figure As the standard deviation of I H component value, ε indicates the segmentation threshold of Chebyshev inequality (1).
The estimation H of H component threshold value is obtained by (1) formulaTAre as follows:
HT=(μ-ε, μ+ε) (1-1)
Wherein, μ-ε is the lower threshold that adaptivenon-uniform sampling is carried out to image I, and μ+ε is to carry out adaptivenon-uniform sampling to image I Upper limit threshold.
It is converted by (1) formula and obtains ε
It brings (1-2) formula into (1-1) formula, obtains T1、T2Calculation formula is
The calculation formula of the probability measure P in the purple soil region of image I in the step S201 are as follows:
Wherein, N3×3It is the total number of 3 × 3 small submatrixs, NsoilIt is the small submatrix number of the 1st class, σTTo make the 1st class submatrix With the maximum standard deviation segmentation threshold of inter-class variance and variance within clusters ratio of the H component of the 2nd class submatrix.
Traditional method for obtaining threshold value with Chebyshev inequality, usually obtains threshold calculations formula by tabling look-up Middle P, but this selection mode of tabling look-up, do not calculate accurately, so that the P chosen only adapts to a kind of image, if desired to another A kind of image is handled, then needs to choose suitable threshold value again, and the accuracy of the P chosen is by the subjective factor for choosing people It influences, the accuracy for causing the threshold value for obtaining with Chebyshev inequality to extract purple soil area area image is low, universality Difference, and expense is big.And the application is by obtaining P to accurately calculating for probability measure P, not by artificial subjective impact, accuracy is high, Universality is strong, can carry out adaptive polo placement selection according to the different color images containing purple soil region of selection, save Human cost has saved the time.
The σTBy establishing and solving σTMathematical model obtain, the σTMathematical model include objective function peace treaty Beam condition,
So that the inter-class variance and variance within clusters ratio maximum of the H component of the 1st class submatrix and the 2nd class submatrix are as target Function, the objective function are
Wherein, BCV is the inter-class variance of the H component of the 1st class submatrix and the 2nd class submatrix;ICV is the 1st class submatrix and the 2nd The variance within clusters of the H component of class submatrix;
The constraint condition is
σmin< σT< σmax (6)
Wherein, wherein σminPoor, the σ for the minimum sandards in the region of interest standard deviation histogram of image ImaxFor image I Maximum standard deviation in the histogram of region of interest standard deviation.
Determine σmin、σmax, the 1st class submatrix and the 2nd class submatrix comprising steps of
S2011: at the center of image I, extracting the region of N number of M × M pixel, obtains H points of the region of each M × M pixel The mean value of magnitude, and the region of the minimum and maximum M × M pixel of the mean value of rejecting H component value, by N-2 M × M picture of reservation Region of interest of the region merging technique as image I of element, calculate the mean μ of the H component value of region of interest ';Wherein, N is 5 or 7, institute The region for stating N number of M × M pixel does not overlap each other, and the multiple that M is 3;In step S2011, the center of image I refers to artificial choosing The central part for taking image I, it is especially high not need precision, it is only necessary to guarantee that the central point of image I is located at the area of N number of M × M pixel In domain.The region of N number of M × M pixel is extracted in rough in this way restriction, can simply, efficiently reduce the purple soil to be extracted The range in region avoids influence of large stretch of background area to P computational accuracy.
The region of interest of image I: being divided into the child window of several 3 × 3 pixels by S2012, set the child window as 3 × 3 small submatrixs;3 × 3 small submatrix is not overlapped between each other, and is paved with region of interest;
S2013: each 3 × 3 small submatrix is calculated for the standard deviation sigma of μ 'i, count and obtain the histogram of region of interest standard deviation Figure, by σiSize sequence is carried out, the minimum sandards difference σ in histogram is obtainedminWith maximum standard deviation σmax, wherein i is indicated I-th of 3 × 3 small submatrixs;
S2014: σT3 × 3 small submatrixs are divided into the small submatrix of two classes, the i.e. small submatrix of the 1st class and the 2nd small submatrix of class, wherein The 1st small submatrix of class meets σi≤σT, the 2nd small submatrix of class meets σi> σT
S2015: BCV and ICV is obtained, (5) formula and (6) formula is brought into, can be obtained σT
The calculation formula of the BCV is
BCV=w0*(u0-uT)2+w1*(u1-uT)2=w0*w1*(u1-u0)2 (5-1)
The calculation formula of the ICV is
Wherein, u0For the mean value of the H component value of the 1st small submatrix of class;u1For the mean value of the H component value of the 2nd small submatrix of class, μT For the standard deviation overall situation mean value of H component value in the histogram of the region of interest standard deviation of image I, σ0It is H points of the 1st small submatrix of class The standard deviation of magnitude, σ1For the standard deviation of the H component value of the 2nd small submatrix of class, w0It is small that all 3 × 3 are accounted for for the small submatrix quantity of the 1st class The ratio of submatrix quantity, w1The ratio of all 3 × 3 small submatrix quantity is accounted for for the small submatrix quantity of the 2nd class.
u0、u1、σ0 2、σ1 2、w0、w1Calculation formula it is as follows:
Wherein, m is the small submatrix number of the 1st class, and k is the small submatrix number of the 2nd class.By the above method, realize certainly The Chebyshev inequality threshold value for adapting to obtain image I, obtains Chebyshev inequality threshold value compared to tabling look-up, precisely higher, The scope of application is wider.
The step S3 includes
S301: converting two values matrix A for bianry image II, and the element value in the two values matrix A is equal in binary map As pixel point value identical with element position in two values matrix A in II;
S302: the element for establishing the label matrix A of two values matrix A in ', and will mark matrix A ' is initialized as 0;
S303: taking one 3 × 3 submatrix at the center of two values matrix A at random, by 3 × 3 submatrix and 3 × 3 unit Matrix carries out convolution, if taking another 3 × 3 submatrix at random at the center of two values matrix A when convolution value≤1;Until convolution value > 1, by 3 × 3 submatrix copy to label matrix A ' in 3 × 3 submatrix in two values matrix A identical position, enter Step S304;It is manually in two values matrix A central point attachment that the center in two values matrix A takes one 3 × 3 submatrix at random One 3 × 3 submatrix is taken at random, the unit matrix of 3 × 3 submatrix and 3 × 3 is then subjected to convolution, if convolution value > 1 Then, by 3 × 3 submatrix copy to label matrix A ' in 3 × 3 submatrix in two values matrix A identical position, Ke Yibao It demonstrate,proves the point that first current traversal place value is 1 obtained in the sub-step b of step S304 to be located in the domain of purple soil area, thus be avoided that Other the scattered sundries of purple soil discrete pieces or H threshold value between purple soil region upper limit threshold and lower threshold are to dry It disturbs, improves the precision for eliminating the isolated pixel region of bianry image II, and reduce expense.
S304: to label matrix A ' carries out spiral traversal;The spiral traverses
A. to mark matrix A ' central point as spiral traverse starting point, and using spiral traversal starting point as currently traverse position; Since when acquiring the color image containing purple soil region, the center that purple soil region is placed in camera lens being acquired, Then centainly belong to the purple soil region to be extracted positioned at the pixel of the color image center position containing purple soil region, with Mark matrix A ' central point be that spiral traverses starting point, avoid background area and other impurities to eliminating isolated pixel region It influences, improves the precision for eliminating the isolated pixel region of bianry image II, and reduce expense.
B. to label matrix A ' current traversal place value judges: if currently traversal place value is 0, enter step c;If current Traversing place value is 1, then uses in two values matrix A and the value of 8 connected domains of current traversal bit element, replacement are marking matrix A ' and should 8 connected domains identical element value in position in two values matrix A;Enter step c;
Whether c. judge mark matrix A ' spiral traversal terminates, if terminating, will mark matrix A ' it is converted into bianry image and obtains To bianry image III;If being not finished, d is entered step;
D. in label matrix A the central point of ' in, current to traverse position with step-length for 1, around label matrix A ' clockwise, It is moved to the next point of spiral traversal, enters step b.
In the present embodiment, judge mark matrix A ' spiral traversal whether terminate i.e. judge mark matrix A ' in element whether It was all traversed, if so, label matrix A ' spiral traversal terminates, if it is not, label matrix A ' spiral traversal is not finished.
By the above method, to mark the central point of matrix A to traverse starting point as spiral, it ensure that spiral traversal starting point in purple It in color soil region, is traversed by spiral way, reduces repetition traversal point, disperse around traverse path uniformly, subtract The small time overhead for eliminating isolated pixel region, eliminates the isolated area of bianry image II.
The isolated pixel region is the purple soil discrete pieces being mingled in background area or H threshold value on purple soil region Limit other scattered sundries between threshold value and lower threshold, for example, containing fertilising, attachment stalk, root system and other organisms and its The impurity of debris.
The step S4 includes
S401: converting two values matrix B for bianry image III, and the element value in the two values matrix B is equal in binary map The identical pixel point value of element position in picture III in two values matrix B;
S402: establishing size Matrix C identical with two values matrix B, and the element value for initializing two values matrix C is 0;It establishes Null set HS, for storing empty point;Null set SS is established, for storing search starting point;
S403: the point in search two values matrix B judges whether the point is boundary when searching element value a little is 1 Point, for example boundary point then will set 2 in the identical element value of two values matrix B location with the boundary point in Matrix C, until two-value square Point in battle array B has all been searched;
S404: skipping the point searched for, and the point in searching matrix C is 0 until searching element value a little, and the point The element value of left adjoint point and upper adjoint point is 2, and the point is not stored in set SS, using the point as search starting point, is entered Step S405;If not searching such point, S408 is entered step;
S405: it is 2 that in judgment matrix C, search starting point is left and right, whether upper and lower four direction has element value Point;Such point if it does not exist, then return step S404;Such point if it exists, then enter step S406;
In the present embodiment, in judgment matrix C, search starting point is left and right, whether upper and lower four direction has element value For 2 point, such point if it exists, then the point is located in the purple soil region to be extracted, reduces and finds the empty model put It encloses, improves precision, reduce expense;
In the present embodiment, the point of described left direction refers in Matrix C, is expert at and positioned at positioned at the left side of point All the points;The point of described right direction, refers in Matrix C, all the points positioned at the right for being expert at and being located at point;Institute The point for stating a little upper direction, refers in Matrix C, all the points positioned at column and positioned at the top of point;Direction under the point Point, refer in Matrix C, positioned at column and be located at point lower section all the points;
S406: by search starting point deposit set HS and set SS, and starting point will be searched for as current search point, entered Step S407;
S407: 4 connected domains of current search point are successively searched for according to the sequence of right adjoint point, lower adjoint point, left adjoint point, upper adjoint point Adjoint point, judge whether adjoint point value is 0 and whether the adjoint point is stored in set HS;
Once searching element goes out the adjoint point that existence value in adjoint point is 0 and is not stored in set HS, then stop to the 4 of current search point The search of other adjoint points of connected domain, and judge whether left and right, the upper and lower four direction of the adjoint point has element value for 2 Point;
If the point that it is in one direction 2 without element value that left and right, the upper and lower four direction of the adjoint point, which is at least deposited, is returned Return step S404;
If left and right, the upper and lower four direction of the adjoint point has the point that element value is 2, which is located to be extracted Purple soil region in, then the adjoint point is stored in set HS, and using the adjoint point as new current search point, return step S407;
If the adjoint point that value is 0 and is not stored in set HS is not present in the adjoint point of 4 connected domains of current search point, return Step S404;
S408: skipping the point searched for, in Matrix C, by right adjoint point, lower adjoint point, left adjoint point, upper adjoint point sequence successively The adjoint point for searching for 4 connected domains of the point (x, y) in HS set, judges whether adjoint point value is 0 and whether the adjoint point is stored in set HS In;
Once searching element to go out is 0 there are adjoint point value and the adjoint point is not stored in point (x, y) in set HS, then stopping is to currently searching The search of other adjoint points of 4 connected domains of rope point, and it regard the point (x, y) as current search point, enter step S407;
Adjoint point value is 0 if it does not exist and the adjoint point is not stored in the point (x, y) in set HS, then enters step S409;
S409: in Matrix C, by HS gather in each point in element corresponding in Matrix C set 1;
S410: setting 1 for the element that Matrix C intermediate value is 2, obtain updated Matrix C, Matrix C is converted into bianry image, Obtain bianry image IV.By the above method, the cavity in bianry image III is filled, so that the soil region to be divided It is more complete.
It is specific as follows that boundary point is judged whether it is in the step S403:
The unit matrix progress convolutional calculation for being connected to domain matrix and 3 × 3 for the 8 of the point for the boundary point of being judged whether it is, Indicate that the adjoint point is boundary point when convolution results are not 9, the convolutional calculation formula are as follows:
Wherein, Con (x, y) be a little 8 connection domain matrixs and 3 × 3 unit matrix convolution results B3×3(x, y) is two Position is 8 connection domain matrixs of the point of (x, y), E in value matrix B3×3For the unit matrix of 3 × 3 ranks.
In the present embodiment, the position is mutually all that the line number of position is identical with row number.
The effect of the application method is compared and illustrated by testing and calculating, specific as follows:
The method in traditional Chebyshev inequality acquisition threshold value extraction purple soil region is set as algorithm 1, by manual The P set is 0.95;
Method (the step 2) that adaptive segmentation threshold extraction purple soil region is obtained in the application is set as algorithm 2;
Method (the step 3) that the isolated pixel region of bianry image II is eliminated in the application is set as algorithm 3;
Method (the step 4) of filling cavity in the application is set as algorithm 4.
The acquisition of experimental image sample: acquired under certain field natural environment all types of distribution (including 4 belong to 34 soil Kind purple soil) purple soil color image, method is: going out the left side 0~20cm of topsoil with native spade spade under the natural environment of field Right purple soil, shooting the natural fracture surface image of its (cubsoil) without spade trace, (cubsoil can keep purple soil nature face to the maximum extent Color and original-state soil structure) 102, and artificial simple background image 60 opens, as the lab diagram for extracting purple soil area area image Decent.
Experimental situation: in Intel (R) Core (TM) i5 3370U CPU, 1.70GHz, in the PC machine of memory 8GB, Emulation experiment is carried out under 7 professional version of Windows, VC++2015 and OpenCV3.4 environment.
Experimental comparison group:
K mean algorithm, Otsu algorithm is respectively adopted, is split with this paper algorithm 1,2, and user's work segmentation result is made For canonical reference;Then, then divide obtained image with 3,4 pairs of algorithms 2 of its this paper algorithm to post-process, it is decent to lab diagram The result of this progress emulation experiment, acquisition is similar, randomly selects the experimental result of a wherein experimental image (as shown in Figure 7) (as shown in Fig. 8 to Figure 14) is analyzed.In the present embodiment, three classes are set as in the K mean value initial clustering of K mean algorithm.
Wherein, Fig. 7 is the gray level image for the experimental image not being split;
Fig. 8 is the gray level image in the purple soil region that experimental image is extracted by the segmentation of K mean algorithm;
Fig. 9 is the gray level image in the purple soil region that experimental image is extracted by the segmentation of Otsu algorithm;
Figure 10 is the gray level image in the purple soil region that experimental image is extracted by the segmentation of algorithm 1;
Figure 11 is the gray level image in the purple soil region that experimental image is extracted by the segmentation of algorithm 2;
Figure 12 is the gray level image in the purple soil region that Figure 11 is extracted by the segmentation of algorithm 3;
Figure 13 is the gray level image in the purple soil region that Figure 12 is extracted by the segmentation of algorithm 4;
Figure 14 is that Figure 12 passes through the gray level image for manually dividing the purple soil region of extraction.It is different grey into Figure 14 in Fig. 7 Degree represents different H component values, can not indicate the difference of H component value very well with binary map, therefore appended herein is grayscale image.
The segmentation effect and time cost of experimental image are as shown in table 1.
1 segmentation effect of table and time cost table
In table, Err is segmentation error, indicates the error and target true area of practical segmentation result and Standard Segmentation result Ratio, divide the calculation formula of error are as follows:
Wherein, NeFor using the soil region area obtained after image segmentation algorithm segmentation, NsRepresent standard soil area.
FPR is false positive rate, indicates the ratio that background pixel point is divided into target pixel points, and the formula of false positive rate is
Wherein, NeFor using the soil region area obtained after image segmentation algorithm segmentation, NsStandard soil area is represented,For NsSupplementary set, FPR is false positive rate.
FNR is false negative rate, indicates the ratio that target pixel points are divided into background pixel point, the calculation formula of FNR are as follows:
Wherein, NeFor using the soil region area obtained after image segmentation algorithm segmentation, NsRepresent standard soil area.
In the present embodiment, Err, FPR, FNR are calculated with (8) formula to (10) formula, artificial segmentation is selected to extract Purple soil region image as standard soil area.
The statistical framework that average time-consuming and time-consuming variance in table 1 is separation calculation 10 times.
Just segmentation result post-processes 3,4 pairs of this paper algorithms 1,2 of this paper algorithm, treatment effect and time cost such as table 2 It is shown:
The segmentation of table 2 post-processing effect and time cost table
Average time-consuming and time-consuming variance in table 2 is first to be extracted again with algorithm 4 to algorithm 1 or the segmentation of algorithm 2 with algorithm 3 The result of the image simulation experimental calculation 10 times statistics in purple soil region.
Experimental result is shown: as shown in Figure 8 and Figure 9, K mean algorithm and Otsu algorithm cannot effectively divide field complexity certainly The purple soil image shot under right environment, K mean algorithm and the average accidentally segmentation rate of Otsu algorithm respectively reach table 1 as the result is shown 44.59% and 34.54%.As shown in Figure 10 and Figure 11, and this paper algorithm 1 and algorithm 2 can effective Ground Split purple soil image, The segmentation precision of algorithm 1 is able to achieve by fiducial probability, the i.e. influence of the probability measure P in purple soil region, algorithm 2 is manually set Adaptivenon-uniform sampling, the purple soil area area image separated are more complete.Table 1 as the result is shown they it is average accidentally segmentation rate be respectively 15.76% and 10.97%, the segmentation precision of algorithm 2 is higher.
The results show that can be effectively in this paper algorithm 1 and algorithm 2 of Ground Split purple soil image, algorithm 1 be averaged table 1 Divide time-consuming 0.12s, the average segmentation time-consuming of algorithm 2 is 0.26s.Algorithm 2 time-consuming it is bigger, be because its algorithm 1 improvement in, It increases foundation and solves σTMathematical model the step of, solve adaptive fiducial probability, the i.e. probability measure in purple soil region P, and then the algorithm steps of adaptive segmentation threshold are obtained, to increase the time cost of algorithm.But due to algorithm 1 and algorithm The difference of 2 segmentation errors, the finishing time cost of first segmentation result is also different, and the time cost averagely post-processed is respectively 3.61s and 3.25s, see Table 2 for details, therefore the purple soil area area image precision that algorithm 2 is just partitioned into is high, reduce post-processing when Between cost.
Comprehensive Tables 1 and 2 experimental result data, the total time that this paper algorithm 2 is combined with algorithm 3 and algorithm 4 is less, segmentation The segmentation error for extracting purple soil area area image is reduced to 2.39%, can divide in high precision and extract purple soil area area image, This paper algorithm is more preferable compared to K mean algorithm, Otsu algorithm, 1 precision of algorithm, and time overhead is smaller.
Further, in the probability measure P for calculating purple soil region, the standard deviation using 3 × 3 small submatrixs is estimated, and soil is made The standard deviation of earth is opposite to assemble to 0 point, and the standard deviation of impurity is relatively distant from 0 point, increases the class of purple soil area region soil and impurity Between distance, be conducive to distinguish purple soil area region soil and impurity;By the soil and impurity of establishing model optimization purple soil region Class between and variance within clusters ratio, i.e. formula (5), (5-1), (5-2), (5-3), (5-4), (5-5), (5-6), (5-7), (5-8) (6) optimal P is obtained, to obtain optimal segmentation threshold T1And T2, realize based on the adaptive of image itself purple soil feature It should divide.Based on the fiducial probability that this is obtained, i.e. the probability measure P in purple soil region has stringent Fundamentals of Mathematics, and building is cut Than avenging husband's inequality adaptivenon-uniform sampling algorithm, the precision for being just partitioned into purple soil area area image can be promoted.
2 experimental result of table is shown: from the spiral shell of rejecting the background area isolated point and discrete small clod of image center Growth algorithm is revolved, i.e. the cavity in the purple soil region of algorithm 3 and the boundary point confirmation based on left and right, upper and lower four direction is filled out Algorithm, i.e. algorithm 4 are filled, segmentation extracts purple soil area area image precision dependent on first segmentation precision.
The simulation experiment result is shown: algorithm 2 is combined with algorithm 3 and algorithm 4, and segmentation extracts the mistake of purple soil area area image Point rate is reduced to 2.39%, and precision is higher, total time cost it is less.
Finally, it is stated that the above examples are only used to illustrate the technical scheme of the present invention and are not limiting, although referring to compared with Good embodiment describes the invention in detail, those skilled in the art should understand that, it can be to skill of the invention Art scheme is modified or replaced equivalently, and without departing from the objective and range of technical solution of the present invention, should all be covered at this In the scope of the claims of invention.

Claims (10)

1. a kind of based on the purple soil image extraction method cut than inequality H threshold value, it is characterised in that: including step
S1: obtaining the color image containing purple soil region, and it is empty to convert HSI color for the color image containing purple soil region Between image I;
S2: obtaining adaptive segmentation threshold, carries out adaptivenon-uniform sampling to image I, obtains bianry image II;
S3: the isolated pixel region of bianry image II is eliminated, bianry image III is obtained;
S4: the cavity in filling bianry image III obtains bianry image IV;
S5: seeking the Hadamard product of bianry image IV and the color image containing purple soil region, obtains only purple soil region Image.
2. according to claim 1 based on the purple soil image segmentation extracting method of Chebyshev inequality H threshold value, feature Be: the step S2 includes
S201: the Chebyshev inequality of the probability measure in the purple soil region of image I is established, according to the purple soil area of image I The Chebyshev inequality of the probability measure in domain determines the threshold value that adaptivenon-uniform sampling is carried out to image I;
S202: according to the threshold value for carrying out adaptivenon-uniform sampling to image I, the adjoint matrix of image I is updated, binary map is obtained As II.
3. according to claim 2 based on the purple soil image segmentation extracting method of Chebyshev inequality H threshold value, feature Be: the step S202 includes
S2021: matrix H is converted by image II, matrix HIMiddle each element value is equal in image I with each element in matrix HIIn The H component value of the identical pixel in position;
S2022: matrix H is establishedIAdjoint matrix H ', according to the update of the adjoint matrix H ' of image I rule to the adjoint of image I Matrix H ' element value be updated, obtain matrix I, matrix I be converted into bianry image, obtains bianry image II;
The update rule of the adjoint matrix H ' of described image I are as follows:
If T1≤H(x,y)≤T2, then H ' (x, y)=1 is set, if H (x, y) < T1Or H (x, y) > T2, then H ' (x, y)=0 is set;
Wherein, H (x, y) is matrix HIMiddle position is the element value of (x, y), and H ' (x, y) is that the middle position adjoint matrix H ' is (x, y) Element value, T1、T2Lower threshold, the upper limit threshold of adaptivenon-uniform sampling are respectively carried out to image I.
4. according to claim 3 based on the purple soil image segmentation extracting method of Chebyshev inequality H threshold value, feature Be: the Chebyshev inequality of the probability measure in the purple soil region of image I is in the step S201
Wherein, P is the probability measure in the purple soil region of image I, and μ indicates the mean value of the H component value of image I, and σ indicates image I H component value standard deviation, ε indicate Chebyshev inequality (1) segmentation threshold.
T is obtained according to (1) formula1、T2Calculation formula is
5. according to claim 4 based on the purple soil image segmentation extracting method of Chebyshev inequality H threshold value, feature It is: the calculation formula of the probability measure P in the purple soil region of image I in the step S201 are as follows:
Wherein, N3×3It is the total number of 3 × 3 small submatrixs, NsoilIt is the small submatrix number of the 1st class, σTTo make the 1st class submatrix and the 2nd The maximum standard deviation segmentation threshold of inter-class variance and variance within clusters ratio of the H component of class submatrix.
6. according to claim 5 based on the purple soil image segmentation extracting method of Chebyshev inequality H threshold value, feature It is: the σTBy establishing and solving σTMathematical model obtain, the σTMathematical model include objective function and constraint item Part,
So that the inter-class variance and variance within clusters ratio maximum of the H component of the 1st class submatrix and the 2nd class submatrix are as target letter Number, the objective function are
Wherein, BCV is the inter-class variance of the H component of the 1st class submatrix and the 2nd class submatrix;ICV is the 1st class submatrix and the 2nd class The variance within clusters of the H component of battle array;
The constraint condition is
σminT< σmax (6)
Wherein, wherein σminPoor, the σ for the minimum sandards in the region of interest standard deviation histogram of image ImaxSense for image I is emerging Maximum standard deviation in the histogram of interesting area's standard deviation.
7. according to claim 6 based on the purple soil image segmentation extracting method of Chebyshev inequality H threshold value, feature It is: determines σmin、σmax, the 1st class submatrix and the 2nd class submatrix comprising steps of
S2011: at the center of image I, the region of N number of M × M pixel is extracted, obtains the H component value in the region of each M × M pixel Mean value, and the region of the minimum and maximum M × M pixel of the mean value of rejecting H component value, by N-2 M × M pixel of reservation Region of interest of the region merging technique as image I, calculate the mean μ of the H component value of region of interest ';Wherein, N is 5 or 7, the N The region of a M × M pixel does not overlap each other, and the multiple that M is 3;
The region of interest of image I: being divided into the child window of several 3 × 3 pixels by S2012, and it is small as 3 × 3 to set the child window Submatrix;3 × 3 small submatrix is not overlapped between each other, and is paved with region of interest;
S2013: each 3 × 3 small submatrix is calculated for the standard deviation sigma of μ 'i, statistics obtains the histogram of region of interest standard deviation, logical It crosses to σiSize sequence is carried out, the minimum sandards difference σ in histogram is obtainedminWith maximum standard deviation σmax, wherein i is indicated i-th 3 × 3 small submatrixs;
S2014: σT3 × 3 small submatrixs are divided into the small submatrix of two classes, the i.e. small submatrix of the 1st class and the 2nd small submatrix of class, wherein the 1st class Small submatrix meets σi≤σT, the 2nd small submatrix of class meets σi> σT
S2015: BCV and ICV is obtained, (5) formula and (6) formula is brought into, can be obtained σT
8. according to claim 1 based on the purple soil image segmentation extracting method of Chebyshev inequality H threshold value, feature Be: the step S3 includes
S301: converting two values matrix A for bianry image II, and the element value in the two values matrix A is equal in bianry image II In pixel point value identical with element position in two values matrix A;
S302: the element for establishing the label matrix A of two values matrix A in ', and will mark matrix A ' is initialized as 0;
S303: taking one 3 × 3 submatrix at the center of two values matrix A at random, by 3 × 3 submatrix and 3 × 3 unit matrix Convolution is carried out, if taking another 3 × 3 submatrix at random at the center of two values matrix A when convolution value≤1;Until convolution value > 1, By 3 × 3 submatrix copy to label matrix A ' in 3 × 3 submatrix in two values matrix A identical position, enter step S304;
S304: to label matrix A ' carries out spiral traversal;The spiral traverses
A. to mark matrix A ' central point as spiral traverse starting point, and using spiral traversal starting point as currently traverse position;
B. to label matrix A ' current traversal place value judges: if currently traversal place value is 0, enter step c;If current traversal Place value is 1, then uses in two values matrix A and the currently value of 8 connected domains of traversal bit element, replacement is marking matrix A ' and 8 company Logical domain identical element value in position in two values matrix A;Enter step c;
Whether c. judge mark matrix A ' spiral traversal terminates, if terminating, will mark matrix A ' it is converted into bianry image and obtains two It is worth image III;If being not finished, d is entered step;
D. in label matrix A, the central point of ' in, current to traverse position with step-length for 1, around label matrix A ' is clockwise, mobile The next point traversed to spiral, enters step b.
9. according to claim 1 based on the purple soil image segmentation extracting method of Chebyshev inequality H threshold value, feature Be: the step S4 includes
S401: converting two values matrix B for bianry image III, and the element value in the two values matrix B is equal in bianry image III The identical pixel point value of element position in middle two values matrix B;
S402: establishing size Matrix C identical with two values matrix B, and the element value for initializing two values matrix C is 0;Establish empty set HS is closed, for storing empty point;Null set SS is established, for storing search starting point;
S403: the point in search two values matrix B judges whether the point is boundary point, such as when searching element value a little is 1 For boundary point, then 2 will be set in the identical element value of two values matrix B location with the boundary point in Matrix C, until in two values matrix B Point be all searched;
S404: skipping the point searched for, and the point in searching matrix C is 0 until searching element value a little, and the left neighbour of the point The element value of point and upper adjoint point is 2, and the point is not stored in set SS, using the point as search starting point, is entered step S405;If not searching such point, S408 is entered step;
S405: in judgment matrix C, search starting point is left and right, whether upper and lower four direction has the point that element value is 2;If There is no such point, then return step S404;Such point if it exists, then enter step S406;
S406: by search starting point deposit set HS and set SS, and starting point will be searched for as current search point, entered step S407;
S407: according to right adjoint point, lower adjoint point, left adjoint point, upper adjoint point sequence successively search for current search point 4 connected domains neighbour Point judges whether adjoint point value is 0 and whether the adjoint point is stored in set HS;
Once searching element goes out the adjoint point that existence value in adjoint point is 0 and is not stored in set HS, then stop 4 connections to current search point The search of other adjoint points in domain, and judge whether left and right, the upper and lower four direction of the adjoint point has element value for 2 point;
If the point that it is in one direction 2 without element value that left and right, the upper and lower four direction of the adjoint point, which is at least deposited, returns to step Rapid S404;
If left and right, the upper and lower four direction of the adjoint point has the point that element value is 2, which is stored in set HS, And using the adjoint point as new current search point, return step S407;
If the adjoint point that value is 0 and is not stored in set HS, return step is not present in the adjoint point of 4 connected domains of current search point S404;
S408: skipping the point searched for, and in Matrix C, successively searches for by the sequence of right adjoint point, lower adjoint point, left adjoint point, upper adjoint point The adjoint point of 4 connected domains of the point (x, y) in HS set, judges whether adjoint point value is 0 and whether the adjoint point is stored in set HS;
Once searching element, there are adjoint point values out for 0 and the adjoint point is not stored in the point (x, y) in set HS, then stop to current search point 4 connected domains other adjoint points search, and by the point (x, y) be used as current search point, enter step S407;
Adjoint point value is 0 if it does not exist and the adjoint point is not stored in the point (x, y) in set HS, then enters step S409;
S409: in Matrix C, by HS gather in each point in element corresponding in Matrix C set 1;
S410: the element that Matrix C intermediate value is 2 is set 1, updated Matrix C is obtained, Matrix C is converted into bianry image, is obtained Bianry image IV.
10. special according to claim 1 based on the purple soil image segmentation extracting method of Chebyshev inequality H threshold value Sign is: it is specific as follows to judge whether it is boundary point in the step S403:
The unit matrix progress convolutional calculation for being connected to domain matrix and 3 × 3 for the 8 of the point for the boundary point of being judged whether it is, works as volume Product result indicates that the adjoint point is boundary point when not being 9, convolution Con (x, the y) calculation formula are as follows:
Wherein, Con (x, y) be a little 8 connection domain matrixs and 3 × 3 unit matrix convolution results B3×3(x, y) is two-value square Position is 8 connection domain matrixs of the point of (x, y), E in battle array B3×3For the unit matrix of 3 × 3 ranks.
CN201810848438.3A 2018-07-27 2018-07-27 Purple soil image segmentation and extraction method based on Chebyshev inequality H threshold Active CN109035289B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810848438.3A CN109035289B (en) 2018-07-27 2018-07-27 Purple soil image segmentation and extraction method based on Chebyshev inequality H threshold

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810848438.3A CN109035289B (en) 2018-07-27 2018-07-27 Purple soil image segmentation and extraction method based on Chebyshev inequality H threshold

Publications (2)

Publication Number Publication Date
CN109035289A true CN109035289A (en) 2018-12-18
CN109035289B CN109035289B (en) 2021-11-12

Family

ID=64647461

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810848438.3A Active CN109035289B (en) 2018-07-27 2018-07-27 Purple soil image segmentation and extraction method based on Chebyshev inequality H threshold

Country Status (1)

Country Link
CN (1) CN109035289B (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110084820A (en) * 2019-03-30 2019-08-02 重庆师范大学 Purple soil image adaptive division and extracting method based on improved FCM algorithm
CN110490861A (en) * 2019-08-22 2019-11-22 石河子大学 A kind of recognition methods and system of the aphid on yellow plate
CN110827306A (en) * 2019-10-18 2020-02-21 重庆师范大学 Purple soil image segmentation and extraction method based on self-adaptive density peak value clustering
CN111292255A (en) * 2020-01-10 2020-06-16 电子科技大学 Filling and correcting technology based on RGB image
CN114332135A (en) * 2022-03-10 2022-04-12 之江实验室 Semi-supervised medical image segmentation method and device based on dual-model interactive learning
CN117314949A (en) * 2023-11-28 2023-12-29 山东远硕上池健康科技有限公司 Personnel injury detection and identification method based on artificial intelligence

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102628796A (en) * 2012-01-13 2012-08-08 首都师范大学 Automatic identification method of thermography sequence defect signals in ultrasonic infrared nondestructive test
CN103530893A (en) * 2013-10-25 2014-01-22 南京大学 Foreground detection method in camera shake scene based on background subtraction and motion information
CN105761260A (en) * 2016-02-15 2016-07-13 天津大学 Skin image affected part segmentation method
CN106198008A (en) * 2016-06-16 2016-12-07 温州大学 A kind of motor bearings outer ring fault identification method
CN106909937A (en) * 2017-02-09 2017-06-30 北京汽车集团有限公司 Traffic lights recognition methods, control method for vehicle, device and vehicle

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102628796A (en) * 2012-01-13 2012-08-08 首都师范大学 Automatic identification method of thermography sequence defect signals in ultrasonic infrared nondestructive test
CN103530893A (en) * 2013-10-25 2014-01-22 南京大学 Foreground detection method in camera shake scene based on background subtraction and motion information
CN105761260A (en) * 2016-02-15 2016-07-13 天津大学 Skin image affected part segmentation method
CN106198008A (en) * 2016-06-16 2016-12-07 温州大学 A kind of motor bearings outer ring fault identification method
CN106909937A (en) * 2017-02-09 2017-06-30 北京汽车集团有限公司 Traffic lights recognition methods, control method for vehicle, device and vehicle

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
刘想等: "基于X射线图像的输油管道焊缝缺陷检测与识别", 《中国优秀硕士学位论文全文数据库》 *
张琨等: "一种基于切比雪夫不等式的自适应阈值背景建模算法", 《计算机科学》 *

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110084820A (en) * 2019-03-30 2019-08-02 重庆师范大学 Purple soil image adaptive division and extracting method based on improved FCM algorithm
CN110084820B (en) * 2019-03-30 2023-05-26 重庆师范大学 Purple soil image self-adaptive segmentation extraction method based on improved FCM algorithm
CN110490861A (en) * 2019-08-22 2019-11-22 石河子大学 A kind of recognition methods and system of the aphid on yellow plate
CN110827306A (en) * 2019-10-18 2020-02-21 重庆师范大学 Purple soil image segmentation and extraction method based on self-adaptive density peak value clustering
CN110827306B (en) * 2019-10-18 2022-06-21 重庆师范大学 Purple soil image segmentation and extraction method based on self-adaptive density peak value clustering
CN111292255A (en) * 2020-01-10 2020-06-16 电子科技大学 Filling and correcting technology based on RGB image
CN114332135A (en) * 2022-03-10 2022-04-12 之江实验室 Semi-supervised medical image segmentation method and device based on dual-model interactive learning
CN114332135B (en) * 2022-03-10 2022-06-10 之江实验室 Semi-supervised medical image segmentation method and device based on dual-model interactive learning
CN117314949A (en) * 2023-11-28 2023-12-29 山东远硕上池健康科技有限公司 Personnel injury detection and identification method based on artificial intelligence
CN117314949B (en) * 2023-11-28 2024-02-20 山东远硕上池健康科技有限公司 Personnel injury detection and identification method based on artificial intelligence

Also Published As

Publication number Publication date
CN109035289B (en) 2021-11-12

Similar Documents

Publication Publication Date Title
CN109035289A (en) Purple soil image segmentation extracting method based on Chebyshev inequality H threshold value
WO2022160771A1 (en) Method for classifying hyperspectral images on basis of adaptive multi-scale feature extraction model
CN104598908B (en) A kind of crops leaf diseases recognition methods
CN105608692B (en) Polarization SAR image segmentation method based on deconvolution network and sparse classification
CN105718945B (en) Apple picking robot night image recognition method based on watershed and neural network
CN105608474B (en) Region adaptivity plant extraction method based on high resolution image
CN108460391B (en) Hyperspectral image unsupervised feature extraction method based on generation countermeasure network
CN107392130A (en) Classification of Multispectral Images method based on threshold adaptive and convolutional neural networks
CN107909015A (en) Hyperspectral image classification method based on convolutional neural networks and empty spectrum information fusion
CN106683102B (en) SAR image segmentation method based on ridge ripple filter and convolutional coding structure learning model
CN106611423B (en) SAR image segmentation method based on ridge ripple filter and deconvolution structural model
CN107832797B (en) Multispectral image classification method based on depth fusion residual error network
CN111340826A (en) Single tree crown segmentation algorithm for aerial image based on superpixels and topological features
CN109522929A (en) It is a kind of based on multi-source image fusion natural environment under wheat weeds recognition methods
CN107341813A (en) SAR image segmentation method based on structure learning and sketch characteristic inference network
CN111598045A (en) Remote sensing farmland change detection method based on object spectrum and mixed spectrum
CN105809194A (en) Method for translating SAR image into optical image
CN110807760A (en) Tobacco leaf grading method and system
CN108615229B (en) Collision detection optimization method based on curvature point clustering and decision tree
CN109785329A (en) Based on the purple soil image segmentation extracting method for improving SLIC algorithm
CN106997591A (en) A kind of super voxel dividing method of RGB D image mutative scales
CN107292328A (en) The remote sensing image shadow Detection extracting method and system of multiple dimensioned multiple features fusion
CN108154158A (en) A kind of building image partition method applied towards augmented reality
CN108961295A (en) Purple soil image segmentation extracting method based on normal distribution H threshold value
CN111882573A (en) Cultivated land plot extraction method and system based on high-resolution image data

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
GR01 Patent grant
GR01 Patent grant