필터 지우기
필터 지우기

change 1 d output to 3 d

조회 수: 1 (최근 30일)
Elysi Cochin
Elysi Cochin 2013년 8월 14일
I have a set of color frames. After doing the below steps when i check the size of BB as [r c d] i find d = 1, what should i do to get it as a color value that is d = 3.... Please do reply
B1 = imread('Frames\1.jpg');
for i = 2 : numFrames
display(i);
B2 = imread(['Frames\',num2str(i),'.jpg']);
for x = 1:r
for n = 1:c
if n ~= c
if B1(x,n+1) == B1(x,n)
BB(x,n) = B2(x,n);
else
BB(x,n) = 0;
end
end
end
end
end
[r c dim] = size(BB)

채택된 답변

Walter Roberson
Walter Roberson 2013년 8월 14일
You do not initialize BB. Every time you write to BB in your code, you do so in two-dimensional form, BB(x,n) . BB is thus going to end up two dimensional (unless c <= 1, in which case BB will not be assigned to at all)

추가 답변 (0개)

카테고리

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

태그

아직 태그를 입력하지 않았습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by