Visual Communication With Paralyzed People Using Face Detection
Visual Communication With Paralyzed People Using Face Detection
A PROJECT REPORT
submitted to the
of
MASTER OF COMPUTER APPLICATIONS
ANNA UNIVERSITY
CHENNAI -600 025
SEPTEMBER-2023
i
BONAFIDE CERTIFICATE
Certified that the project report titled “VISUAL COMMUNICATION WITH PARALYZED
PEOPLE USING FACE DETECTION” is the bonafide work of Mr.R. AKASH (Registration number:
112421622002), who carried out the research under my supervision. Certified further that to
the best of my knowledge the work reported here in does not from part of any other project
report or dissertation on the basis of which a degreeor award was conferred on an earlier
occasion on this or any other candidate.
ii
ACKNOWLEDGEMENT
I would like to express my sincere thanks and gratitude to our honorable Chairman
Thiru.Dr.S.K.PURUSHOTHAMAN,M.E.,Ph.D.,
My sincere thanks to all the teaching and non-teaching members of the Department
of Computer Applications, who have directly or indirectly helped us in this project
R.AKASH
iii
VISUAL COMMUNICATION WITH PARALYZED
PEOPLE USING FACE DETECTION
TABLE OF CONTENTS
S. No Title Page No.
1 Abstract 1
2 Introduction 1
3 Existing System 3
4 Proposed System 4
5 Scope of the project 5
6 Literature Survey 5
(i) Visual Communication 7
(ii) Image Processing 8
(iii) Types of Image Processing 8
(iv) Face Detection 8
7
(v) Eye Detection 9
(vi) Types of Eye Tracking
10
Technology
(vii) Blink Detection 11
The programming language used
8 11
Python
9 System Architecture 17
10 Data flow Diagram 18
11 ER Diagram 19
iv
12 Use case Diagram 20
13 Steps for Implementation 21
14 Modules 22
15 Description of module 22
16 Deep learning 25
17 Implementation 37
18 Future Enhancement 67
19 Conclusion 68
20 Reference 70
v
ABSTRACT
1
Introduction:
This output from Face Detection Algorithm then gets processed using
AdaBoost Classifier to detect the eye region in the face.
Eye detected will be sent to check if there is any movement of the eyeball.
If it’s there, then this movement will be tracked to give out the combination
the patient is using to express the dialogue.
If not, then the blink pattern will be processed to give out the voice as well
as the text input with the respective dialogue.
There are many methods introduced for motor neuron disease patients to
communicate with the outside world such as Brain wave technique and
Electro-oculography.
Loss of speech can be hard to adjust. It is difficult for the patients to make
the caretaker understand what they need especially when they are in hospitals.
It becomes difficult for the patients to express their feelings and even they
cannot take part in conversations.
The proposed system detects the voluntary blinks of the patient and
accordingly sends the message about the requirement to the caretaker and also
gives the voice output via a call to the caretaker. The system uses an inbuilt
camera to capture the video of the patient and with the help of a facial
landmark algorithm, it identifies the face and eyes of the patient. The system
then slides a bunch of images one after the other on the screen and the patient
can choose to blink over the image he wants ,just to convey message of his
2
desires. The system identifies the blink with help of eye aspect ratio and then
sends a message to the care taker of what the patient wants and also the system
initiates a call to the care taker where in a voice is audible saying what the
patient wants.
Problem Statement:
Patients who lose the ability to speak and write they can only contact the
outside world through human-computer interaction; e.g. controlling brain waves
or tracking eye movements. Currently, brain wave-controlling devices need to be
worn by users, so they are not convenient for people to use.
Existing System:
This Eye Blink sensor sense the eye blink using is infrared, The Variation
Across the eye will vary as per eye blink, If the eye is closed the output is high
3
otherwise output is low. The eye -blink sensor works by illuminating the eye
and eyelid area with infrared light, then monitoring the changes in the reflected
light using a phototransistor and differentiator circuit. The exact functionality
depends greatly on the positioning and aiming of the emitter and detector with
respect to the eye. The eye blink sensor is an IR based blink sensor. If the eye is
closed, it means the output is high otherwise the output is low. Here the input
is sampled three times per blink; these input blinks are classified as a short or
long blink. Since eight appliances are being controlled simultaneously (which
is also equal to 23 appliances), three blinks are used to control the appliance.
Obtrusive
Not independent
Proposed System:
The proposed project aims to bring out a solution for the paralyzed people
without any harm to their body externally or internally. It overweighs the
previously developed prototypes in this field because none of the components are
in direct contact with the patients body hence it definitely will prove to be safer.
Fast: There are few algorithms which are developed for video Oculography
system for communication. The main objective of this project is to develop an
algorithm which is extremely fast compared to the existing ones.
3. To give all the services for the paralyzed people after they communicate
their needs via blinks.
5
Literature Survey
We try to take care of their issue utilizing eye blink sensor. An eye blink sensor
is a transducer which detects an eye blink, and gives a yield voltage at whatever
point the eye is shut. This project is about eye blinking for instance, in systems
that monitor a paralyzed human so that he/she can operate home appliances, such
as light, fan, Air Condition and so on. Also, this is connected with Android
Smartphone Bluetooth radio, so that patients can communicate with others in
case of emergency via sending text SMS, just by blinking their eyes.
6
H.S. Prashanth, 2012. Assistance for paralyzed using Eye Blink
Detection, The main aim of this paper is to design a real time interactive system
that can assist the paralyzed to control.
Content:
1. Visual Communication:
Visual communication is the practice of using visual elements to convey a
message, inspire change, or evoke emotion.
7
Image Processing
3. Face Detection
4. Eye Detection
6. Blink Detection
10
Programming Language Used
Python
Python Libraries
As we don’t need to write the same code again and again for
different programs. Python libraries play a very vital role in fields of
Machine Learning, Data Science, Data Visualization, etc.
11
The following are the libraries used in our project
1. OpenCv
2. Dlib
3. Enum
4. Time
5. Tkinter
6. Subprocess
7. Gtts
8. PIL
9. Twillio
10.tempfile
1. OpenCV
By using it, one can process images and videos to identify objects,
faces, or even handwriting of a human. When it integrated with various
libraries, such as NumPy, python is capable of processing the OpenCV
array structure for analysis.
2. Dlib
3. Enum
4. Time
As the name suggests Python time module allows to work with time
in Python. It allows functionality like getting the current time, pausing the
Program from executing, etc. So before starting with this module we need
to import it.
5. Tkinter
Python with tkinter is the fastest and easiest way to create the GUI
applications. Creating a GUI using tkinter is an easy task.
13
6. Subprocess
7. gtts
The speech can be delivered in any one of the two available audio
speeds, fast or slow. However, as of the latest update, it is not possible to
change the voice of the generated audio.
8. PIL(Pillow)
PIL stands for Python Imaging Library, and it’s the original library
that enabled Python to deal with images. PIL was discontinued in 2011 and
only supports Python 2.
14
To use its developers’ own description, Pillow is the friendly PIL
fork that kept the library alive and includes support for Python 3.
9. Twillio
10. Tempfile
In this case, a problem arose that many output files were created and
this cluttered the file system with unwanted files that would require
deleting every time the program ran.
15
System Architecture
16
Data Flow Diagram
17
ER Diagra
18
Use Case Diagram
19
Steps for Implementation
Step 8: Sending the text (or) if emergency situation means doing calls
Modules
3. Preprocessing
4. Face Detection
6. Sending Messages
20
Description of a Module
The very first module is collecting images from the camera The
camera should be placed in front of the paralyzed people and the camera
may be fixed with their wheelchair.
Camera will starts capturing their images when the person clicks the
concerned button that is fixed with the wheelchair.
The Captured images will be send to the system for the furtherr
procedure.
1. simplicity
2. Data Reduction
3. Preprocessing
21
It involves data validation and imputation to assess whether the data
is complete and accurate, and to correct errors and input missing values.
4. Face Detection
22
gaze position and direction, which are helpful to find the emotions of the
paralyzed person.
6. Sending Messages
This process uses the Twillio package to give the call to the
concerned person.
Deep Learning
23
1. Deep Learning is a subfield of Machine Learning that involves the use
of neural networks to model and solve complex problems. Neural
networks are modeled after the structure and function of the human
brain and consist of layers of interconnected nodes that process and
transform data.
2. The key characteristic of Deep Learning is the use of deep neural
networks, which have multiple layers of interconnected nodes. These
networks can learn complex representations of data by discovering
hierarchical patterns and features in the data. Deep Learning
algorithms can automatically learn and improve from data without the
need for manual feature engineering.
3. Deep Learning has achieved significant success in various fields,
including image recognition, natural language processing, speech
recognition, and recommendation systems. Some of the popular Deep
Learning architectures include Convolutional Neural Networks
(CNNs), Recurrent Neural Networks (RNNs), and Deep Belief
Networks (DBNs).
4. Training deep neural networks typically requires a large amount of
data and computational resources. However, the availability of cloud
computing and the development of specialized hardware, such as
Graphics Processing Units (GPUs), has made it easier to train deep
neural networks.
In summary, Deep Learning is a subfield of Machine Learning that involves the
use of deep neural networks to model and solve complex problems. Deep
Learning has achieved significant success in various fields, and its use is
expected to continue to grow as more data becomes available, and more
powerful computing resources become available.
Today Deep learning has become one of the most popular and visible
areas of machine learning, due to its success in a variety of applications, such
as computer vision, natural language processing, and Reinforcement learning.
25
Unsupervised Machine Learning: Unsupervised machine learning is
the machine learning technique in which the neural network learns to
discover the patterns or to cluster the dataset based on unlabeled
datasets. Here there are no target variables. while the machine has to
self-determined the hidden patterns or relationships within the
datasets. Deep learning algorithms like autoencoders and generative
models are used for unsupervised tasks like clustering, dimensionality
reduction, and anomaly detection.
Reinforcement Machine Learning: Reinforcement Machine
Learning is the machine learning technique in which an agent learns
to make decisions in an environment to maximize a reward signal. The
agent interacts with the environment by taking action and observing
the resulting rewards. Deep learning can be used to learn policies, or a
set of actions, that maximizes the cumulative reward over time. Deep
reinforcement learning algorithms like Deep Q networks and Deep
Deterministic Policy Gradient (DDPG) are used to reinforce tasks like
robotics and game playing etc.
Artificial neural networks are built on the principles of the structure and
operation of human neurons. It is also known as neural networks or neural nets.
An artificial neural network’s input layer, which is the first layer, receives input
from external sources and passes it on to the hidden layer, which is the second
layer. Each neuron in the hidden layer gets information from the neurons in the
previous layer, computes the weighted total, and then transfers it to the neurons
in the next layer. These connections are weighted, which means that the impacts
of the inputs from the preceding layer are more or less optimized by giving each
26
input a distinct weight. These weights are then adjusted during the training
process to enhance the performance of the model.
Algorithm Used
Visual Communication
Image Processing
Face Detection
Eye Detection
Blink Detection
1. Visual Communication
28
design principles to communicate that message so that it’s clear and eye-
catching.
2. Image Processing
1. Visualization
2. Recognition
3. Sharpening and Restoration
4. Pattern recognition
5. Retrieval
Visualization
29
Advantages of visualization:
Recognition
30
Step 1: Face detection
The camera detects and locates the image of a face, either alone or
in a crowd. The image may show the person looking straight ahead or in
profile.
31
Step 4: Finding a match
32
Pattern Recognition
Retrieval
3. Face Detection
33
Face detection uses machine learning (ML) and artificial neural
network (ANN) technology, and plays an important role in face tracking,
face analysis and facial recognition. In face analysis, face detection uses
facial expressions to identify which parts of an image or video should be
focused on to determine age, gender and emotions. In a facial recognition
system, face detection data is required to generate a faceprint and match it
with other stored faceprints.
4. Eye Detection
5. Blink Detection
There are a number of uses for blink detection. Probably the most
common use, as far as consumers are concerned, has been in cameras and
smartphones. The aim of this detection has been to help the photographer
improve their photographs, by telling them when their subjects have
blinked.
34
The blink detection technology focuses on the eyes of people in the
photograph (they can often work with up to twenty faces) and whenever a
pair of eyes are occluded there will either be a message displayed on the
lcd screen telling the photographer to delay taking their photograph, or the
more advanced cameras are smart enough to simply snap the photo at a
moment when all eyes are open.
Implementation:
Video_process.py
import cv2
class VideoProcess():
def __init__(self):
self.camera_dev = None
self.frame = None
self.window_name = 'source'
self.terminate = False
def start_capture(self):
self.camera_dev = cv2.VideoCapture(1)
if not self.camera_dev.isOpened():
print('Error: Failed to open Camera')
self.camera_dev = None
return False
# height = self.camera_dev.set(cv2.CAP_PROP_FRAME_HEIGHT, 960)
35
# width = self.camera_dev.set(cv2.CAP_PROP_FRAME_WIDTH, 1280)
# print('VideoProcess: start_capture: height = ', height, 'width', width)
return True
def get_frame(self):
self.fame = None
# Capture frame-by-frame
status, frame = self.camera_dev.read()
if not status:
print('Error: Failed to capture image')
return False, self.fame
# is it necessary to flip?
# gray_frame = cv2.flip(gray_frame, 1)
self.fame = frame.copy()
return True, self.fame
# Capture frame-by-frame
36
status, frame = self.get_frame()
if not status:
print('Error: Failed to capture image')
self.terminate = True
else:
if display_image == True:
self.show_image()
self.terminate_process()
def show_image(self):
# Display the resulting frame
cv2.imshow(self.window_name, self.frame)
key = cv2.waitKey(1)
if key == ord('e'):
self.terminate = True
def terminate_process(self):
# release the capture
self.camera_dev.release()
cv2.destroyAllWindows()
Dlib_process.py
'''
Final Project
'''
import cv2
37
import dlib
from enum import Enum
from time import time
import video_process
class LandMarkLoc(Enum):
lt_eye_top_1 = 37
lt_eye_btm_1 = 41
lt_eye_top_2 = 38
lt_eye_btm_2 = 40
rt_eye_top_1 = 43
rt_eye_btm_1 = 47
rt_eye_top_2 = 44
rt_eye_btm_2 = 46
lt_eye_st_crn = 36
lt_eye_end_crn = 39
rt_eye_st_crn = 42
rt_eye_end_crn = 45
LFT_EYE_TOP1 = 0
LFT_EYE_BTM1 = 1
LFT_EYE_TOP2 = 2
LFT_EYE_BTM2 = 3
RT_EYE_TOP1 = 4
RT_EYE_BTM1 = 5
RT_EYE_TOP2 = 6
RT_EYE_BTM2 = 7
38
LFT_EYE_ST_CNR = 8
LFT_EYE_END_CNR = 9
RT_EYE_ST_CNR = 10
RT_EYE_END_CNR = 11
EYE_STATE_INIT = -1
EYE_STATE_OPEN = 0
EYE_STATE_CLOSE = 1
class DlibProcess():
def __init__(self):
self.face_detector = dlib.get_frontal_face_detector()
self.land_mark_predictor =
dlib.shape_predictor('./models/shape_predictor_68_face_landmarks.dat')
self.terminate = False
self.frame = None
self.face_obj = None
self.land_mark_dict = {}
self.window_name = 'landmark'
self.blink_count = 0
self.eye_state = EYE_STATE_INIT
cv2.namedWindow(self.window_name)
cv2.moveWindow(self.window_name, 100, 100)
self.frame = image.copy();
39
# print('DlibProcess: image shape:', self.frame.shape)
def get_faces(self):
self.face_obj = None
if self.frame is None:
# print('DlibProcess(): get_faces: None objects detected')
return False
face_objs = self.face_detector(gray_frame, 1)
print("DlibProcess: Number of faces detected: {}".format(len(face_objs)))
if len(face_objs) != 1:
# print("DlibProcess: Number of faces detected is not 1")
return False
self.face_obj = face_objs[0]
return True
def get_lanmark_data(self):
self.land_mark_dict = {}
40
gray_frame = cv2.cvtColor(self.frame, cv2.COLOR_BGR2GRAY)
41
land_mark_obj.part(LandMarkLoc.rt_eye_btm_1.value).y)
42
land_mark_obj.part(LandMarkLoc.rt_eye_end_crn.value).y)
lt_h1 = land_mark_obj.part(LandMarkLoc.lt_eye_btm_1.value).y -
land_mark_obj.part(
LandMarkLoc.lt_eye_top_1.value).y
lt_h2 = land_mark_obj.part(LandMarkLoc.lt_eye_btm_2.value).y -
land_mark_obj.part(
LandMarkLoc.lt_eye_top_2.value).y
lt_width = self.land_mark_dict[LFT_EYE_END_CNR][0] -
self.land_mark_dict[LFT_EYE_ST_CNR][0]
lt_h1_ratio = lt_h1 / lt_width
lt_h2_ratio = lt_h2 / lt_width
eye_status = 'OPEN'
if lt_h1_ratio <= 0.18:
eye_status = 'CLOSE'
if self.eye_state == EYE_STATE_OPEN:
self.eye_state = EYE_STATE_CLOSE
self.blink_count += 1
else:
if self.eye_state == EYE_STATE_INIT or self.eye_state ==
EYE_STATE_CLOSE:
self.eye_state = EYE_STATE_OPEN
print('LT1: ', lt_h1, 'LT2: ', lt_h2, 'lt_h1_ratio: ', lt_h1_ratio, 'lt_h2_ratio: ',
lt_h2_ratio,
'EYE sttus', eye_status, 'blink_count: ', self.blink_count)
43
return True, self.blink_count
def show_image(self):
disp_img = self.frame.copy()
if len(self.land_mark_dict) == 0:
disp_img = cv2.line(disp_img, (disp_img.shape[1] - 50,
int(disp_img.shape[0] / 2)),
(disp_img.shape[1] - 50, int(disp_img.shape[0] / 2)), (0, 0,
255), 40)
else:
disp_img = cv2.line(disp_img, (disp_img.shape[1] - 50,
int(disp_img.shape[0] / 2)),
(disp_img.shape[1] - 50, int(disp_img.shape[0] / 2)), (0,
255, 0), 40)
44
# Display the resulting frame
cv2.imshow(self.window_name, disp_img)
key = cv2.waitKey(1)
if key == ord('e'):
self.terminate = True
status = vid_process.start_capture()
if status == False:
print('Error: DlibProcess: Failed to open camera')
self.terminate = True
# Capture frame-by-frame
status, frame = vid_process.get_frame()
if not status:
print('Error: DlibProcess: Failed to capture image')
self.terminate = True
else:
# set the captured image for processing
self.set_image(frame)
45
# Got frame from camera. Get get_faces
if self.get_faces() == True:
self.get_lanmark_data()
self.show_image()
vid_process.terminate_process()
self.blink_count = 0
status = vid_process.start_capture()
if not status:
print('Error: DlibProcess: get_blinkcount: Failed to open camera')
return status, self.blink_count
start_time = time()
while time() - start_time <= 1.0 * duration:
self.land_mark_dict = {}
self.frame = None
# Capture frame-by-frame
status, frame = vid_process.get_frame()
if not status:
46
print('Error: DlibProcess:get_blinkcount: Failed to capture image')
self.blink_count = 0
return status, self.blink_count
else:
# set the captured image for processing
self.set_image(frame)
self.show_image()
vid_process.terminate_process()
Main_view.py
class MainView(ttk.Frame):
47
data_matrix = []
image_reference_list = []
current_option = ""
back_option = ""
next_option = ""
rows = 0
selected_items = ""
blink_count = 0
selected_info_image = None
next_can_img = None
next_can_txt = None
curr_can_txt = None
curr_can_img = None
48
if self.stop_cycle == False:
root.after(100, self.calculate)
def update(self):
print('update function', self.blink_count)
root.after(300, self.update)
def get_next_option_onblink(self):
print("In get_next_option_onblink ::::, blink_count= ",self.blink_count)
for i in range(self.rows):
print("current_option = ",self.current_option)
if self.data_matrix[i][0] == self.current_option:
self.next_option = self.data_matrix[i][1]
self.back_option = self.data_matrix[i][2]
print("In get_next_option_onblink ::::, Back Option= ",
self.back_option, ", Current_Option = ", self.current_option, ", next_option=
", self.next_option)
if self.back_option == "meal" or self.back_option
=="health_assistance" or self.back_option =="mobility_assistance" or
self.back_option =="emergency" :
self.selected_items = ""
self.info_labelimg.configure(image='')
if self.blink_count > 0:
if "back" in self.current_option:
self.selected_items = ""
else:self.selected_items = self.current_option
self.set_selected_info()
49
self.back_option = self.current_option
self.current_option = self.next_option
if self.current_option == "request":
text = self.back_option.replace("_", " ").title()+" Requested"
audio_text = "Your request for " + self.back_option.replace("_",
" ").title() + " has been
sent. Your help is on the way. Thank you."
self.requested_msg.set(audio_text)
print("get requested msg = ", self.requested_msg.get())
self.get_audio_text(audio_text) # remove comment
if "Emergency" in text: self.send_call()
self.set_items(self.back_option, self.current_option, text)
self.stop_cycle = True
root.after(5000, self.set_item_mainscreen("meal"))
else:
text = self.current_option.replace("_", " ").title()
self.set_items(self.back_option, self.current_option, text)
elif self.blink_count == 0:
if "back" in self.current_option:
self.selected_items = self.current_option[:-5]
self.set_selected_info()
#text = "Back"
if "back" in self.back_option: text = "Back"
else : text = self.back_option.replace("_", " ").title()
50
self.set_items(self.current_option, self.back_option, text)
self.current_option = self.back_option
break
def set_selected_info(self):
if self.selected_items != "":
self.selected_info.set("You Selected " + self.selected_items.replace("_","
").title())
self.selected_info_image = PhotoImage(file="./gif_images/" +
self.selected_items + ".gif")
self.info_labelimg.configure(image = self.selected_info_image)
self.info_labelimg.image = self.selected_info_image
"""
Sends an SMS through the Textbelt API.
:param phone: Phone number to send the SMS to.
:param msg: SMS message. Should not be more than 160 characters.
:param apikey: Your textbelt API key. 'textbelt' can be used for free for 1
SMS per day.
:returns: True if the SMS could be sent. False otherwise.
:rtype: bool
"""
result = True
json_success = False
# Attempt to send the SMS through textbelt's API and a requests instance.
try:
resp = requests.post('https://textbelt.com/text', {
'phone': phone,
'message': msg,
'key': apikey,
})
except:
result = False
# Extract boolean API result
if result:
try:
json_success = resp.json()["success"]
51
except:
result = False
# Evaluate if the SMS was successfully sent.
if result:
if not json_success:
result = False;
# Give the result back to the caller.
return result
else:
self.selected_info.set("")
self.info_labelimg.configure(image='')
def main(self):
"""
Send an SMS message for testing purposes.
"""
phone = '+15558838530' # <-- Enter your own phone number here
smsmsg = "You Selected " + self.selected_items.replace("_"," ").title()
apikey = 'textbelt' # <-- Change to your API key, if desired
# Attempt to send the SMS message.
if send_textbelt_sms(phone, smsmsg, apikey):
print('SMS message successfully sent!')
else:
print('Could not send SMS message.')
else:
self.selected_info.set("")
self.info_labelimg.configure(image='')
52
def send_call(self):
account_sid = "AC41f98e886f567f58cec9b61e2d5cbf39"
auth_token = "e6066bc799a63a9251f687404f60dd57"
client = Client (account_sid, auth_token)
twilio_call = client.calls.create(to="+18056896547",
from_="+18447477770",
url="https://api.rcqatol.com/rentcafeapi.aspx?requesttype=twiliotest")
print(twilio_call.status)
self.selected_items = ""
self.selected_info.set("")
self.requested_msg.set("")
self.info_labelimg.configure(image='')
self.can.delete(self.next_can_img)
self.can.delete(self.next_can_txt )
53
self.can.delete(self.curr_can_img )
self.can.delete(self.curr_can_txt )
self.current_option = self.data_matrix[0][0]
54
image=self.image_reference_list[-1], anchor=NW)
self.next_can_txt = self.can.create_text(-self.image_reference_list[-
1].width() + (self.image_reference_list[-1].width() / 2),
self.image_reference_list[-1].height() - 150, text=text, fill='white',
font=("Times", 22, "bold"))
if i >= 45:
self.can.move(self.next_can_img, distx, 0)
self.can.move(self.next_can_txt, distx, 0)
root.update() # update the display
root.after(20) # wait 30 ms
self.curr_can_img = self.next_can_img
self.curr_can_txt = self.next_can_txt
55
top_frame = ttk.Frame(master, padding="15 15 15 15",
style='Black.TLabel')
top_frame.pack(side=TOP, fill="both")
self.logo = PhotoImage(file="./gif_images/logo.png")
main_label = ttk.Label(top_frame, text="", font=("Helvetica", 12, "bold
italic"),
image=self.logo, background= "#003455")
main_label.pack(fill = "none", expand=True)
# ---- info frame to indicate what option is selected
info_frame = ttk.Frame(master, padding="1 1 1
1",style='Black.TLabelframe')
info_frame.pack(side=TOP, fill="both")
self.frmtempimg = Image.open("./gif_images/frame_backimg1.gif")
self.frmtempimg = self.frmtempimg.resize((root.winfo_screenwidth(),
root.winfo_screenheight()))
self.frame_back_image = ImageTk.PhotoImage(image=self.frmtempimg)
self.info_label_backgrnd = ttk.Label(info_frame,
image=self.frame_back_image, border=0)
self.info_label_backgrnd.pack(fill = BOTH, expand = True)
56
self.info_label = ttk.Label(self.info_label_backgrnd, text="",
textvariable=self.selected_info, font=("Times", 20, "bold"), anchor = CENTER,
foreground="white", background = "#154360", border=0) #002366
self.info_label.grid(column=1, row=0, sticky=( W, E)) #pack(fill = "none",
expand = True, side = LEFT) #
self.info_labelimg = ttk.Label(self.info_label_backgrnd,
image=self.selected_info_image, border=0)
self.info_labelimg.grid(column=2, row=0, sticky=(N, W, E, S))
#pack(fill="none", side = LEFT) # grid(column=1, row=0, sticky=(N, W, E,
S))
root.columnconfigure(3, weight=1)
root.rowconfigure(0, weight=1)
for child in self.info_label_backgrnd.winfo_children():
child.grid_configure(padx=10, pady=10)
self.can = Canvas(self)
self.can.pack(side=TOP, fill="both", expand=True)
self.can.config(bd = 4, relief = "sunken")
self.set_item_mainscreen("meal")
57
# ---- message_frame to show final message
message_frame = ttk.Frame(master, padding="15 15 15 15",
style='Black.TLabel')
message_frame.pack(side=BOTTOM, fill="both")
message_label = ttk.Label(message_frame,
textvariable=self.requested_msg, foreground="white",background="#003455",
font=("Times", 17, "bold"))
message_label.pack(fill="none", expand=True)
if __name__ == "__main__":
root = Tk()
main = MainView(root)
root.title("Health Talk")
58
Output Screenshots
For Food
59
For Water
60
For Emergency
61
Output screenshot 5:
62
Output
Future Enhancement:
63
of messages between the muscles and the brain. The main objective is to
design a real time interactive system that can assist the paralysis patients
to control appliances such as lights, fans etc. In addition, It can also play
pre-recorded audio messages through predefined number of eye blinks and
it also helps to alert the doctor or concerned person by sending SMS in case
of emergency by using eye blink Sensor. The eye blink sensor is able to
detect an intentional blink from a normal blink, which is useful for the
paralysis patients especially Tetraplegic patients to regulate their home
devices easily without any help.
Conclusion:
Although blink detection systems exist for other purposes, an
implementation of a blink detection system with the end use of controlling
appliances has not been previously accomplished. While the system is
intended to assist the paralyzed and physically challenged, it can definitely
be used by all types of individuals. The main challenge involved in the
implementation of the system is the development of a real time robust blink
detection algorithm.
Many algorithms have been developed to serve the purpose, with some being
more accurate than the others. This paper presented a blink detection system
based on
online template matching. The first phase involved the blink detection
phase; the second phase involved the counting of blinks and subsequent
control of appliances through a micro controller.
By enabling the paralyzed to gain control of albeit a small
part of their lives, the system can offer some level of independence to
them. The helpers who are assigned the task of tending to paralyzed
persons through the day can then be afforded a break. The system needs
moderate processing power, making it suitable for practical use. For
64
continuous video input, laptops with built in webcams or USB cameras will
suffice.
The system is limited by the efficiency of the blink detection
algorithm and efficiency falls further under limited lighting conditions.
Since the initialization phase of the algorithm is based on differencing
between consecutive frames, background movement in the frame may lead
to inaccurate operation.
Typically, background movement causes non eye pairs to be
detected as eye pairs. This is overcome to some extent by limiting the
search region to the face of an individual, by implementing a face tracking
algorithm prior to blink detection. However, this in turn can lead to reduced
efficiency in blink detection. By giving an option to the user to choose
between the system with and without face tracking, a level of flexibility
can be reached. The application of the blink detection system is not limited
to the control of appliances but can also be used fora variety of other
functions. Playback of audio distress messages over an intercom system is
one of the other applications of the system. Future applications of the
system may include playback of video or audio files by eye blinks and
making a VOIP call to play a distress message. In the future, the system
can be implemented on a Digital Signal Processor, making it a truly
embedded system which could be used as a standalone device without the
need for a laptop or desktop PC. Application 1 ‘Bulb glows on’
REFERENCES
[1]. Experimental results show that the proposed scheme can achieve much
better eye blink detection.
65
[2]. Chinnawat Devahasdin Na Ayudhya, ThitiwanSrinark, A Method for
Real-Time Eye Blink Detection and Its Application
[3]. Michael Chau and Margrit Betke,2005. Real Time Eye Tracking and Blink
Detection with USB Cameras. Boston University Computer Science Technical
Report No. 2005-12. Boston, USA.
[4]. Liting Wang , Xiaoqing Ding , Chi Fang , Changsong Liu , Kongqiao
Wang ,2009. Eye Blink Detection Based on Eye Contour Extraction.
Proceedings of SPIE-IS&T Electronic Imaging. San Jose, CA, USA.
[7]. Kohei Aai and Ronny Mardiyanto, 2011. Comparative Study on Blink
Detection and Gaze Estimation Methods for HCI, in Particular, Gabor Filter
Utilized Blink Detection Method. Proceedings of Eighth International
Conference on Information Technology: New Generations. Las Vegas,
USA, pp. 441-446.
[8]. Taner Danisman, Ian Marius Bilasco, Chabane Djeraba, Nacim
Ihaddadene “Drowsy driver detection system using Eye Blink patterns” 2010
International Conference on Machine and Web Intelligence 29 November 2010
66
[9]. Atish Udayashankar ; Amit R. Kowshik ; S. Chandramouli ; H.S.
Prashanth,” Assistance for paralyzed using Eye Blink Detection, . 2012 fourth
international conference on digital home , 11 december 2012
[10]. Home automation with eye blink for paralyzed patients, DeepBose,
BRAC University, Bangladesh, 2017
[11]. F.M. Sukno, S.K. Pavani, C. Butakoffand and A.F. Frangi, “Automatic
Assessment of Eye Blinking Patterns through Statistical Shape Models,”
ICVS 2009, LNCS 5815, Springer-Verlag Berlin Heidelberg, pp. 33-42, 2009.
[12]. M. Divjak and H. Bischof, “Eye blink based fatigue detection for
prevention of Computer Vision Syndrome,” MVA2009 IAPR Conference on
Machine Vision Applications, Yokohama, Japan, May 2009.
[13]. L. Wang, X. Ding, C. Fang and C. Liu, “Eye blink detection based on
eye contour extraction,” Proceedings of SPIE, vol. 7245, 72450R, 2009.
67