Saturday, December 17, 2016

Real Time Video Surveillance via Bio Metric Gait Recognition

Real Time Video Surveillance via Bio Metric Gait Recognition  

What is Bio-Metric?

"Bio-metric" comes from the Greek words.
‘Bio’ means ‘life’ and ‘metric’ means ‘to measure’.

Types of Bio-metrics:

There are two types of bio-metrics: Behavioral and Physical.  Behavioral: Voice recognition, keystroke, gait recognition (manner of walking), signature.  Physical: Fingerprint, retina, hand, face. Other bio-metric techniques, still in exploratory stages would include DNA bio-metrics, ear shape, fingernails or odor. 
Real Time Video Surveillance via Bio Metric Gait Recognition  

What is Gait Recognition?

 Gait recognition is recognizing people based on the way they walk. The interest in gait as a bio-metric is strongly motivated by the need for an automated recognition system for visual surveillance and monitoring applications. 

Real Time Video Surveillance via Bio Metric Gait Recognition  

Why Gait Recognition?

People often feel that they can identify a familiar person from afar simply by recognizing the way the person walks. This common experience, combined with recent interest bio-metrics, has led to the development of gait recognition as a form of bio-metric identification
Real Time Video Surveillance via Bio Metric Gait Recognition  


BIO-METRIC GAIT RECOGNITION APPROACHES:

·         MACHINE VISION
·         FLOOR SENSOR  
·         WEARABLE SENSOR  
Real Time Video Surveillance via Bio Metric Gait Recognition  


Gait and Gait Recognition:

 We define gait to be the coordinated, cyclic combination of movements that result in human locomotion. The movements are coordinated in the sense that they must occur with a specific temporal pattern for the gait to occur. The movements in a gait repeat as a walker cycles between steps with alternating feet. It is both the coordinated and cyclic nature of the motion that makes gait a unique phenomenon.

What We Do:

As my final year project is real time video Surveillance via Bio Metric Gait Recognition. I do research on that topic and on the end using Matlab 16 i will create an algorithm using existing algorithms which can identify a person by the way he walk.

As we know every person has his unique style of walking and the pattern of walking he repeat will help us to find the difference between two persons.

By using real time of offline video we have to identify a person which was not in our data base.

Usage:

This system helps us in many ways like 
Attendance
Security purposes



 
Real Time Video Surveillance via Bio Metric Gait Recognition  

Real Time Video Surveillance via Bio Metric Gait Recognition  


Blogger : Hafiz Muhammad Usman Siddique
University : Comsats Wah Campus, Pakistan
Project: Real Time Video Surveillance via Bio Metric Gait Recognition
Email: m7u786@gmail.com
Mob: 03075230948

Wednesday, September 28, 2016

Simple Calculator using MATLAB

How to create Simple Calculator using MATLAB - Matlab for beginners

GUI Video is below the code 


function varargout = mycaltest(varargin)
gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...
                   'gui_Singleton',  gui_Singleton, ...
                   'gui_OpeningFcn', @mycaltest_OpeningFcn, ...
                   'gui_OutputFcn',  @mycaltest_OutputFcn, ...
                   'gui_LayoutFcn',  [] , ...
                   'gui_Callback',   []);
if nargin && ischar(varargin{1})
    gui_State.gui_Callback = str2func(varargin{1});
end

if nargout
    [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
    gui_mainfcn(gui_State, varargin{:});
end
function mycaltest_OpeningFcn(hObject, eventdata, handles, varargin)
handles.output = hObject;

guidata(hObject, handles);


function varargout = mycaltest_OutputFcn(hObject, eventdata, handles) 
varargout{1} = handles.output;


function four_Callback(hObject, eventdata, handles)
str = get(handles.ans,'String');
str = strcat(str,'4');
set(handles.ans,'String',str);


function one_Callback(hObject, eventdata, handles)
str = get(handles.ans,'String');
str = strcat(str,'1');
set(handles.ans,'String',str);

function point_Callback(hObject, eventdata, handles)
str = get(handles.ans,'String');
str = strcat(str,'.');
set(handles.ans,'String',str);

function seven_Callback(hObject, eventdata, handles)
str = get(handles.ans,'String');
str = strcat(str,'7');
set(handles.ans,'String',str);

function zero_Callback(hObject, eventdata, handles)
str = get(handles.ans,'String');
str = strcat(str,'0');
set(handles.ans,'String',str);

function two_Callback(hObject, eventdata, handles)
str = get(handles.ans,'String');
str = strcat(str,'2');
set(handles.ans,'String',str);

function five_Callback(hObject, eventdata, handles)
str = get(handles.ans,'String');
str = strcat(str,'5');
set(handles.ans,'String',str);

function eight_Callback(hObject, eventdata, handles)
str = get(handles.ans,'String');
% it will take the value of ans (ans is our static text
str = strcat(str,'8');
%it will concatinate 8 with the privues string
set(handles.ans,'String',str);
%and it will again set the new value to ans static text 

function equal_Callback(hObject, eventdata, handles)
str = get(handles.ans,'String');
%it will take the value 
str = eval(str);
%the eval function solve the string or evalutae the string
set(handles.ans1,'String',str);
%after evaluation the ans was 
      %shown in the above static text ans1.

function three_Callback(hObject, eventdata, handles)
str = get(handles.ans,'String');
str = strcat(str,'3');
set(handles.ans,'String',str);

function six_Callback(hObject, eventdata, handles)
str = get(handles.ans,'String');
str = strcat(str,'6');
set(handles.ans,'String',str);

function nine_Callback(hObject, eventdata, handles)
str = get(handles.ans,'String');
str = strcat(str,'9');
set(handles.ans,'String',str);

function div_Callback(hObject, eventdata, handles)
str = get(handles.ans,'String');
str = strcat(str,'/');
set(handles.ans,'String',str);

function add_Callback(hObject, eventdata, handles)
str = get(handles.ans,'String');
str = strcat(str,'+');
set(handles.ans,'String',str);

function sub_Callback(hObject, eventdata, handles)
str = get(handles.ans,'String');
str = strcat(str,'-');
set(handles.ans,'String',str);

function mul_Callback(hObject, eventdata, handles)
str = get(handles.ans,'String');
str = strcat(str,'*');
set(handles.ans,'String',str);

function clear_Callback(hObject, eventdata, handles)
set(handles.ans1,'String','');
set(handles.ans,'String','');







Read Also:  


Monday, September 26, 2016

Upload file from URL to Server using cURL in PHP


This Post show how to upload data or audio files on server getting from URL and how to download that file in PC using URL.


First put URL in string like below:

$url = 'http://s.cdnpk.eu/pk-mp3/love-dose/s165352040.mp3';

To Download file in PC its a simple short-cut.using download attribute of <a> tag in HTML.

echo "<a href='".$url."' download='myfile.wav'>Download</a>";


Now convert that URL to file using curl.

$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HEADER, false);
$data = curl_exec($curl);
curl_close($curl);

Now create a file on server. And open it in write mode.


  $fileName = "myfile.wav";
  $fh = fopen($fileName, 'w') or die("can't open file");


Write the file which we fetch from URL in 'myfile'. it was in $data variable.

  fwrite($fh, $data);
  fclose($fh);

Close the file that's it. Happy coding. :)


Wednesday, September 21, 2016

BFS (breadth first search) in BST (binary search tree)

BFS code in red color highlighted.  
1) Insertion in BST
2) Normal Searching in BST.
3) BFS in BST


#include<iostream.h>
#include<conio.h>
class Node{
private:
 int data;
 Node* right;
 Node* left;
public:
 Node(){
  root=NULL;
  right=left=NULL;
 }Node *root;

 void insert(int data){
  Node* newnode = new Node();
  newnode->data = data;
   if (root == NULL){
   root=newnode;
   return;
  }
  Node *p,*q;
  p=q=root;
  while (q!=NULL){
   p=q;
   if (newnode->data> q->data)
    q = q->right;
   else q = q->left;
  }
  if (newnode->data> p->data)
   p->right = newnode;
  else p->left = newnode;
 }


 void inorder(Node *root){
  if (root == NULL) return;
  else {
   cout << root->data <<" ";
   inorder(root->left);
  // cout << root->data <<"  ";
   inorder(root->right);
   }
 }



void search(Node *root,int v)
{
int flag=0;
Node *q=root;
while(v != q->data)
{
if(v < q->data && q->left != NULL)
{
flag=2;
q=q->left;
}
else if( v > q->data && q-right !=NULL)
{
flag=2;
q=q->right;
}else{
flag=1;
cout<<"\n Node value not found . "<<endl;
break;
}
}
if(flag == 0 || flag ==2){
cout<<"\nNode is  found= "<<q->data<<endl;
 }
}

void BFS(Node* root,int value){
 Node **arry=NULL;
 int i=0,j=0;
 arry[i]=root;
 if(root->data == value){
 cout<<root->data<<" ";
 }
 else{           i++;
 while(arry[j]->data != value){
 Node *a=arry[j];
 if(a->left != NULL)
 {
  arry[i]=a->left;i++;
if( a->left->data==value)
{break;}
 }
 if(a->right !=NULL)
{
 arry[i]=a->right;i++;
if(a->right->data==value)
{break;}
 }
   j++;}//end of loop
for(int x=0;x<=(sizeof(arry)/sizeof(*arry));x++){
cout<<arry[x]->data<<" ";
    }//end of for
  }//end of else
}//end of function

};

void main()
{
int c,A[]={8,4,5,1,12,11,13,3,14};
 Node b;
 clrscr();
 for(int i=0;i<=8;i++){
 b.insert(A[i]);
 }

 b.inorder(b.root);
 getch();

cout<<"\n\nEnter Value For Search ";cin>>c;
b.BFS(b.root,c);
getch();

// b.search(b.root,c);
//getch();

// cout<<"\n\nInsert a New Value ";cin>>c;
// b.insert(c);
// b.inorder(b.root);
// getch();

}


Thursday, August 4, 2016

Thursday, April 28, 2016

Simple web page layouts examples

in this i share three types of very simple web page layouts you can donwload them from my facebook group the .html was uploaded here.

Download File from following Links:


Web Layout No 1.


Web Layout No 2

Web Layout No 3






<style>
h1,h2,p{text-align: center;color:#eee;}
.top h1{font-size: 800%;}
table{margin:3% auto;}
.top .top_left table td{padding: 20px;background-color: #b3b3b3;}
*{margin:0px;padding:0px;}
body{background-color: #f2ccff;}
.top{border: 2px solid;width: 95%;margin: auto;height: 45%;}
.top .top_left{border: 0px solid;width: 25%;height: 100%;float: left;background-color: #404040}
.top .top_right{border: 1px solid;width: 75%;height: 100%;margin: 0% 25%;background-color: #4f404f;}
.top .top_left .logo{width: 40%;margin:3% auto;height: 50%;border-radius: 100%;background-color:#b3b3b3;}

.menu{border: 2px solid;width: 95%;margin: auto;height: 8%;border-radius: 0px 0px 20px  20px; background-color: #737373;}

.mid{width: 95%;margin: auto;}
.mid .link_item{border: 2px solid olive;width: 25%;height: 100%;margin: 1% 1% 0% 0%;float: left;position: relative;background-color: #eee;border-radius: 10px; }
.mid .main_body{border: 2px solid olive;width:50%;margin: 1% 0%;height: 100%;float:left; position: relative;background-color: #eee;border-radius: 10px;}
.mid .right_links{border: 2px solid olive;width: 22%;height: 100%;margin: 1% 0% 0% 1%;position: relative;float: left;background-color: #eee;border-radius: 10px;}
.footer{width: 95%;margin: auto;height: 10%;float:left;margin-left: 2.5%;background-color: skyblue;}

</style>




<div class="top">
<div class="top_left">
<div class="logo">
</div>
<h2>Beginners Heap</h2><p>Some info about site</p>
<table><tr><td></td><td></td><td></td></tr></table>
</div>
<div class="top_right">
<h1>Slider here</h1>
</div>

</div>

<div class="menu">
</div>

<div class="mid">
<div class="link_item">
</div>
<div class="main_body">
</div>
<div class="right_links">
</div>

</div>


<div class="footer">




</div>


Sunday, April 24, 2016

Delete Data in SQL Database using PHP

In my last three posts i covers the topics that how to create connection insert data and then if we want to update that data so then how to update data in in sql database table using php.

For step by step learning see my privies posts on database and php.









Today in this post we delete a record from login table we take a form inputs from user where he gave us the name and password of the user which he want to delete.


<?php
include "conn.php";

$user = $_POST['user'];
$pass = $_POST['password'];


$sql = "DELETE from login 
        where user='".$user."' and PASSWORD='".$pass."' ";

if ($conn->query($sql) === TRUE) {
    echo "Record Deleted successfully";

} else {
    echo "Error: " . $sql . "<br>" . $conn->error;
}

$conn->close();
?>




Wednesday, April 13, 2016

Create Connection with SQL Database in PHP

How to create connection with mysql database using PHP ?

So for this first create a database in myPhpAdmin and then use that name in mysqli default constructor by default the password was null and user name is root. If you are using XAMP then the servername is localhost.


<?php
$servername = "localhost";
$username = "root";
$password = Null;
$dbname = "paging";

// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);

// Check connection
if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
} else{
echo "Connection Sucssful";
}

?>


copy paste above code save in conn.php file and run on localhost like localhost/conn.php

Saturday, April 9, 2016

View Details On Mouse Click Using Java-Script and HTML

If You Click on the element then it will show its description.




This is First Option
here
is some 
description
This is Second Option
here
is some 
description
This is Third Option
here
is some
 description
This is Fourth Option
here
is some
 description
This is Fifth Option
here
is some
 description


Download Complete Code From Here



HTML Code:
<body>
<div class="main">
<p class="option" onclick="foo(this)" id="1">This is First Option<img src="http://www.clipartbest.com/cliparts/dT6/xXE/dT6xXEpT9.png"></p>
<div class="dec" id="a1"><pre>here
is some 
description</pre></div>
</div>

<div class="main">
<p class="option" onclick="foo(this)" id="2">This is Second Option<img src="http://www.clipartbest.com/cliparts/dT6/xXE/dT6xXEpT9.png"></p>
<div class="dec" id="a2"><pre>here
is some 
description</pre></div>
</div>

<div class="main">
<p class="option" onclick="foo(this)" id="3">This is Third Option<img src="http://www.clipartbest.com/cliparts/dT6/xXE/dT6xXEpT9.png"></p>
<div class="dec" id="a3"><pre>here
is some
 description</pre></div>
</div>

<div class="main">
<p class="option" onclick="foo(this)" id="4">This is Fourth Option<img src="http://www.clipartbest.com/cliparts/dT6/xXE/dT6xXEpT9.png"></p>
<div class="dec" id="a4"><pre>here
is some
 description</pre></div>
</div>

<div class="main">
<p class="option" onclick="foo(this)" id="5">This is Fifth Option<img src="http://www.clipartbest.com/cliparts/dT6/xXE/dT6xXEpT9.png"></p>
<div class="dec" id="a5"><pre>here
is some
 description</pre></div>
</div>
<h1 style="text-align:center;text-shadow:10px 10px 10px red;">""Click on Option to View its Discription""<br><span style="color:blue">Develper:Usman Siddique</span></h1>
</body>


Java-Script Code:

<script>
function foo(getid){
var x = document.getElementById('a'+(getid.id));
if(x.style.display=="block")
{
x.style.display="none";}
else{x.style.display="block";}
}
</script>


CSS Code:
<style>
.main p img{height: 3%;float: left;width: 10%;}
body{background-color:wheat;}
.main{border: 2px solid;width: 20%;margin: auto;background-color:skyblue;box-shadow: 2px 2px 50px hotpink;padding: 10px;}
.option{border: 2px solid wheat;padding:5px;text-align:center;margin: 0px;cursor:pointer}
.dec{background-color: whitesmoke;padding: 5px;display: none; }
</style>

Show Details On Mouse Hover Using CSS HTML


This will show details of an option when the mouse pointer is on that specific option.



Display Discription
This is First Option
here
is some 
description
This is Second Option
here
is some 
description
This is Third Option
here
is some
 description
This is Fourth Option
here
is some
 description
This is Fifth Option
here
is some
 description


Download The Complete Code From here


The HTML Code is:
<body>
<div class="main">
<p class="option" onclick="foo()">This is First Option</p>
<div class="dec"><pre>here
is some
description</pre></div>
</div>

<div class="main">
<p class="option" onclick="foo()">This is Second Option</p>
<div class="dec"><pre>here
is some
description</pre></div>
</div>

<div class="main">
<p class="option" onclick="foo()">This is Third Option</p>
<div class="dec"><pre>here
is some
 description</pre></div>
</div>

<div class="main">
<p class="option" onclick="foo()">This is Fourth Option</p>
<div class="dec"><pre>here
is some
 description</pre></div>
</div>

<div class="main">
<p class="option" onclick="foo()">This is Fifth Option</p>
<div class="dec"><pre>here
is some
 description</pre></div>
</div>
<h1 style="text-align:center;text-shadow:10px 10px 10px red;">""Take Pointer on Option to View its Discription""<br><span style="color:blue">Develper:Usman Siddique</span></h1>


</body>


CSS Code:
<style>
body{background-color:wheat;}
.main{border: 2px solid;width: 20%;margin: auto;background-color:skyblue;box-shadow: 2px 2px 50px hotpink;padding: 10px;}
.option{border: 2px solid wheat;padding:5px;text-align:center;margin: 0px;cursor:pointer}
.dec{background-color: whitesmoke;padding: 5px;display: none; }
.option:hover + .dec{display: block;}
.dec:hover{display: block;}
</style>


Friday, April 8, 2016

Type Casting in Java: Type Conversion in Java


Convert Sting to Int:

String str = "1234";
int foo = Integer.praseInt(str);

Convert Char to Int:

char a = '3';
int foo = (int) a-48;

String to Char Array:

String str = "1234";
char [] charary = str.toCharArray();

Covert Int to String:

int w=1234;
String se=Integer.toString(w);

Convert Double to int:

double x=22.4;
int a= (int)x;

Convert long to int:

long a =10;
int  s = (int) a;

Convert String to BigInteger:


String b="1234422";

BigInteger a=new BigInteger(b); 

Thursday, April 7, 2016

File Handling in Java::Reading and Writing

Reading and writing files in Java using Formatter, Scanner and bufferedreader:


Simple Open a File in Java:

package myfirstproject;
import java.io.*;
public class MyFirstProject {  
    public static void main(String args[]) throws IOException
   {
      File name=new File("C:\\usman\\input.txt");
      if(name.exists()){
          System.out.println(name.getName()+"File is exists");
      }
      else{
          System.out.println("File does not exists");
      }
}
}


Craete New File in Java:

package myfirstproject;
import java.io.*;
import java.util.*;

public class MyFirstProject {  
    public static void main(String args[]) throws IOException
   {
       /*final Formatter x;
       x =new  Formatter("C:\\usman\\fatima.txt");
     
     
*/      File name=new File("C:\\usman\\input1.txt");
        name.createNewFile();
      if(name.exists()){
          System.out.println(name.getName()+"File is exists");
      }
      else{
          System.out.println("File does not exists");
      }
}


}Write in File Using Formatter in Java:
package myfirstproject;
import java.io.*;
import java.util.*;
import java.lang.*;

public class MyFirstProject {  
    public static void main(String args[]) throws IOException
   {
       final Formatter x;
       x = new Formatter("C:\\usman\\usman.txt");
       x.format("%s%s%s%d", "usman " ,"Siddique ", "fatima " ,3);
     
       File name=new File("C:\\usman\\usman.txt");
       if(name.exists()){
           System.out.println("true");
      }
     
       x.close();
}

}



Reading File Using Scanner in Java:
package myfirstproject;
import java.io.*;
import java.util.*;
import java.lang.*;

public class MyFirstProject {  
    private Scanner a;
    public static void main(String args[]) throws IOException
   {
       final Formatter x;
       x = new Formatter("C:\\usman\\input.txt");
     
        MyFirstProject obj=new MyFirstProject();
        obj.a=new Scanner(new File("C:\\usman\\usman.txt"));
        while(obj.a.hasNext()){
            String value=obj.a.next();
       x.format("\n%s\t%d", value  ,3);
        }
       File name=new File("C:\\usman\\usman.txt");
       if(name.exists()){
           System.out.println("true");
      }
     
       x.close();
}

}

Saturday, March 26, 2016

Thursday, February 25, 2016

Simple CV Using HTML and CSS .... About Me Example

HTML:-


<div class="bod">
          <div class="pro">
                 <img src="a.jpg" class="img1">
          </div>
<div class="intro">
   <p class="p1">Hafiz Muhammad Usman Siddique</p>
    <p class="p2">"I am usman.A little boy with big attributes.An empty pocketed with big                ideas in mind.A courage to do big thing but did'nt do any thing yet .lol"</p>

</div>
<div class="second">

<table class="he"  align="center" cellspacing="31px">
<tr><th colspan="3">Skills<hr></th></tr>
<tr>
<td>CSS</td>
<td>HTML</td>
<td>PHP</td></tr>
</table>

<table border="1" align="center" >
<tr><th colspan="2">EDUCATION</th><th colspan="2">INTERNSHIP</th><th colspan="2">PROJECTS</th><th colspan="2">CONTACT</th></tr>
<tr><th rowspan="2">School:</th><td>F G Public School</td>
<th rowspan="2">Ptcl:</th><td>F G Public School</td>
<th rowspan="2">Web:</th><td>F G Public School</td>
<th rowspan="2">Email:</th><td>m7u786@gmail.com</td></tr>
<tr><td>2001-2010</td><td>2001-2010</td></tr>
<tr><th rowspan="2">Collage:</th><td>HITEC Collage For Boys</td>
<th rowspan="2">Lrims:</th><td>F G Public School</td>
<th rowspan="2">Android:</th><td>F G Public School</td>
<th rowspan="2">Mob No:</th><td>03075230948</td></tr>
<tr><td>2011-2012</td></tr>
<tr><th rowspan="2">University:</th><td>Comsats Wah Campus</td>
<th rowspan="2">Codingboths:</th><td>F G Public School</td>
<th rowspan="2">Desktop:</th><td>F G Public School</td>
<th rowspan="2">Address:</th><td>HIT Taxila Cantt,Rawalpindi</td></tr>
<tr><td>2013-2017</td></tr>
<tr><th colspan="2"></th><th colspan="2">Description</th><th colspan="2">Description</th><th colspan="2">Description</th></tr>
<tr><th colspan="2"><pre>i
e-resizee
e</pre></th><th colspan="2"></th><th colspan="2"></th><th colspan="2">.</th></tr>

</div>
</div>



CSS:-


<style>
.he td{border-radius:100px;width:100px;height:100px;text-align:center;border:1px solid ;}
.he {padding:15px;}
.p1{font-weight:bold;font-size:20px;text-align:center;}
.pro{padding-left:43%;padding-top:5%;background-color: #aff;}
.intro{background-color:#eee;}
.second{background-color:#ee9;}
.img1{width: 200px;border-radius: 100px;height: 200px; }
.p2{text-align:center;}body{background-color:whitesmoke;}
.bod{background-color:#eee}
</style>




Tuesday, February 9, 2016

XML - Display XML in browser in Graphical Form Using CSS

XML stands for EXtensible Markup Language.
XML was designed to store and transport data.
XML was designed to be both human- and machine-readable.








XML Document:-


<?xml-stylesheet type="text/css" href="xmlstyle.css"?>
<personal_info>
Thats My Personal Information:- 
<self_intro>
It Show Only Self introduction:-
<name>Name: Hafiz Muhammad Usman Siddique</name>
<mob_no>Mob No: 03075230948</mob_no>
</self_intro>
<education>
It show some Educational introduction:-
<reg_no>Reg No: FA13-BSE-080</reg_no>
<university>University : Comsats Wah Campus</university>
</education>

</personal_info>

CSS File:-


personal_info{color:red;font-weight: bold;border: 1px solid black;width: 24%;padding: 20px;margin: 20px;text-decoration: underline;
}
self_intro{color:green;display: block;padding: 10px;text-decoration: none;
}
name{color:blue;display: block;padding-left: 20px;
}
mob_no{color:orange;display: block;padding-left: 20px;
}
education{color:brown;display: block;padding: 10px;
}
reg_no{color:pink;display: block;padding-left: 20px;
}
university{color:black;padding-left: 20px;
}