필터 지우기
필터 지우기

How to store the matrix of an image in an excel sheet?

조회 수: 1 (최근 30일)
Shreya Shetty
Shreya Shetty 2019년 7월 23일
답변: Shreya Shetty 2019년 7월 26일
Image is present in a folder. I want to store is matrix in an excel sheet. How to proceed?

채택된 답변

Shreya Shetty
Shreya Shetty 2019년 7월 26일
Image is 2d but each component has X,y,depth. So we extract RGB features.Select an image, Extract the RGB components, Save them in a single excel sheet whose name is user defined. Display original image, All-Black and colour versions of RGB components and retreived image from RGB components
[filename,filepath]=uigetfile({'*.jpg'}, 'Select an Image'); imdata= imread(strcat(filepath,filename)); RC=imdata(:,:,1); GC=imdata(:,:,2); BC=imdata(:,:,3); a=zeros(size(imdata, 1), size(imdata, 2)); just_red=cat(3, RC, a, a); just_green=cat(3, a, GC, a); just_blue=cat(3, a, a, BC); figure subplot(5,5,3); imshow(imdata) title('original image') subplot(5,5,7); imshow(RC) subplot(5,5,12); imshow(just_red) title('red channel') subplot(5,5,8); imshow(GC) subplot(5,5,13); imshow(just_green) title('green channel') subplot(5,5,9); imshow(BC) subplot(5,5,14); imshow(just_blue) title('blue channel') im=cat(3,just_red,just_green,just_blue); img=cat(3,RC,GC,BC); subplot(5,5,18); isequal(imdata,img) imshow(img) title('retreived image') [file,Path]=uiputfile('*.xlsx','Save image matrix as'); file=fullfile(Path,file); xlswrite(file,RC,'A1:GR200'); xlswrite(file,GC,'A201:GR400'); xlswrite(file,BC,'A401:GR600');

추가 답변 (1개)

Shreya Shetty
Shreya Shetty 2019년 7월 26일
Make changes as per requirement

카테고리

Help CenterFile Exchange에서 Spreadsheets에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by