X hits on this document

PDF document

A Prototype Optical Tracking System Investigation and Development - page 63 / 170





63 / 170

4.4 Class Design


interface in the figure allows the differing implementation between PC and Blackfin to be


s long as the BlackfinFrameStripProvider and OpenCVFrameStrip-

Provider classes implement the IFrameStripProvider interface correctly then the

higher level software need not know which class it is using.

The ROIProvider class is responsible for discovering new ROIs and tracking them from

frame to frame (the segmentation and tracking phases).

ROIProvider contains a col-

lection of ROI objects.

These are the ROIs that surround the marker images known to

the system.

ROI object is associated with an IPositionPredictor interface which

is used to predict the position of the ROI in the next frame. Due to restrictions in imple- mentation, the objects that implement the IPositionPredictor interface are managed by the ROIProvider object. The centroid data from the ROIProvider are passed onto the Tracker object using an event driven mechanism and passed to the communications module and onto the hub. The module and hub communications protocol is described in

Chapter 6.


Black Spot Image Sensor Driver

The BlackfinFrameStripProvider (see Figure 4.12) implements the IFrameStrip- Provider interface and provides frame strips to the firmware when it is running on the embedded system. It is composed of an IImageSensor interface and using this interface

decouples the frame strip provider from the image sensor implementation. This should make it easier to migrate to other image sensors if desired. The MT9VX class implements the IImageSensor interface and encapsulates the details of retrieving image data from the sensor. It includes code to manipulate image sensor registers and set different sensor resolutions, shutter periods, and modes.

The Blackfin image sensor driver (the MT9VX class) is described below. The driver uses the Direct Memory ccess (DM ) features of the Blackfin processor to efficiently copy data provided by the image sensor into the internal SR M of the DSP. Using the DM frees the DSP from copying the data and allows it to do meaningful processing in parallel with the


. This approach is implemented using double buffering. One buffer is filled by the

while the other is used by the firmware.

fter the first buffer is filled, the firmware

uses this one and the DM

writes to the second buffer.

DM buffers.

descriptor chain is initialised with two descriptors. These feed data into the two

The DM

engine begins at the beginning of the chain and works to the end and

then repeats.

The first descriptor instructs the DM

to write into the first buffer and the

second descriptor writes into the second buffer. The buffers are set up so that after a num-

Document info
Document views487
Page views487
Page last viewedTue Jan 17 20:13:00 UTC 2017