Borrar filtros
Borrar filtros

How to 'color in' pixels of a grayscale image sequence? Or to put it another way: how to convert my set of linear indices specifying pixels in my grayscale sequence to corresponding indices in an RGB sequence?

1 visualización (últimos 30 días)
Supposing I have the linear indices of the pixels which I would like to 'color in'.
If I wanted to set all of those pixels to some specific value in my grayscale image sequence, I could do this:
gryscl_imSeq(LinearPixIndx) = 0.7;
If however, I want to introduce some color I would first need to convert my grayscale image sequence into an m x n x 3 x p matrix, which I could do like this:
RGBvideo = reshape(repmat(reshape(gryscl_imSeq,[],size(gryscl_imSeq,3)),3,1),[size(gryscl_imSeq,1) size(gryscl_imSeq,2) 3 size(gryscl_imSeq,3)]);
If somebody could tell me how to convert my grayscale linear pixels indices into corresponding indices for the RGBvideo I would really appreciate it.
Or if there is a better way to go about what I'm trying to do, I would be very grateful for any suggestions.
Thanks in Advance,
N

Respuestas (1)

Image Analyst
Image Analyst el 28 de Nov. de 2013
Try using ind2rgb().

Categorías

Más información sobre Red en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by