필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

showing error in elevanth line of this code ? please help me to get the output for this code immediately?

조회 수: 1 (최근 30일)
clc;
clear all;
format long;
I1=imread('colored.jpg');
I2=double(I1);
A=I2;
clear vision;
k=1;
for i=1:10:(960-96);
for j=1:10:(1280-128);
m1=max(max(A(i:i+95,j:j+127)));
m2=min(min(A(i:i+95,j:j+127)));
vision(k)=(m1-m2)/(m1);
k=k+1
end;
end;
visionk=mean(vision)
  댓글 수: 1
Adam
Adam 2016년 1월 26일
Please format your code using the {} Code block. Otherwise we don't see an 11th line.
Also please post exactly any error messages you get. Since you know it is the 11th line you should give us all the information you have if you want a quick answer,

답변 (1개)

Walter Roberson
Walter Roberson 2016년 1월 26일
Line 11 of your source is a blank line.
Line 12 of your source will cause a problem if your image is not 960 x 1280 . You should never hard-code image sizes: you should use size() with a single output to find out how big the image is.
Note: color JPEG images are always 3 dimensional, but you are ignoring the third dimension; as a result you will be working entirely on the Red information. That might be fine with you, but it is not fine for other people reading the code, so if it is what you want, then take the time to add in the third dimension specifically, A(something,something,1) as otherwise you confuse yourself and you confuse anyone else trying to read the code.

이 질문은 마감되었습니다.

태그

Community Treasure Hunt

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

Start Hunting!

Translated by