필터 지우기
필터 지우기

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 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