I have a number of images to be marked with certain fixed number of points. (object tracking)
I am using impoint
to make the points on the image and then plot to connect them to each other in a logical way. So far so good. Next, I hit next (on my MATLAB GUI developed using GUIDE) and the new image loads in the axis and the information is lost (the point).
- How can I retain the plotted
impoint
for my next image? - How can I make sure that when I move the
impoint
, the plotted lines also move?
What I still have to work around is:
That I am already using the addNewPositionCallback
for the updation of the position of the point. This callback when written: addNewPositionCallback(H, @fnc);
it issues a function call something like fnc(pos)
My problem is that this call back does not provide a handle.
Hence without the handles information I can not address the right element in the Code. As of now I have implemented it so, that I have written 18 One-liner functions for the fixed number of 18 points that I need to mark on the image. these functions call the same function updatestructure(position, 'point_name', handles)
which is called right after the creation of impoints to plot the link between them on the image. But here too I have no information on handles. Here is what I tried:
pointname = impoint(gca,[]);
setcolor(h,'y');
position = getPosition(h);
updatestructure(position, 'pointname', handles);
addNewPositionCallback(h, @movepointname)
So when update structure is called the plot works fine. I can see what I want. But when I move the point function movepointname()
is called and thats when problem starts.
function movepointname (smart_pos)
updateStruct (smart_pos, 'pointname');
end
This surely generated an error as the handles information was not transferred. I tried vargin
to define what it should do when less argument call is set. In that I would still need handles from somewhere.
Thank you.