Join Patrick W. Crawford for an in-depth discussion in this video Solution: Assign object ID and attributes, part of OpenCV for Python Developers.
- [Instructor] Now let's take a look…at one solution to this challenge.…As a reminder, our goal is to segment out the object…in this fuzzy image,…only draw the large objects…and give each of them a unique color…as both print out the perimeter and area.…To do this we'll move back to the exercise file.…The first thing we want to do…is convert this image to a gray scale…so we can do all of our thresholding.…To do this we'll type gray equals cv2.cvtColor…and then we'll type in image, cv2.COLOR in all caps,…_BGR, number two, and then GRAY.…
Next, this little trick…will actually help make…our adaptive thresholding work better…if we use a blur.…As we've used in the past,…let's use a Gaussian blur by typing blur…equals cv2.GaussianBlur.…Then we'll pass in our gray image…and then the structuring element…we can use as three, three.…You can also play with this value…to see what else works better…and then we'll pass in a value of zero…and then close parentheses.…
Now, let's make use of our adaptive threshold.…To use this we'll type thresh equals…
AuthorPatrick W. Crawford
- Installing and configuring OpenCV
- Data types and structures
- Image types
- Manipulating pixels
- Scaling and rotating images
- Using video inputs
- Creating custom interfaces
- Object detection
- Face and feature detection
- Template matching
Skill Level Intermediate
Python: Programming Efficientlywith Michele Vallisneri2h 15m Intermediate
NumPy Data Science Essential Trainingwith Charles Kelly3h 54m Intermediate
1. Install and Configure OpenCV
2. Basic Image Operations
3. Object Detection
4. Face and Feature Detection
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.