What the error in this code..?

조회 수: 1 (최근 30일)
Lalit Patil
Lalit Patil 2012년 12월 20일
N = 7;
for m=1:N
fname(m,:)=files(m+7,:);
rgb = imread(fname(m,:));
imshow(rgb);
cdata = ginput;
data(:,:,m) = cdata(1:4,:);
end
For this seven images i want data where i will click.
But when i am executing this code, it shows only cursor on image but not allowing to click.. Why..?
If any mistake then tell me..?
  댓글 수: 3
Lalit Patil
Lalit Patil 2012년 12월 20일
Thank you..
And also cdata = ginput(4)
Lalit Patil
Lalit Patil 2012년 12월 20일
when i am clicking on image it is just a click and i can not see where actual i have clicked, so i want to put a mark of '+' sign at there where i click.. So, what will be the modification in code.?

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

채택된 답변

Walter Roberson
Walter Roberson 2012년 12월 20일
Consider using roipoly()
Alternately, only ginput() one value at a time, and text() a '+' into place at the returned coordinates before going on to the next.
  댓글 수: 2
Lalit Patil
Lalit Patil 2012년 12월 20일
I will do ginput(4) so there will be four values.. Now when i clicking to extract this values at that time '+' point should be placed at clicked place in image so i can see how exactly i have clicked... I am clicking at corner of chessboard..
And what you have explained i can't understand..
So, i want to modify code..
Walter Roberson
Walter Roberson 2012년 12월 20일
for K = 1 : 4
thispoint = ginput(1);
text(thispoint(1), thispoint(2), '+');
points(K,:) = thispoint;
end

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

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by