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 commentaires

Adam
Adam le 23 Juin 2017
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 le 23 Juin 2017
Attached the error shown
Stephen23
Stephen23 le 23 Juin 2017
Modifié(e) : Stephen23 le 23 Juin 2017
A hard-coded graphics handle is a bad start:
getpts(1)
Why are you not passing the handle of the figure/axes?

Connectez-vous pour commenter.

 Réponse acceptée

Walter Roberson
Walter Roberson le 23 Juin 2017

0 votes

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 commentaires

Ali Ibrahim
Ali Ibrahim le 23 Juin 2017
Perfect.. it worked!
Ali Ibrahim
Ali Ibrahim le 23 Juin 2017
Thanks

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Graphics Performance dans Centre d'aide et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by