I can't wait to get some C code running using the CSI-2 raspicamV2. For now my skills limit me to basic Python.
My Python3 code with CV2 frame capture on a USB camera and Numpy array manipulation running in Thonny IDE....
Track algo of Minimum sum:
2ms / 25 pixel wide area
9ms / 90 pixel wide area
12ms / 100 pixel wide area
15ms / 115 pixel wide area
20ms / 140 pixel wide area
Placing text on the frame = 2 to 3 ms
Read 25 bytes on Pi serial input @ 100kbaud = 3ms
Parse SBUS protocol into useful values = <1ms
Send out 25 bytes = 3ms
cv2.imshow (show the image on the screen) = <5ms
I sent you email of my algo and code since it's a bit large for the forum.