Answered step by step
Verified Expert Solution
Question
1 Approved Answer
An interesting application of KLT in image processing is rotating a binary ( i . e . black - and - white ) image along
An interesting application of KLT in image processing is rotating a binary ie blackandwhite image
along a horizontal or vertical direction. For example, if you want to identify screwdrivers and
wrenches that may travel on a manufacturing belt using a robot hand with a camera, you can make
shapewise template matching. But, to make template matching, the shape directions must be
aligned; you cannot correlate the shape of a degrees rotated wrench with another one rotated by
degrees. We can use KLT to rotate all shapes to horizontal direction, and then apply a successful
template matching. The rotation requires identification of the direction of the tool may it be a
screwdriver or a wrench We do it as follows:
Assume that the tool is with black pixel over white background. We make a list of
coordinates of the black pixels.
We find the average coordinate corresponding to the center of the tool and subtract this
from all coordinates making them zero mean
We construct a correlation matrix by finding
The eigenvectors of this matrix show the "major" and the "minor" axis of the tool, which
correspond to the "direction" of the tool. So All we need to do is to rotate it to make it
horizontal. Therefore, we apply the KLT not to the pixel values, but to the pixel coordinates!
Question: programming Draw a blackwhite wrench image or find one from the internet
I:
Write a small code to give you an array of the coordinates corresponding to the black pixels.
Average them and subtract this mean to normalize coordinates to the center of the wrench.
Then, find the autocorrelation of the coordinates and determine the eigenvectors. The
eigenvector with the larger eigenvalue must correspond to the vector in the direction of the
wrench, and the other eigenvector must be perpendicular, meaning the width of the
wrench. Using the angles of these vector, rotateback the wrench and make it horizontal.
Show outputs of each step in your Matlab code.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started