Subtracting background from an image

  • Follow


Hi,

In Matlab, I am trying to subtract a background image ([url=http://www.freeimagehosting.net/image.php?52da94ec0d.jpg][img]http://www.freeimagehosting.net/uploads/th.52da94ec0d.jpg[/img][/url]) from an original image ([url=http://www.freeimagehosting.net/image.php?1888ec1fef.jpg][img]http://www.freeimagehosting.net/uploads/th.1888ec1fef.jpg[/img][/url]) that I have. From the short code I have written, the background image is removed from the original image but there is a dark shade on the side of the image ([url=http://www.freeimagehosting.net/image.php?eca45fbcf6.jpg][img]http://www.freeimagehosting.net/uploads/th.eca45fbcf6.jpg[/img][/url]) that I have been trying to get rid of but don't know how. I was wondering if there was a way to get rid of the dark shade or another way to remove the background image from the original image?

Code:
B=imread('25x_prepared.jpg');
figure;imshow(B);
background=imread('25x_prepared_bckgnd.jpg');
figure;imshow(background);
B1=B-background;
figure;imshow(B1);

-Courtney
0
Reply Courtney 9/18/2010 9:46:06 AM

Courtney:
Well there's two reasons that I would guess:
1.  Your background image is not really a background image.  It looks
like it has already been flattened.  It does not have the same overall
shape (profile) as the sample image.
2.  You're subtracting the background.  People often incorrectly talk
about background subtraction as if that's the mathematically accurate
and appropriate thing you want to do.  Unless you're doing radiology,
which it doesn't look like you are, you don't want to do background
subtraction.  It looks like you're doing microscopy of thin samples.
You'd have much better results doing a background division.  Why?
Well if you have 90% as much light coming in at the corner as you do
at the middle, don't you think you'd need to divide by .9 out there?
You can try that once you get a valid background (not one already
flattened).
Good luck,
ImageAnalyst


0
Reply ImageAnalyst 9/18/2010 12:28:11 PM


1 Replies
527 Views

(page loaded in 0.052 seconds)

Similiar Articles:













7/22/2012 1:51:59 PM


Reply: