From the course: OpenCV for Python Developers
Unlock the full course today
Join today to access over 24,400 courses taught by industry experts.
Simple thresholding
From the course: OpenCV for Python Developers
Simple thresholding
- [Instructor] With an understanding of segmentation and the importance of binary images, let's take a look at performing our own simple thresholding. First, we'll load in a black and white image. Do this we'll, type bw = cv2.imread and then we'll use detect underscore_blob.png. And then we are going to pass into value of zero explicitly. This will tell OpenCV to load it in as a black and white image. Next, let's get the height as well as the width by typing height width from the image = bw.shaped 0 to 2 to indicate we only want the first two values from the shape. Finally, let's go ahead and show this image using cv2.imshow, original, black white, end quote and then pass in the BW variable. Now the goal is to imple a straightforward thresh holding method to extract the objects from an image. We can do that by assigning all the objects a value of 1 and everything else a value of 0. To begin, we will initialize our…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
Segmentation and binary images1m 38s
-
(Locked)
Simple thresholding6m 34s
-
(Locked)
Adaptive thresholding4m 38s
-
(Locked)
Skin detection6m 31s
-
(Locked)
Introduction to contours1m 38s
-
(Locked)
Contour object detection6m 56s
-
(Locked)
Area, perimeter, center, and curvature8m 19s
-
(Locked)
Canny edge detection8m 1s
-
(Locked)
Object detection overview1m 59s
-
(Locked)
Challenge: Assign object ID and attributes50s
-
(Locked)
Solution: Assign object ID and attributes10m 5s
-
-
-