it is showing an error when i used pixval(p1) and getpts commands . please help me and sort out the error . i am using 2017 version of matlab

2 views (last 30 days)
dat=zeros(1,12);
out=0;
leaf= imread('peepal.jpg');
[y,x,z]=size(leaf);
if x>800
leaf=imresize(leaf,0.5);
end
%figure(1);
hSelect=figure('MenuBar','none','Name','Please select the two terminals of the longest and main venation of the leaf');
p1=imshow(leaf);
text(0,0,'\newline Please select the two terminal of the longest and main venation of the leaf \newline Click the two terminals of the leaf. \newline You can click many times. The last two selections will be considered as terminals. \newline Press Enter to quit the selection when you are done','FontSize',12,'EdgeColor','red','FontWeight','bold')
%htext=impixelinfoval(gcf,p1);
%%%2% obtain vertex coordinates%%
%pause
pixval(p1);
%%%2% obtain vertex coordinates%%
%pause
[xi,yi] = getpts;
dimension=size(xi);
dingdian(1)=xi(dimension(1)-1,1);
dingdian(2)=yi(dimension(1)-1,1);
dingdian(3)=xi(dimension(1),1);
dingdian(4)=yi(dimension(1),1);
%%%3% model covert to data%%%
imagemd(leaf,dingdian);

Answers (0)

Categories

Find more on Read, Write, and Modify Image in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!