Exemplo n.º 1
0
  void FrameGrabber::run() {
    for (;;) {
      // Stop when requested.
      if (isInterruptionRequested()) {
        return;
      }

      QImage img = session->getSnapshot(false);
      emit frameCaptured(FramePtr(new QImage(img)));
      usleep(512);
    }
  }
Exemplo n.º 2
0
bool QuickFBOCapturer::receiveFrame(const QtAV::VideoFrame &frame)
{
    emit frameCaptured(frame);
    return QuickFBORenderer::receiveFrame(frame);
}
Exemplo n.º 3
0
void QCamera::emitFrame(cv::Mat frame)
{
    emit frameCaptured(frame,this,pattern);
}
Exemplo n.º 4
0
void Wormsign::connectCamera(){
	
	if(camConnect->isChecked()){
		camConnect->setText("Disconnect");
		camList->setEnabled(false);

		//Spawn acquire thread, targeting selected camera
		camThread = new CoreCamThread(camList->currentIndex(),this);
		//camThread->biorules = biorulesConnection;
		connect(camThread,SIGNAL(frameCaptured()),this,SLOT(update()));
		connect(camThread,SIGNAL(frameCaptured()),perfGraph,SLOT(update()));
		for(int i=0; i<4; i++)
			connect(camThread,SIGNAL(frameCaptured()),plots[i],SLOT(update()));
		
		connect(camThread,SIGNAL(frameCaptured()),arenaTrack,SLOT(update()));
		connect(camThread,SIGNAL(frameCaptured()),behaviorModeView,SLOT(update()));

		//Set ROI limits
		int imgX,imgY;
		camThread->getRoiLimits(&imgX, &imgY);
		roiBox[0]->setMinimum(0); roiBox[0]->setMaximum(imgX-2);
		roiBox[1]->setMinimum(0); roiBox[1]->setMaximum(imgY-2);
		roiBox[2]->setMinimum(1); roiBox[2]->setMaximum(imgX);
		roiBox[3]->setMinimum(1); roiBox[3]->setMaximum(imgY);

		//Set Property Limits
		int max,min;
		camThread->getBrightRange(&min,&max);
		brightBox->setRange(min,max);
		brightSlider->setRange(min,max);
		
		camThread->getGainRange(&min,&max);
		gainBox->setRange(min,max);
		gainSlider->setRange(min,max);

		camThread->getGammaRange(&min,&max);
		gammaBox->setRange(min,max);
		gammaSlider->setRange(min,max);

		camThread->getShutterRange(&min,&max);
		shutterBox->setRange(min,max);
		shutterSlider->setRange(min,max);

		//Enable cam prop UI elements
		brightBox->setEnabled(true); gainBox->setEnabled(true);
		gammaBox->setEnabled(true); shutterBox->setEnabled(true);
		brightSlider->setEnabled(true); gainSlider->setEnabled(true);
		gammaSlider->setEnabled(true); shutterSlider->setEnabled(true);
		for(int i=0; i<4; i++) roiBox[i]->setEnabled(true);

		//update values
		refreshCamProps();
		//connect signals
		connect(brightBox,SIGNAL(valueChanged(int)),this,SLOT(setCamProps()));
		connect(gainBox,SIGNAL(valueChanged(int)),this,SLOT(setCamProps()));
		connect(gammaBox,SIGNAL(valueChanged(int)),this,SLOT(setCamProps()));
		connect(shutterBox,SIGNAL(valueChanged(int)),this,SLOT(setCamProps()));

		for(int i=0; i<4; i++) connect(roiBox[i],SIGNAL(editingFinished()),this,SLOT(setCamProps()));

		connect(camThread,SIGNAL(frameCaptured()),canvas,SLOT(update()));

		camThread->start();
	
	}else{