Learn how to inspect the result matrix.
- [Narrator] In this video, we'll unpack…the results from match-template.…Call this function match, and I'll have it…take two Mat objects, a and b.…Create a let binding.…First, I'll get a result matrix…from calling the match-template function…that we defined in the previous video.…I'll pass it the a and b value…given to the match function.…Now I'll create a binding to variable called min-max.…And I'll call cores minMaxLock static method…with the result matrix.…
This will return OpenCV's minMaxLoc object.…It will contain the x and y coordinate…of the highest value that was found in the matrix…which will be the x and y coordinate…of a match if there is one.…It will also contain the values that we can see…how similar the two images are.…I'll now create some bindings that pull this object apart.…First, I'll pull the location apart…using .maxLoc…using .maxLoc…on the min-max object.…This will be the location of the highest match.…Now I'll get its x-value by using .x on the loc…and its y-value using .y.…
Now I'll get its highest value and call it max-val.…
Skill Level Intermediate
1. Problem 1: Exploring Lake Pend Oreille
2. Problem 2: Image Analysis
3. Problem 3: Eight Queens
4. Problem 4: Accessing Peripherals
5. Problem 5: Recursion and Directories
6. Problem 6: Building the Web
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
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.