필터 지우기
필터 지우기

Can anyone tell me how to change the display and storing of the values returned in given form to the form displayed and stored by imhist. Format is given below.

조회 수: 1 (최근 30일)
In case of imhist program working fine because the pixelCounts(Variable) for them are displayed in this form. Given below....
1
2
3
4
5
like this.And in case of LRBP(My code) pixelCounts(Variable) are displayed like this:
columns 1 to 7
1 2 3 4 5
In this form.
Now I want LRBP form to be displayed in imhist form.
That's Why I am getting subscripted dimension mismatch as error. This what I tried to find out cause of the error.
Now can you please help me to guide what should I change??
So that This error will be resolved.

채택된 답변

Jan
Jan 2014년 3월 9일
Which code causes the error? Without seeing the code, we cannot guess what you should change. But it looks easy, because all you need to do is to transpose the output:
a = [1,2,3,4,5,6,7];
disp(a)
disp(a.')
% or equivalently: disp(transpose(a))
% or:
b = [1;2;3;4;5;6;7]
  댓글 수: 1
radha
radha 2014년 3월 10일
Actually I want to store the 4 histograms in row wise form in the .matfile using the below code.
%code
clc; clear all;
output = zeros(5, 1024); % Initialize
for k = 1 : 5
% Compute the 4 histograms...
Image=imread(strcat('Temp\',num2str(k),'.jpg'));
[pixelCount1, grayLevels1] = LRBP(1,Image);
[pixelCount2, grayLevels2] = LRBP(4,Image);
[pixelCount3, grayLevels3] = LRBP(16,Image);
[pixelCount4, grayLevels4] = LRBP(64,Image);
disp('pixelCount1');
disp(pixelCount1);
disp('pixelCount2');
disp(pixelCount2);
disp('pixelCount3');
disp(pixelCount3);
disp('pixelCount4');
disp(pixelCount4);
% Stitch together and stick into one row of the array.
output(k,:) = [pixelCount1', pixelCount2', pixelCount3', pixelCount4'];
disp('pixelCount1');
disp(pixelCount1');
disp('pixelCount2');
disp(pixelCount2');
disp('pixelCount3');
disp(pixelCount3');
disp('pixelCount4');
disp(pixelCount4');
end
save('H.mat', 'output');
While doing this I am getting subscripted dimension mismatch error at the line:
??? Subscripted assignment dimension mismatch.
Error in ==> ImLast at 23 output(k,:) = [pixelCount1', pixelCount2', pixelCount3', pixelCount4'];
So I want to solve this error. According to me this was due to this cause which I asked you.
So I transpose it... Still I am getting error.
Can you help me to solve this error.
If you want then I can give .m files for running my code.
Thanks for your response.
Please help to solve this error!!!!!!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Explore and Edit Images with Image Viewer App에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by