matlab - excessive green color extraction implementation -
i want segment image pixels vegetation , non vegetation. excessive green color extraction algorithm developed.the algorithm shown below.
outimage (x,y,z) = inimage (x,y,z)
if { inimage (x,y,r) < (x,y,g) inimage (x,y,b) < (x,y,g) }
outimage(x,y,z) = 0 otherwise*
where outimage (x,y,z) output image after excessive green segmentation saved in jpg format, inimage(x,y,z) image acquired camera, x no of pixels in each row, y no of pixels in each column , z primary color plane red z equal 1, green z 2 , blue z 3.
i not getting how implement please me implement it.or give rough idea or suggestion how can implement it.
input image:
output:
i want output in format after applying above mentioned algorithm
build 2d mask , use bsxfun
apply color components (third-dim slices):
inimage = imread('filename'); %// type uint8 mask = inimage(:,:,1)<inimage(:,:,2) & inimage(:,:,3)<inimage(:,:,2); %// 2d mask outimage = bsxfun(@times, inimage, uint8(mask)); %// apply mask replicated along 3rd dim
Comments
Post a Comment