8Th Semester Project
2018
FACE DETECTION AND TRACKING USING DIGITAL IMAGE
PROCESSING
Submitted to
Department of Electronics & Communication
Submitted By
Narayan Lal Menariya
Varun Bhatnagar
Content
• Electricity generation and Consumption in India
• Origin and definition of the Problem
• Need to save electricity?
• Method to reduce consumption and wastage.
• Project Work Plan
• Flow Chart
• Literature survey
• Methodology
• Implementation
• Result
• Minor Equipment
• Reference
SUMMARY
In this MATLAB based project we are extracting the frames from the video and
dividing each frame into two quadrant. After detecting the face in respective
quadrant we are setting the flag variable. This flag variable later can be used as a
switch for automatic controlling of the home appliances.
Electricity generation and Consumption in India
• India is the world's third largest producer and fourth largest
consumer of electricity (2016-2017).
• gross electricity generated was 1,236.39 TWh
• total electricity generation was 1,433.4 TWh
• The gross electricity consumption was 1,122 kWh per capita
• Current electricity generation depending on of fossil fuels(71% )
– coal (59.6%),
– Gas(9%),
– Oil(0.52%)
– Nuclear(1.9%)
Origin and definition of the Problem
• We do not waste electricity for any bad intentions
• but owing to our negligence and casual practices of electricity
use causes wastes
• Lack of awareness & importance of energy conservation
• Use of Inefficient equipment/appliances
• Mentality of “I can pay whatever I consume” thinking
• Negligent way of handling of energy utilities
• Fail to monitoring & auditing energy consumption bills
• present busy and stressful life
Need to save electricity?
• To reduce electricity bills.
• Electricity is not only fuel for our daily life but also vital for
countries economic growth (GDP growth).
• Reduce imports of fossil fuels (import rate of fossil fuel is 38 %
report by 2012) and increasing every year )
• Reduce impacts of fossil fuels on environment
– coal based power plant emits 1.1Kg(average) of CO for
producing 1 unit(kWh) of electricity.
– Oil, Gas & Coal are likely to last for only 20 years.
– we have Oil, Gas, Coal reserves of only 0.5% , 0.6% & 7%
respectively of the total world reserves.
How to reduce consumption and avoid wastage?
• Obviously we can ...
– use LED
– aware before using zero bulbs
– Use air conditioners, refrigerators, freezer at optimum temperature
– Etc...
• But what are the other steps ?
• Its the Era of Artificial Intelligence.
– Smart Home Automation attracted the interest of the research
community at the great manner
– But what if any person is impaired to send the message for controlling
the appliances.
Project Work Plan
• Save Electricity and provide Artificial Intelligence
– for Automatically Controlling of the home Appliances with MATLAB
image processing.
• Supposed to have any room
– Room is divided into specific quadrants
– corresponding quadrants having some appliances
– supposed to switch on and off according to the presence of person in
corresponding quadrant
• Once the image and its quadrant are detected
– corresponding appliances are controlled with the help of
microprocessor interrupts and internet of things (IoT).
PROCEDURE OF FACE DETECTION
• Step 1: Read frame from CCTV camera
• Step 2: Matrix dimension into four Quadrants as shown in
figure
• Step 3: Check for any face detection of person
• Step 4: Check for the respective quadrant where the face is
detected
• Step 5: Actuate the respective appliances of that quadrant
• Step 6: Repeat from Step 1
Literature Survey
Literature survey
Viola-Jones algorithm: Two features are selected for the task of face
detection:
1. first feature: the region of the eyes is often darker than the region
of the nose and cheeks
2. second feature: the eyes are darker than the bridge of the nose
Viola-Jones algorithm
3. Classifier can be constructed which reject many of the
negative sub windows while detecting almost all positive
instances.
4. The final detector is scanned across the image at multiple
scales and locations
5. The detector is also scanned across location, by shifting the
window some number of pixels
6. It is useful to post process the detected sub-windows in
order to combine overlapping detections into a single
detection.
FACE TRACKING
Literature Survey
CAMShift Algorithm:
1. Set the region of interest (ROI) of the probability distribution
image to the entire image.
2. Select an initial location of the Mean Shift search window. The
selected location is the target distribution to be tracked.
3. Calculate a color probability distribution of the region centred at
the Mean Shift search window.
4. Iterate Mean Shift algorithm to find the centroid of the probability
image. Store the zeroth moment (distribution area) and centroid
location.
5. For the following frame, center the search window at the mean
location found in Step 4 and set the window size to a function of
the zeroth moment. Go to Step 3.
Methodology
Implementation
• a simple face tracking system can be design by dividing the
tracking problem into three separate problems:
– Detect a face to track
– Identify facial features to track
– Track the face
Step-1: Detect a Face To Track
• vision.CascadeObjectDetector used to detect the location of a
face in a video frame
• The cascade object detector uses the Viola-Jones detection
algorithm and a trained classification model for detection
Step-2: Identify Facial Features To Track
• shape, texture, or color can be used to track the face.
• In this example, we use skin tone as the feature to track.
– Extract the frame from video
– Convert each frame into hue using rgb2hsv() function
– Display the Hue Channel data and draw the bounding box around the
face.
Step 3: Track the Face
• After selecting skin tone as a tracking feature histogram based
tracker can be used to track the face
• Histogram based tracker uses the CamShift algorithm
Implementation
Implementation
• video player object is created for displaying the video
• Track the face over successive video frames until the video is
finished.
Results
Class Room
Result
Quadrants Division of class room
Result
Face Detection in Two Quadrant
flag1 = 0; flag2=1;
Result
If(flag1 == 1)
switch on the appliances of quadrant1
Else
switch off the appliances of quadrant1
If(flag2 == 1)
switch on the appliances of quadrant2
Else
switch off the appliances of quadrant2
Minor Equipment
• CCTV Camera
• MATLAB Software
• Raspberry Pi Board
• NRF24L01 with antenna
Proposed outcome
• Save wastage of Electricity
• IoT Based project
• No need of Manual controlling of home appliance
• Low cost
• Applicable at
– Home
– Hospital
– School
– Etc
• No requirement of larger area for project installation
• Less maintenance is required
Reference
• Electricity Sector in India – Wikipedia
(https://en.wikipedia.org/wiki/Electricity_sector_in_India )
• Image source – Google
• MATLAB Help menu
• Youtube – Matlab Image Processing
• MATALB Reference note by Cranes Varsity
Thanking you...

Home automation using MATLAB image processing

  • 1.
    8Th Semester Project 2018 FACEDETECTION AND TRACKING USING DIGITAL IMAGE PROCESSING Submitted to Department of Electronics & Communication Submitted By Narayan Lal Menariya Varun Bhatnagar
  • 2.
    Content • Electricity generationand Consumption in India • Origin and definition of the Problem • Need to save electricity? • Method to reduce consumption and wastage. • Project Work Plan • Flow Chart • Literature survey • Methodology • Implementation • Result • Minor Equipment • Reference
  • 3.
    SUMMARY In this MATLABbased project we are extracting the frames from the video and dividing each frame into two quadrant. After detecting the face in respective quadrant we are setting the flag variable. This flag variable later can be used as a switch for automatic controlling of the home appliances.
  • 4.
    Electricity generation andConsumption in India • India is the world's third largest producer and fourth largest consumer of electricity (2016-2017). • gross electricity generated was 1,236.39 TWh • total electricity generation was 1,433.4 TWh • The gross electricity consumption was 1,122 kWh per capita • Current electricity generation depending on of fossil fuels(71% ) – coal (59.6%), – Gas(9%), – Oil(0.52%) – Nuclear(1.9%)
  • 5.
    Origin and definitionof the Problem • We do not waste electricity for any bad intentions • but owing to our negligence and casual practices of electricity use causes wastes • Lack of awareness & importance of energy conservation • Use of Inefficient equipment/appliances • Mentality of “I can pay whatever I consume” thinking • Negligent way of handling of energy utilities • Fail to monitoring & auditing energy consumption bills • present busy and stressful life
  • 6.
    Need to saveelectricity? • To reduce electricity bills. • Electricity is not only fuel for our daily life but also vital for countries economic growth (GDP growth). • Reduce imports of fossil fuels (import rate of fossil fuel is 38 % report by 2012) and increasing every year ) • Reduce impacts of fossil fuels on environment – coal based power plant emits 1.1Kg(average) of CO for producing 1 unit(kWh) of electricity. – Oil, Gas & Coal are likely to last for only 20 years. – we have Oil, Gas, Coal reserves of only 0.5% , 0.6% & 7% respectively of the total world reserves.
  • 7.
    How to reduceconsumption and avoid wastage? • Obviously we can ... – use LED – aware before using zero bulbs – Use air conditioners, refrigerators, freezer at optimum temperature – Etc... • But what are the other steps ? • Its the Era of Artificial Intelligence. – Smart Home Automation attracted the interest of the research community at the great manner – But what if any person is impaired to send the message for controlling the appliances.
  • 8.
    Project Work Plan •Save Electricity and provide Artificial Intelligence – for Automatically Controlling of the home Appliances with MATLAB image processing. • Supposed to have any room – Room is divided into specific quadrants – corresponding quadrants having some appliances – supposed to switch on and off according to the presence of person in corresponding quadrant • Once the image and its quadrant are detected – corresponding appliances are controlled with the help of microprocessor interrupts and internet of things (IoT).
  • 9.
    PROCEDURE OF FACEDETECTION • Step 1: Read frame from CCTV camera • Step 2: Matrix dimension into four Quadrants as shown in figure • Step 3: Check for any face detection of person • Step 4: Check for the respective quadrant where the face is detected • Step 5: Actuate the respective appliances of that quadrant • Step 6: Repeat from Step 1
  • 10.
  • 11.
    Literature survey Viola-Jones algorithm:Two features are selected for the task of face detection: 1. first feature: the region of the eyes is often darker than the region of the nose and cheeks 2. second feature: the eyes are darker than the bridge of the nose
  • 13.
    Viola-Jones algorithm 3. Classifiercan be constructed which reject many of the negative sub windows while detecting almost all positive instances. 4. The final detector is scanned across the image at multiple scales and locations 5. The detector is also scanned across location, by shifting the window some number of pixels 6. It is useful to post process the detected sub-windows in order to combine overlapping detections into a single detection.
  • 14.
  • 15.
    Literature Survey CAMShift Algorithm: 1.Set the region of interest (ROI) of the probability distribution image to the entire image. 2. Select an initial location of the Mean Shift search window. The selected location is the target distribution to be tracked. 3. Calculate a color probability distribution of the region centred at the Mean Shift search window. 4. Iterate Mean Shift algorithm to find the centroid of the probability image. Store the zeroth moment (distribution area) and centroid location. 5. For the following frame, center the search window at the mean location found in Step 4 and set the window size to a function of the zeroth moment. Go to Step 3.
  • 16.
  • 17.
    Implementation • a simpleface tracking system can be design by dividing the tracking problem into three separate problems: – Detect a face to track – Identify facial features to track – Track the face Step-1: Detect a Face To Track • vision.CascadeObjectDetector used to detect the location of a face in a video frame • The cascade object detector uses the Viola-Jones detection algorithm and a trained classification model for detection
  • 18.
    Step-2: Identify FacialFeatures To Track • shape, texture, or color can be used to track the face. • In this example, we use skin tone as the feature to track. – Extract the frame from video – Convert each frame into hue using rgb2hsv() function – Display the Hue Channel data and draw the bounding box around the face. Step 3: Track the Face • After selecting skin tone as a tracking feature histogram based tracker can be used to track the face • Histogram based tracker uses the CamShift algorithm Implementation
  • 19.
    Implementation • video playerobject is created for displaying the video • Track the face over successive video frames until the video is finished.
  • 20.
  • 21.
  • 22.
    Result Face Detection inTwo Quadrant flag1 = 0; flag2=1;
  • 23.
    Result If(flag1 == 1) switchon the appliances of quadrant1 Else switch off the appliances of quadrant1 If(flag2 == 1) switch on the appliances of quadrant2 Else switch off the appliances of quadrant2
  • 24.
    Minor Equipment • CCTVCamera • MATLAB Software • Raspberry Pi Board • NRF24L01 with antenna
  • 25.
    Proposed outcome • Savewastage of Electricity • IoT Based project • No need of Manual controlling of home appliance • Low cost • Applicable at – Home – Hospital – School – Etc • No requirement of larger area for project installation • Less maintenance is required
  • 26.
    Reference • Electricity Sectorin India – Wikipedia (https://en.wikipedia.org/wiki/Electricity_sector_in_India ) • Image source – Google • MATLAB Help menu • Youtube – Matlab Image Processing • MATALB Reference note by Cranes Varsity
  • 27.