From: Fabian Siddiqi on
Hi there.

I'm trying to isolate an object inside an image. So, I'll start off with two images:

a) One which just contains the background (I1).
b) One which contains the background + the object I want to isolate (I2).

In theory, this should be pretty easy: subtract both images (I3 = imlincomb(1,I1,-1,I2)) and for all I3(i,j,k) not equal to zero, substitute with the value from I2.

The process is failing in the first step (the subtraction). What am I doing wrong? Is there a better way to do this?

Any help is greatly appreciated.
Thank you very much.
From: Dan on

I'll ask the simple question: Why not use imsubtract?

"Fabian Siddiqi" <fabians(a)gmail.com> wrote in message <hpdgcr$sh3$1(a)fred.mathworks.com>...
> Hi there.
>
> I'm trying to isolate an object inside an image. So, I'll start off with two images:
>
> a) One which just contains the background (I1).
> b) One which contains the background + the object I want to isolate (I2).
>
> In theory, this should be pretty easy: subtract both images (I3 = imlincomb(1,I1,-1,I2)) and for all I3(i,j,k) not equal to zero, substitute with the value from I2.
>
> The process is failing in the first step (the subtraction). What am I doing wrong? Is there a better way to do this?
>
> Any help is greatly appreciated.
> Thank you very much.