Reputation: 15000
I got this code from here
figure, imshow('pout.tif');
h = imdistline(gca);
api = iptgetapi(h);
fcn = makeConstrainToRectFcn('imline',...
get(gca,'XLim'),get(gca,'YLim'));
api.setDragConstraintFcn(fcn);
Can you tell me how i can save the pixel distance data measured between two points "dynamically" into a separate file or as a variable in matlab
Upvotes: 0
Views: 1886
Reputation: 185
figure, imshow('pout.tif');
h = imdistline(gca);
api = iptgetapi(h);
fcn = makeConstrainToRectFcn('imline',...
get(gca,'XLim'),get(gca,'YLim'));
api.setDragConstraintFcn(fcn);
dist = api.getDistance()
I believe you are looking for how to use the API. In the above example, you call api followed by the functions on the page you listed. I.e.
api.getDistance
api.getAngleFromHorizontal
etc
Upvotes: 1