forked from MAAV-Software/maav-cv
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhello.py
More file actions
27 lines (21 loc) · 700 Bytes
/
hello.py
File metadata and controls
27 lines (21 loc) · 700 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import os
from sys import exit
import cv2
script_path = os.path.realpath(__file__)
print(script_path)
print(__file__)
# Print helpful information
print("\nDisplaying sample image using OpenCV2. Press any key to exit. \
\nDO NOT CLOSE THE WINDOW!!! You might need to restart your terminal.\n")
# Get the image from the disk
mast = cv2.imread(cv2.samples.findFile('mast.png'))
if mast is None:
print("Image couldn't load. :(")
exit(1)
# Mast is a cv2.Mat object. In C++, this is a cv2::Mat.
# Show the image
cv2.imshow('Mast for Mission 9', mast)
# Wait for a key press
key_wait = cv2.waitKey(0)
# while key_wait != 13: # 13 is the return / enter key
# key_wait = cv2.waitKey(0)