|
In article <6bd8a425-59ea-4ddc-a65d-248cb44d39fb@15g2000yqy.googlegroups.com>,
ImageAnalyst <imageanalyst@mailinator.com> wrote:
>On Nov 10, 9:44?am, Francis Burton <fbur...@nyx.net> wrote:
>> I have a function that takes a value (0..1) and returns an [r, g, b]
>> triple. Is there a quick way to 'apply' it to a grayscale image MxN
>> to produce an RGB MxNx3 image?
>------------------------------------------------------------------------------------------------------
>You can use the function ind2rgb() in the image processing toolbox.
>If you don't have that toolbox, you can very easily write it yourself.
There it was - right under my eyes! The trick was realizing that
a double matrix in the range 0..1 can be converted into a true
indexed image by
im_indexed = floor(data*size(map,1));
Thanks for pointing me in the right direction.
Francis
|