Method and apparatus for locating a pointing element within a digital image
View Patent ↗A method and apparatus for finding a pointing element within a digital image. A digitized image is received including a background and an object to be tracked. The background and the object have a different color. A rectangle is defined within the image including at least a portion of the object. The defined rectangle is searched to determine the X and Y coordinates of the pointing element.
1. A method for finding a pointing element within a digital image comprising the steps of:
a) receiving a digitized image including a background and an object to be tracked, said background and said object having a different color;
b) defining a rectangle within said image including at least a portion of said object;
c) conducting a search within the defined rectangle starting at a position adjacent a first side of a bottom portion of said rectangle and continuing in a direction towards a second side of said rectangle until said object is located and storing a first x value corresponding thereto;
d) conducting a second search within the defined rectangle starting at a position adjacent said second side of said bottom portion of said rectangle and continuing in a direction towards said first side of said rectangle until said object is located and storing a second x value corresponding thereto;
e) conducting a third search within the defined rectangle starting at a position adjacent a top portion of said rectangle and offset from said first x value and continuing in a direction towards said bottom until said object is located and storing a first y value corresponding thereto;
f) conducting a fourth search within the defined rectangle starting at a position adjacent said top portion of said rectangle and offset from said second x value and continuing in a direction towards said bottom until said object is located and storing a second y value corresponding thereto;
g) conducting a fifth search using the stored first x and second x and first y and second y positions to find a point representing one of a leftmost and a rightmost position of said object and storing x and y coordinates corresponding to said found point.