GRID PROBLEM WANTED TO PUT A GRID ON THE RECTANGLE

4 次查看(过去 30 天)
I AM CURRENTLY DOING MY FINAL YEAR PROJECT SO NOW I DETECTED A FACE AND I USE RECTANGLE SYNTAX TO HIGHLIGHT THE DETECTED FACE SO I WANTED TO PUT A GRID ON THE RECTANGLE, HOW CAN I DO THAT ? THANK YOU.
% handles structure with handles and user data (see GUIDATA)
global face
global img3
faceDetector=vision.CascadeObjectDetector('FrontalFaceLBP','MinSize',[500,500]); %Create a detector object
img3=rgb2gray(img3); % convert to gray
BB=step(faceDetector,img3); % Detect faces
img3 = insertObjectAnnotation(img3, 'rectangle', BB, 'Face'); %Annotate detected faces.
axes(handles.axes34);
imshow(img3);
title('Detected face');
htextinsface = vision.TextInserter('Text', 'face : %2d', 'Location', [5 2],'Font', 'Courier New','FontSize', 14);
hold on
for i=1:size(BB,1)
rectangle('position',BB(i,:),'Linewidth',2,'Linestyle','-','Edgecolor','y');
end
hold on
N=size(BB,1);
handles.N=N;
counter=1;
for i=1:N
face=imcrop(img3,BB(i,:));
%savenam = strcat('C:\Users\User\Desktop\SEMESTER 6\CSP650\DetectFace\' ,num2str(counter), '.jpg'); %this is where and what your image will be saved
baseDir = 'C:\Users\User\Desktop\SEMESTER 6\CSP650\';
baseName = 'test_';
newName = [baseDir baseName num2str(counter) '.jpg'];
handles.face=face;

回答(1 个)

darova
darova 2020-6-14
here is the way
[x,y] = meshgrid(0:10,0:5);
plot(x,y,'k')
line(x',y','color','k')

标签

Community Treasure Hunt

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

Start Hunting!

Translated by