Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Get the surrounding pixels of a binary image
Replies: 2   Last Post: Nov 5, 2012 10:15 AM

 Messages: [ Previous | Next ]
 Javier Posts: 61 Registered: 4/26/11
Re: Get the surrounding pixels of a binary image
Posted: Nov 5, 2012 10:15 AM

"Ankur Verma" wrote in message <k78kl2\$9ff\$1@newscl01ah.mathworks.com>...
> well.. I am not sure but try this one. Try to find edge in the given image, the resulting image will give a binary image with 1 at the edge (the green colored pixel) and 0 for everything else. then simple you can find the pixel value. for example:
>
> %% image.png is the given image%
> a=im2bw(imread('image.png')); % Return a binary image
> b=find(edge(a)==1); % Return 'b' having the absolute index of the boundary pixels in the given image%%
>
> Regards
> Ankur Verma

Hi, thanks for answering. I have solved the problem: the pixels I want are the ones whose bwdist is 1!

Date Subject Author
11/5/12 Javier
11/5/12 Ankur Verma
11/5/12 Javier