This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import cv2 | |
| vid = cv2.VideoCapture(0) # instead of file path we will use the id of the device (webcam) | |
| #now we define some specific parameter for the webcam | |
| vid.set(3,640) | |
| vid.set(4,480) | |
| #Rest Code is same as basic video read | |
| while vid.isOpened(): # Used to check if camera is opened or not | |
| success,img=vid.read() | |
| if success: | |
| cv2.imshow("Video",img) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import cv2 | |
| img = cv2.imread("Resources/lena.png") | |
| cv2.imshow("Picture",img) | |
| cv2.waitKey(3000) # Define the time until it is visible |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import cv2 | |
| vid = cv2.VideoCapture("Resources/test_video.mp4") | |
| #since video is stream of pictures we have to use something else here | |
| while True: | |
| success,img=vid.read() | |
| if success: | |
| cv2.imshow("Video", img) | |
| if cv2.waitKey(1) & 0xFF == ord('q'): | |
| break |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 1 :: Install Latest Cmake (Using the office dmg ) | |
| https://cmake.org/download/ | |
| Configure the paths for the cmake using the below command | |
| sudo "/Applications/CMake.app/Contents/bin/cmake-gui" --install | |
| 2 :: Default mac os vim lacks python3 support and many other features ,so we will be compiling vim with full features(can limit if u want) | |
| Verify first if Xcode developers tools are installed or not ,if not this will install it in mac | |
| xcode-select --install | |
| Now lets just move on to compiling vim from source on our distribution. | |
| mkdir -p .vim/src |
NewerOlder