error in display and write an image file...

ISC(:,:,1) = ISCR(:,:) .* 255;
ISC(:,:,2) = ISCG(:,:) .* 255;
ISC(:,:,3) = ISCB(:,:) .* 255;
ISC = uint8(ISC);
figure(1),
subplot(2,2,1), imshow(ISCR,[]);
subplot(2,2,2), imshow(ISCG,[]);
subplot(2,2,3), imshow(ISCB,[]);
subplot(2,2,4), imshow(ISC);
I wanted to get a RGB image from ISCR, ISCG and ISCB… When I display the ISCR, ISCG and ISCB channels using figure, imshow(ISCR,[]); but if i give only figure, imshow(ISCR,[]); only full white figure file comes...
I wanted to display the final combined RGB image, i did the above code but I don’t view anything just white figure file… What can be the problem… Please rectify it for me…

1 件のコメント

Geoff Hayes
Geoff Hayes 2015 年 3 月 21 日
Elysi - what is the minimum and maximum value for each of ISCR, ISCG, and ISCB? Which of the four subplots show the correct image, or do all of them just show a white image?

サインインしてコメントする。

 採用された回答

Image Analyst
Image Analyst 2015 年 3 月 25 日

0 投票

That's because ISC and ISCR are double, not uint8 . It expects doubles to be in the range 0-1. If you have values above that, like 200 or 255, it will display them as white. If you use [], then it scales the array to 0-1 and then it will display fine because it's in the expected range.

7 件のコメント

Image Analyst
Image Analyst 2015 年 3 月 26 日
Attach the original image file so I can try it.
Image Analyst
Image Analyst 2015 年 3 月 27 日
You didn't use [] like I suggested! Try this:
imshow(ISC(:,:,1), []);
Please take special note to see the left and right bracket after the array.
Image Analyst
Image Analyst 2015 年 3 月 27 日
Attach the images here, not on tinypic which is a pain for me to get the images from due to ads and other problems. Use the green and brown frame icon or the paper clip icon.
Image Analyst
Image Analyst 2015 年 3 月 28 日
編集済み: Image Analyst 2015 年 3 月 28 日
I'm not sure your use of inv() is correct. To transpose the curve I don't think you'd do a matrix inverse. Get rid of inv and it seems to work fine.
Elysi Cochin
Elysi Cochin 2015 年 3 月 30 日
編集済み: Elysi Cochin 2015 年 3 月 30 日
sir, it was with the equation... now it is working fine...
Image Analyst
Image Analyst 2015 年 3 月 30 日
But you still have the matrix inverse function inv() in there??? That's weird.
Elysi Cochin
Elysi Cochin 2015 年 3 月 31 日
no sir it was the inverse of the function... i found the inverse of the function using finverse and applied it to the code... and it worked well...

サインインしてコメントする。

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by