Hi,
Will appreciate if anybody will comment on what am I doing wrong?
I have 4 grayscale images available, L, R, G, B
First, I combine from them RGB image with the following expressions in each channel (literally speaking, it's L*(R||G||B)/(R+G+B), with some channel normalization):
R
(L-min(L))/(max(L)-min(L))/
((R-min(R))/(max(R)-min(R))+(G-min(G))/(max(G)-min(G))+(B-min(B))/(max(B)-min(B)))*
(R-min(R))/(max(R)-min(R))
and the same for G and B channels with R in the last line replaced with G and B respectively.
This approach works fine and at the end I'm getting RGB image stretched following L, with data in all 3 channels, R,G,B.
After that I'm trying to apply some logic, define symbols k_col=2.5, SR,SG,SB, and change expressions in channels to (only R one is presented):
SR=(L-min(L))/(max(L)-min(L))/
((R-min(R))/(max(R)-min(R))+(G-min(G))/(max(G)-min(G))+(B-min(B))/(max(B)-min(B)))*
(R-min(R))/(max(R)-min(R))*k_col;
iif(SR>1,1,SR)
Expressions for G and B are the same with bold R in 1st, 3rd, and 4th lines replaced by G and B.
In this case after execution I've got color image in which only R channel is calculated right, G and B are all zeros.
There is no mistypes in my expressions, attached is related PSM file... This behavior will be reproduced in case if formulae is presented for each channel, and it is "complicated", in other word, consists of more than 1 expression with use of some local symbols.
What am I doing wrong? How to get data in all 3 channels using non-trivial expressions (consists of more than one expression) in channel formulae?
Thanks a lot for your help,
Yuriy