private void sendSmsDetails() { database objData = new database(); string data = objData.getSmsDetails(userIdCapture); string[] dataEle = data.Split(','); string masking = "weSecureYou"; string message = "ALERT!! An intruder has been detected."; string jsonResponse = SendSMS(masking, dataEle[1].ToString(), message, dataEle[0].ToString(), dataEle[2].ToString()); }
private void ProcessFrame(object sender, EventArgs arg) { Image <Bgr, Byte> ImageFrame = capture.QuerySmallFrame(); if (ImageFrame != null) { Image <Gray, byte> grayframe = ImageFrame.Convert <Gray, byte>(); var faces = grayframe.DetectHaarCascade(haar, 1.4, 4, Emgu.CV.CvEnum.HAAR_DETECTION_TYPE.DO_CANNY_PRUNING, new Size(25, 25))[0]; foreach (var face in faces) { ImageFrame.Draw(face.rect, new Bgr(Color.Green), 3); Bitmap BmpInput = ImageFrame.ToBitmap(); if (counter == 0) { firstFrame = BmpInput; } counter++; pictureBox2.Image = BmpInput; ImageConverter converter = new ImageConverter(); byte[] file = (byte[])converter.ConvertTo(BmpInput, typeof(byte[])); database obj = new database(); if (!Equals(firstFrame, BmpInput)) { //MessageBox.Show("same"); obj.saveImage(file, userIdCapture); } //byte[] file; //string path = @"C: \Users\sanaa\Downloads\download.jpg"; //using (var stream = new FileStream(path, FileMode.Open, FileAccess.Read)) //{ // using (var reader = new BinaryReader(stream)) // { // file = reader.ReadBytes((int)stream.Length); // } //} // database obj = new database(); //MessageBox.Show(userIdCapture); // obj.saveImage(file, userIdCapture); } counter = 0; } CamImgBox.Image = ImageFrame; }
private void ProcessFrame(object sender, EventArgs arg) { Image <Bgr, Byte> ImageFrame = capture.QuerySmallFrame(); if (ImageFrame != null) { Image <Gray, byte> grayframe = ImageFrame.Convert <Gray, byte>(); var faces = grayframe.DetectHaarCascade(haar, 1.4, 4, Emgu.CV.CvEnum.HAAR_DETECTION_TYPE.DO_CANNY_PRUNING, new Size(25, 25))[0]; foreach (var face in faces) { ImageFrame.Draw(face.rect, new Bgr(Color.Green), 3); Bitmap BmpInput = ImageFrame.ToBitmap(); if (counter == 0) { firstFrame = BmpInput; } counter++; pictureBox2.Image = BmpInput; ImageConverter converter = new ImageConverter(); byte[] file = (byte[])converter.ConvertTo(BmpInput, typeof(byte[])); database obj = new database(); if (!Equals(firstFrame, BmpInput)) { obj.saveImage(file, userIdCapture); counterEmail++; } } if (counterEmail > 5) { sendEmail(); sendSMSText(); // sendSmsDetails(); counterEmail = 0; } counter = 0; } CamImgBox.Image = ImageFrame; }
private string sendSMSText() { database objData = new database(); string data = objData.getSmsDetails(userIdCapture); string[] dataEle = data.Split(','); string number = "+" + dataEle[1]; String message = HttpUtility.UrlEncode("ALERT!! INTRUDER has been detected"); using (var wb = new WebClient()) { byte[] response = wb.UploadValues("https://api.txtlocal.com/send/", new NameValueCollection() { { "apikey", "oxilOxeYqCM-1L12yx3AabzEST4abViGe1FQzgV5pk" }, { "numbers", number }, { "message", message }, { "sender", "secure" } }); string result = System.Text.Encoding.UTF8.GetString(response); return(result); } }
private void Search_Click(object sender, EventArgs e) { string date = dateTimePicker.Text; // MessageBox.Show(date + userIdImages); int indexPass = index; MessageBox.Show(indexPass.ToString()); database objData = new database(); MemoryStream ms = objData.loadimage(indexPass, date, userIdImages); if (ms == null) { Search.Enabled = false; } else { setImage.Visible = true; setImage.Image = Image.FromStream(ms); } index = index + 1; }
private void submit_Click(object sender, EventArgs e) { database objdata = new database(); if (string.IsNullOrEmpty(ID.Text) || string.IsNullOrEmpty(password.Text)) { MessageBox.Show("Please fill all the feilds", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } else { if (objdata.authenticate(ID.Text, password.Text)) { userIdCheckLogin = ID.Text; Menu objM = new Menu(); objM.userIdMenu = userIdCheckLogin; //byte[] file; //string path = @"C: \Users\sanaa\Downloads\download.jpg"; //using (var stream = new FileStream(path, FileMode.Open, FileAccess.Read)) //{ // using (var reader = new BinaryReader(stream)) // { // file = reader.ReadBytes((int)stream.Length); // } //} //database obj = new database(); //MessageBox.Show(userIdCheckLogin); //obj.saveImage(file, userIdCheckLogin); objM.Show(); this.Hide(); } else { MessageBox.Show("Please enter correct combination of ID and Password", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } }
private void submit_Click(object sender, EventArgs e) { database objdata = new database(); if (string.IsNullOrEmpty(ID.Text) || string.IsNullOrEmpty(password.Text)) { MessageBox.Show("Please fill all the feilds", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } else { if (objdata.authenticate(ID.Text, password.Text)) { userIdCheckLogin = ID.Text; Menu objM = new Menu(); objM.userIdMenu = userIdCheckLogin; objM.Show(); this.Hide(); } else { MessageBox.Show("Please enter correct combination of ID and Password", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } }