This code used to work, I tried it now.. it does not work.. i do not know what happened! Can anyone try to help me with that? Manual selection to the photo does not work also !

댓글 수: 3

Adam
Adam 2017년 6월 23일
Just saying code 'does not work' is no help to anyone. Does it give an error? Does it give an incorrect result? Only you know your own code and what you have changed in it.
Ali Ibrahim
Ali Ibrahim 2017년 6월 23일
Attached the error shown
Stephen23
Stephen23 2017년 6월 23일
편집: Stephen23 2017년 6월 23일
A hard-coded graphics handle is a bad start:
getpts(1)
Why are you not passing the handle of the figure/axes?

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

 채택된 답변

Walter Roberson
Walter Roberson 2017년 6월 23일

0 개 추천

To expand on Stephen's response: change your code to
function [loc] = get_image_point (I)
fig = figure('name','Doubleclick to set location');
imshow(I);
title('Double click on the center of the ring')
[c r] = getpts(fig);
loc = int32([c r]);
if size(loc)>1
loc = [loc(1,1) loc(1,2)];
end
close(fig);
end

댓글 수: 2

Ali Ibrahim
Ali Ibrahim 2017년 6월 23일
Perfect.. it worked!
Ali Ibrahim
Ali Ibrahim 2017년 6월 23일
Thanks

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Graphics Performance에 대해 자세히 알아보기

질문:

2017년 6월 23일

편집:

2017년 6월 23일

Community Treasure Hunt

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

Start Hunting!

Translated by