Computer Vision Robotic Agents @ Allegheny College Janyl Jumadinova - - PowerPoint PPT Presentation

computer vision
SMART_READER_LITE
LIVE PREVIEW

Computer Vision Robotic Agents @ Allegheny College Janyl Jumadinova - - PowerPoint PPT Presentation

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 /


slide-1
SLIDE 1

Computer Vision

Robotic Agents @ Allegheny College Janyl Jumadinova October 8, 2019

Janyl Jumadinova Computer Vision October 8, 2019 1 / 12

slide-2
SLIDE 2

Computer Vision

Make computers understand images and video.

Janyl Jumadinova Computer Vision October 8, 2019 2 / 12

slide-3
SLIDE 3

Computer Vision

Make computers understand images and video.

Janyl Jumadinova Computer Vision October 8, 2019 2 / 12

slide-4
SLIDE 4

Why computer vision matters?

Janyl Jumadinova Computer Vision October 8, 2019 3 / 12

slide-5
SLIDE 5

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 Computer Vision October 8, 2019 4 / 12

slide-6
SLIDE 6

OpenCV

Janyl Jumadinova Computer Vision October 8, 2019 5 / 12

slide-7
SLIDE 7

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 Computer Vision October 8, 2019 6 / 12

slide-8
SLIDE 8

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 Computer Vision October 8, 2019 6 / 12

slide-9
SLIDE 9

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 Computer Vision October 8, 2019 7 / 12

slide-10
SLIDE 10

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 Computer Vision October 8, 2019 8 / 12

slide-11
SLIDE 11

Images

How to input or output an image?

Janyl Jumadinova Computer Vision October 8, 2019 9 / 12

slide-12
SLIDE 12

Images

How to input or output an image?

Janyl Jumadinova Computer Vision October 8, 2019 9 / 12

slide-13
SLIDE 13

HighGUI: OpenCV Functions

namedWindow(winname, flags); Creates window accessed by its

  • name. Window handles repaint and resize events.

Janyl Jumadinova Computer Vision October 8, 2019 10 / 12

slide-14
SLIDE 14

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 Computer Vision October 8, 2019 10 / 12

slide-15
SLIDE 15

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 Computer Vision October 8, 2019 10 / 12

slide-16
SLIDE 16

Video: OpenCV Functions

VideoCapture: Class for video capturing from video files, image sequences or cameras.

Janyl Jumadinova Computer Vision October 8, 2019 11 / 12

slide-17
SLIDE 17

Video: OpenCV Functions

VideoCapture: Class for video capturing from video files, image sequences or cameras. VideoWriter: Class for writing to video.

Janyl Jumadinova Computer Vision October 8, 2019 11 / 12

slide-18
SLIDE 18
  • s

The os module in Python allows interaction with the Operating System, including environment variable manipulation and file system navigation.

  • s.getcwd(): Get the current working directory.
  • s.chdir(’/newdir’): Change cwd to newdir.
  • s.listdir(path=.): List of everything in the present directory.
  • s.path: contains functions for manipulating filenames and directory

names.

  • s.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 Computer Vision October 8, 2019 12 / 12