Wednesday, May 28, 2008

How to do adaptive threshold?

  1. Convolve the image i.e. the mean or median. imageCon=imfilter(imageOri) or medfilter()
  2. Subtract the original from the convolved image. imageDif= imageOri-imageCon;
  3. Threshold the difference image with C(constant). imageThr=imageDif-C;
  4. Invert the thresholded image. imageEnd=imcomplement(imageThr);
See More:""
Matlab code:""

No comments: