Help with this problem on MATLAB filtering

2 views (last 30 days)
Hi. I'm not sure of which filter to use. Could someone help me by explaining which filter I should use? I need to show the digits from the digital display in the image.

Accepted Answer

Image Analyst
Image Analyst on 11 Sep 2012
There are some filters that may work, such as mean shift, anisotropic diffusion ( http://www.csse.uwa.edu.au/~pk/Research/MatlabFns/#anisodiff), or bilateral ( http://homepages.inf.ed.ac.uk/rbf/CVonline/LOCAL_COPIES/MANDUCHI1/Bilateral_Filtering.html) You may also want to investigate noise reduction methods like non-local means and BM3D. However, your most promising solution right now is simply to get a better image. Get proper lighting and alignment of your camera. That is your biggest problem at the moment, and everyone knows it is so much easier to get good images to start with than to try to fix up poor quality images after they've been captured.
  4 Comments
Esther
Esther on 11 Sep 2012
was this the code for Anisotropic diffusion? i had an error that says: i'f ndims(im)==3'
function diff = anisodiff(im, niter, kappa, lambda, option)
if ndims(im)==3 error('Anisodiff only operates on 2D grey-scale images'); end
im = double(im); [rows,cols] = size(im); diff = im;
for i = 1:niter % fprintf('\rIteration %d',i);
% Construct diffl which is the same as diff but % has an extra padding of zeros around it. diffl = zeros(rows+2, cols+2); diffl(2:rows+1, 2:cols+1) = diff; % North, South, East and West differences deltaN = diffl(1:rows,2:cols+1) - diff; deltaS = diffl(3:rows+2,2:cols+1) - diff; deltaE = diffl(2:rows+1,3:cols+2) - diff; deltaW = diffl(2:rows+1,1:cols) - diff; % Conduction if option == 1 cN = exp(-(deltaN/kappa).^2); cS = exp(-(deltaS/kappa).^2); cE = exp(-(deltaE/kappa).^2); cW = exp(-(deltaW/kappa).^2); elseif option == 2 cN = 1./(1 + (deltaN/kappa).^2); cS = 1./(1 + (deltaS/kappa).^2); cE = 1./(1 + (deltaE/kappa).^2); cW = 1./(1 + (deltaW/kappa).^2); end diff = diff + lambda*(cN.*deltaN + cS.*deltaS + cE.*deltaE + cW.*deltaW); % Uncomment the following to see a progression of images % subplot(ceil(sqrt(niterations)),ceil(sqrt(niterations)), i) % imagesc(diff), colormap(gray), axis image
end %fprintf('\n');
Image Analyst
Image Analyst on 11 Sep 2012
I don't know. If you got it from Peter's web site - the link I gave - then I guess it must be. Of course you may need to be adapt it slightly to your situation, but I've done it and it works for my images.

Sign in to comment.

More Answers (0)

Categories

Find more on Images in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!