Help with this problem on MATLAB filtering

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

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
Edited: Esther on 11 Sep 2012
thanks! Cause i was told to capture photos under a brighter light and dimmer light. Therefore i don't know if it's alright to have shadow when i take the image. Do you have any example on how do i know which kind of images will be easier for image processing?
Try at least pointing your camera at the display so that the optic axis is normal (perpendicular) to the display. Then try using broad extended light sources, like a light panel with a diffuser, so that you don't have reflections and shadows. Dimmer light is almost never preferable to brighter light - not sure what that person was thinking.
If you can't get better images, and your camera is in a fixed location, then you can still do it. Just identify where to look and look there and determine if the segment is black or clear. Just use my code that I gave you in your related question, with obvious adaptations.
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');
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)

Tags

Community Treasure Hunt

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

Start Hunting!