Filter löschen
Filter löschen

plot marker on image without imshow and save plotted marker image

3 Ansichten (letzte 30 Tage)
Ankit Singh
Ankit Singh am 8 Mai 2016
imshow(I);
hold on;
plot(shape(:,1),shape(:,2),'+','MarkerSize',10);
i want marker should embedded in I, Later i can crop it

Antworten (2)

Image Analyst
Image Analyst am 8 Mai 2016

Walter Roberson
Walter Roberson am 8 Mai 2016
  2 Kommentare
Ankit Singh
Ankit Singh am 8 Mai 2016
Bearbeitet: Ankit Singh am 8 Mai 2016
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);
Walter Roberson
Walter Roberson am 8 Mai 2016
Please show the complete error message, everything in red.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Image Processing and Computer Vision finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by