Discontinue processing on edge pixels within an image

1 view (last 30 days)
I have enhanced the edge information within an image. Now I want another algorithm to work on the rest of the image information excluding edges. I am taking small image blocks at a time on which the algorithm is going to be applied. How can I make this algorithm to work on the rest of the image information and not on edges? Should I define a fixed width for edges and brute force the algorithm to not work on pixels of "this much" width or "intensity". That wouldn't be robust, right? Any ideas would be appreciated.

Accepted Answer

Image Analyst
Image Analyst on 26 Dec 2014
Well there are two ways.
  1. You could process the whole image and then just replace the edge pixels of the output image with the original pixels. This is by far the easiest.
  2. You could try to not use the pixels in the processing in the first place by setting them to 0 or nan or some other flag value. How you handle it really depends on what king of processing takes place.
To do the first way, just have your mask of edge pixels, then do
outputImage(mask) = originalImage(mask);
  6 Comments
Image Analyst
Image Analyst on 1 Jan 2015
Actually there is a setting in R2014b that lets you specify whether nan's are included or ignored in calculations. Look in Home->Preferences>Workspace->Statistical Calculations

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!