void FrameDifferenceBGS::saveConfig()
{
  CvFileStorage* fs = cvOpenFileStorage("./config/FrameDifferenceBGS.xml", 0, CV_STORAGE_WRITE);

  cvWriteInt(fs, "enableThreshold", enableThreshold);
  cvWriteInt(fs, "threshold", threshold);
  cvWriteInt(fs, "showOutput", showOutput);

  cvReleaseFileStorage(&fs);
}
Example #2
0
void DPTextureBGS::saveConfig()
{
    CvFileStorage* fs = cvOpenFileStorage("./config/DPTextureBGS.xml", 0, CV_STORAGE_WRITE);

    //cvWriteReal(fs, "alpha", alpha);
    //cvWriteInt(fs, "enableFiltering", enableFiltering);
    cvWriteInt(fs, "showOutput", showOutput);

    cvReleaseFileStorage(&fs);
}
void GMG::saveConfig()
{
  CvFileStorage* fs = cvOpenFileStorage("./config/GMG.xml", 0, CV_STORAGE_WRITE);

  cvWriteInt(fs, "initializationFrames", initializationFrames);
  cvWriteReal(fs, "decisionThreshold", decisionThreshold);
  cvWriteInt(fs, "showOutput", showOutput);

  cvReleaseFileStorage(&fs);
}
void FrameDifferenceBGS::loadConfig()
{
  CvFileStorage* fs = cvOpenFileStorage("./config/FrameDifferenceBGS.xml", 0, CV_STORAGE_READ);
  
  enableThreshold = cvReadIntByName(fs, 0, "enableThreshold", true);
  threshold = cvReadIntByName(fs, 0, "threshold", 15);
  showOutput = cvReadIntByName(fs, 0, "showOutput", true);

  cvReleaseFileStorage(&fs);
}
Example #5
0
void GMG::loadConfig()
{
  CvFileStorage* fs = cvOpenFileStorage("./config/GMG.xml", 0, CV_STORAGE_READ);
  
  initializationFrames = cvReadIntByName(fs, 0, "initializationFrames", 20);
  decisionThreshold = cvReadRealByName(fs, 0, "decisionThreshold", 0.7);
  showOutput = cvReadIntByName(fs, 0, "showOutput", true);
  
  cvReleaseFileStorage(&fs);
}
void FrameDifferenceBGS::loadConfig()
{
    CvFileStorage* fs = cvOpenFileStorage("E:\\yzbx_programe\\QT\\qt_bgslibrary\\config\\FrameDifferenceBGS.xml", 0, CV_STORAGE_READ);

    enableThreshold = cvReadIntByName(fs, 0, "enableThreshold", true);
    threshold = cvReadIntByName(fs, 0, "threshold", 15);
    showOutput = cvReadIntByName(fs, 0, "showOutput", true);

    cvReleaseFileStorage(&fs);
}
void FrameDifferenceBGS::saveConfig()
{
    CvFileStorage* fs = cvOpenFileStorage("E:\\yzbx_programe\\QT\\qt_bgslibrary\\config\\FrameDifferenceBGS.xml", 0, CV_STORAGE_WRITE);

    cvWriteInt(fs, "enableThreshold", enableThreshold);
    cvWriteInt(fs, "threshold", threshold);
    cvWriteInt(fs, "showOutput", showOutput);

    cvReleaseFileStorage(&fs);
}
Example #8
0
void DPTextureBGS::loadConfig()
{
    CvFileStorage* fs = cvOpenFileStorage("./config/DPTextureBGS.xml", 0, CV_STORAGE_READ);

    //alpha = cvReadRealByName(fs, 0, "alpha", 1e-6f);
    //enableFiltering = cvReadIntByName(fs, 0, "enableFiltering", true);
    showOutput = cvReadIntByName(fs, 0, "showOutput", true);

    cvReleaseFileStorage(&fs);
}
void DPEigenbackgroundBGS::loadConfig()
{
  CvFileStorage* fs = cvOpenFileStorage("./config/DPEigenbackgroundBGS.xml", 0, CV_STORAGE_READ);
  
  threshold = cvReadIntByName(fs, 0, "threshold", 225);
  historySize = cvReadIntByName(fs, 0, "historySize", 20);
  embeddedDim = cvReadIntByName(fs, 0, "embeddedDim", 10);
  showOutput = cvReadIntByName(fs, 0, "showOutput", true);

  cvReleaseFileStorage(&fs);
}
void DPEigenbackgroundBGS::saveConfig()
{
  CvFileStorage* fs = cvOpenFileStorage("./config/DPEigenbackgroundBGS.xml", 0, CV_STORAGE_WRITE);

  cvWriteInt(fs, "threshold", threshold);
  cvWriteInt(fs, "historySize", historySize);
  cvWriteInt(fs, "embeddedDim", embeddedDim);
  cvWriteInt(fs, "showOutput", showOutput);

  cvReleaseFileStorage(&fs);
}
Example #11
0
void DPWrenGABGS::saveConfig()
{
  CvFileStorage* fs = cvOpenFileStorage("./config/DPWrenGABGS.xml", 0, CV_STORAGE_WRITE);

  cvWriteReal(fs, "threshold", threshold);
  cvWriteReal(fs, "alpha", alpha);
  cvWriteInt(fs, "learningFrames", learningFrames);
  cvWriteInt(fs, "showOutput", showOutput);

  cvReleaseFileStorage(&fs);
}
void DPAdaptiveMedianBGS::loadConfig()
{
  CvFileStorage* fs = cvOpenFileStorage("DPAdaptiveMedianBGS.xml", 0, CV_STORAGE_READ);
  
  threshold = cvReadIntByName(fs, 0, "threshold", 40);
  samplingRate = cvReadIntByName(fs, 0, "samplingRate", 7);
  learningFrames = cvReadIntByName(fs, 0, "learningFrames", 30);
  showOutput = cvReadIntByName(fs, 0, "showOutput", true);

  cvReleaseFileStorage(&fs);
}
Example #13
0
void DPWrenGABGS::loadConfig()
{
  CvFileStorage* fs = cvOpenFileStorage("./config/DPWrenGABGS.xml", 0, CV_STORAGE_READ);
  
  threshold = cvReadRealByName(fs, 0, "threshold", 12.25f);
  alpha = cvReadRealByName(fs, 0, "alpha", 0.005f);
  learningFrames = cvReadIntByName(fs, 0, "learningFrames", 30);
  showOutput = cvReadIntByName(fs, 0, "showOutput", true);

  cvReleaseFileStorage(&fs);
}
Example #14
0
void DPGrimsonGMMBGS::saveConfig()
{
  CvFileStorage* fs = cvOpenFileStorage("./config/DPGrimsonGMMBGS.xml", 0, CV_STORAGE_WRITE);

  cvWriteReal(fs, "threshold", threshold);
  cvWriteReal(fs, "alpha", alpha);
  cvWriteInt(fs, "gaussians", gaussians);
  cvWriteInt(fs, "showOutput", showOutput);

  cvReleaseFileStorage(&fs);
}
Example #15
0
void DPGrimsonGMMBGS::loadConfig()
{
  CvFileStorage* fs = cvOpenFileStorage("./config/DPGrimsonGMMBGS.xml", 0, CV_STORAGE_READ);
  
  threshold = cvReadRealByName(fs, 0, "threshold", 9.0);
  alpha = cvReadRealByName(fs, 0, "alpha", 0.01);
  gaussians = cvReadIntByName(fs, 0, "gaussians", 3);
  showOutput = cvReadIntByName(fs, 0, "showOutput", true);

  cvReleaseFileStorage(&fs);
}
void MixtureOfGaussianV2BGS::saveConfig()
{
  CvFileStorage* fs = cvOpenFileStorage("./config/MixtureOfGaussianV2BGS.xml", 0, CV_STORAGE_WRITE);

  cvWriteReal(fs, "alpha", alpha);
  cvWriteInt(fs, "enableThreshold", enableThreshold);
  cvWriteInt(fs, "threshold", threshold);
  cvWriteInt(fs, "showOutput", showOutput);

  cvReleaseFileStorage(&fs);
}
void MixtureOfGaussianV2BGS::loadConfig()
{
  CvFileStorage* fs = cvOpenFileStorage("./config/MixtureOfGaussianV2BGS.xml", 0, CV_STORAGE_READ);
  
  alpha = cvReadRealByName(fs, 0, "alpha", 0.05);
  enableThreshold = cvReadIntByName(fs, 0, "enableThreshold", true);
  threshold = cvReadIntByName(fs, 0, "threshold", 15);
  showOutput = cvReadIntByName(fs, 0, "showOutput", true);

  cvReleaseFileStorage(&fs);
}
void LBSimpleGaussian::loadConfig()
{
  CvFileStorage* fs = cvOpenFileStorage("./config/LBSimpleGaussian.xml", 0, CV_STORAGE_READ);
  
  sensitivity = cvReadIntByName(fs, 0, "sensitivity", 66);
  noiseVariance = cvReadIntByName(fs, 0, "noiseVariance", 162);
  learningRate = cvReadIntByName(fs, 0, "learningRate", 18);
  showOutput = cvReadIntByName(fs, 0, "showOutput", true);

  cvReleaseFileStorage(&fs);
}
void DPAdaptiveMedianBGS::saveConfig()
{
  CvFileStorage* fs = cvOpenFileStorage("DPAdaptiveMedianBGS.xml", 0, CV_STORAGE_WRITE);

  cvWriteInt(fs, "threshold", threshold);
  cvWriteInt(fs, "samplingRate", samplingRate);
  cvWriteInt(fs, "learningFrames", learningFrames);
  cvWriteInt(fs, "showOutput", showOutput);

  cvReleaseFileStorage(&fs);
}
void LBSimpleGaussian::saveConfig()
{
  CvFileStorage* fs = cvOpenFileStorage("./config/LBSimpleGaussian.xml", 0, CV_STORAGE_WRITE);

  cvWriteInt(fs, "sensitivity", sensitivity);
  cvWriteInt(fs, "noiseVariance", noiseVariance);
  cvWriteInt(fs, "learningRate", learningRate);
  cvWriteInt(fs, "showOutput", showOutput);

  cvReleaseFileStorage(&fs);
}
Example #21
0
int main( int argc, char* argv[] ) {

    my_struct ms;
    ms.i = 123;
    ms.point = cvPoint(4,5);
    ms.rect = cvRect(6, 7, 8, 9);

    CvFileStorage* fs_write = cvOpenFileStorage( "my_struct1.xml", NULL, CV_STORAGE_WRITE );
    write_my_struct( fs_write, "Hello my_struct!", &ms);
    cvReleaseFileStorage( &fs_write );

    my_struct ms_read;
    CvFileStorage *fs_read = cvOpenFileStorage ("my_struct2.xml", NULL, CV_STORAGE_READ);
    read_my_struct(fs_read, NULL, &ms_read);
    cvReleaseFileStorage(&fs_read);

    print_my_struct( &ms_read );

    return 0;

}
void DPPratiMediodBGS::saveConfig()
{
  CvFileStorage* fs = cvOpenFileStorage("./config/DPPratiMediodBGS.xml", 0, CV_STORAGE_WRITE);

  cvWriteInt(fs, "threshold", threshold);
  cvWriteInt(fs, "samplingRate", samplingRate);
  cvWriteInt(fs, "historySize", historySize);
  cvWriteInt(fs, "weight", weight);
  cvWriteInt(fs, "showOutput", showOutput);

  cvReleaseFileStorage(&fs);
}
void DPPratiMediodBGS::loadConfig()
{
  CvFileStorage* fs = cvOpenFileStorage("./config/DPPratiMediodBGS.xml", 0, CV_STORAGE_READ);
  
  threshold = cvReadIntByName(fs, 0, "threshold", 30);
  samplingRate = cvReadIntByName(fs, 0, "samplingRate", 5);
  historySize = cvReadIntByName(fs, 0, "historySize", 16);
  weight = cvReadIntByName(fs, 0, "weight", 5);
  showOutput = cvReadIntByName(fs, 0, "showOutput", true);

  cvReleaseFileStorage(&fs);
}
void WeightedMovingMeanBGS::saveConfig()
{
  CvFileStorage* fs = cvOpenFileStorage("./config/WeightedMovingMeanBGS.xml", 0, CV_STORAGE_WRITE);

  cvWriteInt(fs, "enableWeight", enableWeight);
  cvWriteInt(fs, "enableThreshold", enableThreshold);
  cvWriteInt(fs, "threshold", threshold);
  cvWriteInt(fs, "showOutput", showOutput);
  cvWriteInt(fs, "showBackground", showBackground);

  cvReleaseFileStorage(&fs);
}
Example #25
0
  void PreProcessor::loadConfig()
  {
#if CV_MAJOR_VERSION < 4
    CvFileStorage* fs = cvOpenFileStorage("./config/PreProcessor.xml", 0, CV_STORAGE_READ);

    equalizeHist = cvReadIntByName(fs, 0, "equalizeHist", false);
    gaussianBlur = cvReadIntByName(fs, 0, "gaussianBlur", false);
    enableShow = cvReadIntByName(fs, 0, "enableShow", true);

    cvReleaseFileStorage(&fs);
#endif
  }
void cvReleaseTestSeq(CvTestSeq** ppTestSeq)
{
    CvTestSeq_* pTS = (CvTestSeq_*)ppTestSeq[0];

    icvTestSeqReleaseAll(&pTS->pElemList);
    if(pTS->pImg) cvReleaseImage(&pTS->pImg);
    if(pTS->pImgMask) cvReleaseImage(&pTS->pImgMask);
    if(pTS->pFileStorage)cvReleaseFileStorage(&pTS->pFileStorage);

    cvFree(ppTestSeq);

}   /* cvReleaseTestSeq */
Example #27
0
  void PreProcessor::saveConfig()
  {
#if CV_MAJOR_VERSION < 4
    CvFileStorage* fs = cvOpenFileStorage("./config/PreProcessor.xml", 0, CV_STORAGE_WRITE);

    cvWriteInt(fs, "equalizeHist", equalizeHist);
    cvWriteInt(fs, "gaussianBlur", gaussianBlur);
    cvWriteInt(fs, "enableShow", enableShow);

    cvReleaseFileStorage(&fs);
#endif
  }
// --------------------------------------------------------------------------
// main(Number of arguments, Argument values)
// Description  : This is the entry point of the program.
// Return value : SUCCESS:0  ERROR:-1
// --------------------------------------------------------------------------
int main(int argc, char **argv)
{
    // AR.Drone class
    ARDrone ardrone;

    // Initialize
    if (!ardrone.open()) {
        printf("Failed to initialize.\n");
        return -1;
    }

    // Image of AR.Drone's camera
    IplImage *image = ardrone.getImage();

    // Read intrincis camera parameters
    CvFileStorage *fs = cvOpenFileStorage("camera.xml", 0, CV_STORAGE_READ);
    CvMat *intrinsic = (CvMat*)cvRead(fs, cvGetFileNodeByName(fs, NULL, "intrinsic"));
    CvMat *distortion = (CvMat*)cvRead(fs, cvGetFileNodeByName(fs, NULL, "distortion"));

    // Initialize undistortion maps
    CvMat *mapx = cvCreateMat(image->height, image->width, CV_32FC1);
    CvMat *mapy = cvCreateMat(image->height, image->width, CV_32FC1);
    cvInitUndistortMap(intrinsic, distortion, mapx, mapy);

    // Main loop
    while (1) {
        // Key input
        int key = cvWaitKey(1);
        if (key == 0x1b) break;

        // Update
        if (!ardrone.update()) break;

        // Get an image
        image = ardrone.getImage();

        // Remap the image
        cvRemap(image, image, mapx, mapy);

        // Display the image
        cvShowImage("camera", image);
    }

    // Release the matrices
    cvReleaseMat(&mapx);
    cvReleaseMat(&mapy);
    cvReleaseFileStorage(&fs);

    // See you
    ardrone.close();

    return 0;
}
void WeightedMovingMeanBGS::loadConfig()
{
  CvFileStorage* fs = cvOpenFileStorage("./config/WeightedMovingMeanBGS.xml", 0, CV_STORAGE_READ);
  
  enableWeight = cvReadIntByName(fs, 0, "enableWeight", true);
  enableThreshold = cvReadIntByName(fs, 0, "enableThreshold", true);
  threshold = cvReadIntByName(fs, 0, "threshold", 15);
  showOutput = cvReadIntByName(fs, 0, "showOutput", true);
  showBackground = cvReadIntByName(fs, 0, "showBackground", false);

  cvReleaseFileStorage(&fs);
}
void T2FGMM_UV::loadConfig()
{
  CvFileStorage* fs = cvOpenFileStorage("./config/T2FGMM_UV.xml", 0, CV_STORAGE_READ);
  
  threshold = cvReadRealByName(fs, 0, "threshold", 9.0);
  alpha = cvReadRealByName(fs, 0, "alpha", 0.01);
  km = cvReadRealByName(fs, 0, "km", 1.5);
  kv = cvReadRealByName(fs, 0, "kv", 0.6);
  gaussians = cvReadIntByName(fs, 0, "gaussians", 3);
  showOutput = cvReadIntByName(fs, 0, "showOutput", true);

  cvReleaseFileStorage(&fs);
}