Question: 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 (i.e. black-and-white) 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
shape-wise template matching. But, to make template matching, the shape directions must be
aligned; you cannot correlate the shape of a 45 degrees rotated wrench with another one rotated by
-10 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 (xi,yi) 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 22 correlation matrix by finding R=[E{xi2}E{xiyi}E{yixi}E{yi2}]
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 black-white wrench image (or find one from the internet)
I:1...
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 22 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, rotate-back the wrench and make it horizontal.
Show outputs of each step in your Matlab code.
 An interesting application of KLT in image processing is rotating a

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!