Opencv Square Detector

Writer’s Note: In the eve of AR Apps such as Pokemon Go, the possibilities of creating apps of this sort are endless. (the square is empty!) I convert the original image in a Gray format, but Emgu detect the eight lines (a pair for side). Top 7 Mistakes Newbies Make Going Solar - Avoid These For Effective Power Harvesting From The Sun - Duration: 7:14. py However, to see any results, you will need a green object with the same HSV color range was the one I used in this demo. In this article you saw in the field of edge detection, the Harris Corner Detection algorithm that is able to detect the corner within a picture. It is the size of Sobel kernel used for find image gradients. OpenCV Overview Nate Kent [email protected] It works on Windows, Linux, Mac OS X, Android and iOS. Open Source Computer Vision Library. นำเทคนิค contours ใน OpenCV มาประยุกต์ เพื่อนำมาจับ object ที่ต้องแล้วนำ. 1 Image sources for detection describes the algorithm to accomplish this. In windows just use Opencv Installation by Nugets packages Here. In line 4, we converted the image to grayscale because OpenCV mostly operates in gray scale. The negative images for a one gesture are provided by the positives images of the other gestures. It is because, we find the sudoku square by finding the biggest blob ( an independant particle) in the image. Following program is an example. As part of an ongoing project with the New York Public I applied the canny edge detector to the. In this section we will perform simple operations on images using OpenCV like opening images, drawing simple shapes on images and interacting with images through callbacks. First parameter, Input image should be a binary image, so apply threshold or use canny edge detection before finding applying hough transform. Segmentation of images by understanding contours, circle, and line detection. It can 3D scan parts. The article describes an adaptive skin color detector based on paper ” An Adaptive Real-time Skin Detector Based on Hue Thresholding: A Comparison on Two Motion Tracking Methods ” by Dadgostar, Farhad and Sarrafzadeh, Abdolhossein and provides implementation in C++. Face detection uses classifiers, which are algorithms that detects what is either a face(1) or not a face(0) in an image. Here, in this section, we will perform some simple object detection techniques using template matching. As can be seen, the eyes with/without the glasses on as well as most of the small faces from the photos are detected at this scale most of the time. Because the performance of the object detection directly affects the performance of the robots using it, I chose to take the time to understand how OpenCV’s object detection works and how to optimize its performance. Ball Tracking / Detection using OpenCV - the author of this tutorial shows you how to detect and track a colored ball. OpenCV Overview Nate Kent [email protected] Obstacle detection using OpenCV In this tutorial, the designer uses four steps to detect obstacles in front of the robot. pdf), Text File (. So we will just use the right-hand side of the image for shape detection. The image classification is what we know as image recognition where we put an object in a respective class. October 23, 2017. In this article you saw in the field of edge detection, the Harris Corner Detection algorithm that is able to detect the corner within a picture. We will be using default pre-trained models to detect face, eyes and mouth. Criteria of being a 'square': polygon edge count is 4, area at least 1000 pixels, maximum angle between edges is close to 90. mp4 Below is a. Writer's Note: In the eve of AR Apps such as Pokemon Go, the possibilities of creating apps of this sort are endless. This is a contour detection based on opencv's study examples, in this case, use the draw method draws a few smiling faces of the same size in the picture (formed by a circle), and contour detection function will be marked with red smiley face outline detection, implemented contour detection function. import cv2. Steps to Canny Edge Detection on Webcam | OpenCV with Visual Studio in Windows 10. Also, I'll use OpenCV's C++ interface. Blob Detection. Introduction to OpenCV The OpenCV Tutorials, Release 2. I want to use openCV for resizing/cropping. Top 7 Mistakes Newbies Make Going Solar - Avoid These For Effective Power Harvesting From The Sun - Duration: 7:14. นำเทคนิค contours ใน OpenCV มาประยุกต์ เพื่อนำมาจับ object ที่ต้องแล้วนำ. OpenCV for Freepascal in Windows and Linux. Simple shape detection Opencv with Python. Filter by Convexity - Concavity. A contour detection based on opencv to practice. Open Source Computer Vision Library. It works in a very similar fashion to HoughLines, but where minLineLength and maxLineGap were the parameters to discard or retain lines, HoughCircles has a minimum distance between the circles’ centers and the minimum and maximum radius of the circles. Thanks to all for your support !!! So a small gift on this occasion A couple of months ago, I had told you about a new OpenCV-Python tutorial was under development. add_argument("-i", "--image", help = "path to the image file. There are docs on the c++ bindings. Contribute to alyssaq/opencv development by creating an account on GitHub. Hi, This is a post to answer some common questions that can arise while dealing with the Sudoku Solver. A popular computer vision library written in C/C++ with bindings for Python, OpenCV provides easy ways of manipulating color spaces. In this article you saw in the field of edge detection, the Harris Corner Detection algorithm that is able to detect the corner within a picture. As a result, sliding windows are used only when we are detecting a single object class with a fixed aspect ratio. In this introductory tutorial, you'll learn how to simply segment an object from an image based on color in Python using OpenCV. OpenCV only assists you with the already implemented functions and models. In this post, I'll show you how run the OpenCV object detector in MATLAB…. You'll even learn how to approximate contours, do contour. A blog about OpenCV Python Tutorial. -rw-r–r–@ 1 chen staff 110477 6 25 01:07 opencv_face_detect_rectangle. OpenCV is a library of python which supports a built in model for detecting faces in an image using Haar Cascades. The intensity property is 4-element tuple [ Sum(dx), Sum(abs(dx)), Sum(dy), Sum(abs(dy)) ]. png" file from the OpenCV sample folder is used here. Contribute to opencv/opencv development by creating an account on GitHub. As the name implies, morphological operations are the set of operations that process images. Camera calibration using opencv with square grid patterns chessboard patterns. First of all, Follow this tutorial to Install & Configure OpenCV with Visual Studio 2015. Olympic Games Head of Security Ed Best visits Garrett to test and approve the new detector in April. CV_64F etc, take its absolute value and then convert back to cv. jpg ファイル data/dst/opencv_face_detect_rectangle. Over the last few years, the average mobile phone performance has increased significantly. jpg が作成されたことが確認した。 検出領域にモザイク処理. And further classify both categories of particles into small,medium and large shaped particles. Filter by Convexity - Concavity. In line 4, we converted the image to grayscale because OpenCV mostly operates in gray scale. py However, to see any results, you will need a green object with the same HSV color range was the one I used in this demo. After that, in line 12, we used classcv2. Distance Calculation Model. initially i generate the online sample data matrix code. OpenCV's SimpleBlobDetector will be the primary function that we will be using. I've been using the app since few months and the best thing about the app I like is its perspective transformation i. It can be used for tasks such as object recognition, image registration, classification, or 3D reconstruction. Tutorial for creating an invisibility cloak using OpenCV. to transform an angled image (non-top-down clicked image) and display it as if it was captured top-down at 90 degrees. This bad boy is more suitable in technology such as security systems or high-end stalking. OpenCV - Dilation - Erosion and dilation are the two types of morphological operations. OpenCV only assists you with the already implemented functions and models. Fueled by the steady doubling rate of computing power every 13 months, face detection and recognition has transcended from an esoteric. It is a Sudoku Grabber. In this article, I will show you how to create a simple rectangle detector using OpenCV on native Android step by step. The growing interest in computer vision of the past decade. OpenCV C++/Obj-C: Advanced square detection. Intersections. OpenCV Erosion and Dilation. That is why, OpenCV doc says, " The contours are a useful tool for shape analysis and object detection and recognition ". In line 4, we converted the image to grayscale because OpenCV mostly operates in gray scale. If cameras are placed properly it is easy /I suggest to use manually positioned ROI and do some correlation with “seat empty pattern” / but how about cases like “baby or bag”/, taken. In this tutorial, we will be doing basic color detection in OpenCV version 2. Contribute to opencv/opencv development by creating an account on GitHub. Robust logo detection with OpenCV Get $500 – $1500 referal bonus by joining one of the best freelance communites via this link. Includes Eigenfaces in pure Java, OpenCV detection via JNI, integration of the Betaface. In order for the chest to be collected, the level of guarding monster must be lower or equal to highest difficulty reached in particular world during timeline. Sobel(), cv. v1 model was trained with aligned face images, therefore, the face images from the custom dataset must be aligned too. We implement well-known Bag of Words algorithm (BoW) in order to perform image classification of tiger cat images. Learn OpenCV : C++ and Python Examples. Segmentation of images by understanding contours, circle, and line detection. Detect and Track Objects With OpenCV (computers) These tutorials introduce you into the detection and tracking objects with OpenCV when you’re using computers. In this tutorial, we are going to build an application which is going to be able to recognize certain objects. In the standard pinhole camera model, one. Nagmode, Dhaval Pimplaskar. Following program is an example. Hough lines transform: The Houg lines transform is an algorythm used to detect straight lines. (Downloa…. OpenCV 3 image and video processing with Python OpenCV 3 with Python Image - OpenCV BGR : Matplotlib RGB Basic image operations - pixel access iPython - Signal Processing with NumPy Signal Processing with NumPy I - FFT and DFT for sine, square waves, unitpulse, and random signal Signal Processing with NumPy II - Image Fourier Transform : FFT & DFT. Open Source Computer Vision Library. r 1] contains the positions of the first r-1 queens. I’m building a system in order to recognize gestures with several detectors, each detector is trained to detect a single gesture. OpenCV C++/Obj-C: Advanced square detection. 1 Image sources for detection describes the algorithm to accomplish this. face liveness detection with Python, Keras and OpenCV. In particular, to compute al…. Pose estimation. This asset is a Marker-Less Augmented Reality Example using the actual environment as input instead of printed square markers and display 3d model in WebCamTexture in real-time. In this project readers will learn how to create a standard real-time project using OpenCV (for desktop), and how to perform a new method of marker-less augmented reality, using the actual…. Below code demonstrates this procedure for a horizontal Sobel filter and difference in results. Pysource 28,635 views. py --video videos/example_01. With the SimpleBlobDetector, you can distinguish. Dyer, UWisc Note: these are just products of components of the gradient, Ix, Iy Windowing function - computing a weighted sum (simplest case, w=1) CSE486, Penn State Robert Collins Intuitive Way to Understand Harris Treat gradient vectors as a set of (dx,dy) points. Once compiled, run the application with the following syntax:. I have a script in Unity that does this, but I. If you want to detect both edges, better option is to keep the output datatype to some higher forms, like cv. We will see how thanks to the application of some filters you can highlight the trend of color gradient and in particular to detect the contours or edges of an image. Intersections. Then, run calibration sample to get camera parameters. Paul Viola and Michael Jones adapted the idea of using Haar wavelets and developed the so-called Haar-like features. In the standard pinhole camera model, one. In this tutorial, we will learn how to select a bounding box or a rectangular region of interest (ROI) in an image in OpenCV. This time we will discuss about how to detect rectangle shape from image. In this article, I will show you how to create a simple rectangle detector using OpenCV on native Android step by step. This bad boy is more suitable in technology such as security systems or high-end stalking. ArUco markers are binary square fiducial markers that can be used for camera pose estimation. Finding blocks of text in an image using Python, OpenCV and numpy. Basically I have a set of 512x512 textures and I'd like them to inherit the aspect ratio of the plane they're placed upon, so they would be cropped from the center but not stretched. Third argument is aperture_size. OpenCV/cv/include OpenCV/cv/src and library path should contain OpenCV/lib. Now you can use this function to approximate the shape. so how to i detect that code or how to improve the quality of this data matrix code using openCV c++. The name Haar itself refers to Haar Wavelet, a mathematical. v1 model was trained with aligned face images, therefore, the face images from the custom dataset must be aligned too. Opencv Detection. Here's an example of the output image from this phase: Perform edge detection on the binarized image by applying the cv2. Abstract: The tutorial provides a detailed discussion on OpenCV library for face & eye detection based on Haar-like classifiers, which is the most common technique in computer-vision for face and eye detection. For example, a small colored ball, a suitable colored mug, or a pencil with a square of colored paper taped to it is ideal. opencv tennis ball detection - Free download as PDF File (. com site with modifications for speed detection. 3 on Android. Aim My project is to classify bulb,finger and two finger shaped turmeric particles from an image which also contains triangle and rectangle shaped turmeric particles. In this article, I will show you how to create a simple rectangle detector using OpenCV on native Android step by step. If you have only these regular shapes, there is a simple procedure as follows : 1. 4x4x4 = 64; Implying that there are more than 1 4x4 square at each key-point location. My flat has a great view over a busy square and I was hoping i could have my raspberrypi automatically count how many people are in the square at any given moment, using computer vision. Source Code V1. (forget cvCaptureFromCAM for example and all your wonderful apps you’ve thought up !) However, some nice apps (such as raspivid or raspistill) controls the pi camera using MMAL functions. Here I have done for blue color. face_count() will output how many total faces in the given photo. So far so good. In this tutorial we are going to learn face detection with help of Raspberry PI and with PI camera. In the past, we had to write our own bounding box selector by handling mouse events. As the name implies, morphological operations are the set of operations that process images. Detection of faces is achieved using the OpenCV (Open Computer Vision) library. The second step is to convert the image into a grayscale image. We’re going to learn in this tutorial how to detect the lines of the road in a live video using Opencv with Python. Color-based image segmentation is used in this project to help the computer learn how to detect the tumor. Over the last few years, the average mobile phone performance has increased significantly. So it can be easily installed in Raspberry Pi with Python and Linux environment. If you want to detect both edges, better option is to keep the output datatype to some higher forms, like cv. If cameras are placed properly it is easy /I suggest to use manually positioned ROI and do some correlation with “seat empty pattern” / but how about cases like “baby or bag”/, taken. XML which detects eye nose and mouth in the image for particularly 1 face. mp4 Below is a. In the previous tutorial, we could detect and track an object using color separation. Because the performance of the object detection directly affects the performance of the robots using it, I chose to take the time to understand how OpenCV's object detection works and how to optimize its performance. k-Nearest Neighbour classification – OpenCV 3. highgui import imshow, VideoCapture from ecto_opencv. Abstract: The tutorial provides a detailed discussion on OpenCV library for face & eye detection based on Haar-like classifiers, which is the most common technique in computer-vision for face and eye detection. Aim My project is to classify bulb,finger and two finger shaped turmeric particles from an image which also contains triangle and rectangle shaped turmeric particles. opencv based on median filtering method, median filter was proposed in 1971 by Tukey, which is a non-linear filtering techniques and typical. Computer vision with OpenCV. Returns sequence of squares detected on the image. Writer’s Note: In the eve of AR Apps such as Pokemon Go, the possibilities of creating apps of this sort are endless. We install opencv and then we compile the php facedetect extension with php. Use square size equal to 3cm. Raw pixel data is hard to use for machine learning, and for comparing images in general. En m'inspirant des fichiers square. Below code demonstrates this procedure for a horizontal Sobel filter and difference in results. First, chec. It helps us reduce the amount of data (pixels) to process and maintains the structural aspect of the image. So if we find a contour in a binary image, we are finding the boundaries of objects in an image. Introduction to OpenCV; Gui Features in OpenCV; Core Operations; Image Processing in OpenCV. Open Source Computer Vision Library. It is partly inspired by the scale-invariant feature transform (SIFT) descriptor. Canny Edge Detection in OpenCV¶. Along with this, he has developed several Deep Learning solutions, using OpenCV for video analysis. I am surprised how fast the detection is given the limited capacity of the Raspberry Pi (about 3 to 4 fps). We're going to look into two commonly used edge detection schemes - the gradient (Sobel - first order derivatives) based edge detector and the Laplacian (2nd order derivative, so it is extremely. My flat has a great view over a busy square and I was hoping i could have my raspberrypi automatically count how many people are in the square at any given moment, using computer vision. I'm not going to explain how works the Laplace algorithm, but the only thing you need to know is that this algorithm is the first step for line and edge detection. 3 $\begingroup$ Circle detection opencv. Introduction: OpenCV (i. pdf), Text File (. Python, OpenCVでカスケード型分類器を使った顔検出と瞳検出(顔認識と瞳認識)を行う。以下に公式のチュートリアル(英語)がある。OpenCV: Face Detection using Haar Cascades ここでは、静止画: 画像ファイルを読み込んで顔検出と瞳検出 動画: カメラを使ってリアルタイムで顔検出と瞳検出 について説明. Basically I have a set of 512x512 textures and I'd like them to inherit the aspect ratio of the plane they're placed upon, so they would be cropped from the center but not stretched. During calibration, the user gives the application an image of the gauge to calibrate, and it prompts the user to enter the range of values in degrees. jpg ファイル data/dst/opencv_face_detect_rectangle. We will be using default pre-trained models to detect face, eyes and mouth. Nevertheless, the answer of whether it is good enough depends on your approach to the problem. Caffe is a Deep Learning Framework created by Facebook which allows us to create Deep Learning models. In this introductory tutorial, you'll learn how to simply segment an object from an image based on color in Python using OpenCV. If you can see yourself with a red square around your face, that’s good news. I'm working on a face detection code that will put a square around your face when its detected, but will display text or an image when no face is detected on screen. The first step is to capture an image. In this chapter, we will learn to: Find Image gradients, edges etc; We will see following functions : cv. Writer’s Note: In the eve of AR Apps such as Pokemon Go, the possibilities of creating apps of this sort are endless. In This article, belonging to the OpenCV series with Python, we will talk about the analysis of contours and gradients of an image. It works in a very similar fashion to HoughLines, but where minLineLength and maxLineGap were the parameters to discard or retain lines, HoughCircles has a minimum distance between the circles' centers and the minimum and maximum radius of the circles. This is also used by more complex algorithm included into OpenCV. Last week we learned how to compute the center of a contour using OpenCV. Now you can use this function to approximate the shape. One of the first steps of the marker detection process is an adaptive thresholding of the input image. Wrapping OpenCV Function Mapping - Emgu. Open Source Computer Vision Library. If you're interested in looking at the lines and edges in an image, I would recommend taking a look at Canny Edge Detection, which is an algorithm developed by John F Canny in 1986. We will be using default pre-trained models to detect face, eyes and mouth. In this post, I'll show you how run the OpenCV object detector in MATLAB…. with Python 3. Their main benefit is that their detection is robust, fast and simple. face_count() will output how many total faces in the given photo. A contour detection based on opencv to practice. So far so good. OpenCV (Open Source Computer Vision) is a computer vision library that contains various functions to perform operations on Images or videos. cvCvtColor (src. opencv based on median filtering method, median filter was proposed in 1971 by Tukey, which is a non-linear filtering techniques and typical. 3 was used to create the scale pyramid. cvCornerHarris (src[, ]) Applies the Harris edge detector to the input image. opencv tennis ball detection. Laplacian() etc Theory. Ideally I'd like it to respond after a couple of second of no detection but anything is better than nothing! Its no longer null in the draw because its been initialised by the. Loads several images sequentially and tries to find squares in each image. Not only does the program need to detect motion, it needs to time the moving car as it passes across the camera's field of view, and it needs to know how far the car traveled. In this post, I'll show you how run the OpenCV object detector in MATLAB…. face liveness detection with Python, Keras and OpenCV. Skip to content. I would like to know if there is an example or a manual where I could find tips, even if it's in another platform it can be helpful. If you have only these regular shapes, there is a simple procedure as follows : 1. I'm a Computer Engineering student and I'm working on a project called Machine learning for intelligent tumor detection and identification. To apply the Transform, first an edge detection pre-processing is desirable. Canny Edge Detection in OpenCV¶. Simple shape detection Opencv with Python. A line can be represented as y = mx + c or in parametric form, as r = xcosθ + ysinθ where r is the perpendicular distance from origin to the line, and θ is the angle formed by this perpendicular line and horizontal axis measured in counter-clockwise ( That direction varies on how you represent the coordinate system. A contour detection based on opencv to practice. x, such as the HTC One X before upgrade to Android 4. Last week we learned how to compute the center of a contour using OpenCV. Posts about opencv square detection written by jinurajan. Pysource 28,635 views. Features in images are points of interest which present rich image content information. Robust logo detection with OpenCV Get $500 – $1500 referal bonus by joining one of the best freelance communites via this link. This post is part of a series I am writing on Image Recognition and Object Detection. Erosion and Dilation are morphological image processing operations. Curve Detection Opencv Python. Detect a rounded rectangle using opencv in android. cvCornerHarris (src[, ]) Applies the Harris edge detector to the input image. 2 compiling with CUDA support following instruction in http (As these tutorials are on OpenCV python you will. CascadeClassifier. Contribute to opencv/opencv development by creating an account on GitHub. Locate faces on large images with OpenCV To be useful a face identification tool should be able to deal with images of any dimension containing several items : people, streets, cars, … As the VGG-Face model has been optimized on centered faces we will add a pre-processing step that extract faces from an images. Image Moment is a particular weighted average of image pixel intensities, with the help of which we can find some specific properties of an image, like radius, area, centroid etc. mp4 Below is a. 1 - Converting to Grayscale [OpenCV4Android] force close when converting bitmap to mat [OpenCV4Android] Feature Detection detect() crashes [OpenCV4Android] problem in running sample projects using C++ OpenCV code with Android in eclipse. Then, try to detect the most common colour inside your whole square and set it to a "non-square" area. "Face detection is a computer technology that determines the locations and sizes of human faces in arbitrary (digital) images. OpenCV comes with a ready-made function for this, cv2. Also, I'll use OpenCV's C++ interface. Install and Use Computer Vision Toolbox OpenCV Interface. It then uses these calibrated values in the measurement stage to. Welcome to a corner detection with OpenCV and Python tutorial. We will find an object in an image and then we will describe its features. The first step is to capture an image. You will create a liveness detector capable of spotting fake faces Create a Python + OpenCV script capable of taking our trained liveness detector model and apply it to real-time video. Object Detection using opencv III - Training an svm for the extracted hog features Start of borrowed stuff Histograms of Oriented Gradients or HOG features in combination with a support vector machine have been successfully used for object Detection (most popularly pedestrian detection). The chess board is segmented from the input image, edges are detected using Canny’s edge detector and cross lines are detected using Hough transform. How does OpenCV find chessboard corners? Ask Question Asked 7 years, 7 months ago. Let’s face detect ourself ! This is closed to previous example, except now images are submitted to OpenCV for face detection. OpenCV C++/Obj-C: Advanced square detection. The intensity property is 4-element tuple [ Sum(dx), Sum(abs(dx)), Sum(dy), Sum(abs(dy)) ]. Find Contours in the image ( image should be binary as given in your question) 2. OpenCV Code Walkthrough. That is why, OpenCV doc says, " The contours are a useful tool for shape analysis and object detection and recognition ". Then, in line 8, we loaded LBP face detector using classcv2. Corner points are estimated by fitting lines through the edges of each square and intersecting them. OpenCV library can be used to perform multiple operations on videos. Wound Segmentation using Wavelet Transform in OpenCV. txt) or read book online for free. opencv median filtering. Now that's corrected. Yolo, Computer Vision, Deep Learning, Opencv, Object Detection In this post, we will learn how to train YOLOv3 on a custom dataset using the Darknet framework and also how to use the generated weights with OpenCV DNN module to make an object detector. As you can see, the Red Pokemon cartridge is easily detected!. Each method in this class corresponds to a function in OpenCV of the same name. Reaching high. Sourav Johar has over two years of experience with OpenCV and over three years of experience coding in Python. Then (if 3 columns of squares are equal-sized), you can detect the height of a square (distance between the two strips) and you can detect the max and min area (height and width) in the image. Thanks to the OpenCV library, all this analysis can be invoked through the use of a single cv2. $ rosrun n900-cam facedetect. Hello Everyone! So, this is my first blog post! Here I’ll talk about a very simple app that i tried to make. Let's see how to detect the corner in the image. Here I have done for blue color. pas and IPL. Open Source Computer Vision) is an open source library. You need to have the cascade files (included in OpenCV) in the same directory as your program. Contribute to opencv/opencv development by creating an account on GitHub. Corner points are estimated by fitting lines through the edges of each square and intersecting them. Aim My project is to classify bulb,finger and two finger shaped turmeric particles from an image which also contains triangle and rectangle shaped turmeric particles. Nagmode, Dhaval Pimplaskar. After 20 stages I get the message “Required leaf false alarm rate achieved. Just starting out with openCV, so apologies if this is a daft question. to transform an angled image (non-top-down clicked image) and display it as if it was captured top-down at 90 degrees. Source Code V1. Car detection using OpenCV I am working on a small personal project where i have to know wether an image shown is a car or not. So far so good. Object detection using custom Haar Cascade on an image with OpenCV - run-custom-cascade. This item has been introduced in v1. $ python detect_color. Then, in line 8, we loaded LBP face detector using classcv2. It then uses these calibrated values in the measurement stage to. cornerHarris() function, making the work much easier to carry out analysis of images at a higher level with Python. OpenCV's SimpleBlobDetector will be the primary function that we will be using. The aruco module is based on the ArUco library, a popular library for detection of square fiducial markers developed by Rafael Muñoz and Sergio Garrido: are selected for the adaptive thresholding (see OpenCV threshold() function for more details). In this, second argument is called epsilon, which is maximum distance from contour to approximated contour.