TypeError: <unknown> is not a numpy array in pi_head_tracking_tutorial
I am asking and answering my own question here to help a few people who have run into a snag when trying my pi_head_tracking_tutorial when running Diamondback. This tutorial uses the Python OpenCV CamShift function to track a colored patch in a video when the user selects the patch with the mouse. While this function worked fine under C-Turtle, under Diamondback, the following error occurs right after selecting the region to track:
TypeError: <unknown> is not a numpy array
The error occurs right after this function call:
(iters, (area, value, rect), track_box) = cv.CamShift(backproject, self.track_window, crit)
I have submitted a ticket to see if it is really a bug.
Compiling OpenCV from the latest source does not fix the problem. Please see my answer below for a workaround.
--patrick