GPS::GPS(QWidget *parent){ this->setParent(parent); ui.setupUi(this); this->move(20, 20); gpsScene = new QGraphicsScene(); this->instrumentView->setScene(gpsScene); ui.gridLayout->addWidget(this->instrumentView, 0, 0, 1, 1); longitudePosition.setX(120); longitudePosition.setY(130); latitudePosition.setX(120); latitudePosition.setY(80); sizes << 0.55; sizes << 0.85; sizes << 1.15; index = 0; initializeImages(); setDefaultStyleSheet(); changeWidgetSize(); connect(this->instrumentView, SIGNAL(mouseMoved(QMouseEvent*)), this, SLOT(mouseMoveEvent(QMouseEvent*))); connect(this->instrumentView, SIGNAL(mousePressed(QMouseEvent*)), this, SLOT(mousePressEvent(QMouseEvent*))); connect(this->instrumentView, SIGNAL(mouseDoubleClicked(QMouseEvent*)), this, SLOT(changeSize())); this->initializeSettings(); }
President::President(std::string &filename, std::string &name): mName(name), mYearsElected(0), mCurrentFrame(0), mFrames(0), mTimeOut(0) { if(biographyMap.empty()) initBiographyMap(); mFrames = animationMap[name].first; mTimeOut = animationMap[name].second; initializeImages(filename); randomStatFunc(); }
int main(int argc, char* argv[]) { char fname[100]="output"; if (argc == 0) return usage(argv[0]); int processArgumentOne, processArgumentTwo; speed_up = 33; printf("Choose processing mode:\n"); printf("1: Hough Transform\n"); printf("2: Least Squares Means Linear Regression\n"); printf("3: Singular Value Decomposition\n"); printf("4: Factored Singular Value Decomposition\n"); scanf("%d", &processArgumentOne); sprintf(fname,"output%d.csv", processArgumentOne); oFile=fopen(fname,"w"); //if(*processArgument != 1 || *processArgument != 2 || *processArgument != 3) { printf("Enter a valid option\n"); return -1; } printf("Choose input type:\n"); printf("1: Process input as movie file\n"); printf("2: Process input as image in sequential series\n"); scanf("%d", &processArgumentTwo); if(processArgumentTwo == 1) { gCapture = cvCreateFileCapture(argv[1]); frame = cvQueryFrame(gCapture); } else if (processArgumentTwo == 2) frame = cvLoadImage(argv[1]); cvShowImage(argv[1], red); initializeImages(); cvSplit(frame, blue, green, red, NULL); subFrameX = .1 * width; subFrameY = .1 * height; cvNamedWindow("Initial", CV_WINDOW_AUTOSIZE); cvShowImage("Initial", frame); cvSetMouseCallback("Initial", myMouseCallback, NULL); cvWaitKey(0); cvDestroyWindow("Initial"); cvNamedWindow("Frame Analysis", CV_WINDOW_NORMAL); cvSetMouseCallback("Frame Analysis", onTileSelect, NULL); stream = fopen("output","w"); printf("Starting...\n"); gettimeofday(&tStart, 0); int processTypeInput = processArgumentOne; int inputFileType = processArgumentTwo; switch(processTypeInput) { case 1: runHoughTransform(inputFileType); break; case 2: runLSMRegression(inputFileType); break; case 3: runSVD(inputFileType); break; case 4: runFactoredSVD(inputFileType); break; default: printf("Quit without processing\n"); break; } gettimeofday(&tComplete, 0); totalRunTime = (tComplete.tv_sec - tStart.tv_sec); //printf("Total Processing Time: %f\n", totalProcessingTime); printf("Total Runtime: %f seconds\n", totalRunTime); cvReleaseCapture(&gCapture); cvDestroyWindow(argv[0]); return(0); }