"MATLAB programming" MATLAB to get the computer recovered

Source: Internet
Author: User

In school often have classmate computer theft, probably all is the thickness careless. It is said that the iphone has been stolen to obtain a photograph of the thief, so that it can be found. Now use MATLAB to write a program so that when thieves use the computer to surf the Internet, the computer's own initiative to send photos of the people in front of the computer to your designated mailbox.

The premise is that your computer is equipped with a webcam and a web!

Use the following code to test whether your mailbox is set correctly:


run the above script file in MATLAB to see if the message is sentThe following four steps are for computer tracking: program code such as the following: The first step:Set your own photos (note that all actions are under your Matlab current folder)
the second step: Obtain the current computer photos and compare with their own pictures, if the similarity is not high. Will send photos of the current computer to your designated mailbox
The% filename is called sendemail.mclear myaddress= ' [email protected] '; % here sender for you e-mail the QQ number.           Note your mailbox to have to provide SMTP service, no, it doesn't matter, QQ mailbox will remind settings set mypassword= ' password ';              % here for your mail above the corresponding password (general and QQ password same) to = ' [email protected] '; % here for you to send to the mailbox Setpref (' Internet ', ' E_Mail ', myaddress); Setpref (' Internet ', ' smtp_server ', ' smtp.qq.com '); Setpref (' Internet ', ' smtp_username ', myaddress), Setpref (' Internet ', ' Smtp_password ', mypassword);p Rops =   Java.lang.system.getproperties;props.setproperty (' Mail.smtp.auth ', ' true '); subject = ' Computer thief '; % message Subject obj = Videoinput (' WinVideo '); H=preview (obj); set (GCF, ' visible ', ' off ') set (h, ' visible ', ' on ') Start (obj);p ause ( 10)% assume that your PC calls the camera for a short time. Can not use this sentence photo=getsnapshot (obj), imwrite (photo, ' thief.jpg ') pause (10)% assume that your computer calls the camera for a short time, can not use these three sentences photo=getsnapshot (obj Imwrite (photo, ' thief.jpg ') a=imread (' yourpicture.jpg ');% here ' yourpicture.jpg for your own photos a1=rgb2gray (a); Aa=imread (' Thief.jpg '), Aa1=rgb2gray (AA), corr= corr2 (A1,AA1), if corr<0.85%0.85 can set a range of 0-1 by itself, the smaller the value, the more easily matched two graphs, The best value is 0.8-0.9sendmail (to, SUBJEct,[], ' thief.jpg '); end  

Step Two:Compile the STEP2 program to generate EXE files directly to the Internet to find the method, I am here to demonstrate one, operations such as the following: First remove the black box: In the command form input: CD (prefdir) Edit Compopts.bat in the open file at the end of the Add the following statement ( The premise is that the VC compiler is selected in the solution installation compiler, if other compilers are selected. Own Baidu method): Set Linkflags=%linkflags%/subsystem:windows/entry:maincrtstartup compiler installation for example:

Mcc-m SendEmail (SendEmail is a file in Step2) This command may compile for a few minutes, please be patient and generate a Sendemail.exe file when finished running Fourth Step:To create a task schedule, right-click My Computer, and then tap Manage. In the left column, select Task Scheduler.

Select "Create Task" in the right column, pop up the Create Task dialog box, fill in the name of the task, tick the hide below, and select the configuration. Windows7 the Trigger tab, click New, and select Log on. "Daily", tick the delay task. Set the delay time to 3 minutes. Are you sure. Actions tab, click New, select Start Program, and then click Browse. Select the exe file generated under the Matlab folder to determine.

On the Criteria tab, simply tick "Start only if the network connection below is available," and then select "Whatever connection" in the drop-down list (this setting is very important and can only be sent if the computer is networked). Are you sure. The next two tabs, they seem to do.

Then log off the user and log on again. Connect to the network within three minutes.   After three minutes, the program will take its own initiative, the entire process is over. Program Description : Because there is preview in the program. Causes the form to be displayed when the image is taken. Easy was found by thieves. Let's say your webcam starts very fast to change the program in STEP2 to:

clearmyaddress= ' [email protected] '; mypassword= ' password '; to = ' [email protected] '; Setpref (' Internet ', ' E_Mail ', myaddress); Setpref (' Internet ', ' smtp_server ', ' smtp.qq.com '); Setpref (' Internet ', ' smtp_username ', myaddress); Setpref (' Internet ', ' Smtp_password ', mypassword);p Rops = Java.lang.system.getproperties;props.setproperty (' Mail.smtp.auth ', ' true '); subject = ' Computer thief '; obj = videoinput (' WinVideo ');%h=preview (obj); set (GCF, ' visible ', ' off ')%set (H, ' visible ', ' on ') Start (obj);p ause (2); Photo=getsnapshot (obj); Imwrite (photo, ' thief.jpg ') a=imread (' yourpicture.jpg '); A1=rgb2gray (a); Aa=imread (' Thief.jpg '); Aa1=rgb2gray (AA); corr= corr2 (A1,AA1); if Corr<0.85sendmail (to, subject,[], ' thief.jpg '); end

In such cases, there is no need for image matching. You can just use the first piece of the program in this article.


/p>

Original: http://blog.csdn.net/tengweitw/article/details/34559489

nineheadedbird



" matlab programming "MATLAB to get the computer recovered

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.