フィルターのクリア

plot marker on image without imshow and save plotted marker image

3 ビュー (過去 30 日間)
Ankit Singh
Ankit Singh 2016 年 5 月 8 日
コメント済み: Walter Roberson 2016 年 5 月 8 日
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);
Walter Roberson
Walter Roberson 2016 年 5 月 8 日
Please show the complete error message, everything in red.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeImage 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