plot marker on image without imshow and save plotted marker image

3 次查看(过去 30 天)
imshow(I);
hold on;
plot(shape(:,1),shape(:,2),'+','MarkerSize',10);
i want marker should embedded in I, Later i can crop it

回答(2 个)

Image Analyst
Image Analyst 2016-5-8

Walter Roberson
Walter Roberson 2016-5-8
  2 个评论
Ankit Singh
Ankit Singh 2016-5-8
编辑:Ankit Singh 2016-5-8
i have tried this code but not working
load('imageDB.mat','I');
load('bboxDB.mat','bbox');
faceDetect = vision.CascadeObjectDetector();
bbox=step(faceDetect,I);
face = imcrop(I,bbox);
imshow(face, 'Parent', handles.ecluideanAxes);
RighteyeDetect = vision.CascadeObjectDetector('RightEye','MergeThreshold',24);
Righteyebox=step(RighteyeDetect,face);
n=size(Righteyebox,1);
e=[];
d=0;
for it=1:n
for j=1:n
if (j > it)
if ((abs(Righteyebox(j,2)-Righteyebox(it,2))<68)&& (abs(Righteyebox(j,1)-Righteyebox(it,1))>40))
e(1,:)=Righteyebox(it,:);
e(2,:)=Righteyebox(j,:);
d=1;
break;
end
end
end
if(d == 1)
break;
end
end
Righteyebox(1,:)=e(1,:);
Righteyebox(2,:)=e(2,:);
c=Righteyebox(1,3)/2;
d=Righteyebox(1,4)/2;
%Left Eyes Centroid
eyeCenter1x=Righteyebox(1,1)+c+bbox(1);
eyeCenter1y=Righteyebox(1,2)+d+bbox(2);
e=Righteyebox(2,3)/2;
f=Righteyebox(2,4)/2;
%Right Eyes Centroid
eyeCenter2x=Righteyebox(2,1)+e+bbox(1);
eyeCenter2y=Righteyebox(2,2)+f+bbox(2);
euclideanDistance = CalcDistance(eyeCenter1x,eyeCenter1y,eyeCenter2x,eyeCenter2y);
euclideanDistance = round(euclideanDistance);
shape=[eyeCenter1x eyeCenter1y;eyeCenter2x eyeCenter2y;];
RGB = insertMarker(RGB,[shape(:,1);shape(:,2)],'x','color','red','size',10);
But I'm getting this error
Error in insertMarker (line 72)
validateAndParseInputs(I, position, varargin{:});
Error in FinalDesign>eyesecubtn_Callback (line 257)
RGB =
insertMarker(RGB,[shape(:,1);shape(:,2)],'x','color','red','size',10);

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Image Processing and Computer Vision 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by