Тёмный

Face Detection on Image using Matlab 

Nuruzzaman Faruqui
Подписаться 16 тыс.
Просмотров 29 тыс.
50% 1

You can download the code from here: admissionschol...
Images processing has always been an active field of research. There are scope of improvement, innovation, development and modification in image processing. As a result the field is ever expanding, full of challenges and excitements. Usually students start image processing with fundamentals of image processing. It includes related mathematical background, popular algorithms, their implementations and applications. Eventually they start working on projects. One of the most common image processing project is Face Detection. In this article, we are going to explain how to perform Face Detection in Still Picture using MATLAB.
This article explains the implementation process of face detection in still picture using MATLAB. Along with explanation, it includes the MATLAB code.
Implementation of Face Detection in Still Picture using MATLAB
It is wise to start with the basics. Generally speaking, the most basic version of face detection is Face Detection in Still Picture. In general it is always beneficial to start with the basics because learners get the scope of developing a solid foundation. If you are working with face detection, I recommend you to understand the basics of face detection in still pictures first.
Once we have the image, we are ready to start writing the code. I am going to explain the code line by line. Hopefully it will make it easier to understand.
1. First read the image using ‘imread()’ function and store it in a variable
2. Then read the width and height of the image using ‘size()’ function. We need to know the size of the image to resize it. If the image is too large, it will take longer to detect the face. However, reducing the size of the image does not impact the detection accuracy significantly.
3. Once the size is detected, we are going to initiate an ‘if’ condition.
4. If the width of the image is more than 320 pixels, then we will resize it to 320 pixel width. We use ‘imresize()’ function to resize images. We will not touch the height so that the width and height ratio is maintained by the function.
5. Now we can use ‘vision.CascadeObjectDetector’, a built-in pre-trained object detection of MATLAB, to detect the face. First of all, we need to create an instance of this object
6. Then using ‘step()’ function, we have to assign the image to the object detector. After doing it, the ‘step()’ function will return the location of the face
7. As we have the location of the face on the image now, we can simply draw a rectangle on that location using ‘insertShape()’ function
8. And finally we can show the image with detected face
Using this simple 8 steps, we can detect face on images using MATLAB. You can download the code from here: admissionschol...

Опубликовано:

 

11 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 47   
@mrmkkryt6485
@mrmkkryt6485 4 года назад
This is my first project. I was very happy when the code produced result. Thank you so much for your wonderful teaching.
@zarishlashari6758
@zarishlashari6758 Год назад
hahah Same...Happiness on its peak😍😁😂
@jaganmohanroyalnanubala3095
@jaganmohanroyalnanubala3095 Месяц назад
Hello Sir, I can not able to access the inbuilt laptop camera,How we can do sir.please letme know
@zarishlashari6758
@zarishlashari6758 Год назад
jazakALLAH..sir🌷👑 i follow step by step Process...it works
@jayendrachoudhary5314
@jayendrachoudhary5314 3 года назад
great it really works
@NuruzzamanFaruquis
@NuruzzamanFaruquis 3 года назад
Thank you.
@mrmkkryt6485
@mrmkkryt6485 4 года назад
Can you make more videos of this sort to help out budding engineers.
@alialaraby6165
@alialaraby6165 3 года назад
Thank you for this lesson Please, I want you to tell me what is the algorithm for this subject and how to do a test on the webcam online not recorded video .. What is the code or what are the changes to this code to do the required purpose
@shahanurrahman-vy7rv
@shahanurrahman-vy7rv Год назад
Really useful video. Thanks
@yakshas.j9201
@yakshas.j9201 4 года назад
Why is my Matlab showing this error?? (Unable to resolve the name vision.CascadeObjectDetector)
@NuruzzamanFaruquis
@NuruzzamanFaruquis 4 года назад
Have you installed Computer Vision toolbox?
@sunilkumar-ke5wv
@sunilkumar-ke5wv 4 года назад
@@NuruzzamanFaruquis how do i download that? plzs send me the link
@alsabtilaila1923
@alsabtilaila1923 3 года назад
@@sunilkumar-ke5wv Same problem here
@prachiprajapat5515
@prachiprajapat5515 3 года назад
Same problem
@prachiprajapat5515
@prachiprajapat5515 3 года назад
Is there any solution to resolve these priblem
@prayagsawai7017
@prayagsawai7017 3 года назад
Hello Sir, now we have detected a face, next i want to compare the face with stored sets of faces and show the name of the person. How should i approach this.
@hammadzaheer2122
@hammadzaheer2122 3 года назад
Sir i found the error in matlab 2012 which says for line 12 Error in Face_Detection_on_image (line 12) the_Image = insertShape(the_image, 'Rectangle', face_Location); Can you please guide me sir i am on some work regarding to face detection, i will wait for your humble suggestion
@NuruzzamanFaruquis
@NuruzzamanFaruquis 3 года назад
The insertShape() function was introduced in Matlab 2013A. Please use MATLAB 2013 or higher version to get rid of the problem.
@sehrishkhalid8065
@sehrishkhalid8065 3 года назад
vision.cascadeObject is giving error. I dont have computer vision toolbox installed..........Do we have to buy it????????Kindlly reply me
@lodzart1575
@lodzart1575 4 года назад
good lesson please keep it up! Thank you
@barihahaider4637
@barihahaider4637 4 года назад
this code is not working on MATLAB 2015a. can you share another code of face detection on image like this one which could run on MATLAB 2015? i need it! please.
@animeamvs6421
@animeamvs6421 4 года назад
I have error : undeffiened functiob or variable "webcam"
@NuruzzamanFaruquis
@NuruzzamanFaruquis 4 года назад
You do not have support package for webcam. Install it and the problem will be solved.
@amj7090
@amj7090 3 года назад
I was getting error help out sir [Location of the face= Invalid expression. Check for missing or extra characters.] anyone help me out plss
@afriadialsidiminahmad5474
@afriadialsidiminahmad5474 Год назад
Hallo, sir, can you make a tutorial on ear pattern classification in the recognition of the human ear?
@saharasad8773
@saharasad8773 2 года назад
JazakAllah ✨
@geminiqueen11
@geminiqueen11 3 года назад
Thank you ☺ Can you make video of matlab fire detection plz
@dimas5070
@dimas5070 2 года назад
thank you sir
@RESC_Eng
@RESC_Eng 4 года назад
perfect thank you so much
@top10gameing33
@top10gameing33 3 года назад
nice lesson ,can you pls post animal detection the forest
@D3GamesOficial
@D3GamesOficial 4 года назад
Nice lesson
@NuruzzamanFaruquis
@NuruzzamanFaruquis 4 года назад
Thank You
@nabilahzainal5761
@nabilahzainal5761 3 года назад
Hi sir. Can this code be used to detect corrosion?
@NuruzzamanFaruquis
@NuruzzamanFaruquis 3 года назад
If you train the classifier to detect corrosion, then it is possible.
@cmscfojas6629
@cmscfojas6629 Год назад
Can you share how the detector detected the face?
@eylulmood4830
@eylulmood4830 4 года назад
Thank you :)
@NuruzzamanFaruquis
@NuruzzamanFaruquis 4 года назад
Most welcome
@hamoudihamoudi-gh5xy
@hamoudihamoudi-gh5xy 4 года назад
Nice job
@NuruzzamanFaruquis
@NuruzzamanFaruquis 4 года назад
Thank you
@amj7090
@amj7090 3 года назад
Sir can I get result using 2021 Version
@robincr9533
@robincr9533 4 года назад
Nice When will be the next video
@NuruzzamanFaruquis
@NuruzzamanFaruquis 4 года назад
The next video will be published in 48 hours. Thank you.
@saqibriaz8777
@saqibriaz8777 4 года назад
Code plz
@rukhsana7155
@rukhsana7155 2 года назад
Have complete MATLAB tutorial code with dataset Face Mask Gender Recognition
@user-xy6mk2bj2z
@user-xy6mk2bj2z 4 года назад
I need code pluzzzzz
@D3GamesOficial
@D3GamesOficial 4 года назад
Dude, is a simple code, rewrite that.
@NuruzzamanFaruquis
@NuruzzamanFaruquis 4 года назад
Will be available in my website soon