Learn how to check for horizontally flipped images.
- [Instructor] In this video, we'll implement the algorithm…that finds the best possible match between two images.…We need to check if the cropped image is a horizontal flip…of the original image, so first I'll implement a function…called horizontal flip.…I'll make this take a mat object as its parameter.…Now I'll create a let binding.…First, I'll call get image meta on the mat object,…and I'll destructure this using keys…into each of rows, cols, and type.…Next, I'll create a new empty matrix called result mat…using the mat constructor…and passing it the rows, cols, and type from above.…
In the let body,…I'll use the core classes flip static method…to flip the input matrix and store it in the result matrix.…Next I'll pass it the value one…which is used for a horizontal flip.…This function returns nil…and fills the result matrix with the values.…So now I'll put result matrix here…so that our function returns it.…With this in place, I'm ready to write our function,…called best match,…that will find the best match between two images.…
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?
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.