{"id":16698,"date":"2020-07-12T17:53:44","date_gmt":"2020-07-12T12:23:44","guid":{"rendered":"https:\/\/www.mygreatlearning.com\/blog\/facial-recognition-using-python\/"},"modified":"2024-10-15T00:23:01","modified_gmt":"2024-10-14T18:53:01","slug":"facial-recognition-using-python","status":"publish","type":"post","link":"https:\/\/www.mygreatlearning.com\/blog\/facial-recognition-using-python\/","title":{"rendered":"Facial Recognition using Python | Face Detection by OpenCv and Computer Vision"},"content":{"rendered":"\n<p>Facial recognition is part of the computer vision techniques, and when I am talking about <a href=\"https:\/\/www.mygreatlearning.com\/blog\/what-is-computer-vision-the-basics\/\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\"computer vision (opens in a new tab)\">computer vision<\/a>, what does that stand for, and how is that related to our life?<\/p>\n\n\n\n<p>Let\u2019s a take real-time example,<\/p>\n\n\n\n<p>Our generation is quite familiar with Social media platforms, and we all share our memories with our virtual friends.<\/p>\n\n\n\n<p>But did you ever think when you upload some new photos in those social media sites, how they give you the suggestion to tag your friends automatically without any extra efforts?<\/p>\n\n\n\n<p>Here comes the computer vision technology in the scenario.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"what-is-computer-vision\"><strong>What is Computer Vision?<\/strong><\/h2>\n\n\n\n<p>Computer vision is a process to give the ability to the computer to see as a human. It is the part of computer science which is focused on replicating the intricate parts of the human visual system. It helps to identify and process the objects in images through the computer.<\/p>\n\n\n\n<p>The whole idea for the computer vision is to make an automatic replica of the human eye, which is more efficient than human eyes. Learn how <a aria-label=\"image recognition (opens in a new tab)\" href=\"https:\/\/www.mygreatlearning.com\/blog\/image-recognition\/\" target=\"_blank\" rel=\"noreferrer noopener\">image recognition<\/a> works. Work on <a href=\"https:\/\/www.mygreatlearning.com\/academy\/learn-for-free\/courses\/computer-vision-projects\" target=\"_blank\" rel=\"noreferrer noopener\">Computer Vision Projects<\/a> to improve your skillset.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"introduction-to-opencv\"><strong>Introduction to OpenCv:<\/strong><\/h2>\n\n\n\n<p>There are some predefined packages and libraries are there to make our life simple.&nbsp;<\/p>\n\n\n\n<p>One of the most important and popular libraries is Opencv. It helps us to develop a system which can process images and real-time video using computer vision. OpenCv focused on image processing, real-time video capturing to detect faces and objects.<\/p>\n\n\n\n<p><strong>Background of OpenCV:<\/strong><\/p>\n\n\n\n<p>&nbsp;<a href=\"https:\/\/opencv.org\/\" rel=\"nofollow\">OpenCV<\/a> was invented by&nbsp; Intel in 1999 by <strong>Gary Bradsky<\/strong>. The first release was in the year 2000. OpenCV stands for <strong>Open Source Computer Vision Library<\/strong>. This Library is based on optimised C\/C++ and it supports Java and Python along with C++ through interfaces.&nbsp;<\/p>\n\n\n\n<p>OpenCV is one of the most popular and successful libraries for computer vision and it has an immense number of users because of its simplicity, processing time and high demand in computer vision applications. OpenCV-Python is like a python wrapper around the C++ implementation. OpenCv has more than 2500 implemented algorithms which are freely available for commercial purpose as well. Check out the free course on <a href=\"\/academy\/learn-for-free\/courses\/face-recognition-in-opencv\" target=\"_blank\" rel=\"noreferrer noopener\">face recognition in opencv<\/a>.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"applications-of-opencv\"><strong>Applications of OpenCV:<\/strong><\/h2>\n\n\n\n<ol class=\"wp-block-list\"><li><strong>Medical image analysis: <\/strong>We all know image processing in the medical industry is very popular.&nbsp;&nbsp;<\/li><\/ol>\n\n\n\n<p>Let\u2019s take an example:<\/p>\n\n\n\n<p>Identify Brain tumour: Every single day almost thousands of patients are dealing with brain tumours. There are many software which are using OpenCv to detect the stage of the tumour using an image segmentation technique.<\/p>\n\n\n\n<p>One of the applications is RSIP Vision which builds a probability<strong> map<\/strong> to localize the tumour and uses deformable models to obtain the <strong>tumour boundaries with zero level energy.<\/strong><br><\/p>\n\n\n\n<p><\/p>\n\n\n\n<ol class=\"wp-block-list\"><li><strong>Object Detection: <\/strong>Detecting objects from the images is one of the most popular applications.<\/li><\/ol>\n\n\n\n<p>Suppose,<\/p>\n\n\n\n<p>You want to detect a person sitting on a two-wheeler vehicle without a helmet which is equivalent to a defensible crime.<\/p>\n\n\n\n<p>So you can make a system which detects the person without a helmet and captures the vehicle number to add a penalty.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>There are many applications there using OpenCv which are really helpful and efficient. These applications are also taking us towards a more advanced world with less human efforts.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"face-detection-using-opencv\"><strong>Face detection using OpenCV:<\/strong><\/h2>\n\n\n\n<ol class=\"wp-block-list\"><li><strong>Install OpenCV:<\/strong><\/li><\/ol>\n\n\n\n<p><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/strong>OpenCV-Python supports&nbsp;<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Mac OS,&nbsp;<\/li><li>Linux,&nbsp;<\/li><li>Windows.<\/li><\/ul>\n\n\n\n<p><strong>Detailed documentation For <\/strong><a href=\"https:\/\/docs.opencv.org\/3.0-beta\/doc\/py_tutorials\/py_setup\/py_setup_in_windows\/py_setup_in_windows.html\"><strong>windows<\/strong><\/a><strong> and for <\/strong><a href=\"https:\/\/www.pyimagesearch.com\/2016\/12\/19\/install-opencv-3-on-macos-with-homebrew-the-easy-way\/\"><strong>Mac<\/strong><\/a><strong>&nbsp;<\/strong><\/p>\n\n\n\n<p><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/strong><strong>pip install opencv-python<\/strong><strong>&nbsp;<\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"read-the-image-using-opencv\"><strong>Read the image using OpenCv:<\/strong><\/h2>\n\n\n\n<p>Machine converts images into an array of pixels where the dimensions of the image depending on the resolution of the image. The computer reads any image as a range of values between 0 and 255. Colour images have 3 primary channels&nbsp;&nbsp;<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Red,&nbsp;<\/li><li>green&nbsp;<\/li><li>and blue<\/li><\/ol>\n\n\n\n<p>A matrix is built by the library for every primary colour. Then the combination of matrices provides a Pixel value for the individual R, G, B colours.<\/p>\n\n\n\n<p>Two types of resolutions are there:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>RGB ---&gt; (Dimension ex: 32* 32 * 3 \u2192 3 refers to the RGB value)<\/li><li>Gray Scale&nbsp;<\/li><\/ol>\n\n\n\n<p><strong>Let\u2019s take an example of an image array with real-life image:<\/strong><\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Import cv2: Importing OpenCV<\/li><li>Img : Store and read the image&nbsp;<\/li><li>Print the array of the image<strong>&nbsp;<\/strong><\/li><\/ol>\n\n\n\n<p><strong>Output:<\/strong> Array of an image<\/p>\n\n\n\n<p><strong>The input image is read by using an imread module.<\/strong><\/p>\n\n\n\n<p><strong>Now in this imread module it has a parameter if we write,<\/strong><\/p>\n\n\n\n<ol class=\"wp-block-list\"><li><strong>img=cv2.imread(\u2018input image\u2019,1) \u2192 this 1 stands for color image<\/strong><\/li><li><strong>img=cv2.imread(\u2018input image\u2019,0) \u2192 0 stands for black and white image<\/strong><\/li><\/ol>\n\n\n\n<p><strong>3. Find out the shape of the Image:<\/strong><br><\/p>\n\n\n\n<ol class=\"wp-block-list\"><li><strong>img=cv2.imread(\u2018input image\u2019,1)<\/strong><\/li><\/ol>\n\n\n\n<p>3 refers to the RGB colour. Our image is a coloured image<br><\/p>\n\n\n\n<ol class=\"wp-block-list\"><li><strong>img=cv2.imread(\u2018input image\u2019,0)<\/strong><\/li><\/ol>\n\n\n\n<p><\/p>\n\n\n\n<ol class=\"wp-block-list\"><li><strong>Display the Image:<\/strong><\/li><\/ol>\n\n\n\n<p>Now we will just display our image using opencv functions<br><\/p>\n\n\n\n<ol class=\"wp-block-list\"><li><strong>Convert input image into grayscale image:<\/strong><\/li><\/ol>\n\n\n\n<p>So in this step, we need to convert our input images into gray scale images.<br><\/p>\n\n\n\n<p><strong>But why do we need to convert the input image into grayscale?<\/strong><br><\/p>\n\n\n\n<p>The reason why we need to convert them is that colour increases the complexity of the model. The inherent complexity of gray scale images is lower than coloured images.&nbsp;<br><\/p>\n\n\n\n<p>cv2.cvtColor() \u2192 method is used to convert an image from one color space to another. This method has more than 150 color-space conversion methods available.&nbsp;<br><\/p>\n\n\n\n<p><strong>COLOR_BGR2GRAY\u2192 <\/strong>&nbsp;Stands for converting the image into gray scale.<br><\/p>\n\n\n\n<ol class=\"wp-block-list\"><li><strong>Resize the input image:<\/strong><\/li><\/ol>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Now we will resize the input&nbsp; image using OpenCV library.<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>By default in resizing, it only changes the width and height of the image.<\/li><\/ol>\n\n\n\n<p><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Syntax to resize the image:<\/strong><\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cv2.resize(src, dsize[, dst[, fx[, fy[, interpolation]]]])<\/p>\n\n\n\n<p>&nbsp;&nbsp;<strong>Now you all have doubts, what are those parameters right?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>src<\/strong><strong> \u2192 <\/strong>src stands for the source, it converts the original image into numpy array<\/li><li><strong>dsize\u2192 <\/strong>dsize is basically the desired size of the output image. The nature of the size is tuple.<\/li><li><strong>fx<\/strong><strong> \u2192<\/strong> fx is used for the scaling factor along X-axis or Horizontal axis<\/li><li><strong>fy\u2192 <\/strong>fy is also used to scale factor the Y-axis or Vertical axis<\/li><li><strong>interpolation<\/strong><strong> \u2192 <\/strong>Interpolation is a method which decides the pixel value based on the neighbouring pixels and the scale at which the image is being resized<ul><li>INTER_NEAREST<\/li><li>INTER_LINEAR<\/li><li>INTER_AREA<\/li><li>INTER_CUBIC<\/li><li>INTER_LANCZOS4<\/li><\/ul><\/li><\/ul>\n\n\n\n<p><\/p>\n\n\n\n<ol class=\"wp-block-list\"><li><strong>Use haarcascade_frontalface_default.xml file to detect face:&nbsp;<\/strong><\/li><\/ol>\n\n\n\n<p><strong>But I know you all have a question: what is this haarcascade_frontalface_default.xml file right?<\/strong><br><\/p>\n\n\n\n<p>Let me tell you,<br><\/p>\n\n\n\n<p>Haar Cascade is basically a machine learning object detection algorithm which is used to identify objects in an image or video.<br><\/p>\n\n\n\n<p>And also It is a machine learning based approach where a cascade function is trained on a lot of positive and negative images and then it is used to detect objects in other images.<br><\/p>\n\n\n\n<p>Now haar cascade file in OpenCv is basically a classifier. This classifier is used to detect particular objects from the input image.<\/p>\n\n\n\n<p>The haarcascade_frontalface_default.xml is a part of the haar cascade mainly designed by OpenCV to detect the frontal face.<\/p>\n\n\n\n<p>We have three feature detection using Haar cascade<\/p>\n\n\n\n<p>1. Edge features<\/p>\n\n\n\n<p>2. Line features<\/p>\n\n\n\n<p>3. Center surrounded features<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>cv2.CascadeClassifier\u2192 This method will load the xml file from the library directly.<br><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"detect-the-face-from-the-image\"><strong>Detect the face from the image:<\/strong><\/h2>\n\n\n\n<p>As we already preprocess our input image and convert them into grayscale now we can jump to find the face in the input image.<\/p>\n\n\n\n<p>To find the face in the image face_cascade.detectMultiScale(gray, 1.1, 4) \u2192&nbsp; this method will help&nbsp;<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>But you all are thinking about what are these parameters?<br><\/p>\n\n\n\n<p>Let me explain you,<br><\/p>\n\n\n\n<p>cv2.CascadeClassifier.detectMultiScale(image[, scaleFactor[, minNeighbors[, flags[, minSize[, maxSize]]]]])&nbsp;<br><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>image<\/strong> : image stands for matrix of the type CV_8U which contains an image where objects are detected.<\/li><li><strong>scaleFactor<\/strong> : ScaleFactor helps to find out how much the image size is reduced at each image scale.<\/li><li><strong>minNeighbors<\/strong> : this parameter helps to detect how many neighbors each candidate rectangle should have to retain it. This parameter has a direct relation with the quality of the detected faces: higher value means less detection with higher quality.<\/li><li><strong>flags<\/strong> : Flags is used for the parameter with the same meaning for an old cascade as in the function cvHaarDetectObjects. It is not used for a new cascade.<\/li><li><strong>minSize<\/strong> : minSize stands for minimum possible object size. If Objects are smaller than that are ignored.<\/li><\/ul>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>maxSize<\/strong> :And this parameter is used to determine the&nbsp; Maximum possible object size. If Objects are larger than that are ignored.<\/li><\/ul>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>We define the detectMultiScale function for our image.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<ol class=\"wp-block-list\"><li><strong>Draw the rectangle around the face:<\/strong><\/li><\/ol>\n\n\n\n<p>Now define the method to create a rectangle using cv2.rectangle.<\/p>\n\n\n\n<p>Pass the parameters such as the image object, RGB values of the box outline and the width of the rectangle through the methods.<br><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>Output:<\/strong><br><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>As we break down our code into multiple part now let's check out the full code once:<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>So we can see with the OpenCV library, we can easily detect the face from the images. You can check out the free <a href=\"https:\/\/www.mygreatlearning.com\/opencv\/free-courses\" target=\"_blank\" rel=\"noreferrer noopener\">opencv courses<\/a> and get a detailed understanding of it. <\/p>\n\n\n\n<p>Great Learning's GL Academy has free courses to help you upskill. Here, you can learn to develop a <a href=\"https:\/\/www.mygreatlearning.com\/academy\/learn-for-free\/courses\/how-to-build-your-own-chatbot-using-python\" target=\"_blank\" rel=\"noreferrer noopener\">python chatbot<\/a> as well.<\/p>\n\n\n\n<p>Happy Learning!<br><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Facial recognition is part of the computer vision techniques, and when I am talking about computer vision, what does that stand for, and how is that related to our life? Let\u2019s a take real-time example, Our generation is quite familiar with Social media platforms, and we all share our memories with our virtual friends. But [&hellip;]<\/p>\n","protected":false},"author":41,"featured_media":16720,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_uag_custom_page_level_css":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[2],"tags":[36803,36796],"content_type":[],"class_list":["post-16698","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-artificial-intelligence","tag-opencv","tag-python"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.3 (Yoast SEO v27.3) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Face Detection by OpenCv and Computer Vision | Facial Recognition using Python<\/title>\n<meta name=\"description\" content=\"Face Detection by OpenCv: Machine converts images into an array of pixels where the dimensions of the image depending on the resolution of the image.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.mygreatlearning.com\/blog\/facial-recognition-using-python\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Facial Recognition using Python | Face Detection by OpenCv and Computer Vision\" \/>\n<meta property=\"og:description\" content=\"Face Detection by OpenCv: Machine converts images into an array of pixels where the dimensions of the image depending on the resolution of the image.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.mygreatlearning.com\/blog\/facial-recognition-using-python\/\" \/>\n<meta property=\"og:site_name\" content=\"Great Learning Blog: Free Resources what Matters to shape your Career!\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/GreatLearningOfficial\/\" \/>\n<meta property=\"article:published_time\" content=\"2020-07-12T12:23:44+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-10-14T18:53:01+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/07\/shutterstock_680761540-1.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1000\" \/>\n\t<meta property=\"og:image:height\" content=\"667\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Great Learning Editorial Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/Great_Learning\" \/>\n<meta name=\"twitter:site\" content=\"@Great_Learning\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Great Learning Editorial Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/facial-recognition-using-python\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/facial-recognition-using-python\\\/\"},\"author\":{\"name\":\"Great Learning Editorial Team\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#\\\/schema\\\/person\\\/6f993d1be4c584a335951e836f2656ad\"},\"headline\":\"Facial Recognition using Python | Face Detection by OpenCv and Computer Vision\",\"datePublished\":\"2020-07-12T12:23:44+00:00\",\"dateModified\":\"2024-10-14T18:53:01+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/facial-recognition-using-python\\\/\"},\"wordCount\":1591,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/facial-recognition-using-python\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/07\\\/shutterstock_680761540-1.jpg\",\"keywords\":[\"OpenCV\",\"python\"],\"articleSection\":[\"AI and Machine Learning\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/facial-recognition-using-python\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/facial-recognition-using-python\\\/\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/facial-recognition-using-python\\\/\",\"name\":\"Face Detection by OpenCv and Computer Vision | Facial Recognition using Python\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/facial-recognition-using-python\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/facial-recognition-using-python\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/07\\\/shutterstock_680761540-1.jpg\",\"datePublished\":\"2020-07-12T12:23:44+00:00\",\"dateModified\":\"2024-10-14T18:53:01+00:00\",\"description\":\"Face Detection by OpenCv: Machine converts images into an array of pixels where the dimensions of the image depending on the resolution of the image.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/facial-recognition-using-python\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/facial-recognition-using-python\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/facial-recognition-using-python\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/07\\\/shutterstock_680761540-1.jpg\",\"contentUrl\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/07\\\/shutterstock_680761540-1.jpg\",\"width\":1000,\"height\":667,\"caption\":\"facial recognition using python\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/facial-recognition-using-python\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Blog\",\"item\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"AI and Machine Learning\",\"item\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/artificial-intelligence\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Facial Recognition using Python | Face Detection by OpenCv and Computer Vision\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/\",\"name\":\"Great Learning Blog\",\"description\":\"Learn, Upskill &amp; Career Development Guide and Resources\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#organization\"},\"alternateName\":\"Great Learning\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#organization\",\"name\":\"Great Learning\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/GL-Logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/GL-Logo.jpg\",\"width\":900,\"height\":900,\"caption\":\"Great Learning\"},\"image\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/GreatLearningOfficial\\\/\",\"https:\\\/\\\/x.com\\\/Great_Learning\",\"https:\\\/\\\/www.instagram.com\\\/greatlearningofficial\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/school\\\/great-learning\\\/\",\"https:\\\/\\\/in.pinterest.com\\\/greatlearning12\\\/\",\"https:\\\/\\\/www.youtube.com\\\/user\\\/beaconelearning\\\/\"],\"description\":\"Great Learning is a leading global ed-tech company for professional training and higher education. It offers comprehensive, industry-relevant, hands-on learning programs across various business, technology, and interdisciplinary domains driving the digital economy. These programs are developed and offered in collaboration with the world's foremost academic institutions.\",\"email\":\"info@mygreatlearning.com\",\"legalName\":\"Great Learning Education Services Pvt. Ltd\",\"foundingDate\":\"2013-11-29\",\"numberOfEmployees\":{\"@type\":\"QuantitativeValue\",\"minValue\":\"1001\",\"maxValue\":\"5000\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#\\\/schema\\\/person\\\/6f993d1be4c584a335951e836f2656ad\",\"name\":\"Great Learning Editorial Team\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/02\\\/unnamed.webp\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/02\\\/unnamed.webp\",\"contentUrl\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/02\\\/unnamed.webp\",\"caption\":\"Great Learning Editorial Team\"},\"description\":\"The Great Learning Editorial Staff includes a dynamic team of subject matter experts, instructors, and education professionals who combine their deep industry knowledge with innovative teaching methods. Their mission is to provide learners with the skills and insights needed to excel in their careers, whether through upskilling, reskilling, or transitioning into new fields.\",\"sameAs\":[\"https:\\\/\\\/www.mygreatlearning.com\\\/\",\"https:\\\/\\\/in.linkedin.com\\\/school\\\/great-learning\\\/\",\"https:\\\/\\\/x.com\\\/https:\\\/\\\/twitter.com\\\/Great_Learning\",\"https:\\\/\\\/www.youtube.com\\\/channel\\\/UCObs0kLIrDjX2LLSybqNaEA\"],\"award\":[\"Best EdTech Company of the Year 2024\",\"Education Economictimes Outstanding Education\\\/Edtech Solution Provider of the Year 2024\",\"Leading E-learning Platform 2024\"],\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/author\\\/greatlearning\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Face Detection by OpenCv and Computer Vision | Facial Recognition using Python","description":"Face Detection by OpenCv: Machine converts images into an array of pixels where the dimensions of the image depending on the resolution of the image.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.mygreatlearning.com\/blog\/facial-recognition-using-python\/","og_locale":"en_US","og_type":"article","og_title":"Facial Recognition using Python | Face Detection by OpenCv and Computer Vision","og_description":"Face Detection by OpenCv: Machine converts images into an array of pixels where the dimensions of the image depending on the resolution of the image.","og_url":"https:\/\/www.mygreatlearning.com\/blog\/facial-recognition-using-python\/","og_site_name":"Great Learning Blog: Free Resources what Matters to shape your Career!","article_publisher":"https:\/\/www.facebook.com\/GreatLearningOfficial\/","article_published_time":"2020-07-12T12:23:44+00:00","article_modified_time":"2024-10-14T18:53:01+00:00","og_image":[{"width":1000,"height":667,"url":"http:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/07\/shutterstock_680761540-1.jpg","type":"image\/jpeg"}],"author":"Great Learning Editorial Team","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/Great_Learning","twitter_site":"@Great_Learning","twitter_misc":{"Written by":"Great Learning Editorial Team","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.mygreatlearning.com\/blog\/facial-recognition-using-python\/#article","isPartOf":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/facial-recognition-using-python\/"},"author":{"name":"Great Learning Editorial Team","@id":"https:\/\/www.mygreatlearning.com\/blog\/#\/schema\/person\/6f993d1be4c584a335951e836f2656ad"},"headline":"Facial Recognition using Python | Face Detection by OpenCv and Computer Vision","datePublished":"2020-07-12T12:23:44+00:00","dateModified":"2024-10-14T18:53:01+00:00","mainEntityOfPage":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/facial-recognition-using-python\/"},"wordCount":1591,"commentCount":0,"publisher":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/facial-recognition-using-python\/#primaryimage"},"thumbnailUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/07\/shutterstock_680761540-1.jpg","keywords":["OpenCV","python"],"articleSection":["AI and Machine Learning"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.mygreatlearning.com\/blog\/facial-recognition-using-python\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.mygreatlearning.com\/blog\/facial-recognition-using-python\/","url":"https:\/\/www.mygreatlearning.com\/blog\/facial-recognition-using-python\/","name":"Face Detection by OpenCv and Computer Vision | Facial Recognition using Python","isPartOf":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/facial-recognition-using-python\/#primaryimage"},"image":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/facial-recognition-using-python\/#primaryimage"},"thumbnailUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/07\/shutterstock_680761540-1.jpg","datePublished":"2020-07-12T12:23:44+00:00","dateModified":"2024-10-14T18:53:01+00:00","description":"Face Detection by OpenCv: Machine converts images into an array of pixels where the dimensions of the image depending on the resolution of the image.","breadcrumb":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/facial-recognition-using-python\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.mygreatlearning.com\/blog\/facial-recognition-using-python\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.mygreatlearning.com\/blog\/facial-recognition-using-python\/#primaryimage","url":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/07\/shutterstock_680761540-1.jpg","contentUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/07\/shutterstock_680761540-1.jpg","width":1000,"height":667,"caption":"facial recognition using python"},{"@type":"BreadcrumbList","@id":"https:\/\/www.mygreatlearning.com\/blog\/facial-recognition-using-python\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog","item":"https:\/\/www.mygreatlearning.com\/blog\/"},{"@type":"ListItem","position":2,"name":"AI and Machine Learning","item":"https:\/\/www.mygreatlearning.com\/blog\/artificial-intelligence\/"},{"@type":"ListItem","position":3,"name":"Facial Recognition using Python | Face Detection by OpenCv and Computer Vision"}]},{"@type":"WebSite","@id":"https:\/\/www.mygreatlearning.com\/blog\/#website","url":"https:\/\/www.mygreatlearning.com\/blog\/","name":"Great Learning Blog","description":"Learn, Upskill &amp; Career Development Guide and Resources","publisher":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/#organization"},"alternateName":"Great Learning","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.mygreatlearning.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.mygreatlearning.com\/blog\/#organization","name":"Great Learning","url":"https:\/\/www.mygreatlearning.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.mygreatlearning.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/06\/GL-Logo.jpg","contentUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/06\/GL-Logo.jpg","width":900,"height":900,"caption":"Great Learning"},"image":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/GreatLearningOfficial\/","https:\/\/x.com\/Great_Learning","https:\/\/www.instagram.com\/greatlearningofficial\/","https:\/\/www.linkedin.com\/school\/great-learning\/","https:\/\/in.pinterest.com\/greatlearning12\/","https:\/\/www.youtube.com\/user\/beaconelearning\/"],"description":"Great Learning is a leading global ed-tech company for professional training and higher education. It offers comprehensive, industry-relevant, hands-on learning programs across various business, technology, and interdisciplinary domains driving the digital economy. These programs are developed and offered in collaboration with the world's foremost academic institutions.","email":"info@mygreatlearning.com","legalName":"Great Learning Education Services Pvt. Ltd","foundingDate":"2013-11-29","numberOfEmployees":{"@type":"QuantitativeValue","minValue":"1001","maxValue":"5000"}},{"@type":"Person","@id":"https:\/\/www.mygreatlearning.com\/blog\/#\/schema\/person\/6f993d1be4c584a335951e836f2656ad","name":"Great Learning Editorial Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/02\/unnamed.webp","url":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/02\/unnamed.webp","contentUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/02\/unnamed.webp","caption":"Great Learning Editorial Team"},"description":"The Great Learning Editorial Staff includes a dynamic team of subject matter experts, instructors, and education professionals who combine their deep industry knowledge with innovative teaching methods. Their mission is to provide learners with the skills and insights needed to excel in their careers, whether through upskilling, reskilling, or transitioning into new fields.","sameAs":["https:\/\/www.mygreatlearning.com\/","https:\/\/in.linkedin.com\/school\/great-learning\/","https:\/\/x.com\/https:\/\/twitter.com\/Great_Learning","https:\/\/www.youtube.com\/channel\/UCObs0kLIrDjX2LLSybqNaEA"],"award":["Best EdTech Company of the Year 2024","Education Economictimes Outstanding Education\/Edtech Solution Provider of the Year 2024","Leading E-learning Platform 2024"],"url":"https:\/\/www.mygreatlearning.com\/blog\/author\/greatlearning\/"}]}},"uagb_featured_image_src":{"full":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/07\/shutterstock_680761540-1.jpg",1000,667,false],"thumbnail":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/07\/shutterstock_680761540-1-150x150.jpg",150,150,true],"medium":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/07\/shutterstock_680761540-1-300x200.jpg",300,200,true],"medium_large":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/07\/shutterstock_680761540-1-768x512.jpg",768,512,true],"large":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/07\/shutterstock_680761540-1.jpg",1000,667,false],"1536x1536":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/07\/shutterstock_680761540-1.jpg",1000,667,false],"2048x2048":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/07\/shutterstock_680761540-1.jpg",1000,667,false],"web-stories-poster-portrait":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/07\/shutterstock_680761540-1.jpg",640,427,false],"web-stories-publisher-logo":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/07\/shutterstock_680761540-1.jpg",96,64,false],"web-stories-thumbnail":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/07\/shutterstock_680761540-1.jpg",150,100,false]},"uagb_author_info":{"display_name":"Great Learning Editorial Team","author_link":"https:\/\/www.mygreatlearning.com\/blog\/author\/greatlearning\/"},"uagb_comment_info":0,"uagb_excerpt":"Facial recognition is part of the computer vision techniques, and when I am talking about computer vision, what does that stand for, and how is that related to our life? Let\u2019s a take real-time example, Our generation is quite familiar with Social media platforms, and we all share our memories with our virtual friends. But&hellip;","_links":{"self":[{"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/posts\/16698","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/users\/41"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/comments?post=16698"}],"version-history":[{"count":16,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/posts\/16698\/revisions"}],"predecessor-version":[{"id":84308,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/posts\/16698\/revisions\/84308"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/media\/16720"}],"wp:attachment":[{"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/media?parent=16698"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/categories?post=16698"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/tags?post=16698"},{"taxonomy":"content_type","embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/content_type?post=16698"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}