arko && funsize. what is beer? amazing what is computer vision? giving computers cameras,...

13
COMPUTER VISION, ROBOTS & BEER Arko && funsize

Upload: cathleen-alexander

Post on 18-Dec-2015

218 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Arko && funsize. What is Beer?  Amazing What is computer vision?  Giving computers cameras, LIDAR, optical sensors  Run that through an algorithm

COMPUTER VISION, ROBOTS & BEER

Arko && funsize

Page 2: Arko && funsize. What is Beer?  Amazing What is computer vision?  Giving computers cameras, LIDAR, optical sensors  Run that through an algorithm

What is Beer? Amazing

Page 3: Arko && funsize. What is Beer?  Amazing What is computer vision?  Giving computers cameras, LIDAR, optical sensors  Run that through an algorithm

What is computer vision? Giving computers cameras, LIDAR,

optical sensors Run that through an algorithm Now you know where things are!

Page 4: Arko && funsize. What is Beer?  Amazing What is computer vision?  Giving computers cameras, LIDAR, optical sensors  Run that through an algorithm

In code we trust

Page 5: Arko && funsize. What is Beer?  Amazing What is computer vision?  Giving computers cameras, LIDAR, optical sensors  Run that through an algorithm

What’s out there?

HardwareUSB CameraMicrosoft KinectUSB LIDAR

SoftwareOpenCV (cross-platform)Microsoft SDK (meh)OpenNI (cross-platform)OpenPCL (cross-platform)

Page 6: Arko && funsize. What is Beer?  Amazing What is computer vision?  Giving computers cameras, LIDAR, optical sensors  Run that through an algorithm

Let’s just dive in..

OpenCV Example:Import IplImage (BGR.. not RBG..)Convert BRG to HSVThresholds, Erode, DilateHSV Selection and Band (Take a slice)Draw contours on what meets the cases

Page 7: Arko && funsize. What is Beer?  Amazing What is computer vision?  Giving computers cameras, LIDAR, optical sensors  Run that through an algorithm

Here’s the Code:output_im = cvCloneImage(input_im);

IplImage *hsv_im = cvCreateImage(cvSize(input_im->width, input_im->height), 8, 3);

IplImage *temp_im = cvCreateImage(cvSize(input_im->width, input_im->height),8, 1);

cvCvtColor(input_im, hsv_im, CV_BGR2HSV);

int rows = input_im->height;

int cols = input_im->width;

cvZero(temp_im);

for (int row=0; row<rows; row++) {

for (int col=0; col<cols; col++) {

CvScalar hsv = cvGet2D(hsv_im, row, col);

int h = hsv.val[0];

int v = hsv.val[2];

if ((170 < h || h > 175) && (v > 80)) {

cvSet2D(temp_im, row, col, cvScalar(255));

}

}

}

cvErode(temp_im, temp_im, NULL, 1);

CvMemStorage *storage = cvCreateMemStorage();

CvSeq *contours;

cvFindContours(temp_im, storage, &contours); // destroys temp

cvDrawContours(output_im, contours, CV_RGB(0,255,0), CV_RGB(0,255,0), 1);

Page 8: Arko && funsize. What is Beer?  Amazing What is computer vision?  Giving computers cameras, LIDAR, optical sensors  Run that through an algorithm

Try for yourself:

Good Source to learn: https://github.com/egradman/cv-worksho

p/blob/master/code_fragments.txt

OpenCV webapp (please don’t spam): https://github.com/egradman/cv-worksho

p/blob/master/code_fragments.txt

Page 9: Arko && funsize. What is Beer?  Amazing What is computer vision?  Giving computers cameras, LIDAR, optical sensors  Run that through an algorithm

Example on OpenCV

Page 10: Arko && funsize. What is Beer?  Amazing What is computer vision?  Giving computers cameras, LIDAR, optical sensors  Run that through an algorithm

Example with Kinect + OpenCV

Page 11: Arko && funsize. What is Beer?  Amazing What is computer vision?  Giving computers cameras, LIDAR, optical sensors  Run that through an algorithm

Example with OpenPCL

Page 12: Arko && funsize. What is Beer?  Amazing What is computer vision?  Giving computers cameras, LIDAR, optical sensors  Run that through an algorithm

Demo of OpenPCL

Will it work? Yes.

Page 13: Arko && funsize. What is Beer?  Amazing What is computer vision?  Giving computers cameras, LIDAR, optical sensors  Run that through an algorithm

Apply this to a robot

Now it can see State Estimation Apply visual data to update state

estimate Recognize points of interestHave sensors like an IMU

Now you can navigate,

plan paths, avoid objects