Computer Vision Robotic Agents @ Allegheny College Janyl Jumadinova October 8, 2019 Janyl Jumadinova October 8, 2019 1 / 12 Computer Vision
Computer Vision Make computers understand images and video. Janyl Jumadinova October 8, 2019 2 / 12 Computer Vision
Computer Vision Make computers understand images and video. Janyl Jumadinova October 8, 2019 2 / 12 Computer Vision
Why computer vision matters? Janyl Jumadinova October 8, 2019 3 / 12 Computer Vision
OpenCV An open source BSD licensed computer vision library - Patent-encumbered code isolated into “non-free” module (SIFT, SURF, some of the Face Detectors, etc.) Available on all major platforms - Android, iOS, Linux, Mac OS X, Windows Written primarily in C++ - Bindings available for Python, Java, even MATLAB (in 3.0). Documentation: http://docs.opencv.org Source: https://github.com/Itseez/opencv Janyl Jumadinova October 8, 2019 4 / 12 Computer Vision
OpenCV Janyl Jumadinova October 8, 2019 5 / 12 Computer Vision
OpenCV: Pixel Grayscale: each pixel has a value between 0 (black) and 255 (white) - values between 0 and 255 are varying shades of gray. Janyl Jumadinova October 8, 2019 6 / 12 Computer Vision
OpenCV: Pixel Grayscale: each pixel has a value between 0 (black) and 255 (white) - values between 0 and 255 are varying shades of gray. Color: pixels are normally represented in the RGB color space - one value for the Red component, one for Green, and one for Blue, - each of the three colors is represented by an integer in the range 0 to 255, - how “much” of the color there is. Janyl Jumadinova October 8, 2019 6 / 12 Computer Vision
OpenCV: Coordinate System The point (0, 0) corresponds to the upper left corner of the image x value increases as we move to the right y value increases as we move down Janyl Jumadinova October 8, 2019 7 / 12 Computer Vision
OpenCV: Image Representation OpenCV represents images as NumPy arrays (matrices). NumPy is a library for the Python programming language that provides support for large, multi- dimensional arrays. To access a pixel value, we need to supply the x and y coordinates of the pixel. OpenCV actually stores RGB values in the order of Blue, Green, and Red. Janyl Jumadinova October 8, 2019 8 / 12 Computer Vision
Images How to input or output an image? Janyl Jumadinova October 8, 2019 9 / 12 Computer Vision
Images How to input or output an image? Janyl Jumadinova October 8, 2019 9 / 12 Computer Vision
HighGUI: OpenCV Functions namedWindow(winname, flags); Creates window accessed by its name. Window handles repaint and resize events. Janyl Jumadinova October 8, 2019 10 / 12 Computer Vision
HighGUI: OpenCV Functions namedWindow(winname, flags); Creates window accessed by its name. Window handles repaint and resize events. destroyWindow(winname); : Destroys a window with the given name. destroyAllWindows(); : Destroys all of the HighGUI windows. Janyl Jumadinova October 8, 2019 10 / 12 Computer Vision
HighGUI: OpenCV Functions namedWindow(winname, flags); Creates window accessed by its name. Window handles repaint and resize events. destroyWindow(winname); : Destroys a window with the given name. destroyAllWindows(); : Destroys all of the HighGUI windows. waitKey([delay]); : Waits for a key press; delay is in milliseconds. Janyl Jumadinova October 8, 2019 10 / 12 Computer Vision
Video: OpenCV Functions VideoCapture : Class for video capturing from video files, image sequences or cameras. Janyl Jumadinova October 8, 2019 11 / 12 Computer Vision
Video: OpenCV Functions VideoCapture : Class for video capturing from video files, image sequences or cameras. VideoWriter : Class for writing to video. Janyl Jumadinova October 8, 2019 11 / 12 Computer Vision
os The os module in Python allows interaction with the Operating System, including environment variable manipulation and file system navigation. os.getcwd() : Get the current working directory. os.chdir(’/newdir’) : Change cwd to newdir. os.listdir(path=.) : List of everything in the present directory. os.path : contains functions for manipulating filenames and directory names. os.path.join() : function constructs a path name out of one or more partial path names. In this case, it simply concatenates strings. Calling this function will add an extra slash to the path name before joining it to the file name. This function can take any number of arguments. Janyl Jumadinova October 8, 2019 12 / 12 Computer Vision
Recommend
More recommend