OpenCV: Resolving NoneType errors

[email]
[email]