Code covered by the BSD License  

Highlights from
face detection based doorbell (gmail n facebook)

image thumbnail

face detection based doorbell (gmail n facebook)

by

 

you can see the faces of the peoples who are on your doors using g mail n Facebook!

faceOnFB_Gmail.m
%you can set ur camra proprties using "imaqtool"
vid = videoinput('winvideo', 1, 'YUY2_640x480');
set(vid, 'FramesPerTrigger', Inf);
set(vid, 'ReturnedColorspace', 'rgb')
vid.FrameGrabInterval = 10;
start(vid)
faceDetector = vision.CascadeObjectDetector();
for k=1:inf
data = getsnapshot(vid);
bbox = step(faceDetector, data);
imout = insertObjectAnnotation(data,'rectangle',bbox,'Face');
imshow(imout);
hold on;
if (bbox>0)
%change source and destination mail address    
facebook = 'targetfbaccount@facebook.com';
gmail = 'targetfbaccount@gmail.com';
myaddress = 'yourgmail@gmail.com';
mypassword = 'yourpassword';
setpref('Internet','E_mail',myaddress);
setpref('Internet','SMTP_Server','smtp.gmail.com');
setpref('Internet','SMTP_Username',myaddress);
setpref('Internet','SMTP_Password',mypassword);
props = java.lang.System.getProperties;
props.setProperty('mail.smtp.auth','true');
props.setProperty('mail.smtp.socketFactory.class', ...
                  'javax.net.ssl.SSLSocketFactory');
props.setProperty('mail.smtp.socketFactory.port','465');
imshow(imout);
saveas(gcf,'image.jpg')
dt = datestr(now,'mmmm dd, yyyy HH:MM:SS.FFF AM');
sendmail(gmail,'MATLAB doorbell',dt,'image.jpg');
sendmail(facebook,'MATLAB doorbell',dt,'image.jpg');
pause(10);
end
end
stop(vid);
hold off;

Contact us