Changeset 353 in flair-src
- Timestamp:
- Feb 19, 2020, 5:29:19 PM (5 years ago)
- Location:
- trunk/lib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/FlairCore/src/Image.h
r338 r353 69 69 return pixelSize * width * height; 70 70 } 71 std::string GetDescription() const { return " cvimage"; };71 std::string GetDescription() const { return "image"; }; 72 72 73 73 Format GetFormat() const { return format; }; -
trunk/lib/FlairSensorActuator/src/V4LCamera.cpp
r352 r353 43 43 void V4LCamera::Run(void) { 44 44 pimpl_->Run(); 45 /*46 Time cam_time, new_time, fpsNow, fpsPrev;47 int fpsCounter = 0;48 49 cam_time = GetTime();50 fpsPrev = cam_time;51 52 while (!ToBeStopped()) {53 // fps counter54 fpsCounter++;55 if (fpsCounter == 100) {56 fpsNow = GetTime();57 fps->SetText("fps: %.1f",58 fpsCounter / ((float)(fpsNow - fpsPrev) / 1000000000.));59 fpsCounter = 0;60 fpsPrev = fpsNow;61 }62 63 // cam properties64 if (gain->ValueChanged() == true && autogain->Value() == false)65 SetGain(gain->Value());66 if (exposure->ValueChanged() == true && autoexposure->Value() == false)67 SetExposure(exposure->Value());68 if (bright->ValueChanged() == true)69 SetBrightness(bright->Value());70 if (sat->ValueChanged() == true)71 SetSaturation(sat->Value());72 if (contrast->ValueChanged() == true)73 SetContrast(contrast->Value());74 if (hue->ValueChanged() == true)75 SetHue(hue->Value());76 //if (sharpness->ValueChanged() == true)77 // cvSetCaptureProperty(capture, CV_CAP_PROP_SHARPNESS, sharpness->Value());78 if (autogain->ValueChanged() == true) {79 if (autogain->Value() == true) {80 gain->setEnabled(false);81 } else {82 gain->setEnabled(true);83 SetGain(gain->Value());84 }85 SetAutoGain(autogain->Value());86 }87 if (autoexposure->ValueChanged() == true) {88 if (autoexposure->Value() == true) {89 exposure->setEnabled(false);90 } else {91 exposure->setEnabled(true);92 SetExposure(exposure->Value());93 }94 SetAutoExposure(autoexposure->Value());95 }96 //if (awb->ValueChanged() == true)97 // cvSetCaptureProperty(capture, CV_CAP_PROP_AWB, awb->Value());98 99 // cam pictures100 if (!GrabFrame()) {101 Printf("Could not grab a frame\n");102 }103 104 //check for ps3eye deconnection in hds uav105 new_time = GetTime();106 if(new_time-cam_time>100*1000*1000) {107 Thread::Warn("delta t trop grand\n");108 hasProblems=true;109 }110 111 //select buffer112 if(useMemoryUsrPtr) {//buffers are already in CMEM113 imageData=(char*)buffers[dQueuedBuffer.index];114 //dequeue it latter (buffer used by ProcessUpdate)115 } else {//copy to CMEM allocated buffer116 memcpy(imageData,(char *)buffers[dQueuedBuffer.index],output->GetDataType().GetSize());117 QueueBuffer(&dQueuedBuffer);//we can do it right now118 }119 120 output->GetMutex();121 output->buffer=imageData;122 output->ReleaseMutex();123 124 output->SetDataTime(cam_time);125 ProcessUpdate(output);126 cam_time = new_time;127 128 if(useMemoryUsrPtr) {129 QueueBuffer(&dQueuedBuffer);//now it is possible to dequeue130 }131 }132 */133 45 } 134 46
Note:
See TracChangeset
for help on using the changeset viewer.