CN109345536A - A kind of image superpixel dividing method and its device - Google Patents

A kind of image superpixel dividing method and its device Download PDF

Info

Publication number
CN109345536A
CN109345536A CN201810935803.4A CN201810935803A CN109345536A CN 109345536 A CN109345536 A CN 109345536A CN 201810935803 A CN201810935803 A CN 201810935803A CN 109345536 A CN109345536 A CN 109345536A
Authority
CN
China
Prior art keywords
pixel
super
seed
pixel block
block
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
CN201810935803.4A
Other languages
Chinese (zh)
Other versions
CN109345536B (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.)
Guangzhou Shiyuan Electronics Thecnology Co Ltd
Original Assignee
Guangzhou Shiyuan Electronics Thecnology Co Ltd
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 Guangzhou Shiyuan Electronics Thecnology Co Ltd filed Critical Guangzhou Shiyuan Electronics Thecnology Co Ltd
Priority to CN201810935803.4A priority Critical patent/CN109345536B/en
Publication of CN109345536A publication Critical patent/CN109345536A/en
Application granted granted Critical
Publication of CN109345536B publication Critical patent/CN109345536B/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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10024Color image

Abstract

The present invention relates to a kind of image superpixel dividing method and its devices.The described method includes: dividing multiple initial super-pixel block in the picture, each seed is numbered;Distance metric factor values of each pixel of image about each seed in the neighborhood of pixels are calculated, label of the number of the smallest seed of distance metric factor values as the pixel is selected;According to the label of each pixel, multiple super-pixel block are re-formed in the picture, determine sub-pixel coordinate and pixel value in each super-pixel block;Layback calculates step, carries out successive ignition.The embodiment of the present invention constructs super-pixel block in the way of searching for neighborhood super-pixel seed centered on pixel, the pixel or a pixel that only need be read image a line every time can realize the segmentation of super-pixel, and it is higher that slice type optimizes fine granularity, under the premise of ensureing super-pixel segmentation effect, it is beneficial to Project Realization.

Description

A kind of image superpixel dividing method and its device
Technical field
The invention belongs to digital image processing techniques fields, and in particular to a kind of image superpixel dividing method and its dress It sets.
Background technique
Super-pixel (superpixel) is a kind of Preprocessing Technique fast-developing in recent years, can be quick by image It is divided into a certain number of image regions (set of pixel).Compared to the basic unit in traditional treatment method --- as Element, super-pixel is more conducive to the extraction for having feature and the expression of structural information, and the meter of subsequent processing can be greatly lowered Complexity is calculated, is widely applied in computer vision field, especially image segmentation.
In computer vision field, digital picture is subdivided into multiple images subregion (set of pixel) (also referred to as Super-pixel).Wherein, super-pixel is adjacent by a series of positions and color, brightness, the similar pixel of Texture eigenvalue form it is small Region.These zonules remain the effective information of further progress image segmentation mostly, and will not generally destroy object in image The boundary information of body.Image segmentation the result is that the set of image sub-zones (entirety of these subregions covers entire figure Picture), or the set (such as edge detection) of contour line extracted from image.Each pixel in one sub-regions is at certain Under the measurement of characteristic or the characteristic by being calculated all is similar, such as color, brightness, texture.Neighboring region is at certain It is very different under the measurement of characteristic.
Super-pixel generating algorithm substantially mainly include watershed, mean shift, figure cut, k-means etc..Wherein, SLIC (simple linear iterative clustering) algorithm, i.e., simple linear iteraction clustering algorithm are based on k- A kind of thought of means is simple, realizes convenient algorithm, converts color image under CIELAB color space and XY coordinate Then 5 dimensional feature vectors construct distance metric to 5 dimensional feature vectors, the process of Local Clustering is carried out to image pixel. SLIC algorithm can generate compact, approaches uniformity super-pixel, and in arithmetic speed, contour of object is kept, super-pixel vpg connection has Have higher overall merit, be more conform with it is intended that segmentation effect.
As shown in Figure 1, existing image superpixel dividing method includes the following steps:
Step 1: the Pixel Dimensions to input are that W × H image initializes, and are divided into M × N number of super-pixel at equal intervals Block evenly distributes corresponding multiple seeds, using the pixel at the Geometric center coordinates of each super-pixel block as current super-pixel The initial seed of block.If the side length pixel number of super-pixel block is S pixel, super-pixel block number Num=W/S × H/S.
The pixel in each super-pixel block is numbered according to the M of initialization × N number of super-pixel block, is initialized to one Label image is opened, the number value of the super-pixel block is all set to corresponding to the label image value of the pixel in each super-pixel block.
Step 2: to the pixel in some contiguous range of each seed calculate the distance metric of the pixel and seed because Subvalue, the distance metric factor are weighting apart from propinquity and color similarity, be five dimensional vectors (x, y, l, a, B), (x, y) indicates that pixel coordinate, (l, a, b) indicate lab color space triple channel color value.
Distance metric factor calculation formula is as follows:
Wherein:
(xj, yj, lj, aj, bj) indicate the pixel coordinate and pixel value of currently processed pixel, (xi, yi, li, ai, bi) table Show sub-pixel coordinate and pixel value.dcIndicate color distance, dsRepresent space length, NsIt is maximum space distance in class, it is fixed Justice is Ns=S, maximum color distance NcBoth different and different with picture, it is also different and different with cluster, usually take a fixation (value range [1,40] generally takes and 10) replaces constant m.
Such as super-pixel block is having a size of S × S, then being set greater than the ruler of super-pixel block for the neighborhood of seed therein It is very little, contiguous range is generally set as 2S × 2S.In this way, a pixel may include in the neighborhood of multiple seeds, judgement is worked as The distance between pre-treatment pixel and current seed measure coefficient, if it is greater than the distance degree relative to another seed before The factor is measured, then does not change the label value of pixel;If the distance metric factor of another seed before being less than, by currently processed picture The label value of element is updated to the number of current seed.
Step 3: according to the label image of update, each super-pixel block centre coordinate and pixel mean value are recalculated, as New seed.
Step 4: iteration executes step 2,3.
Generally neatly compactly, neighborhood characteristics are easier to express the super-pixel that above-mentioned image superpixel dividing method generates, Cromogram can not only be divided, segmentation grayscale image can also be compatible with.But existing scheme does slice type optimization, seed, which updates, to be needed The information of a neighborhood is wanted, at least needs the pixel for reading in 3SxW or 3Sx3S that could ensure currently processed seed each time Corresponding super-pixel block is accurately updated, and needs bigger memory space to do slice type optimization.
Summary of the invention
In order to solve the excessive technical problem of required memory space, further increases image segmentation speed and optimize particulate Degree, the invention proposes a kind of image superpixel dividing method and its devices.Described image superpixel segmentation method, including it is following Step:
Super-pixel block seed initialization step: dividing multiple super-pixel block in the picture, is arranged in each super-pixel block One seed, is numbered each seed;
Distance calculates step: calculating the distance metric factor of each pixel of image about each seed in the neighborhood of pixels Value, the size of super-pixel block where the neighborhood size of each pixel is greater than the pixel;
Pixel tag setting procedure: for each pixel, select the number of the smallest seed of distance metric factor values as The label of the pixel;
Seed updates step: according to the label of each pixel, re-forming multiple super-pixel block in the picture, redefines Sub-pixel coordinate and pixel value (x in each super-pixel blockk,yk,lk,ak,bk);
Iteration return step: layback calculates step, the number of iterations or sub-pixel coordinate until reaching setting And pixel value is no longer changed.
Further, in super-pixel block seed initialization step, multiple super-pixel are evenly dividing with step-length S in the picture Block.
Further, it is calculated in step in distance, distance metric factor calculation formula is as follows:
Dist=Dlab+k*Dxy
Wherein:
Dlab=abs (li-lk)+abs(ai-ak)+abs(bi-bk)
Dxy=abs (xi-xk)+abs(yi-yk)
(xi,yi,li,ai,bi) indicate the pixel coordinate and pixel value of currently processed pixel, DlabIndicate color distance, DxyRepresent space length;K is proportionality coefficient, value in the range of 1/A~20/A, and A is the super picture where currently processed pixel Plain block size.
Further, it is calculated in step in distance, calculates the seed in each pixel of image and the super-pixel block where it And the distance between seed in the adjacent each super-pixel block of super-pixel block where it measure coefficient.
Further, the quantity of the adjacent each super-pixel block of the super-pixel block where it is 4 or 9.
Further, it is updated in step in seed, the pixel at the Geometric center coordinates of each super-pixel block is determined as this The seed of super-pixel block.
Further, the number of iterations is no less than 5 times.
Further, for each initial super-pixel block having a size of S × S, current pixel neighborhood size is at least 2S × 2S.
Further, it is updated in step in seed, the pixel at the Geometric center coordinates of each super-pixel block is determined as this The seed of super-pixel block.
The embodiment of the present invention also provides a kind of image superpixel segmenting device, comprising:
Super-pixel block seed initialization module: multiple initial super-pixel block are divided in the picture, in each super-pixel block One seed is set, each seed is numbered;
Distance calculation module: the distance metric factor of each pixel of image about each seed in the neighborhood of pixels is calculated Value, the size of super-pixel block where the neighborhood size of each pixel is greater than the pixel;
Pixel tag setting module: label of the number of the smallest seed of distance metric factor values as the pixel is selected;
Seed update module: according to the label of each pixel, re-forming multiple super-pixel block in the picture, determines each Sub-pixel coordinate and pixel value (x in super-pixel blockk,yk,lk,ak,bk);
Iteration return module: so that repeatedly being calculated apart from calculating unit iteration.
The embodiment of the present invention also proposes a kind of computer readable storage medium, is stored thereon with computer program, the calculating The step of above method is realized when machine program is executed by processor.
The embodiment of the present invention also proposes a kind of computer equipment, including memory, processor and storage are on a memory simultaneously The step of computer program that can be run on a processor, the processor realizes the above method when executing described program.
Beneficial effects of the present invention: the embodiment of the present invention propose image superpixel dividing method and its device, use with The mode that neighborhood super-pixel seed is searched for centered on pixel constructs super-pixel block, adjacent instead of being searched for centered on super-pixel block seed Domain pixel constructs the mode of super-pixel block, and the pixel or a pixel for only needing be read image a line every time can be realized super The segmentation of pixel, and slice type optimization fine granularity is higher, under the premise of ensureing super-pixel segmentation effect, is beneficial to engineering reality It is existing.
Detailed description of the invention
Fig. 1 is the image superpixel segmentation schematic diagram of the prior art;
Fig. 2 is the image superpixel segmentation schematic diagram of the embodiment of the present invention;
Fig. 3 is the image superpixel dividing method flow chart of the embodiment of the present invention;
Fig. 4 is the image superpixel dividing method flow chart of the preferred embodiment of the present invention;
Fig. 5 is the block diagram of the image superpixel segmenting device of the embodiment of the present invention.
Specific embodiment
To make the objectives, technical solutions, and advantages of the present invention clearer, below in conjunction with specific embodiment, and reference Attached drawing, the present invention is described in more detail.But as known to those skilled in the art, the invention is not limited to attached drawings and following reality Apply example.
As shown in Figure 2,3, the embodiment of the present invention proposes a kind of image superpixel dividing method, and use is centered on pixel It searches for neighborhood super-pixel seed and constructs super-pixel block, instead of searching for neighborhood territory pixel centered on super-pixel block seed in the prior art Construct super-pixel block, comprising the following steps:
Super-pixel block seed initialization step: multiple initial super-pixel block are divided in the picture, in each super-pixel block One seed is set, each seed is numbered.
According to picture size, the number of super-pixel block is set, seed is evenly distributed in image, and carry out to each seed Number.By this step, it is formed uniformly multiple initial super-pixel block in the picture.
For example, image includes N number of pixel, pre-segmentation is the initial super-pixel block of K identical sizes, each block of pixels In be provided with a seed, K seed is numbered from 1 to K.The size of each initial super-pixel block is N/K, then adjacent kind The distance (step-length S) of son is S=sqrt (N/K), that is, the size of each initial super-pixel block is S × S.
Distance calculates step: calculating the distance metric factor of each pixel of image about each seed in the neighborhood of pixels Value, the size of super-pixel block where the neighborhood size of each pixel is greater than the pixel.
Specifically, the distance metric factor is the weighting apart from propinquity and color similarity, it is five dimensional vectors (x, y, l, a, b), (x, y) indicate that pixel coordinate, (l, a, b) indicate lab color space triple channel color value.
Distance metric factor calculation formula is as follows:
Dist=Dlab+k*Dxy
Wherein:
Dlab=abs (li-lk)+abs(ai-ak)+abs(bi-bk)
Dxy=abs (xi-xk)+abs(yi-yk)
(xi,yi,li,ai,bi) indicate the pixel coordinate and pixel value of currently processed pixel, (xk,yk,lk,ak,bk) table Show sub-pixel coordinate and pixel value.DlabIndicate color distance, DxyRepresent space length, k is proportionality coefficient, 1/A~ Value in the range of 20/A, A are the super-pixel block size where currently processed pixel.
Each initial super-pixel block is having a size of S × S, then being set greater than the pixel institute for the neighborhood of pixel therein In the size of super-pixel block, contiguous range can be set as at least 2S × 2S.In this way, the neighborhood of a pixel may include more A seed can calculate distance degree of the pixel about multiple seeds in its neighborhood for each pixel in this step Measure factor values.
But above-mentioned neighborhood choice method may cause the subsequent seed point redefined and drift about, in order to solve this Problem, preferred embodiment of the embodiment of the present invention be calculate image each pixel and its where super-pixel block seed and its The distance between each seed in the adjacent multiple super-pixel block of the super-pixel block at place measure coefficient, wherein described where it The quantity of the adjacent multiple super-pixel block of super-pixel block can be 4 or 9, and the selection to adjacent multiple super-pixel block It is arbitrary, without enforceable requirement.
Pixel tag setting procedure: in distance metric factor values of each pixel about each seed in the neighborhood of pixels In calculated result, label of the number of the smallest seed of distance metric factor values as the pixel is selected.
If in the neighborhood of some pixel, there are four seeds 1,2,3,5, distance metric of the pixel about four seeds Factor values are Dist1, Dist2, Dist3 and Dist5, and minimum value therein is Dist3, then the label of the pixel is Dist3 The number 3 of corresponding seed 3.
Seed updates step: according to the label of pixel each in image, re-forming multiple super-pixel block, determines each super Sub-pixel coordinate and pixel value (x in block of pixelsk,yk,lk,ak,bk)。
Specifically, calculating the gradient value of all pixels point in each super-pixel block, seed is moved on in the super-pixel block The smallest pixel of gradient.The purpose for the arrangement is that in order to avoid seed point is fallen in the biggish profile and border of gradient, in order to avoid influence Subsequent Clustering Effect.
In order to further prevent seed to drift about, the present embodiment is preferably used the Geometric center coordinates of each super-pixel block The pixel at place be the super-pixel block seed, that is, calculate the abscissa of all pixels in the super-pixel block average value and The average value of the ordinate of all pixels, the pixel coordinate as identified seed.This method is simple and easy, in conjunction with this hair The neighborhood choice method and distance metric factor value-based algorithm of bright embodiment, can obtain good display effect.
Iteration return step: layback calculates step, and the number of iterations is typically no less than 5 times.
Layback calculates the continuous iteration of step and makes error convergence, that is, until seed is no longer changed, it is preferred that By 10 iteration, more satisfactory effect can be obtained to most pictures.
In the foregoing description, the overall description image superpixel dividing method of the embodiment of the present invention, even if to pixel Centered on search for the mode of neighborhood super-pixel seed and construct super-pixel block, instead of in the prior art centered on super-pixel block seed Search for the mode of neighborhood territory pixel building super-pixel block.But for specific means used by wherein each step there are many selection, Different segmentation effects is had using different neighborhood choice methods and distance metric factor value-based algorithm etc..Hereinafter, referring to Fig. 4 pairs The image superpixel dividing method of the preferred embodiment of the present invention is illustrated, comprising the following steps:
Super-pixel block seed initialization step: multiple initial super-pixel block are evenly dividing with step-length in the picture, each One seed is set in super-pixel block, each seed is numbered, so that being formed uniformly in image latticed multiple initial Super-pixel block.
Specifically, image includes N number of pixel, pre-segmentation is the initial super-pixel block of K identical sizes, each pixel It is provided with a seed in block, K seed is numbered from 1 to K.The size of each initial super-pixel block is N/K, then adjacent The distance (step-length) of seed is S=sqrt (N/K), that is, the size of each initial super-pixel block is S × S.
Distance calculates step: calculating each pixel of image and the seed of the super-pixel block where it and surpassing where it The distance between each seed in the adjacent multiple super-pixel block of block of pixels measure coefficient, wherein the super-pixel block where it The quantity of adjacent multiple super-pixel block can be 4 or 9.
Specifically, the distance metric factor is the weighting apart from propinquity and color similarity, it is five dimensional vectors (x, y, l, a, b), (x, y) indicate that pixel coordinate, (l, a, b) indicate lab color space triple channel color value.
Distance metric factor calculation formula is as follows:
Dist=Dlab+k*Dxy
Wherein:
Dlab=abs (li-lk)+abs(ai-ak)+abs(bi-bk)
Dxy=abs (xi-xk)+abs(yi-yk)
(xi,yi,li,ai,bi) indicate the pixel coordinate and pixel value of currently processed pixel, (xk,yk,lk,ak,bk) table Show sub-pixel coordinate and pixel value.DlabIndicate color distance, DxyRepresent space length, k is proportionality coefficient, 1/A~ Value in the range of 20/A, A are the super-pixel block size where currently processed pixel.
Pixel tag setting procedure: in distance metric factor values of each pixel about each seed in the neighborhood of pixels In calculated result, label of the number of the smallest seed of distance metric factor values as the pixel is selected.
If there are five seeds 1,2,3,5,7 in the neighborhood of some pixel, wherein seed 1 is super where current pixel Seed in block of pixels, seed 2,3,5,7 are the seed in the adjacent super-pixel block of super-pixel block where current pixel, the picture Element is Dist1, Dist2, Dist3, Dist5 and Dist7 about the distance metric factor values of five seeds, and minimum value therein is Dist3, then the label of the pixel is the number 3 of the corresponding seed 3 of Dist3.
Seed updates step: according to the label of pixel each in image, re-forming multiple super-pixel block, determines each super Pixel at the Geometric center coordinates of block of pixels is the seed of the super-pixel block, obtains sub-pixel coordinate and pixel value (xk,yk, lk,ak,bk)。
Iteration return step: layback calculates step, by 10 iteration, to most pictures can obtain compared with Ideal effect.
Image superpixel dividing method in the preferred embodiment of the present invention calculates simple, image data needed for single calculation Few, system resource occupies less, and the pixel or a pixel for only needing be read image a line every time can realize super-pixel Segmentation, and slice type optimization fine granularity is higher, under the premise of ensureing super-pixel segmentation effect, is beneficial to Project Realization.
The present invention also provides a kind of image superpixel segmenting device, neighborhood super-pixel seed is searched in use centered on pixel Super-pixel block is constructed, constructs super-pixel block instead of searching for neighborhood territory pixel centered on super-pixel block seed in the prior art, referring to Fig. 5, comprising:
Super-pixel block seed initialization component: multiple initial super-pixel block are divided in the picture, in each super-pixel block One seed is set, each seed is numbered.
According to picture size, the number of super-pixel block is set, seed is evenly distributed in image, and carry out to each seed Number.It is formed uniformly multiple initial super-pixel block in the picture as a result,.
For example, image includes N number of pixel, pre-segmentation is the initial super-pixel block of K identical sizes, each block of pixels In be provided with a seed, K seed is numbered from 1 to K.The size of each initial super-pixel block is N/K, then adjacent kind The distance (step-length) of son is S=sqrt (N/K), that is, the size of each initial super-pixel block is S × S.
Apart from calculating unit: calculating the distance metric factor of each pixel of image about each seed in the neighborhood of pixels Value, the size of super-pixel block where the neighborhood size of each pixel is greater than the pixel.
Specifically, the distance metric factor is the weighting apart from propinquity and color similarity, it is five dimensional vectors (x, y, l, a, b), (x, y) indicate that pixel coordinate, (l, a, b) indicate lab color space triple channel color value.
Distance metric factor calculation formula is as follows:
Dist=Dlab+k*Dxy
Wherein:
Dlab=abs (li-lk)+abs(ai-ak)+abs(bi-bk)
Dxy=abs (xi-xk)+abs(yi-yk)
(xi,yi,li,ai,bi) indicate the pixel coordinate and pixel value of currently processed pixel, (xk,yk,lk,ak,bk) table Show sub-pixel coordinate and pixel value.DlabIndicate color distance, DxyRepresent space length, k is proportionality coefficient, 1/A~ Value in the range of 20/A, A are the super-pixel block size where currently processed pixel.
Each initial super-pixel block is having a size of S × S, then being set greater than the pixel institute for the neighborhood of pixel therein In the size of super-pixel block, contiguous range can be set as at least 2S × 2S.In this way, the neighborhood of a pixel may include more A seed, so as to calculate the distance metric factor of the pixel about multiple seeds in its neighborhood for each pixel Value.
But above-mentioned neighborhood choice method may cause the subsequent seed point redefined and drift about, in order to solve this Problem, preferred embodiment of the embodiment of the present invention be calculate image each pixel and its where super-pixel block seed and its The distance between each seed in the adjacent multiple super-pixel block of the super-pixel block at place measure coefficient, wherein described where it The quantity of the adjacent multiple super-pixel block of super-pixel block can be 4 or 9, and the selection to adjacent multiple super-pixel block It is arbitrary, without enforceable requirement.
Pixel tag set parts: in distance metric factor values of each pixel about each seed in the neighborhood of pixels In calculated result, label of the number of the smallest seed of distance metric factor values as the pixel is selected.
If in the neighborhood of some pixel, there are four seeds 1,2,3,5, distance metric of the pixel about four seeds Factor values are Dist1, Dist2, Dist3 and Dist5, and minimum value therein is Dist3, then the label of the pixel is Dist3 The number 3 of corresponding seed 3.
Seed updates component: according to the label of pixel each in image, re-forming multiple super-pixel block, determines each super Sub-pixel coordinate and pixel value (x in block of pixelsk,yk,lk,ak,bk)。
Specifically, calculating the gradient value of all pixels point in each super-pixel block, seed is moved on in the super-pixel block The smallest pixel of gradient.The purpose for the arrangement is that in order to avoid seed point is fallen in the biggish profile and border of gradient, in order to avoid influence Subsequent Clustering Effect.
In order to further prevent seed to drift about, the present embodiment is preferably used the Geometric center coordinates of each super-pixel block The pixel at place be the super-pixel block seed, that is, calculate the abscissa of all pixels in the super-pixel block average value and The average value of the ordinate of all pixels, the pixel coordinate as identified seed.This method is simple and easy, in conjunction with this hair The neighborhood choice method and distance metric factor value-based algorithm of bright embodiment, can obtain good display effect.
Iteration Returning part: so that being calculated apart from calculating unit iteration, the number of iterations is typically no less than 5 times.
Make error convergence apart from the continuous iteration of calculating unit, that is, until seed is no longer changed, it is preferred that pass through 10 iteration can obtain more satisfactory effect to most pictures.
In the foregoing description, the overall description image superpixel segmenting device of the embodiment of the present invention, even if to pixel Centered on search neighborhood super-pixel seed construct super-pixel block, searched for centered on super-pixel block seed instead of in the prior art adjacent Domain pixel constructs super-pixel block.But for specific means used by wherein each component, there are many selections, using different neighbours Area selecting method and distance metric factor value-based algorithm etc. have different segmentation effects.Hereinafter, to the preferred embodiment of the present invention Image superpixel segmenting device is illustrated, and described device includes:
Super-pixel block seed initialization component: multiple initial super-pixel block are evenly dividing with step-length in the picture, each One seed is set in super-pixel block, each seed is numbered.So that being formed uniformly in image latticed multiple initial Super-pixel block.
Specifically, image includes N number of pixel, pre-segmentation is the initial super-pixel block of K identical sizes, each pixel It is provided with a seed in block, K seed is numbered from 1 to K.The size of each initial super-pixel block is N/K, then adjacent The distance (step-length) of seed is S=sqrt (N/K), that is, the size of each initial super-pixel block is S × S.
Apart from calculating unit: calculating each pixel of image and the seed of the super-pixel block where it and surpassing where it The distance between each seed in the adjacent multiple super-pixel block of block of pixels measure coefficient, wherein the super-pixel block where it The quantity of adjacent multiple super-pixel block can be 4 or 9.
Specifically, the distance metric factor is the weighting apart from propinquity and color similarity, it is five dimensional vectors (x, y, l, a, b), (x, y) indicate that pixel coordinate, (l, a, b) indicate lab color space triple channel color value.
Distance metric factor calculation formula is as follows:
Dist=Dlab+k*Dxy
Wherein:
Dlab=abs (li-lk)+abs(ai-ak)+abs(bi-bk)
Dxy=abs (xi-xk)+abs(yi-yk)
(xi,yi,li,ai,bi) indicate the pixel coordinate and pixel value of currently processed pixel, (xk,yk,lk,ak,bk) table Show sub-pixel coordinate and pixel value.DlabIndicate color distance, DxyRepresent space length, k is proportionality coefficient, 1/A~ Value in the range of 20/A, A are the super-pixel block size where currently processed pixel.
Pixel tag set parts: in distance metric factor values of each pixel about each seed in the neighborhood of pixels In calculated result, label of the number of the smallest seed of distance metric factor values as the pixel is selected.
If there are five seeds 1,2,3,5,7 in the neighborhood of some pixel, wherein seed 1 is super where current pixel Seed in block of pixels, seed 2,3,5,7 are the seed in the adjacent super-pixel block of super-pixel block where current pixel, the picture Element is Dist1, Dist2, Dist3, Dist5 and Dist7 about the distance metric factor values of five seeds, and minimum value therein is Dist3, then the label of the pixel is the number 3 of the corresponding seed 3 of Dist3.
Seed updates component: according to the label of pixel each in image, re-forming multiple super-pixel block, determines each super Pixel at the Geometric center coordinates of block of pixels is the seed of the super-pixel block, obtains sub-pixel coordinate and pixel value (xk,yk, lk,ak,bk)。
Iteration Returning part: so that being calculated apart from calculating unit iteration, by 10 iteration, to most pictures It can obtain more satisfactory effect.
Image superpixel segmenting device in the preferred embodiment of the present invention calculates simple, image data needed for single calculation Few, system resource occupies less, and the pixel or a pixel for only needing be read image a line every time can realize super-pixel Segmentation, and slice type optimization fine granularity is higher, under the premise of ensureing super-pixel segmentation effect, is beneficial to Project Realization.
The embodiment of the present invention also proposes a kind of computer readable storage medium, is stored thereon with computer program, the calculating The step of above method is realized when machine program is executed by processor.
The embodiment of the present invention also proposes a kind of computer equipment, including memory, processor and storage are on a memory simultaneously The step of computer program that can be run on a processor, the processor realizes the above method when executing described program.
It will be understood by those skilled in the art that in flow charts indicate or logic described otherwise above herein and/or Step may be embodied in and appoint for example, being considered the order list of the executable instruction for realizing logic function In what computer-readable medium, for instruction execution system, device or equipment (such as computer based system including processor System or other can be from instruction execution system, device or equipment instruction fetch and the system executed instruction) use, or combine this A little instruction execution systems, device or equipment and use.For the purpose of this specification, " computer-readable medium " can be it is any can be with Include, store, communicate, propagate, or transport program is for instruction execution system, device or equipment or in conjunction with these instruction execution systems System, device or equipment and the device used.
The more specific example (non-exhaustive list) of computer-readable medium include the following: there are one or more wirings Electrical connection section (electronic device), portable computer diskette box (magnetic device), random access memory (RAM), read-only memory (ROM), erasable edit read-only storage (EPROM or flash memory), fiber device and portable optic disk is read-only deposits Reservoir (CDROM).In addition, computer-readable medium can even is that the paper that can print described program on it or other are suitable Medium, because can then be edited, be interpreted or when necessary with it for example by carrying out optical scanner to paper or other media His suitable method is handled electronically to obtain described program, is then stored in computer storage.
It should be appreciated that each section of the invention can be realized with hardware, software, firmware or their combination.Above-mentioned In embodiment, software that multiple steps or method can be executed in memory and by suitable instruction execution system with storage Or firmware is realized.It, and in another embodiment, can be under well known in the art for example, if realized with hardware Any one of column technology or their combination are realized: having a logic gates for realizing logic function to data-signal Discrete logic, with suitable combinational logic gate circuit specific integrated circuit, programmable gate array (PGA), scene Programmable gate array (FPGA) etc..
In the description of this specification, reference term " one embodiment ", " some embodiments ", " example ", " specifically show The description of example " or " some examples " etc. means specific features, structure, material or spy described in conjunction with this embodiment or example Point is included at least one embodiment or example of the invention.In the present specification, schematic expression of the above terms are not Centainly refer to identical embodiment or example.Moreover, particular features, structures, materials, or characteristics described can be any One or more embodiment or examples in can be combined in any suitable manner.
More than, embodiments of the present invention are illustrated.But the present invention is not limited to above embodiment.It is all Within the spirit and principles in the present invention, any modification, equivalent substitution, improvement and etc. done should be included in guarantor of the invention Within the scope of shield.

Claims (10)

1. a kind of image superpixel dividing method, which comprises the following steps:
Super-pixel block seed initialization step: dividing multiple super-pixel block in the picture, and one is arranged in each super-pixel block Each seed is numbered in seed;
Distance calculates step: distance metric factor values of each pixel of image about each seed in the neighborhood of pixels are calculated, The size of super-pixel block where the neighborhood size of each pixel is greater than the pixel;
Pixel tag setting procedure: for each pixel, select the number of the smallest seed of distance metric factor values as the picture The label of element;
Seed updates step: according to the label of each pixel, re-forming multiple super-pixel block in the picture, redefines each Sub-pixel coordinate and pixel value (x in super-pixel blockk,yk,lk,ak,bk);
Iteration return step: layback calculates step, the number of iterations or sub-pixel coordinate and picture until reaching setting Plain value is no longer changed.
2. image superpixel dividing method as described in claim 1, which is characterized in that in super-pixel block seed initialization step In, multiple super-pixel block are evenly dividing with step-length S in the picture.
3. image superpixel dividing method as claimed in claim 2, which is characterized in that calculated in step in distance, apart from degree It is as follows to measure factor calculation formula:
Dist=Dlab+k*Dxy
Wherein:
Dlab=abs (li-lk)+abs(ai-ak)+abs(bi-bk)
Dxy=abs (xi-xk)+abs(yi-yk)
(xi,yi,li,ai,bi) indicate the pixel coordinate and pixel value of currently processed pixel, DlabIndicate color distance, DxyIt represents Space length;K is proportionality coefficient, value in the range of 1/A~20/A, and A is the super-pixel block ruler where currently processed pixel It is very little.
4. the image superpixel dividing method as described in one of claim 1-3, which is characterized in that it is calculated in step in distance, Calculate image each pixel it is adjacent with the seed in the super-pixel block where it and the super-pixel block where it is each surpass The distance between seed in block of pixels measure coefficient.
5. image superpixel dividing method as claimed in claim 4, which is characterized in that the super-pixel block where it is adjacent The quantity of each super-pixel block be 4 or 9.
6. image superpixel dividing method as claimed in claim 5, which is characterized in that it is updated in step in seed, it will be each Pixel at the Geometric center coordinates of super-pixel block is determined as the seed of the super-pixel block.
7. image superpixel dividing method as claimed in claim 6, which is characterized in that the number of iterations is no less than 5 times.
8. image superpixel dividing method as claimed in claim 2, which is characterized in that each initial super-pixel block is having a size of S × S, current pixel neighborhood size are at least 2S × 2S.
9. image superpixel dividing method as claimed in claim 8, which is characterized in that it is updated in step in seed, it will be each Pixel at the Geometric center coordinates of super-pixel block is determined as the seed of the super-pixel block.
10. a kind of image superpixel segmenting device characterized by comprising
Super-pixel block seed initialization module: multiple initial super-pixel block are divided in the picture, are arranged in each super-pixel block One seed, is numbered each seed;
Distance calculation module: calculating distance metric factor values of each pixel of image about each seed in the neighborhood of pixels, The size of super-pixel block where the neighborhood size of each pixel is greater than the pixel;
Pixel tag setting module: label of the number of the smallest seed of distance metric factor values as the pixel is selected;
Seed update module: according to the label of each pixel, re-forming multiple super-pixel block in the picture, determines each super picture Sub-pixel coordinate and pixel value (x in plain blockk,yk,lk,ak,bk);
Iteration return module: so that repeatedly being calculated apart from calculating unit iteration.
CN201810935803.4A 2018-08-16 2018-08-16 Image super-pixel segmentation method and device Active CN109345536B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810935803.4A CN109345536B (en) 2018-08-16 2018-08-16 Image super-pixel segmentation method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810935803.4A CN109345536B (en) 2018-08-16 2018-08-16 Image super-pixel segmentation method and device

Publications (2)

Publication Number Publication Date
CN109345536A true CN109345536A (en) 2019-02-15
CN109345536B CN109345536B (en) 2021-02-09

Family

ID=65296847

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810935803.4A Active CN109345536B (en) 2018-08-16 2018-08-16 Image super-pixel segmentation method and device

Country Status (1)

Country Link
CN (1) CN109345536B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109977767A (en) * 2019-02-18 2019-07-05 浙江大华技术股份有限公司 Object detection method, device and storage device based on super-pixel segmentation algorithm
CN110096961A (en) * 2019-04-04 2019-08-06 北京工业大学 A kind of indoor scene semanteme marking method of super-pixel rank
CN111291811A (en) * 2020-02-07 2020-06-16 京东数字科技控股有限公司 Region dividing and classifying method, device and computer readable storage medium
CN112164087A (en) * 2020-10-13 2021-01-01 北京无线电测量研究所 Super-pixel segmentation method and device based on edge constraint and segmentation boundary search

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140056518A1 (en) * 2012-08-22 2014-02-27 Canon Kabushiki Kaisha Image processing apparatus, image processing method, and program
CN104143186A (en) * 2014-07-04 2014-11-12 华南理工大学 SLIC super-pixel block optimizing method
CN105138970A (en) * 2015-08-03 2015-12-09 西安电子科技大学 Spatial information-based polarization SAR image classification method
CN106778635A (en) * 2016-12-19 2017-05-31 江苏慧眼数据科技股份有限公司 A kind of human region detection method of view-based access control model conspicuousness
CN107016684A (en) * 2017-04-13 2017-08-04 中国人民解放军国防科学技术大学 A kind of super-pixel rapid generation of Polarimetric SAR Image

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140056518A1 (en) * 2012-08-22 2014-02-27 Canon Kabushiki Kaisha Image processing apparatus, image processing method, and program
CN104143186A (en) * 2014-07-04 2014-11-12 华南理工大学 SLIC super-pixel block optimizing method
CN105138970A (en) * 2015-08-03 2015-12-09 西安电子科技大学 Spatial information-based polarization SAR image classification method
CN106778635A (en) * 2016-12-19 2017-05-31 江苏慧眼数据科技股份有限公司 A kind of human region detection method of view-based access control model conspicuousness
CN107016684A (en) * 2017-04-13 2017-08-04 中国人民解放军国防科学技术大学 A kind of super-pixel rapid generation of Polarimetric SAR Image

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
RADHAKRISHNA ACHANTA等: "SLIC Superpixels Compared to State-of-the-art Superpixel Method", 《IEEE TRANSACTIONS ON PATTERN ANALYSIS AND MACHINE INTELLIGENCE》 *

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109977767A (en) * 2019-02-18 2019-07-05 浙江大华技术股份有限公司 Object detection method, device and storage device based on super-pixel segmentation algorithm
CN110096961A (en) * 2019-04-04 2019-08-06 北京工业大学 A kind of indoor scene semanteme marking method of super-pixel rank
CN110096961B (en) * 2019-04-04 2021-03-02 北京工业大学 Indoor scene semantic annotation method at super-pixel level
CN111291811A (en) * 2020-02-07 2020-06-16 京东数字科技控股有限公司 Region dividing and classifying method, device and computer readable storage medium
CN111291811B (en) * 2020-02-07 2023-12-08 京东科技控股股份有限公司 Region dividing and classifying method, device and computer readable storage medium
CN112164087A (en) * 2020-10-13 2021-01-01 北京无线电测量研究所 Super-pixel segmentation method and device based on edge constraint and segmentation boundary search
CN112164087B (en) * 2020-10-13 2023-12-08 北京无线电测量研究所 Super-pixel segmentation method and device based on edge constraint and segmentation boundary search

Also Published As

Publication number Publication date
CN109345536B (en) 2021-02-09

Similar Documents

Publication Publication Date Title
Ibrahim et al. Image segmentation methods based on superpixel techniques: A survey
ES2680678T3 (en) Detection of the edges of a core using image analysis
CN109345536A (en) A kind of image superpixel dividing method and its device
Zhao et al. FLIC: Fast linear iterative clustering with active search
Bergeest et al. Efficient globally optimal segmentation of cells in fluorescence microscopy images using level sets and convex energy functionals
US8983189B2 (en) Method and systems for error correction for three-dimensional image segmentation
WO2013178725A1 (en) Segmentation of a foreground object in a 3d scene
CN107871321B (en) Image segmentation method and device
Estellers et al. Harmonic active contours
Li et al. Iterative image segmentation with feature driven heuristic four-color labeling
Wang et al. An efficient level set method based on multi-scale image segmentation and hermite differential operator
Hu et al. Highly accurate optical flow estimation on superpixel tree
Katkar et al. A novel approach for medical image segmentation using PCA and K-means clustering
Zhou et al. Superpixels by bilateral geodesic distance
Gu et al. Generalizing mumford-shah model for multiphase piecewise smooth image segmentation
Reso et al. Occlusion-aware method for temporally consistent superpixels
Feng et al. A curve evolution approach for image segmentation using adaptive flows
Pan et al. Superpixels of RGB-D images for indoor scenes based on weighted geodesic driven metric
Tai et al. A multigrid algorithm for maxflow and min-cut problems with applications to multiphase image segmentation
Zhao et al. Hybrid image segmentation method based on anisotropic Gaussian kernels and adjacent graph region merging
Li et al. Fast and robust active contours model for image segmentation
Wang et al. Image segmentation algorithm by piecewise smooth approximation
Shah et al. A new selective segmentation model for texture images and applications to medical images
Zhang et al. Semiautomatic right-angle building extraction from very high-resolution aerial images using graph cuts with star shape constraint and regularization
Weber et al. Spatio-temporal quasi-flat zones for morphological video segmentation

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