int image_main(void) { unsigned int total[1]; total[0] = 0; unsigned char pps[4]; // PPS NAL Unit Data unsigned char sps[10]; // SPS NAL Unit Data unsigned int iframelength[1]; // Length of I-Frame NAL Unit unsigned int numberofframes[1]; //Number of I-Frames int iframearrayposition; //Location of array with I-Frame Offsets int j; int images; iframearrayposition = avccparser(sps, pps, numberofframes); // 'Demux' Video, retrieve SPS, PPS, and Offset Data images = numberofframes[0]; // Set number of Iframes to Process printf("(image.c) Number of Frames %d \n",images); for(j=1;j<5;j++) { iframeparser(iframebuffer, j, iframearrayposition, iframelength); //Retrieve I-Frame NAL Unit lud(iframebuffer,iframelength, sps, pps,j); //Decode I-frame into RGB image edgedetect(j,total); printf("(image.c) Encoding Frame %i\n", j); // Only encode JPEG images that have corners if (total[0]) { main_encoder(2,j); } printf(" \n\n(image.c) Final Count per Image: %d ",total[0]); } //printf(" \n\n(image.c) Final Count: %d ",total[0]); return (0); }
void scanfill(float x1,float y1,float x2,float y2,float x3,float y3,float x4,float y4) { int le[500],re[500]; int i,y; for(i=0;i<500;i++) { le[i]=500; re[i]=0; } edgedetect(x1,y1,x2,y2,le,re); edgedetect(x2,y2,x3,y3,le,re); edgedetect(x3,y3,x4,y4,le,re); edgedetect(x4,y4,x1,y1,le,re); for(y=0;y<500;y++) { if(le[y]<=re[y]) for(i=(int)le[y];i<(int)re[y];i++) draw_pixel(i,y); } }
void scanfill(float xo1,float yo1, float x2, float y2,float x3, float y3,float x4, float y4) { int le[500],re[500]; int i,scanline; for(i=0;i<500;i++) { le[i]=500; re[i]=0; } edgedetect(xo1,yo1,x2,y2,le,re); edgedetect(x2,y2,x3,y3,le,re); edgedetect(x3,y3,x4,y4,le,re); edgedetect(x4,y4,xo1,yo1,le,re); for(scanline=0; scanline<500; scanline++) { if(le[scanline]<=re[scanline]) for(i=(int)le[scanline];i<(int)re[scanline];i++) draw_ppixel(i,scanline,BLACK); } }
void MainWindow::createActions() { openAction = new QAction(tr("&open..."),this); connect(openAction,SIGNAL(triggered()),this,SLOT(open())); saveAction = new QAction(tr("&save..."),this); connect(saveAction,SIGNAL(triggered()),this,SLOT(save())); exitAction = new QAction(tr("&exit"), this); connect(exitAction, SIGNAL(triggered()),this,SLOT(exit())); facedetectAction = new QAction(tr("&Face Detect"),this); connect(facedetectAction, SIGNAL(triggered()),this,SLOT(facedetect())); powertfAction = new QAction(tr("&Power Transform"),this); connect(powertfAction, SIGNAL(triggered()),this,SLOT(powertf())); edgedetectAction = new QAction(tr("&Edge Detect"),this); connect(edgedetectAction, SIGNAL(triggered()),this,SLOT(edgedetect())); houghAction = new QAction(tr("&Hough Check"),this); connect(houghAction, SIGNAL(triggered()), this, SLOT(houghcheck())); morphAction = new QAction(tr("&Morphology"),this); connect(morphAction, SIGNAL(triggered()), this, SLOT(morphology())); blurAction = new QAction(tr("&Blur"),this); connect(blurAction, SIGNAL(triggered()), this, SLOT(bluropt())); histeqAction = new QAction(tr("&Histeq"),this); connect(histeqAction, SIGNAL(triggered()), this, SLOT(histeqopt())); aboutAction = new QAction(tr("&about"),this); connect(aboutAction, SIGNAL(triggered()),this,SLOT(about())); docAction = new QAction(tr("&doc"),this); connect(docAction, SIGNAL(triggered()),this,SLOT(doc())); backwardAction = new QAction(tr("&backward"),this); backwardAction->setIcon(QIcon(":/images/backward.png")); connect(backwardAction,SIGNAL(triggered()), this, SLOT(backward())); forwardAction = new QAction(tr("&forward"),this); forwardAction->setIcon(QIcon(":/images/forward.png")); connect(forwardAction,SIGNAL(triggered()), this, SLOT(forward())); camstartAction = new QAction(tr("&CAM_Start"), this); camstartAction->setIcon(QIcon(":/images/Start.png")); camstartAction->setEnabled(true); connect(camstartAction,SIGNAL(triggered()),this,SLOT(camera_start())); camstopAction = new QAction(tr("&CAM_Stop"), this); camstopAction->setIcon(QIcon(":/images/Stop.png")); camstopAction->setEnabled(false); connect(camstopAction,SIGNAL(triggered()),this,SLOT(camera_stop())); }