Converting back to colour image after wavelet transform on luminance plane
Show older comments
Hi, I'm having difficulty converting my images back to colour. I started with two colour images of the same scene taken at different focus settings. I then Converted the images from RGB to NTSC colourspace and assigned Luminance planes of images to Lumback and Lumfront.
% Reading in images
Focusfront=imread('focusfront.jpg');
Focusback=imread('focusback.jpg');
%%%Convert image from RGB to NTSC colourspace
%%%and Assign Luminance planes of images to Lumback and
Lumfront
NFocusfront=rgb2ntsc(Focusfront);
Lumfront=NFocusfront(1:M,1:N,1);
NFocusback=rgb2ntsc(Focusback);
Lumback=NFocusback(1:M,1:N,1);
The images were broken down into blocks of 8 by 8. I then performed haar transforms on these images and selected the block with greater detail from each image to create 1 composite image.
I've tried ntsc2rgb but it comes up with an error message saying: ??? Error using ==> ntsc2rgb>parse_inputs at 95 YIQMAP must be a M-by-3 array.
Thanks in advance for any advice. Karen
Answers (1)
Walter Roberson
on 23 Mar 2011
0 votes
When you select the blocks with greater detail based upon the luminance channel, you should should select the same blocks from the other two channels (which might turn out to be as simple as changing a ",1)" to a ",:)" in the code.) The array you feed in to ntsc2rgb() needs to be 3 dimensional -- it needs to have the other two channels.
Categories
Find more on Computer Vision Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!