Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: creating rgb image using pixels values
Replies: 3   Last Post: Dec 29, 2012 11:48 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
ImageAnalyst

Posts: 12,907
Registered: 12/26/06
Re: creating rgb image using pixels values
Posted: Dec 29, 2012 11:48 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"Shobana " <manoharanshobana@ymail.com> wrote in message <kbn609$gvt$1@newscl01ah.mathworks.com>...
> hai..
> I am having red,green and blue plane pixel values and i want to form image with this values.Is there any function is available in the matlab?
> I tried cat() function and imwrite also but its not working.if anybody knows please help me

--------------------------------------------------------------------------------------
cat() should work:

rgbImage = cat(3, redChannel, greenChannel, blueChannel);

You might need to cast the channels to uint8 beforehand depending on what you're going to do with the image. If you want to display it with imshow() or write it to disk with imwrite() you'll need to cast to uint8

rgbImage = cat(3, uint8(redChannel), uint8(greenChannel), uint8(blueChannel));

Or
imshow(uint8(rgbImage));



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.