Perhaps you want to use the Teensy to control the motors because you have found a way to do it, and you don't know how to achieve the same effect on the Pi, and the project taxes your current skill level enough that you prefer to do it this way. That is perfectly valid. Or, perhaps you simply want to split the motor control to the Teensy because you want to learn from figuring out how to get it to communicate with the Pi. That is also perfectly valid.
However: If the goal is only to get something up and running, the Pi can do this itself. It has enough GPIO, and the CPU need only spend a tiny fraction of its resources on motor control compared to computer vision. If you want to do this in the easiest way possible, get a motor shield for the Pi, and have it do both vision and motor control.
As for the #include problem, you will probably get better advice on a Pi-specific forum. When asking for such help, you really need to include both the source code and the error you got.