Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
Drexel University or The Math Forum.
|
|
|
|
Re: creating rgb image using pixels values
Posted:
Dec 29, 2012 11:48 PM
|
|
"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));
|
|
|
|