void MainWindow::on_imgLabel_clicked() { dbg << "click img" << std::endl; this->scaleImg = !this->scaleImg; setImg(); coutdebug(); }
/// <summary> /// Initializes a new instance of the <see cref="FocusEstimation"/> class. /// The source image of which the focus should be estimated is set and the patch window size (sliding window). /// </summary> /// <param name="img">The source img.</param> /// <param name="wSize">Size w of the sliding window.</param> FocusEstimation::FocusEstimation(const cv::Mat & img, int wSize) { setImg(img); mWindowSize = wSize; }
void MainWindow::prevImg() { index--; if(index < 0) index = imgdir.fileList.count() - 1; this->scaleImg = true; if(random) index = getRandIndex(); setImg(); }
void MainWindow::nextImg() { index++; if(index > imgdir.fileList.count() - 1) index = 0; this->scaleImg = true; if(random) index = getRandIndex(); setImg(); }
int Room::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QObject::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { if (_id < 4) qt_static_metacall(this, _c, _id, _a); _id -= 4; } #ifndef QT_NO_PROPERTIES else if (_c == QMetaObject::ReadProperty) { void *_v = _a[0]; switch (_id) { case 0: *reinterpret_cast< QString*>(_v) = id(); break; case 1: *reinterpret_cast< QString*>(_v) = name(); break; case 2: *reinterpret_cast< QString*>(_v) = description(); break; case 3: *reinterpret_cast< QString*>(_v) = img(); break; } _id -= 4; } else if (_c == QMetaObject::WriteProperty) { void *_v = _a[0]; switch (_id) { case 0: setID(*reinterpret_cast< QString*>(_v)); break; case 1: setName(*reinterpret_cast< QString*>(_v)); break; case 2: setDescription(*reinterpret_cast< QString*>(_v)); break; case 3: setImg(*reinterpret_cast< QString*>(_v)); break; } _id -= 4; } else if (_c == QMetaObject::ResetProperty) { _id -= 4; } else if (_c == QMetaObject::QueryPropertyDesignable) { _id -= 4; } else if (_c == QMetaObject::QueryPropertyScriptable) { _id -= 4; } else if (_c == QMetaObject::QueryPropertyStored) { _id -= 4; } else if (_c == QMetaObject::QueryPropertyEditable) { _id -= 4; } else if (_c == QMetaObject::QueryPropertyUser) { _id -= 4; } #endif // QT_NO_PROPERTIES return _id; }
void TrackThread::run() { VideoCapture caputure; // string WindowNameOutput="window"; Mat frame; Mat output; //emit Mess(QString("test"),QString("camera open filed")); //return ; caputure.open(0); if(!caputure.isOpened()) { emit Messquit(QString("warning"),QString("you don't have a camera, please connect one")); //md->mess("warning","camera open failed"); return; } // namedWindow(WindowNameOutput); // cvWaitKey(1000); Sleep(1000); while(nRunFlag){ if(!caputure.read(frame)) { emit Messquit(QString("warning"),QString("please connect camera")); //md->mess("warning","camera read failed"); break; } flip(frame,frame,1); int re=process (frame,output); //控制 //if(md->ready){ if(re==1){ emit moveup(); } //md->moveUp(); else if(re==2){ emit movedown(); } //md->moveDown(); else if(re==3){ emit moveleft(); } //md->moveLeft(); else if (re==4){ emit moveright(); } //md->moveRight(); //} // imshow(WindowNameOutput,output); // 显示 cvtColor(output, output, CV_BGR2RGB); QImage qq((unsigned char*)output.data,output.cols, output.rows,output.step, QImage::Format_RGB888); // md->setimg(QPixmap::fromImage(qq)); emit setImg(QPixmap::fromImage(qq)); // if(md->exitt) // break; Sleep(50); // cvWaitKey(1000); } caputure.release(); // destroyWindow (WindowNameOutput); }
/// <summary> /// Initializes a new instance of the <see cref="FocusEstimation"/> class. /// The source image of which the focus should be estimated is set. /// </summary> /// <param name="img">The source img.</param> FocusEstimation::FocusEstimation(const cv::Mat & img) { setImg(img); }