image processing - Setting the value of each element with minimum value in the row to 1 and others to 0 in matlab? -



image processing - Setting the value of each element with minimum value in the row to 1 and others to 0 in matlab? -

this trying in matlab can't seem around achieving it

for each row in filtered image, assign value of 1 pixels have minimum value in row , other pixels zero

here's solution:

img = imread('http://i.stack.imgur.com/ty3ye.jpg'); img = rgb2gray(img); %# transform jpeg color image grayscale minvalue = min(img,[],2); %# set pixels equal minimum value 1 bw = bsxfun(@eq,img,minvalue);

when run on image linked, get

which shows there plenty of border effects median filtering. removing border 10 pixels, i.e. with

img = img(10:end-9,10:end-9);

and running code again, find

which makes quite bit more sense.

matlab image-processing

Comments

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -