I want to apply this code on another image, but i am getting this problem, and the image can not be shown.
Please any help

1 件のコメント

KSSV
KSSV 2017 年 9 月 19 日
Haseeb Hassan it is a big matrix of 3D. Why you want to view it? There is no necessity to see it.

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

 採用された回答

Jan
Jan 2017 年 9 月 19 日
編集済み: Jan 2017 年 9 月 19 日

1 投票

The Variable Editor is not thought to display the contents of huge and/or 3D arrays. It is simply not useful to display them as a table. Therefore the behavior is expected and useful - and not a "problem". Use another tool to display the array, e.g. the image command.

4 件のコメント

Haseeb Hassan
Haseeb Hassan 2017 年 9 月 23 日
編集済み: Walter Roberson 2017 年 9 月 23 日
Okay Sir one thing more can you make it clear, that i have a grayscale image i used the below function for it can you tell me what will do this code with this grayscale image, i know it adding the channels to gray scale image, but i am not fully aware of the situation what values it adds to grayscale(which is a single channel image).PLease explain the effect of the below function on single dimenesional image.Here is a function.
function [Image]=gray2rgb(Image)
%Gives a grayscale image an extra dimension
%in order to use color within it
[m n]=size(Image);
rgb=zeros(m,n,3);
rgb(:,:,1)=Image;
rgb(:,:,2)=rgb(:,:,1);
rgb(:,:,3)=rgb(:,:,1);
Image=rgb/255;
end
Walter Roberson
Walter Roberson 2017 年 9 月 23 日
The code copies the single input channel. RGB images that look gray have their three channels equal.
The code expects a uint8 image and turns it into a double image in the appropriate range.
Another way of writing the code would be:
gray2rgb = @(Image) im2double( Image(:,:,[1 1 1]) )
Image Analyst
Image Analyst 2017 年 9 月 23 日
I don't advise you to call your image Image since there is a built in function called image. So let's call your grayscale image grayImage. Then to create an rgb image in the range 0-1, you can simply do
rgb = cat(3, grayImage, grayImage, grayImage) / 255;
Instead of all those lines of code you were using.
Haseeb Hassan
Haseeb Hassan 2017 年 9 月 25 日
Thanks Sir @ImageAnalyst and @WalterRoberson.I got you people points.Now i am doing detection in this three channel image so how useful it will be,i am compare to gray image, what advantages will this three channels image now to further crack down this three channel image as compared to single channel image(gray image).Thanks for you people responses.Cheers

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeImage Processing Toolbox についてさらに検索

タグ

質問済み:

2017 年 9 月 19 日

コメント済み:

2017 年 9 月 25 日

Community Treasure Hunt

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

Start Hunting!

Translated by