arko && funsize. what is beer? amazing what is computer vision? giving computers cameras,...
TRANSCRIPT
COMPUTER VISION, ROBOTS & BEER
Arko && funsize
What is Beer? Amazing
What is computer vision? Giving computers cameras, LIDAR,
optical sensors Run that through an algorithm Now you know where things are!
In code we trust
What’s out there?
HardwareUSB CameraMicrosoft KinectUSB LIDAR
SoftwareOpenCV (cross-platform)Microsoft SDK (meh)OpenNI (cross-platform)OpenPCL (cross-platform)
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
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);
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
Example on OpenCV
Example with Kinect + OpenCV
Example with OpenPCL
Demo of OpenPCL
Will it work? Yes.
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