Alexander Bryan Shooty The Robot Final Formal report EEL 4665/5666 Intelligent Machines Design Laboratory University of Florida Department of

Size: px
Start display at page:

Download "Alexander Bryan Shooty The Robot Final Formal report EEL 4665/5666 Intelligent Machines Design Laboratory University of Florida Department of"

Transcription

1 Alexander Bryan Shooty The Robot Final Formal report EEL 4665/5666 Intelligent Machines Design Laboratory University of Florida Department of Electrical and Computer Engineering TAs: Andy Gray, Josh Weaver, Nick Cox Instructors: Dr. A. Antonio Arroyo Dr. Eric M. Schwartz

2 Table of Contents Abstract...3 Executive Summary...4 Introduction...4 Integrated System...4 Sensors...6 Conclusion...7 Appendices...7 launcher.h...7 launcher.c...8 db_find.hpp...13 db_find.cpp...14

3 Abstract Shooty the Robot will attempt to play the simple game of darts, throw darts at a target as accurately as possible. Except darts are dangerous and guns are easier to fire. Therefore, the robot will instead fire nerf darts with a USB missile launcher. Executive Summary At boot up, Shooty will begin searching for a target to fire at. The target is known to be an orange circle. For each frame, some thresholding is done and a black and white image is produced with everything that was orange now being white, and everything else black. Then the image is dilated and eroded to remove some noise. Then, contours are found. The minimum bounding circle for the largest contour is then drawn around the contour. The area of the contour and the area of the circle are compared. If they are close, then we assume this is our target as it fits the characteristics we are searching for: a large orange circle. After the target is found, the camera then attempts to center itself on it. Shooty knows where the center of the circle is in each frame, so it's trivial to detect in which direction to move. Actually moving the turret (on which the camera is mounted) is quite easy. A command for move [left right up down ] is given. The turret will move in that direction until it's hardware limit is reached (i.e the turret has moved as far in that direction as the hardware will allow), or when the command for stop is given. When the target has been centered in the image, Shooty must now aim up a certain amount based on how far away the target is, because gravity naturally pulls the missile down. Knowing the radius of the circle, some simple calibration tests performed earlier give Shooty the proper angle of incline needed to perform an accurate shot. After the shot is fired, Shooty will then move the turret all the way down to begin finding the target again. This is done because at times, the angle of inclination needed will be so high that the target is no longer in the frame or is cut off at the bottom and is not recognized as a circle. Introduction It's fun to play darts, but it's even more fun with people. Unfortunately, there are not always people around to play darts with. This is where shooty comes in. Shooty makes darts more fun to play as Shooty plays darts with you. Integrated System Shooty's processing power will be done using a Raspberry Pi. The Pi will do all image processing and will control the missile launcher through USB.

4 The USB missile launcher shown below can be moved, aimed, and fired. It can easily be given commands over USB, which simplifies the design. Images will be captured using a Logitech C270 webcam

5 A 3-cell LiPo battery will be used to power the system. A Raspberry Pi is traditionally powered via USB, and the webcam and missile launcher draw power from the USB port they are connected to. A powered USB hub must be used to power all of these devices as the Raspberry Pi cannot supply enough power to the devices itself. A 5V voltage regulator was connected to the 3 cell LiPo with the output going to the power connector of the powered USB hub. Sensors The Logitech C270 webcam will be used for image detection. The webcam will be used to locate the target, center on it, calculate it's approximate distance away, and aim upwards a certain amount based on how far away the target is. Conclusion The robot was successfully able to identify a target, aim, and fire at the target with reasonable accuracy. The aiming was slow, due the specific method used to move the turret and the low frame rate, but it was accurate and got the job done. The end result was more accurate than I thought it could be be, but also slower. Work could have been done to move the turret a certain distance based on the location of the target in the image, instead of moving a constant step size each frame. This would have sped up the aiming process. Appendices launcher.h #ifndef LAUNCHER_H #define LANUCHER_H #include <unistd.h> #include <time.h> #include <usb.h>

6 #define UP 0x02 #define DOWN 0x01 #define LEFT 0x04 #define RIGHT 0x08 #define FIRE 0x10 #define STOP 0x20 #define DEGS_PER_SEC_LR 50 #define NSEC_PER_DEG_LR /50 #define DEGS_PER_SEC_UD 76 #define NSEC_PER_DEG_UD /76 #define INT_MAX_ void send_command_cheeky(struct usb_device* dev, char cmd); void turn(struct usb_device* dev, char dir, time_t sec, long long nsec); void turn_lr_deg(struct usb_device* dev, char dir, int deg); void turn_up_deg(struct usb_device* dev, char dir, int deg); struct usb_device* find_dev(); char get_code(char *code_str); void a_wait(time_t sec, long nsec); int ts_cmp(struct timespec* a, struct timespec* b); void center_up(struct usb_device* dev); #endif launcher.c #include <stdio.h> #include <stdlib.h> #include <string.h> #include <usb.h> #include "launcher.h" #include <unistd.h> #include <time.h> int debug = 0; void send_command_cheeky(struct usb_device* dev, char cmd) usb_dev_handle *launcher; char data[8]; //some data to be sent over usb int ret;

7 launcher = usb_open(dev); if( launcher == NULL ) perror("unable to open device"); exit(exit_failure); /* Detach kernel driver (usbhid) from device interface and claim */ /* Is this what requires root? */ usb_detach_kernel_driver_np(launcher, 0); usb_detach_kernel_driver_np(launcher, 1); ret = usb_set_configuration(launcher, 1); if (ret < 0) perror("unable to set device configuration"); exit(exit_failure); ret = usb_claim_interface(launcher, 0); if (ret < 0) perror("unable to claim interface"); exit(exit_failure); memset(data, 0, 8); //data will mostly be zeros, so zero it data[0] = 0x02; //has to be done data[1] = cmd; ret = usb_control_msg(launcher, USB_DT_HID, USB_REQ_SET_CONFIGURATION, USB_RECIP_DEVICE, 0,//index data, 8, // Length of data. 5000); // Timeout if(ret!= 8) fprintf(stderr, "Error: %s\n", usb_strerror()); exit(exit_failure); usb_release_interface(launcher, 0); usb_close(launcher);

8 struct usb_device* find_dev() // needs to happen usb_init(); usb_find_busses(); usb_find_devices(); struct usb_bus *busses, *bus; struct usb_device *dev = NULL; busses = usb_get_busses(); printf("did init\n"); //iterate through busses for(bus = busses; bus &&!dev; bus = bus->next) //iterate through devices on current bus for(dev = bus->devices; dev; dev = dev->next) if(dev->descriptor.idvendor == 0x2123 && dev->descriptor.idproduct == 0x1010) printf("found it\n"); return dev; printf("found nothing\n"); return NULL; char get_code(char *code_str) if(strcmp(code_str, "up") == 0) return UP; else if (strcmp(code_str, "down") == 0) return DOWN; else if (strcmp(code_str, "left") == 0) return LEFT; else if (strcmp(code_str, "right") == 0)

9 return RIGHT; else if (strcmp(code_str, "fire") == 0) return FIRE; else if (strcmp(code_str, "stop") == 0) return STOP; else return 0x00; //error code void turn(struct usb_device* dev, char dir, time_t sec, long long nsec) //dir is the hex code relating to left, right, up, or down if(nsec <= INT_MAX_) send_command_cheeky(dev, dir); a_wait(sec, nsec); send_command_cheeky(dev, STOP); else send_command_cheeky(dev, dir); a_wait(sec, INT_MAX_); nsec -= INT_MAX_; while(nsec > INT_MAX_) a_wait(0,int_max_); nsec -= INT_MAX_ ; a_wait(0, nsec); send_command_cheeky(dev, STOP); int ts_cmp(struct timespec* a, struct timespec* b) /** Returns -1, 0, or 1 if a is less than, equal to, or greater than b */ /** Can 0 ever really happen? */

10 if(a->tv_sec < b->tv_sec) return -1; else if (a->tv_sec > b->tv_sec) return 1; else if(a->tv_nsec < b->tv_nsec) return -1; else if(a->tv_nsec > b->tv_nsec) return 1; else return 0; void a_wait(time_t sec, long nsec) /** * Waits the given seconds and nanoseconds, but really only has * resolution to ~1ms. It could have resolution to the nanosecond, * but that would max out a core with the constant polling. Instead, * while the polling occurs, we sleep for a milisecond */ /* * timespec is specified as * struct timespec * time_t tv_sec; seconds * long tv_nsec; nanoseconds * ; */ struct timespec curr, end; clock_gettime(clock_monotonic_raw, &curr); /* * CLOCK_MONOTONIC_RAW isn't affected by timezone changes or admin * changing the system time */

11 end.tv_sec = curr.tv_sec + sec; end.tv_nsec = curr.tv_nsec + nsec; while(ts_cmp(&curr, &end) < 1) /* * sleep for a milisecond, otherwise we max out a core polling for * unncessary resolution */ usleep(1000); clock_gettime(clock_monotonic_raw, &curr); void turn_lr_deg(struct usb_device* dev, char dir, int deg) time_t secs_to_turn = deg / DEGS_PER_SEC_LR; long long degs_rem = deg % DEGS_PER_SEC_LR; long long nsec_to_turn = degs_rem * NSEC_PER_DEG_LR; turn(dev, dir, secs_to_turn, nsec_to_turn); void turn_up_deg(struct usb_device* dev, char dir, int deg) time_t secs_to_turn = deg / DEGS_PER_SEC_UD; long long degs_rem = deg % DEGS_PER_SEC_UD; long long nsec_to_turn = degs_rem * NSEC_PER_DEG_UD; turn(dev, dir, secs_to_turn, nsec_to_turn); void center_up(struct usb_device* dev) printf("centering\n"); turn(dev, DOWN, 1, 0); printf("done centering\n");

12 db_find.hpp #ifndef DB_FIND_H #define DB_FIND_H #define SCALER_LOW.7 #define SCALER_HIGH 1.3 #define RAD_MIN 20 #define COLS 640 #define ROWS 480 #include "opencv2/core/core.hpp" #include "opencv2/features2d/features2d.hpp" #include "opencv2/highgui/highgui.hpp" #include "opencv2/imgproc/imgproc.hpp" #include "opencv2/calib3d/calib3d.hpp" #include "launcher.h" typedef struct db_status unsigned int up : 1; unsigned int down : 1; unsigned int left : 1; unsigned int right : 1; unsigned int just_fired : 1; unsigned int center: 1; struct timespec release_at; db_status; cv::mat thresh_img(cv::mat img, std::vector<int> lowerb, std::vector<int> upperb); int max_contour_area_index( std::vector<std::vector<cv::point> > contours ); bool is_circle(float radius, float calc_area); void set_db_status(db_status*, cv::point2f center, int radius); float rad_to_in(float radius); float in_to_cm(float in); int in_to_deg(float in); void move_launcher(struct usb_device*, db_status*); int rad_to_deg(float radius);

13 void check_fire(struct usb_device*, db_status*); #endif db_find.cpp #include <stdio.h> #include <iostream> #include <unistd.h> #include <usb.h> #include "db_find.hpp" #include "launcher.h" #include <math.h> #include <cstdlib> using namespace std; using namespace cv; float y_tilt_sec; float radius; int main() //launcher init struct usb_device* launch_dev = find_dev(); if (launch_dev == NULL) fprintf(stderr, "ERROR: couldn't find device\n"); exit(exit_failure); //opencv init VideoCapture cap(0); namedwindow("cam", CV_WINDOW_AUTOSIZE); namedwindow("threshed", CV_WINDOW_AUTOSIZE); Mat frame; Mat framehsv; Mat threshed_img; Mat approx_curve; Mat final = Mat::zeros(ROWS, COLS, CV_8UC3); Point2f center; db_status db_stat = 0, 0, 0, 0, 0, 0; int dbrad;

14 int dbcenterx; int dbcentery; vector<vector<point> > contours; vector<vec4i> hierarchy; int max_index; int lowerb[] = 0, 115, 115; int upperb[] = 17, 255, 255; vector<int> upperb_vect(upperb, upperb + sizeof(upperb)/sizeof(int)); vector<int> lowerb_vect(lowerb, lowerb + sizeof(lowerb)/sizeof(int)); center_up(launch_dev); char key = 'a'; while(1) try cap >> frame; //grab current frame and put it into frame //convert to HSV space cvtcolor(frame, framehsv, CV_BGR2HSV); //thresh image threshed_img = thresh_img(framehsv, lowerb_vect, upperb_vect); imshow("threshed", threshed_img); //grab contours findcontours( threshed_img, contours, hierarchy, CV_RETR_TREE, CV_CHAIN_APPROX_SIMPLE, Point(0, 0) ); max_index = max_contour_area_index( contours ); Scalar color( 255, 255, 255 ); //drawcontours( threshed_img, contours, max_index, color, CV_FILLED, 8, // hierarchy ); check_fire(launch_dev, &db_stat); if(contours.size() > 0) approxpolydp(contours[max_index], approx_curve, 3, true); minenclosingcircle(approx_curve, center, radius); dbrad = (int)radius;

15 if(dbrad > RAD_MIN && is_circle(radius, contourarea(contours[max_index]))) printf("radius:\t%f\n", radius); Scalar color2(0, 255, 255); circle( final, center, (int)dbrad, color2, 2, 8, 0); imshow("cam", final); set_db_status(&db_stat, center, dbrad); move_launcher(launch_dev, &db_stat); final = Mat::zeros(ROWS, COLS, CV_8UC3); //imshow("cam", frame); key = waitkey(10); if(key == 27) break; else if(key == 's') imwrite("pic.png", frame); printf("took pic\n"); catch (exception& e) printf("gay exception\n\n"); continue; return 0; Mat thresh_img(mat img, vector<int> lowerb, vector<int> upperb) /* * Takes in HSV image and returns thresholded version */ Mat threshed_image; inrange(img, lowerb, upperb, threshed_image); erode(threshed_image, threshed_image, Mat());

16 dilate(threshed_image, threshed_image, Mat(), Point(-1, -1), 3); return threshed_image; int max_contour_area_index( vector<vector<point> > contours ) float curr_area, max_area = 0; int max_area_i = 0; for(int i = 0; i < contours.size(); i++) curr_area = contourarea(contours[i], false); if(curr_area > max_area) max_area = curr_area; max_area_i = i; return max_area_i; bool is_circle(float radius, float area_guess) float area_calc = M_PI*powf(radius, 2); if( area_calc < SCALER_LOW * area_guess) return false; else if( area_calc > SCALER_HIGH * area_guess ) return false; else return true; void set_db_status(db_status* db_status_p, Point2f center, int radius) /* * Sets position of db relative to screen. * (0,0) is at top left, not botton left like in a normal cartesian plane */

17 //horizontal if( center.x < COLS/2-10 ) db_status_p->left = 1; db_status_p->right = 0; else if( center.x > COLS/ ) db_status_p->right = 1; db_status_p->left = 0; else db_status_p->right = 0; db_status_p->left = 0; //vertical if( center.y < ROWS/2-10 ) db_status_p->up = 1; db_status_p->down = 0; else if( center.y > ROWS/ ) db_status_p->down = 1; db_status_p->up = 0; else db_status_p->down = 0; db_status_p->up = 0; if(db_status_p->left db_status_p->right db_status_p->up db_status_p->down) db_status_p->center = 0; else db_status_p->center = 1; void move_launcher(struct usb_device* dev, db_status* db_stat) if(db_stat->just_fired)

18 return; else if(db_stat->center) float in = rad_to_in(radius); int deg = rad_to_deg(radius); printf("radius: %f\tdeg: %d\n", radius, deg); struct timespec tmp; clock_gettime(clock_monotonic_raw, &tmp); turn_up_deg(dev, UP, deg); clock_gettime(clock_monotonic_raw, &tmp); send_command_cheeky(dev, FIRE); //grab curr time and add 3 secs approx time to fire clock_gettime(clock_monotonic_raw, &tmp); tmp.tv_sec += 3; db_stat->release_at = tmp; db_stat->just_fired = 1; printf("locking\n"); printf("%lu\n", tmp.tv_sec); else if(db_stat->left) printf("need to turn left\n"); //turn_lr_deg(dev, LEFT, 1); turn(dev, LEFT, 0, /2); //.005 sec db_stat->left = 0; else if(db_stat->right) printf("need to turn right\n"); //turn_lr_deg(dev, RIGHT, 1); turn(dev, RIGHT, 0, /2); //.005 sec db_stat->right = 0; else if(db_stat->up) printf("need to turn up\n"); //turn_up_deg(dev, UP, 1); turn(dev, UP, 0, ); //.01 sec

19 db_stat->up = 0; y_tilt_sec +=.01; else if(db_stat->down) printf("need to turn down\n"); //turn_up_deg(dev, DOWN, 1); turn(dev, DOWN, 0, ); //.01 sec db_stat->down = 0; y_tilt_sec -=.01; void check_fire(struct usb_device* dev, db_status* db_stat) if(db_stat->just_fired) struct timespec now; clock_gettime(clock_monotonic_raw, &now); //if release_at time has passed if( ts_cmp( &(db_stat->release_at), &now ) <= 0 ) printf("releasing\n"); printf("%lu\n",now.tv_sec); center_up( dev ); db_stat->just_fired = 0; float rad_to_in(float radius) /* Returns how far away the db is in inches */ return (radius )/(-6.2); float in_to_cm(int in) return in*2.54; int in_to_deg(float in) return round((in - 3.5)/(9.1)); int rad_to_deg(float radius)

20 if(radius > 84 && radius < 96) return 6; else if(radius > 40 && radius < 55) return 20; else if(radius > 80 && radius <= 110) return 20; else if(radius > 110 && radius < 140) return 50; else return 8;

Embedded Driving Me Nuts: Writing a Real Driver In User Space

Embedded Driving Me Nuts: Writing a Real Driver In User Space Embedded Driving Me Nuts: Writing a Real Driver In User Space Now you can control USB hardware without touching the kernel and even make your driver run on BSD-based OSes with no code changes. by Greg

More information

Pawel Cieslewski Robo-Retriever Formal Report

Pawel Cieslewski Robo-Retriever Formal Report Pawel Cieslewski Robo-Retriever Formal Report EEL 4665 Intelligent Machines Design Laboratory University of Florida Department of Electrical and Computer Engineering TAs: Andy Gray, Josh Weaver, Nick Cox

More information

Comparing Different Visual Motion Detection Algorithms

Comparing Different Visual Motion Detection Algorithms Comparing Different Visual Motion Detection Algorithms New Mexico Supercomputing Challenge Final Report April 1, 2014 Team: 143 School of Dreams Academy Team Members: Albert Reed Zack Daniels Chloe Grubb

More information

#include <stdlib.h> #include <stdio.h> #include "opencv2/opencv.hpp" #include <vector> #include <cmath> #include <pthread.h> #include <unistd.

#include <stdlib.h> #include <stdio.h> #include opencv2/opencv.hpp #include <vector> #include <cmath> #include <pthread.h> #include <unistd. #include #include #include "opencv2/opencv.hpp" #include #include #include #include #include "LineDesc.h" #include "PotentialBug.h" #include

More information

Programming. C++ Basics

Programming. C++ Basics Programming C++ Basics Introduction to C++ C is a programming language developed in the 1970s with the UNIX operating system C programs are efficient and portable across different hardware platforms C++

More information

RLL Computer Vision Code 1.0 HLL

RLL Computer Vision Code 1.0 HLL RLL Computer Vision Code 1.0 HLL : 1.8.13 RLL Computer Vision Code 1.0 HLL class HCVC::ArmourDetector... class HCVC::ArmourTracker... class HCVC::ImagePreprocessor... 1.8.13 RLL Computer Vision Code 1.0

More information

D-Rex. Final Report. An Ho. April 21, 14

D-Rex. Final Report. An Ho. April 21, 14 D-Rex Final Report An Ho April 21, 14 University of Florida Department of Electrical and Computer Engineering EEL 4665 IMDL Instructors: A. Antonio Arroyo, Eric M. Schwartz TA: Andrew Gray Table of Contents

More information

Wall-Follower. Xiaodong Fang. EEL5666 Intelligent Machines Design Laboratory University of Florida School of Electrical and Computer Engineering

Wall-Follower. Xiaodong Fang. EEL5666 Intelligent Machines Design Laboratory University of Florida School of Electrical and Computer Engineering Wall-Follower Xiaodong Fang EEL5666 Intelligent Machines Design Laboratory University of Florida School of Electrical and Computer Engineering TAs: Tim Martin Josh Weaver Instructors: Dr. A. Antonio Arroyo

More information

Formal Proposal (Special Sensor) [NOTE: Jump to Experimental Layout & Result Section] Si-Fo. The Universal Signs Follower.

Formal Proposal (Special Sensor) [NOTE: Jump to Experimental Layout & Result Section] Si-Fo. The Universal Signs Follower. Formal Proposal (Special Sensor) [NOTE: Jump to Experimental Layout & Result Section] Si-Fo The Universal Signs Follower Izhar Shaikh Intelligent Machine Design Lab EEL 4665, Fall 2015 Professors: Dr.

More information

Autonomous Bottle Opener Robot

Autonomous Bottle Opener Robot Date: 03/19/02 Student Name: Clerc Jean-Philippe TAs: Aamir Qaiyumi Uriel Rodriguez Instructors: Dr. A. A Arroyo Dr. Schwartz University of Florida Department of Electrical and Computer Engineering Intelligent

More information

OpenCV. OpenCV Tutorials OpenCV User Guide OpenCV API Reference. docs.opencv.org. F. Xabier Albizuri

OpenCV. OpenCV Tutorials OpenCV User Guide OpenCV API Reference. docs.opencv.org. F. Xabier Albizuri OpenCV OpenCV Tutorials OpenCV User Guide OpenCV API Reference docs.opencv.org F. Xabier Albizuri - 2014 OpenCV Tutorials OpenCV Tutorials: Introduction to OpenCV The Core Functionality (core module) Image

More information

Colorado School of Mines. Computer Vision. Professor William Hoff Dept of Electrical Engineering &Computer Science.

Colorado School of Mines. Computer Vision. Professor William Hoff Dept of Electrical Engineering &Computer Science. Professor William Hoff Dept of Electrical Engineering &Computer Science http://inside.mines.edu/~whoff/ 1 Pose Estimation in OpenCV 2 Pose Estimation of a Known Model Assume we have a known object model,

More information

Vinci, the painter! Sai Prasanth Krishnamoorthy Mrudula Vaidya Lalit Damodaran

Vinci, the painter! Sai Prasanth Krishnamoorthy Mrudula Vaidya Lalit Damodaran Vinci, the painter! Sai Prasanth Krishnamoorthy Mrudula Vaidya Lalit Damodaran Overview and Purpose More than 100 million disabled Children with severe motor disabilities do not get to enjoy and express

More information

Chapter Four: Loops. Slides by Evan Gallagher. C++ for Everyone by Cay Horstmann Copyright 2012 by John Wiley & Sons. All rights reserved

Chapter Four: Loops. Slides by Evan Gallagher. C++ for Everyone by Cay Horstmann Copyright 2012 by John Wiley & Sons. All rights reserved Chapter Four: Loops Slides by Evan Gallagher The Three Loops in C++ C++ has these three looping statements: while for do The while Loop while (condition) { statements } The condition is some kind of test

More information

Kurt Schmidt. October 30, 2018

Kurt Schmidt. October 30, 2018 to Structs Dept. of Computer Science, Drexel University October 30, 2018 Array Objectives to Structs Intended audience: Student who has working knowledge of Python To gain some experience with a statically-typed

More information

Operating Systems Course: Jacobs University Bremen Date: Dr. Jürgen Schönwälder Deadline:

Operating Systems Course: Jacobs University Bremen Date: Dr. Jürgen Schönwälder Deadline: Operating Systems Course: 320202 Jacobs University Bremen Date: 2011-02-23 Dr. Jürgen Schönwälder Deadline: 2011-02-28 Problem Sheet #2 Problem 2.1: home-made busy-waiting semaphore (2+3 = 5 points) In

More information

EEL 5666C FALL Robot Name: DogBot. Author: Valerie Serluco. Date: December 08, Instructor(s): Dr. Arroyo. Dr. Schwartz. TA(s): Andrew Gray

EEL 5666C FALL Robot Name: DogBot. Author: Valerie Serluco. Date: December 08, Instructor(s): Dr. Arroyo. Dr. Schwartz. TA(s): Andrew Gray EEL 5666C FALL 2015 Robot Name: DogBot Author: Valerie Serluco Date: December 08, 2015 Instructor(s): Dr. Arroyo Dr. Schwartz TA(s): Andrew Gray Jacob Easterling INTRODUCTION ABSTRACT One of the fun things

More information

Final Report. EEL 5666 Intelligent Machines Design Laboratory

Final Report. EEL 5666 Intelligent Machines Design Laboratory Final Report EEL 5666 Intelligent Machines Design Laboratory TAs: Mike Pridgen & Thomas Vermeer Instructors: Dr. A. Antonio Arroyo & Dr. Eric M. Schwartz Hao (Hardy) He Dec 08 th, 2009 Table of Contents

More information

Final Report. Autonomous Robot: Chopper John Michael Mariano December 9, 2014

Final Report. Autonomous Robot: Chopper John Michael Mariano December 9, 2014 Final Report Autonomous Robot: Chopper John Michael Mariano December 9, 2014 EEL 4665: Intelligent Machines Design Laboratory Instructors: Dr. A. Antonio Arroyo, Dr. Eric M. Schwartz TA: Nicholas Cox,

More information

AS AUTOMAATIO- JA SYSTEEMITEKNIIKAN PROJEKTITYÖT CEILBOT FINAL REPORT

AS AUTOMAATIO- JA SYSTEEMITEKNIIKAN PROJEKTITYÖT CEILBOT FINAL REPORT AS-0.3200 AUTOMAATIO- JA SYSTEEMITEKNIIKAN PROJEKTITYÖT CEILBOT FINAL REPORT Jaakko Hirvelä GENERAL The goal of the Ceilbot-project is to design a fully autonomous service robot moving in a roof instead

More information

OpenCV. Basics. Department of Electrical Engineering and Computer Science

OpenCV. Basics. Department of Electrical Engineering and Computer Science OpenCV Basics 1 OpenCV header file OpenCV namespace OpenCV basic structures Primitive data types Point_ Size_ Vec Scalar_ Mat Basics 2 OpenCV Header File #include .hpp is a convention

More information

Matlab? Chapter 3-4 Matlab and IPT Basics. Working Environment. Matlab Demo. Array. Data Type. MATLAB Desktop:

Matlab? Chapter 3-4 Matlab and IPT Basics. Working Environment. Matlab Demo. Array. Data Type. MATLAB Desktop: Matlab? Lecture Slides ME 4060 Machine Vision and Vision-based Control Chapter 3-4 Matlab and IPT Basics By Dr. Debao Zhou 1 MATric LABoratory data analysis, prototype and visualization Matrix operation

More information

Mobile Autonomous Robotic Sentry (MARS) with Facial Detection and Recognition

Mobile Autonomous Robotic Sentry (MARS) with Facial Detection and Recognition Mobile Autonomous Robotic Sentry (MARS) with Facial Detection and Recognition Tyler M. Lovelly University of Florida, Dept. of Electrical & Computer Engineering 12315 Clarendon Ct Spring Hill, FL 34609

More information

CSCI 512 / EENG 512 Computer Vision Spring Lab 6. February 17, 2016

CSCI 512 / EENG 512 Computer Vision Spring Lab 6. February 17, 2016 Lab 6 February 17, 2016 NAME NAME This lab assignment should be done in teams of two. Go through the exercises below and show me your results. If you don t finish by the end of today s class, you may show

More information

Introduction to OpenCV. Marvin Smith

Introduction to OpenCV. Marvin Smith Introduction to OpenCV Marvin Smith Introduction OpenCV is an Image Processing library created by Intel and maintained by Willow Garage. Available for C, C++, and Python Newest update is version 2.2 Open

More information

Agenda. The main body and cout. Fundamental data types. Declarations and definitions. Control structures

Agenda. The main body and cout. Fundamental data types. Declarations and definitions. Control structures The main body and cout Agenda 1 Fundamental data types Declarations and definitions Control structures References, pass-by-value vs pass-by-references The main body and cout 2 C++ IS AN OO EXTENSION OF

More information

Laboratory of Applied Robotics

Laboratory of Applied Robotics Laboratory of Applied Robotics OpenCV: Shape Detection Paolo Bevilacqua RGB (Red-Green-Blue): Color Spaces RGB and HSV Color defined in relation to primary colors Correlated channels, information on both

More information

Introduction to C++ Systems Programming

Introduction to C++ Systems Programming Introduction to C++ Systems Programming Introduction to C++ Syntax differences between C and C++ A Simple C++ Example C++ Input/Output C++ Libraries C++ Header Files Another Simple C++ Example Inline Functions

More information

ECE 2400 Computer Systems Programming Fall 2017 Topic 12: Transition from C to C++

ECE 2400 Computer Systems Programming Fall 2017 Topic 12: Transition from C to C++ ECE 2400 Computer Systems Programming Fall 2017 Topic 12: Transition from C to C++ School of Electrical and Computer Engineering Cornell University revision: 2017-10-23-01-13 1 C++ Namespaces 2 2 C++ Functions

More information

Master Chief A. Final Report Justin Dickinson

Master Chief A. Final Report Justin Dickinson Master Chief A Final Report Justin Dickinson University of Florida Department of Electrical and Computer Engineering EEL 5666 IMDL Spring 2009 Intelligent Machines Design Laboratory Table of Contents Abstract..3

More information

Introduction to Processing

Introduction to Processing Processing Introduction to Processing Processing is a programming environment that makes writing programs easier. It contains libraries and functions that make interacting with the program simple. The

More information

Progress Review 1 Tushar Agrawal. Team A - Avengers Teammates: Adam Yabroudi, Pratik Chatrath, Sean Bryan ILR #2

Progress Review 1 Tushar Agrawal. Team A - Avengers Teammates: Adam Yabroudi, Pratik Chatrath, Sean Bryan ILR #2 Progress Review 1 Tushar Agrawal Team A - Avengers Teammates: Adam Yabroudi, Pratik Chatrath, Sean Bryan ILR #2 October 23, 2015 1. Individual Progress For the week, I was responsible for setting up the

More information

Basic C Programming (2) Bin Li Assistant Professor Dept. of Electrical, Computer and Biomedical Engineering University of Rhode Island

Basic C Programming (2) Bin Li Assistant Professor Dept. of Electrical, Computer and Biomedical Engineering University of Rhode Island Basic C Programming (2) Bin Li Assistant Professor Dept. of Electrical, Computer and Biomedical Engineering University of Rhode Island Data Types Basic Types Enumerated types The type void Derived types

More information

CSE au Midterm Exam Nov. 2, 2018 Sample Solution

CSE au Midterm Exam Nov. 2, 2018 Sample Solution Question 1. (16 points) Build tools and make. We re building a C++ software back-end prototype for a new food web site. So far, we ve got the following source files with the code for two main programs

More information

UNIVERSITY OF TORONTO FACULTY OF APPLIED SCIENCE AND ENGINEERING

UNIVERSITY OF TORONTO FACULTY OF APPLIED SCIENCE AND ENGINEERING UNIVERSITY OF TORONTO FACULTY OF APPLIED SCIENCE AND ENGINEERING APS 105 Computer Fundamentals Final Examination December 16, 2013 2:00 p.m. 4:30 p.m. (150 minutes) Examiners: J. Anderson, B. Korst, J.

More information

Building on the foundation. Now that we know a little about cout cin math operators boolean operators making decisions using if statements

Building on the foundation. Now that we know a little about cout cin math operators boolean operators making decisions using if statements Chapter 5 Looping Building on the foundation Now that we know a little about cout cin math operators boolean operators making decisions using if statements Advantages of Computers Computers are really

More information

CSE 333 Midterm Exam Sample Solution 7/28/14

CSE 333 Midterm Exam Sample Solution 7/28/14 Question 1. (20 points) C programming. For this question implement a C function contains that returns 1 (true) if a given C string appears as a substring of another C string starting at a given position.

More information

Chapter 15 - C++ As A "Better C"

Chapter 15 - C++ As A Better C Chapter 15 - C++ As A "Better C" Outline 15.1 Introduction 15.2 C++ 15.3 A Simple Program: Adding Two Integers 15.4 C++ Standard Library 15.5 Header Files 15.6 Inline Functions 15.7 References and Reference

More information

III. Classes (Chap. 3)

III. Classes (Chap. 3) III. Classes III-1 III. Classes (Chap. 3) As we have seen, C++ data types can be classified as: Fundamental (or simple or scalar): A data object of one of these types is a single object. int, double, char,

More information

6.096 Introduction to C++ January (IAP) 2009

6.096 Introduction to C++ January (IAP) 2009 MIT OpenCourseWare http://ocw.mit.edu 6.096 Introduction to C++ January (IAP) 2009 For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms. Welcome to 6.096 Lecture

More information

Basic Types, Variables, Literals, Constants

Basic Types, Variables, Literals, Constants Basic Types, Variables, Literals, Constants What is in a Word? A byte is the basic addressable unit of memory in RAM Typically it is 8 bits (octet) But some machines had 7, or 9, or... A word is the basic

More information

HW4-2. float phi[size][size]={};!

HW4-2. float phi[size][size]={};! HW 4 #include #include //atoi #include #include #include #include //timing routines #include #include #define SIZE 256 using

More information

Jordan University of Science & Technology Department of Computer Science CS 211 Exam #1 (23/10/2010) -- Form A

Jordan University of Science & Technology Department of Computer Science CS 211 Exam #1 (23/10/2010) -- Form A Jordan University of Science & Technology Department of Computer Science CS 211 Exam #1 (23/10/2010) -- Form A Name: ID#: Section #: Day & Time: Instructor: Answer all questions as indicated. Closed book/closed

More information

Lecture 2: C Programming Basic

Lecture 2: C Programming Basic ECE342 Introduction to Embedded Systems Lecture 2: C Programming Basic Ying Tang Electrical and Computer Engineering Rowan University 1 Facts about C C was developed in 1972 in order to write the UNIX

More information

CONTROL THE GPIO PINS ON THE DELL EMBEDDED BOX PC 5000 IN UBUNTU LINUX

CONTROL THE GPIO PINS ON THE DELL EMBEDDED BOX PC 5000 IN UBUNTU LINUX CONTROL THE GPIO PINS ON THE DELL EMBEDDED BOX PC 5000 IN UBUNTU LINUX ABSTRACT The Dell Embedded Box PC 5000 provides General Purpose I/O (GPIO) pins for customization. Due to the unavailability of the

More information

PusleIR Multitouch Screen Software SDK Specification. Revision 4.0

PusleIR Multitouch Screen Software SDK Specification. Revision 4.0 PusleIR Multitouch Screen Software SDK Specification Revision 4.0 Table of Contents 1. Overview... 3 1.1. Diagram... 3 1.1. PulseIR API Hierarchy... 3 1.2. DLL File... 4 2. Data Structure... 5 2.1 Point

More information

CHAPTER 1.2 INTRODUCTION TO C++ PROGRAMMING. Dr. Shady Yehia Elmashad

CHAPTER 1.2 INTRODUCTION TO C++ PROGRAMMING. Dr. Shady Yehia Elmashad CHAPTER 1.2 INTRODUCTION TO C++ PROGRAMMING Dr. Shady Yehia Elmashad Outline 1. Introduction to C++ Programming 2. Comment 3. Variables and Constants 4. Basic C++ Data Types 5. Simple Program: Printing

More information

C++: Overview and Features

C++: Overview and Features C++: Overview and Features Richard Newman r.newman@rdg.ac.uk Room CS127 2003-12-11 Programming & Design, 2003 1 Introduction You have: used streams seen how classes are used seen some C++ code Today: good

More information

Introduction to Programming

Introduction to Programming Introduction to Programming Summer Term 2015 Dr. Adrian Kacso, Univ. Siegen adriana.dkacsoa@duni-siegena.de Tel.: 0271/740-3966, Office: H-B 8406 State: May 6, 2015 Betriebssysteme / verteilte Systeme

More information

CIS 2107 Computer Systems and Low-Level Programming Fall 2011 Midterm

CIS 2107 Computer Systems and Low-Level Programming Fall 2011 Midterm Fall 2011 Name: Page Points Score 1 5 2 10 3 10 4 7 5 8 6 15 7 4 8 7 9 16 10 18 Total: 100 Instructions The exam is closed book, closed notes. You may not use a calculator, cell phone, etc. For each of

More information

Appendix. Grammar. A.1 Introduction. A.2 Keywords. There is no worse danger for a teacher than to teach words instead of things.

Appendix. Grammar. A.1 Introduction. A.2 Keywords. There is no worse danger for a teacher than to teach words instead of things. A Appendix Grammar There is no worse danger for a teacher than to teach words instead of things. Marc Block Introduction keywords lexical conventions programs expressions statements declarations declarators

More information

Introduction to OpenCV

Introduction to OpenCV Introduction to OpenCV Stefan Holzer, David Joseph Tan Chair for Computer Aided Medical Procedures Technische Universität München Germany Introduction to OpenCV Where to get OpenCV?

More information

OpenCV 비디오처리 김성영교수 금오공과대학교 컴퓨터공학과

OpenCV 비디오처리 김성영교수 금오공과대학교 컴퓨터공학과 OpenCV 비디오처리 김성영교수 금오공과대학교 컴퓨터공학과 학습내용 Reading video sequences Seeking video sequences Writing video sequences Foreground extraction 2 Reading video sequences VideoCapture: class for video capturing from

More information

Chapter Four: Loops II

Chapter Four: Loops II Chapter Four: Loops II Slides by Evan Gallagher & Nikolay Kirov Chapter Goals To understand nested loops To implement programs that read and process data sets To use a computer for simulations Processing

More information

- It computes the Standard Deviation by calculating the difference of each channel (R,G,B and A) of a pixel.

- It computes the Standard Deviation by calculating the difference of each channel (R,G,B and A) of a pixel. Standard Deviation: It is common to find comparison of two bitmaps in Image Processing Development. Comparison of two bitmaps means how each pixel of image1 is different from corresponding pixel of image2

More information

Programming RT systems with pthreads

Programming RT systems with pthreads Programming RT systems with pthreads Giuseppe Lipari http://feanor.sssup.it/~lipari Scuola Superiore Sant Anna Pisa December 1, 2011 Outline 1 Timing utilities 2 Periodic threads 3 Scheduler selection

More information

Solution to CSE 250 Final Exam

Solution to CSE 250 Final Exam Solution to CSE 250 Final Exam Fall 2013 Time: 3 hours. December 13, 2013 Total points: 100 14 pages Please use the space provided for each question, and the back of the page if you need to. Please do

More information

Midterm #2 CISC 220, Winter 2008

Midterm #2 CISC 220, Winter 2008 Midterm #2 CISC 220, Winter 2008 ***Please do NOT turn over this page and begin the exam until you are given permission*** STUDENT NUMBER: Please do not write your name on the exam, but write your student

More information

Advanced practical Programming for Scientists

Advanced practical Programming for Scientists Advanced practical Programming for Scientists Thorsten Koch Zuse Institute Berlin TU Berlin WS2014/15 Variants opt33 Intel Xeon E3-1245 v3 @ 3.40GHz (Haswell) opt17 Intel Xeon E3-1280 @ 3.50GHz (Ivy Bridge)

More information

Circle inversion fractals are based on the geometric operation of inversion of a point with respect to a circle, shown schematically in Fig. 1.

Circle inversion fractals are based on the geometric operation of inversion of a point with respect to a circle, shown schematically in Fig. 1. MSE 350 Creating a Circle Inversion Fractal Instructor: R.G. Erdmann In this project, you will create a self-inverse fractal using an iterated function system (IFS). 1 Background: Circle Inversion Circle

More information

Real Time Data Plotting

Real Time Data Plotting Real Time Data Plotting Introduction This lesson will show how to write a program plot data on a X-Y graph. On the Arduino, write a program to sample a sensor and print the voltage to the Serial interface.

More information

Unit Testing. Contents. Steven Zeil. July 22, Types of Testing 2. 2 Unit Testing Scaffolding Drivers Stubs...

Unit Testing. Contents. Steven Zeil. July 22, Types of Testing 2. 2 Unit Testing Scaffolding Drivers Stubs... Steven Zeil July 22, 2013 Contents 1 Types of Testing 2 2 6 2.1 Scaffolding................. 7 2.1.1 Drivers............... 7 2.1.2 Stubs................ 13 3 Integration Testing 17 1 1 Types of Testing

More information

Gabrielle Evaristo CSE 460. Lab Shared Memory

Gabrielle Evaristo CSE 460. Lab Shared Memory Gabrielle Evaristo CSE 460 Lab 7 1. Shared Memory Use man to study each of the shared memory functions and write a brief description on the usage of each of them. o shmget (shared memory get): Allocated

More information

COMP322 - Introduction to C++ Lecture 02 - Basics of C++

COMP322 - Introduction to C++ Lecture 02 - Basics of C++ COMP322 - Introduction to C++ Lecture 02 - Basics of C++ School of Computer Science 16 January 2012 C++ basics - Arithmetic operators Where possible, C++ will automatically convert among the basic types.

More information

Rubik's Cube Algorithm

Rubik's Cube Algorithm Rubik's Cube Algorithm The assignment was to create an algorithm that would solve a randomly organized Rubik's Cube. While very simple on the surface, this problem turned out to be incredibly complex,

More information

Use a calculator and c = 2 π r to calculate the circumference of a circle with a radius of 1.0.

Use a calculator and c = 2 π r to calculate the circumference of a circle with a radius of 1.0. Floating Point Math Submitted by Andy Lindsay on Thu, 03/21/2013-16:37 original source: http://learn.parallax.com/propeller-c-start-simple/floating-point-math Lesson edited to work with Dev-C++ IDE by

More information

Systems Programming/ C and UNIX

Systems Programming/ C and UNIX Systems Programming/ C and UNIX A. Fischer CSCI 4547/6647 What is Time? November 6, 2017 A. Fischer CSCI 4547/6647[1ex]What is Time? Systems Programming Lecture 8... 1/24 November 6, 2017 1 / 24 Outline

More information

1. Introduction to the OpenCV library

1. Introduction to the OpenCV library Image Processing - Laboratory 1: Introduction to the OpenCV library 1 1. Introduction to the OpenCV library 1.1. Introduction The purpose of this laboratory is to acquaint the students with the framework

More information

BGI Graphics Engine Tutorial

BGI Graphics Engine Tutorial BGI Graphics Engine Tutorial Tutor: Anton Gerdelan Computer game program layout Computer games (and other graphical programs) have a recognisable program structure: #include library files Global variables

More information

CSE 374 Final Exam Sample Solution 3/17/11

CSE 374 Final Exam Sample Solution 3/17/11 Question 1. (12 points) (testing) In Homework 5, many solutions included a function to add or insert a new word into the trie, creating appropriate strings and nodes as needed (something like insert(char

More information

Unit Testing. Steven Zeil. July 22, Types of Testing 2. 2 Unit Testing Scaffolding Drivers Stubs...

Unit Testing. Steven Zeil. July 22, Types of Testing 2. 2 Unit Testing Scaffolding Drivers Stubs... Steven Zeil July 22, 2013 Contents 1 Types of Testing 2 2 Unit Testing 4 2.1 Scaffolding............ 4 2.1.1 Drivers.......... 4 2.1.2 Stubs........... 9 3 Integration Testing 12 1 1 Types of Testing Testing

More information

#ifndef DOUBLE_LIST /* this string SHOULD NOT previously exist */ #define DOUBLE_LIST

#ifndef DOUBLE_LIST /* this string SHOULD NOT previously exist */ #define DOUBLE_LIST /* This is a personal header file. Call it double_list.h * Its name should be reflected into the macro definition (#define). * For instance, here I should say something like: * #define DOUBLE_LIST #ifndef

More information

Getting Familiar with CCN

Getting Familiar with CCN Getting Familiar with CCN 1 Project Goal In this project you will experiment with simple client/server programs in CCN to familiarize yourselves with the CCN basics. You will compile, run, and answer the

More information

Multimedia Retrieval Exercise Course 2 Basic of Image Processing by OpenCV

Multimedia Retrieval Exercise Course 2 Basic of Image Processing by OpenCV Multimedia Retrieval Exercise Course 2 Basic of Image Processing by OpenCV Kimiaki Shirahama, D.E. Research Group for Pattern Recognition Institute for Vision and Graphics University of Siegen, Germany

More information

Programming in C Quick Start! Biostatistics 615 Lecture 4

Programming in C Quick Start! Biostatistics 615 Lecture 4 Programming in C Quick Start! Biostatistics 615 Lecture 4 Last Lecture Analysis of Algorithms Empirical Analysis Mathematical Analysis Big-Oh notation Today Basics of programming in C Syntax of C programs

More information

CSE 303, Winter 2007, Final Examination 15 March Please do not turn the page until everyone is ready.

CSE 303, Winter 2007, Final Examination 15 March Please do not turn the page until everyone is ready. Name: CSE 303, Winter 2007, Final Examination 15 March 2007 Please do not turn the page until everyone is ready. Rules: The exam is closed-book, closed-note, except for two 8.5x11in pieces of paper (both

More information

Introduction to C Language

Introduction to C Language Introduction to C Language Instructor: Professor I. Charles Ume ME 6405 Introduction to Mechatronics Fall 2006 Instructor: Professor Charles Ume Introduction to C Language History of C Language In 1972,

More information

Lecture 04 FUNCTIONS AND ARRAYS

Lecture 04 FUNCTIONS AND ARRAYS Lecture 04 FUNCTIONS AND ARRAYS 1 Motivations Divide hug tasks to blocks: divide programs up into sets of cooperating functions. Define new functions with function calls and parameter passing. Use functions

More information

Chapter 19: Program Design. Chapter 19. Program Design. Copyright 2008 W. W. Norton & Company. All rights reserved.

Chapter 19: Program Design. Chapter 19. Program Design. Copyright 2008 W. W. Norton & Company. All rights reserved. Chapter 19 Program Design 1 Introduction Most full-featured programs are at least 100,000 lines long. Although C wasn t designed for writing large programs, many large programs have been written in C.

More information

H.O.#2 Fall 2015 Gary Chan. Overview of C++ Programming

H.O.#2 Fall 2015 Gary Chan. Overview of C++ Programming H.O.#2 Fall 2015 Gary Chan Overview of C++ Programming Topics C++ as a problem-solving tool Introduction to C++ General syntax Variable declarations and definitions Assignments Arithmetic operators COMP2012H

More information

CSCI-243 Exam 1 Review February 22, 2015 Presented by the RIT Computer Science Community

CSCI-243 Exam 1 Review February 22, 2015 Presented by the RIT Computer Science Community CSCI-243 Exam 1 Review February 22, 2015 Presented by the RIT Computer Science Community http://csc.cs.rit.edu History and Evolution of Programming Languages 1. Explain the relationship between machine

More information

University of Technology. Laser & Optoelectronics Engineering Department. C++ Lab.

University of Technology. Laser & Optoelectronics Engineering Department. C++ Lab. University of Technology Laser & Optoelectronics Engineering Department C++ Lab. Second week Variables Data Types. The usefulness of the "Hello World" programs shown in the previous section is quite questionable.

More information

UNIVERSITY OF TORONTO FACULTY OF APPLIED SCIENCE AND ENGINEERING

UNIVERSITY OF TORONTO FACULTY OF APPLIED SCIENCE AND ENGINEERING UNIVERSITY OF TORONTO FACULTY OF APPLIED SCIENCE AND ENGINEERING APS 105 Computer Fundamentals Final Examination December 15, 2014 9:30 a.m. 12:00 p.m. (150 minutes) Examiners: B. Li, J. Rose, H. Timorabadi,

More information

CSE 333 Midterm Exam Sample Solution 7/29/13

CSE 333 Midterm Exam Sample Solution 7/29/13 Question 1. (44 points) C hacking a question of several parts. The next several pages are questions about a linked list of 2-D points. Each point is represented by a Point struct containing the point s

More information

Informatik I (D-ITET) Übungsstunde 9, Hossein Shafagh

Informatik I (D-ITET) Übungsstunde 9, Hossein Shafagh Informatik I (D-ITET) Übungsstunde 9, 20.11.2017 Hossein Shafagh shafagh@inf.ethz.ch Self-Assessment III 1) Characters: FILO - 2P for the completely correct answer - 0P otherwise 2) Pointers Self-Assessment

More information

CS 240 Data Structure Spring 2018 Exam I 03/01/2018

CS 240 Data Structure Spring 2018 Exam I 03/01/2018 CS 240 Data Structure Spring 2018 Exam I 03/01/2018 This exam contains three section A) Code: (basic data type, pointer, ADT) a. Reading: Trace the code to predict the output of the code b. Filling: Fill

More information

15 122: Principles of Imperative Computation. Practice Exam August 4, 2015

15 122: Principles of Imperative Computation. Practice Exam August 4, 2015 15 122: Principles of Imperative Computation Practice Exam August 4, 2015 15-122 Practice Exam Page 2 of 17 1. Fun with C. The following C programs have between 0 and 1 errors in them. If the function

More information

s s tr t r s t st t t rt r t s r 2 st t t t s 2 r r r t t r r t t t s r t t s ss r2 r t t s s t t t r s q r t r t rs

s s tr t r s t st t t rt r t s r 2 st t t t s 2 r r r t t r r t t t s r t t s ss r2 r t t s s t t t r s q r t r t rs Pr t t r 2 t t t r str t r s t s r t s t 1 r s t r 2 t q s t r 2 r rs t r t s r s s s t t t 2 s t r t t t 1 st t r t s t r 2 s 2 r q r ts t st s t s 2 t s r r t2 s r t2 r t t2 t t s t t r st st r t s t

More information

OpenCV. Rishabh Maheshwari Electronics Club IIT Kanpur

OpenCV. Rishabh Maheshwari Electronics Club IIT Kanpur OpenCV Rishabh Maheshwari Electronics Club IIT Kanpur Installing OpenCV Download and Install OpenCV 2.1:- http://sourceforge.net/projects/opencvlibrary/fi les/opencv-win/2.1/ Download and install Dev C++

More information

#include <stdio.h> int main() { char s[] = Hsjodi, *p; for (p = s + 5; p >= s; p--) --*p; puts(s); return 0;

#include <stdio.h> int main() { char s[] = Hsjodi, *p; for (p = s + 5; p >= s; p--) --*p; puts(s); return 0; 1. Short answer questions: (a) Compare the typical contents of a module s header file to the contents of a module s implementation file. Which of these files defines the interface between a module and

More information

Computer Science Foundation Exam

Computer Science Foundation Exam Computer Science Foundation Exam January 13, 2018 Section I A DATA STRUCTURES NO books, notes, or calculators may be used, and you must work entirely on your own. Name: UCFID: NID: Question # Max Pts Category

More information

Princeton University COS 333: Advanced Programming Techniques A Subset of C90

Princeton University COS 333: Advanced Programming Techniques A Subset of C90 Princeton University COS 333: Advanced Programming Techniques A Subset of C90 Program Structure /* Print "hello, world" to stdout. Return 0. */ { printf("hello, world\n"); -----------------------------------------------------------------------------------

More information

Functions in C++ Problem-Solving Procedure With Modular Design C ++ Function Definition: a single

Functions in C++ Problem-Solving Procedure With Modular Design C ++ Function Definition: a single Functions in C++ Problem-Solving Procedure With Modular Design: Program development steps: Analyze the problem Develop a solution Code the solution Test/Debug the program C ++ Function Definition: A module

More information

OpenStax-CNX module: m :Hough Transform * Alice Xie. 2. Software Implementation of the Hough Transform

OpenStax-CNX module: m :Hough Transform * Alice Xie. 2. Software Implementation of the Hough Transform OpenStax-CNX module: m58714 1 2:Hough Transform * Alice Xie This work is produced by OpenStax-CNX and licensed under the Creative Commons Attribution License 4.0 2. Software Implementation of the Hough

More information

Variables. Data Types.

Variables. Data Types. Variables. Data Types. The usefulness of the "Hello World" programs shown in the previous section is quite questionable. We had to write several lines of code, compile them, and then execute the resulting

More information

Andrew Yenalavitch Homework 1 CSE Fall 2014

Andrew Yenalavitch Homework 1 CSE Fall 2014 Andrew Yenalavitch Homework 1 CSE 420 - Fall 2014 1.) ( 20 points ) In the class, we have discussed how to draw a line given by y = m x + b using Besenham's algorithm with m 1. Extend the algorithm to

More information

Computer and Machine Vision

Computer and Machine Vision Computer and Machine Vision Lecture Week 12 Part-1 Additional Programming Considerations March 29, 2014 Sam Siewert Outline of Week 12 Computer Vision APIs and Languages Alternatives to C++ and OpenCV

More information

Laboratory 2: Programming Basics and Variables. Lecture notes: 1. A quick review of hello_comment.c 2. Some useful information

Laboratory 2: Programming Basics and Variables. Lecture notes: 1. A quick review of hello_comment.c 2. Some useful information Laboratory 2: Programming Basics and Variables Lecture notes: 1. A quick review of hello_comment.c 2. Some useful information 3. Comment: a. name your program with extension.c b. use o option to specify

More information

Priority Queues and Huffman Trees

Priority Queues and Huffman Trees Priority Queues and Huffman Trees 1 the Heap storing the heap with a vector deleting from the heap 2 Binary Search Trees sorting integer numbers deleting from a binary search tree 3 Huffman Trees encoding

More information

LCP-USB Inclinometer sensor DLL Interface library description Page 1 of 5

LCP-USB Inclinometer sensor DLL Interface library description Page 1 of 5 LCP-USB Inclinometer sensor DLL Interface library description Page 1 of 5 Description The LCP-USB sensor connects to a USB host (PC) with a standard 4 pin USB A connector. It is USB 2.0 compatible. The

More information