Code covered by the BSD License  

Highlights from
color image segmentation

image thumbnail

color image segmentation

by

 

24 Nov 2010 (Updated )

segment color image robust to texture

local_min_img(img, scale)
function bw = local_min_img(img, scale)
%find the local minima with neighbor-hood scale 'scale' of an image
%inputs:
%  img: input 2d-image
%  scale: neighborhood scale
%outputs:
%  bw: the valleys
[valley_r, valley_c] = local_min(img, scale);
imgHeight = size(img, 1);
imgWidth = size(img, 2);
row_map = repmat([0:imgWidth-1], [imgHeight, 1]);
col_map = repmat([0:imgHeight-1]', [1, imgWidth]);
valley_r = valley_r / imgHeight;
bw = (valley_r == row_map) & (valley_c == col_map);

Contact us