AVR32 IDE (C/C++)
- uses AVR32 GNU toolchain
- requires FLIP 3 for uart bootloading
- tested only on eGizmo AVR32 mcu board (AT32UC3L0128)
svn repo source:
svn co http://yus-repo.googlecode.com/svn/trunk/AVR32/avr32-ide
forum link: AVR32 GCC IDE
.
Prototype Projects - experiments on theoretical electronics/electrical designs and actual prototype circuits.
svn co http://yus-repo.googlecode.com/svn/trunk/AVR32/avr32-ide
import cv2.cv as cv HAAR_CASCADE = "/usr/local/share/OpenCV/haarcascades/haarcascade_frontalface_default.xml" cv.NamedWindow( "mycamera" ) capture = cv.CreateCameraCapture(0) storage = cv.CreateMemStorage() cascade = cv.Load(HAAR_CASCADE) while True: image = cv.QueryFrame(capture) faces = cv.HaarDetectObjects(image, cascade, storage, 1.1, 3, cv.CV_HAAR_DO_CANNY_PRUNING, (100,100)) for((x,y,w,h),i) in faces: cv.Rectangle(image, (x,y), (x+w, y+h), (0,255,0), 3) cv.ShowImage( "mycamera", image ) if cv.WaitKey(5) > 0: break cv.DestroyWindow( "mycamera" )
#include <opencv2/highgui/highgui.hpp> #include <opencv2/objdetect/objdetect.hpp> using namespace cv; #define HAAR_CASCADE "/usr/local/share/OpenCV/haarcascades/haarcascade_frontalface_default.xml" int main(int argc, const char ** argv) { cvNamedWindow( "mycamera" /*, CV_WINDOW_AUTOSIZE*/); // create camera window, 1=CV_WINDOW_AUTOSIZE(default,the user cannot resize the window) CvCapture *capture = cvCreateCameraCapture(0); // start capturing frames from camera (i.e. /dev/video0 device) CvMemStorage *storage = cvCreateMemStorage(); // create new memory storage CvHaarClassifierCascade *cascade = (CvHaarClassifierCascade *)cvLoad(HAAR_CASCADE); // load frontal face detector while (1){ IplImage *image = cvQueryFrame(capture); // grab and retrieve frame CvSeq *faces = cvHaarDetectObjects(image, cascade, storage, 1.1, 3, CV_HAAR_DO_CANNY_PRUNING, cvSize(100,100)); // find rectangular regions that contain faces for(int i=0; i < faces->total; i++){ CvRect *r = (CvRect *)cvGetSeqElem(faces, i); // get bounding rectangle of the detected face cvRectangle(image, cvPoint(r->x, r->y), cvPoint(r->x + r->width, r->y + r->height), cvScalar(0,255,0), 3); // draw a green rectangle } cvShowImage( "mycamera", image ); // display image within window if (cvWaitKey(5) > 0) // press any key to exit break; } // cleanups cvReleaseHaarClassifierCascade( &cascade ); // release cascade cvReleaseMemStorage( &storage ); // release memory storage cvReleaseCapture( &capture ); // stop capturing/reading cvDestroyWindow( "mycamera" ); // end camera window return 0; }
import cv2.cv as cv cv.NamedWindow( "mycamera", 1 ) capture = cv.CreateCameraCapture( 0 ) while True: img = cv.QueryFrame( capture ) cv.ShowImage( "mycamera", img ) if cv.WaitKey(20) > 0: break cv.DestroyWindow( "mycamera" )
#include <opencv2/highgui/highgui.hpp> using namespace cv; int main( int argc, const char** argv ) { cvNamedWindow( "mycamera", 1 ); // create camera window CvCapture *capture = cvCreateCameraCapture( 0 ); // start capturing frames from camera (i.e. /dev/video0 device) while(1){ IplImage* img = cvQueryFrame( capture ); // grab and retrieve frame cvShowImage( "mycamera", img ); // display image within window if( waitKey(20) > 0 ) // press any key to exit (interval=20ms) break; } // cleanups cvReleaseCapture( &capture ); // stop capturing/reading // not needed in python (?) cvDestroyWindow( "mycamera" ); // end camera window return 0; }