# Separate two images using a statistical approach

So I have a fundamental question (for which I can't find a good answer anywhere). Say we have two images (A and B) and their mixed image (C) as follows:

Now say that I've been given Image (A) and Image (C) or Image (B) and Image (C). What are some algorithmic methods that will allow me to separate Image A from Image C or Image B from Image C. My goal is eventually to take something like Image C and decompose it into Image A and Image B. My idea is that if I am given either Image C and Image A or Image C and Image B, I can easily derive the complement (i.e. given A and C, I can get B or given B and C, I can get A).

Algorithmically, I want to do the following:

1. Detect the points that are similar between Image A and Image C (if Images A and C are given) or Image B and C (if Images B and C are given).
2. Reconstruct Image B (Image B') from Image A and Image C (if Images A and C are given) or reconstruct Image A (Image A') from Image B and Image C (if Images B and C are given).
3. Then iteratively delete the newly constructed Image B' or Image A' (from step 2) from either Image C respectively. The output will either be Image B'' or Image A''.
4. Compare the recovered image (from step 3) with the original image. So the idea is to then compare Image B'' with the original Image B or Image A'' with the original Image A.

I'd appreciate any papers or methods that clearly state the mathematics (or statistical technique) used to solve such problems. A lot of fancy words are thrown around but it's really hard to find a precise and easy-to-understand solution for these.

• Any specificity on how they are mixed? I mean, if they are just added together, then $B = C - A$. Jul 28, 2023 at 23:26
• In case the mixture coefficients are not known, you might gess it by minimizing the residual output entropy. Those ideas are used in ICA Jul 29, 2023 at 0:30
• What is the mixing modeling? Is it uniform all over the image?
– Royi
Jul 29, 2023 at 12:52
• @AnonSubmitter85 - They are not added with the same proportion so B = C-A wouldn't work. Jul 30, 2023 at 0:17
• @GideonGenadiKogan - The mixture coefficients are unknown. Can you share a paper or method or code that implements that? Jul 30, 2023 at 0:18

I assume that the registration problem is not the main question here and it can be solved by simple scaling, upsampling to get the subpixel accuracy, and argmax over the correlation between $$B$$ and $$C$$.

Following I will refer to the rest of the process.

Assuming $$C$$ is a linear combination of $$A$$ and $$B$$ $$\alpha A + \beta' B = C'$$ Without loss of generality, let us define $$\beta=\frac{\beta'}{\alpha}$$ and $$C=\frac{C'}{\alpha}$$. This leads to $$A + \beta B = C$$ Assuming $$C$$ and $$B$$ are known, we can optimize $$\beta$$ for different functions of $$A$$.

Similar to ICA (following is from Wikipedia),

separation of mixed signals gives very good results is based on two assumptions and three effects of mixing source signals. Two assumptions:

1. The source signals are independent of each other.
2. The values in each source signal have non-Gaussian distributions.

This might be utilized in two directions:

1. Minimization of mutual information
2. Maximization of non-Gaussianity

The Minimization-of-Mutual information (MMI) family of ICA algorithms uses measures like Kullback-Leibler Divergence and maximum entropy. The non-Gaussianity family of ICA algorithms, motivated by the central limit theorem, uses kurtosis and negentropy.

Therefore, one way to extract $$\beta$$ is

$$\beta=\underset{\beta}{\mathrm{argmax}}\space \mathrm{Kurt}\left[C-\beta B\right]$$

Wikipedia lists numerous other ways to do it...

• None of the three images have the same scale, this won't work without proper registration.
– user67664
Jul 30, 2023 at 9:36
• @YvesDaoust I agree. Will refer to it in my answer Jul 30, 2023 at 9:47
• The registration problem is critical, as it adds four degrees of freedom, making the problem much less tractable.
– user67664
Jul 30, 2023 at 10:17
• @GideonGenadiKogan - this is great! I will try implementing this and share my results. Quick question - can you explain the loss of generality? For example, once I compute $\beta$, I'm assuming that I still need to go back and compute $\beta'$ and and $\alpha$? Jul 31, 2023 at 14:58
• @SpaceCadet2810 you can not get $\alpha$. Say you have a mixture of two images but before the mixing you scale both of them with same scale. Can you restore the scale? I think you can not as it is arbitrary... What the answer missing ro be accepted? Jul 31, 2023 at 15:40