Azzera filtri
Azzera filtri

plot marker on image without imshow and save plotted marker image

3 visualizzazioni (ultimi 30 giorni)
imshow(I);
hold on;
plot(shape(:,1),shape(:,2),'+','MarkerSize',10);
i want marker should embedded in I, Later i can crop it

Risposte (2)

Image Analyst
Image Analyst il 8 Mag 2016

Walter Roberson
Walter Roberson il 8 Mag 2016
  2 Commenti
Ankit Singh
Ankit Singh il 8 Mag 2016
Modificato: Ankit Singh il 8 Mag 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 il 8 Mag 2016
Please show the complete error message, everything in red.

Accedi per commentare.

Categorie

Scopri di più su Image Processing and Computer Vision in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by