Help with this problem on MATLAB filtering

1 visualización (últimos 30 días)
Esther
Esther el 11 de Sept. de 2012
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.

Respuesta aceptada

Image Analyst
Image Analyst el 11 de Sept. de 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 comentarios
Esther
Esther el 11 de Sept. de 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 el 11 de Sept. de 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.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Image Processing Toolbox en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by