Create a codelab for vision

Students will be writing the vision code for the 2020 galactic search
challenge, in which they have to detect which field layout is present
based on where the balls are.

Put this in frc971 because it can be used each year even though it is a
2020 challenge.

Signed-off-by: milind-u <milind.upadhyay@gmail.com>
Change-Id: I125688dcf18e3c18904d28c03811bf13f390b5d2
diff --git a/frc971/vision_codelab/img_viewer.py b/frc971/vision_codelab/img_viewer.py
new file mode 100755
index 0000000..fca4e9b
--- /dev/null
+++ b/frc971/vision_codelab/img_viewer.py
@@ -0,0 +1,21 @@
+#!/usr/bin/python3
+
+from absl import app, flags
+import cv2 as cv
+import glog
+import matplotlib.pyplot as plt
+
+flags.DEFINE_bool("hsv", False, "Displays the image in hsv")
+
+
+def main(argv):
+    glog.check_eq(len(argv), 2, "Expected one image filename as an argument")
+    bgr_img = cv.imread(argv[1])
+    img = cv.cvtColor(
+        bgr_img, cv.COLOR_BGR2HSV if flags.FLAGS.hsv else cv.COLOR_BGR2RGB)
+    plt.imshow(img)
+    plt.show()
+
+
+if __name__ == "__main__":
+    app.run(main)