Modified for raspberry pi CSI camera