Though I have a basic in C, I was recommended by all my programmer friends to pick it up in Python instead. There are more tutorial therefore easier to use, especially in an open source library like OpenCV.
Note: Programming have many language like a human language. They use similar logic but different way to write. Some language have feature or command that others don’t. C is the most fundamental one. Then follow by C++(the simplified version). Picture it as Latin. It is difficult to write a quick program from C/C++ as you have to write everything from scratch. On the other hand, language like Python has many pre-made feature and shorter to write. This make it easier to do a quick prototype and make things work.
Compile file (Mac)
Drag and drop your file
** if permission denied — type this in terminal
chmod +x test.py
cd = go to the folder that contains all the file that you wrote
+x = give permission to run the file
./test.py = run the file
(test.py = your file name)
Playing Video From File : Link
if cv2.waitKey(1) & 0xFF == ord(‘q’):
Q:What is ‘&oxFF’?
A: There are some bugs in the library. ‘&oxFF’ is added after ‘cv2.waitKey()’ to make it function properly.