• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ cvWriteInt函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中cvWriteInt函数的典型用法代码示例。如果您正苦于以下问题:C++ cvWriteInt函数的具体用法?C++ cvWriteInt怎么用?C++ cvWriteInt使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了cvWriteInt函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: storeTrainingData

//存储训练结果
void storeTrainingData()
{
	CvFileStorage * fileStorage;
	int i;

	
	fileStorage = cvOpenFileStorage( "facedata.xml", 0, CV_STORAGE_WRITE );

	//存储特征值,投影矩阵,平均矩阵等训练结果
	cvWriteInt( fileStorage, "nEigens", nEigens );
	cvWriteInt( fileStorage, "nTrainFaces", nTrainFaces );
	cvWrite(fileStorage, "trainPersonNumMat", personNumTruthMat, cvAttrList(0,0));
	cvWrite(fileStorage, "eigenValMat", eigenValMat, cvAttrList(0,0));
	cvWrite(fileStorage, "projectedTrainFaceMat", projectedTrainFaceMat, cvAttrList(0,0));
	cvWrite(fileStorage, "avgTrainImg", pAvgTrainImg, cvAttrList(0,0));
	for(i=0; i<nEigens; i++)
	{
		char varname[200];
		sprintf( varname, "eigenVect_%d", i );
		cvWrite(fileStorage, varname, eigenVectArr[i], cvAttrList(0,0));
	}


	cvReleaseFileStorage( &fileStorage );
}
开发者ID:xingren,项目名称:face-recognition,代码行数:26,代码来源:fuction.cpp


示例2: main

int main(int argc, const char * argv[]) {
    CvMat *cmatrix = cvCreateMat(5,5,CV_32FC1);
    float element_3_2 = 7.7;
    *((float*)CV_MAT_ELEM_PTR( *cmatrix, 3,2) ) = element_3_2;
    cvmSet(cmatrix,4,4,0.5000);
    cvSetReal2D(cmatrix,3,3,0.5000);
    
    CvFileStorage* fs1 = cvOpenFileStorage("cfg.xml", 0, CV_STORAGE_WRITE);
    cvWriteInt( fs1, "frame_count", 10 );
    cvStartWriteStruct( fs1, "frame_size", CV_NODE_SEQ );
    cvWriteInt( fs1 , 0, 320 );
    cvWriteInt( fs1 , 0, 200 );
    cvEndWriteStruct( fs1 );
    cvWrite( fs1, "color_cvt_matrix", cmatrix );
    cvReleaseFileStorage( &fs1 );
    
    CvFileStorage* fs2 = cvOpenFileStorage("cfg.xml", 0, CV_STORAGE_READ);
    int frame_count = cvReadIntByName( fs2 , 0, "frame_count");
    CvSeq* s = cvGetFileNodeByName( fs2,0,"frame_size" )->data.seq;
    int frame_width = cvReadInt( (CvFileNode*)cvGetSeqElem(s,0) );
    int frame_height = cvReadInt( (CvFileNode*)cvGetSeqElem(s,1) );
    CvMat* color_cvt_matrix = (CvMat*) cvReadByName( fs2, 0 , "color_cvt_matrix");
    
    printf("color_cvt_matrix: width=%d, height=%d\n",color_cvt_matrix->width, color_cvt_matrix->height );
    printf("frame_count=%d, frame_width=%d, frame_height=%d\n",frame_count,frame_width,frame_height);
    
    cvReleaseFileStorage( &fs2 );
    
    return 0;
}
开发者ID:yourtion,项目名称:LearningOpenCV,代码行数:30,代码来源:FileStorage.cpp


示例3: storeTrainingData

// Save the training data to the file 'facedata.xml'.
void storeTrainingData()
{
    CvFileStorage * fileStorage;
    int i;
    
    // create a file-storage interface

    fileStorage = cvOpenFileStorage( facedata, 0, CV_STORAGE_WRITE );    
    // Store the person names. Added by Shervin.
    cvWriteInt( fileStorage, "nPersons", nPersons );
    for (i=0; i<nPersons; i++) {
        char varname[200];
        sprintf( varname, "personName_%d", (i+1) );
        cvWriteString(fileStorage, varname, personNames[i].c_str(), 0);
    }
    
    // store all the data
    cvWriteInt( fileStorage, "nEigens", nEigens );
    cvWriteInt( fileStorage, "nTrainFaces", nTrainFaces );
    cvWrite(fileStorage, "trainPersonNumMat", personNumTruthMat, cvAttrList(0,0));
    cvWrite(fileStorage, "eigenValMat", eigenValMat, cvAttrList(0,0));
    cvWrite(fileStorage, "projectedTrainFaceMat", projectedTrainFaceMat, cvAttrList(0,0));
    cvWrite(fileStorage, "avgTrainImg", pAvgTrainImg, cvAttrList(0,0));
    for(i=0; i<nEigens; i++)
    {
        char varname[200];
        sprintf( varname, "eigenVect_%d", i );
        cvWrite(fileStorage, varname, eigenVectArr[i], cvAttrList(0,0));
    }
    
    // release the file-storage interface
    cvReleaseFileStorage( &fileStorage );
}
开发者ID:HVisionSensing,项目名称:DesignProjectOpenCV,代码行数:34,代码来源:FaceRec.cpp


示例4: SaveFeature

void SaveFeature(
		FEATURE* 	feature,
		char* 		fileName){
	CvFileStorage* fs = cvOpenFileStorage( fileName, 0, CV_STORAGE_WRITE, NULL);
	if (fs==NULL){
		fprintf(stderr, "can't open feature file\n");
		return;
	}
	cvWriteInt(fs, "radius", feature->radius);
	cvWriteInt(fs, "neighbors", feature->neighbors);
	cvWriteInt(fs, "grid_x", feature->grid_x);
	cvWriteInt(fs, "grid_y", feature->grid_y);
	cvWriteInt(fs, "num_faces", feature->num_faces);

	char faceid[1024];
	char id[1024];

	for (int i=0; i<feature->num_faces; i++){
		strcpy(faceid, "face-");
		sprintf(id, "%d", i);
		strcat(faceid, id);
		cvWrite( fs, faceid, feature->histogram[i], cvAttrList(0,0) );
	}
	if (HUELBP_ON){
		for (int i=0; i<feature->num_faces; i++){
			strcpy(faceid, "hue-face-");
			sprintf(id, "%d", i);
			strcat(faceid, id);
			cvWrite( fs, faceid, feature->hue_histogram[i], cvAttrList(0,0) );
		}
	}
	cvReleaseFileStorage( &fs );
}
开发者ID:namwkim,项目名称:FaceSearch,代码行数:33,代码来源:face-search.c


示例5: cvWriteString

void CvGBTrees::write_params( CvFileStorage* fs ) const
{
    const char* loss_function_type_str =
        params.loss_function_type == SQUARED_LOSS ? "SquaredLoss" :
        params.loss_function_type == ABSOLUTE_LOSS ? "AbsoluteLoss" :
        params.loss_function_type == HUBER_LOSS ? "HuberLoss" :
        params.loss_function_type == DEVIANCE_LOSS ? "DevianceLoss" : 0;


    if( loss_function_type_str )
        cvWriteString( fs, "loss_function", loss_function_type_str );
    else
        cvWriteInt( fs, "loss_function", params.loss_function_type );

    cvWriteInt( fs, "ensemble_length", params.weak_count );
    cvWriteReal( fs, "shrinkage", params.shrinkage );
    cvWriteReal( fs, "subsample_portion", params.subsample_portion );
    //cvWriteInt( fs, "max_tree_depth", params.max_depth );
    //cvWriteString( fs, "use_surrogate_splits", params.use_surrogates ? "true" : "false");
    if (class_labels) cvWrite( fs, "class_labels", class_labels);

    data->is_classifier = !problem_type();
    data->write_params( fs );
    data->is_classifier = 0;
}
开发者ID:Rocky030,项目名称:opencv,代码行数:25,代码来源:gbt.cpp


示例6: WriteOutDefaultGridSize

/*
 *  Write out to YAML the default grid size for non-protocol based illumination
 */
void WriteOutDefaultGridSize(WriteOut* DataWriter, WormAnalysisParam* Param){
	/** Write out default grid size for non-protocol illumination **/
	cvStartWriteStruct(DataWriter->fs,"DefaultGridSizeForNonProtocolIllum",CV_NODE_MAP,NULL);
		cvWriteInt(DataWriter->fs,"x",Param->DefaultGridSize.width);
		cvWriteInt(DataWriter->fs,"y",Param->DefaultGridSize.height);
	cvEndWriteStruct(DataWriter->fs);

	return;
}
开发者ID:MaxMillion,项目名称:mindcontrol,代码行数:12,代码来源:WriteOutWorm.c


示例7: WriteProtocol

/**
 * Write out a Protocol to YAML file, given an initialized CvFileStorage
 */
void WriteProtocol(Protocol* myP, CvFileStorage* fs){
	if (fs==0){
		printf("fs is zero! Could you have specified the wrong directory?\n");
		return;
	}
	/** Write out Protocol **/
	cvStartWriteStruct(fs,"Protocol",CV_NODE_MAP,NULL);
		if (myP->Filename!=NULL) cvWriteString(fs,"Filename",myP->Filename);
		if (myP->Description!=NULL)  cvWriteString(fs,"Description",myP->Description);
		cvStartWriteStruct(fs,"GridSize",CV_NODE_MAP,NULL);
			cvWriteInt(fs,"height",myP->GridSize.height);
			cvWriteInt(fs,"width",myP->GridSize.width);
		cvEndWriteStruct(fs);
		//printf("yo\n");
		/** Write Out Steps **/
		cvStartWriteStruct(fs,"Steps",CV_NODE_SEQ,NULL);
		int j;
		int jtot=myP->Steps->total;


		CvSeqReader StepReader;
		cvStartReadSeq(myP->Steps,&StepReader,0);
		for (j = 0; j < jtot; ++j) {
			//printf("About to write step number %d\n",j);
			CvSeq** CurrentMontagePtr = (CvSeq**) StepReader.ptr;
			CvSeq* CurrentMontage=*CurrentMontagePtr;
			assert(CurrentMontage!=NULL);
		//	printf("ping\n");
		//	printf("CurrentMontage->total=%d",CurrentMontage->total);
			cvStartWriteStruct(fs,NULL,CV_NODE_SEQ,NULL);
			int k;
			int ktot=CurrentMontage->total;
		//	printf("ktot=%d\n",ktot);

			CvSeqReader MontageReader;
			cvStartReadSeq(CurrentMontage,&MontageReader);
			for (k = 0; k < ktot; ++k) {
			//	printf("About to write polygon number %d\n",k);
				WormPolygon** CurrentPolygonPtr= (WormPolygon**) MontageReader.ptr;
				WormPolygon* CurrentPolygon=*CurrentPolygonPtr;

				cvWrite(fs,NULL,CurrentPolygon->Points);

				CV_NEXT_SEQ_ELEM(CurrentMontage->elem_size,MontageReader);
			}
			CurrentMontagePtr=NULL;
			CurrentMontage=NULL;
			cvEndWriteStruct(fs);

			/** Loop to Next Step **/
			CV_NEXT_SEQ_ELEM(myP->Steps->elem_size,StepReader);

		}
		cvEndWriteStruct(fs);
	cvEndWriteStruct(fs);
}
开发者ID:Sophrinix,项目名称:mindcontrol,代码行数:59,代码来源:IllumWormProtocol.c


示例8: cvOpenFileStorage

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);
}
开发者ID:yzbx,项目名称:qt-bgslibrary,代码行数:10,代码来源:FrameDifferenceBGS.cpp


示例9: cvOpenFileStorage

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);
}
开发者ID:noobavss,项目名称:nooba-plugin-bgsubtractor,代码行数:10,代码来源:GMG.cpp


示例10: cvOpenFileStorage

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

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

  cvReleaseFileStorage(&fs);
}
开发者ID:tfygg,项目名称:Computer-Vision,代码行数:10,代码来源:StaticFrameDifferenceBGS.cpp


示例11: write_param

int CvArrTest::write_default_params( CvFileStorage* fs )
{
    int code = CvTest::write_default_params( fs );
    if( code < 0 )
        return code;

    if( ts->get_testing_mode() == CvTS::CORRECTNESS_CHECK_MODE )
    {
        write_param( fs, "test_case_count", test_case_count );
        write_param( fs, "min_log_array_size", min_log_array_size );
        write_param( fs, "max_log_array_size", max_log_array_size );
    }
    else if( ts->get_testing_mode() == CvTS::TIMING_MODE )
    {
        int i;

        start_write_param( fs ); // make sure we have written the entry header containing the test name
        if( size_list )
        {
            cvStartWriteStruct( fs, "size", CV_NODE_SEQ+CV_NODE_FLOW );
            for( i = 0; size_list[i].width >= 0; i++ )
            {
                cvStartWriteStruct( fs, 0, CV_NODE_SEQ+CV_NODE_FLOW );
                cvWriteInt( fs, 0, size_list[i].width );
                cvWriteInt( fs, 0, size_list[i].height );
                if( whole_size_list &&
                    (whole_size_list[i].width > size_list[i].width ||
                    whole_size_list[i].height > size_list[i].height) )
                {
                    cvWriteInt( fs, 0, whole_size_list[i].width );
                    cvWriteInt( fs, 0, whole_size_list[i].height );
                }
                cvEndWriteStruct( fs );
            }
            cvEndWriteStruct(fs);
        }

        if( depth_list )
        {
            cvStartWriteStruct( fs, "depth", CV_NODE_SEQ+CV_NODE_FLOW );
            for( i = 0; depth_list[i] >= 0; i++ )
                cvWriteString( fs, 0, cvTsGetTypeName(depth_list[i]) );
            cvEndWriteStruct(fs);
        }

        write_int_list( fs, "channels", cn_list, -1, -1 );

        if( optional_mask )
        {
            static const int use_mask[] = { 0, 1 };
            write_int_list( fs, "use_mask", use_mask, 2 );
        }
    }
    return 0;
}
开发者ID:Avatarchik,项目名称:EmguCV-Unity,代码行数:55,代码来源:cxts_arrtest.cpp


示例12: cvOpenFileStorage

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);
}
开发者ID:ajaxhe,项目名称:opencv-project,代码行数:11,代码来源:DPEigenbackgroundBGS.cpp


示例13: cvWriteString

void CvANN_MLP::write_params( CvFileStorage* fs )
{
    //CV_FUNCNAME( "CvANN_MLP::write_params" );

    __BEGIN__;

    const char* activ_func_name = activ_func == IDENTITY ? "IDENTITY" :
                            activ_func == SIGMOID_SYM ? "SIGMOID_SYM" :
                            activ_func == GAUSSIAN ? "GAUSSIAN" : 0;

    if( activ_func_name )
        cvWriteString( fs, "activation_function", activ_func_name );
    else
        cvWriteInt( fs, "activation_function", activ_func );

    if( activ_func != IDENTITY )
    {
        cvWriteReal( fs, "f_param1", f_param1 );
        cvWriteReal( fs, "f_param2", f_param2 );
    }

    cvWriteReal( fs, "min_val", min_val );
    cvWriteReal( fs, "max_val", max_val );
    cvWriteReal( fs, "min_val1", min_val1 );
    cvWriteReal( fs, "max_val1", max_val1 );

    cvStartWriteStruct( fs, "training_params", CV_NODE_MAP );
    if( params.train_method == CvANN_MLP_TrainParams::BACKPROP )
    {
        cvWriteString( fs, "train_method", "BACKPROP" );
        cvWriteReal( fs, "dw_scale", params.bp_dw_scale );
        cvWriteReal( fs, "moment_scale", params.bp_moment_scale );
    }
    else if( params.train_method == CvANN_MLP_TrainParams::RPROP )
    {
        cvWriteString( fs, "train_method", "RPROP" );
        cvWriteReal( fs, "dw0", params.rp_dw0 );
        cvWriteReal( fs, "dw_plus", params.rp_dw_plus );
        cvWriteReal( fs, "dw_minus", params.rp_dw_minus );
        cvWriteReal( fs, "dw_min", params.rp_dw_min );
        cvWriteReal( fs, "dw_max", params.rp_dw_max );
    }

    cvStartWriteStruct( fs, "term_criteria", CV_NODE_MAP + CV_NODE_FLOW );
    if( params.term_crit.type & CV_TERMCRIT_EPS )
        cvWriteReal( fs, "epsilon", params.term_crit.epsilon );
    if( params.term_crit.type & CV_TERMCRIT_ITER )
        cvWriteInt( fs, "iterations", params.term_crit.max_iter );
    cvEndWriteStruct( fs );

    cvEndWriteStruct( fs );

    __END__;
}
开发者ID:cybertk,项目名称:opencv,代码行数:54,代码来源:mlann_mlp.cpp


示例14: cvOpenFileStorage

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);
}
开发者ID:berlino,项目名称:traffic-counting,代码行数:11,代码来源:MixtureOfGaussianV2BGS.cpp


示例15: cvOpenFileStorage

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);
}
开发者ID:asus4,项目名称:ofxBGS,代码行数:11,代码来源:DPWrenGABGS.cpp


示例16: cvOpenFileStorage

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);
}
开发者ID:foss-transportationmodeling,项目名称:Vista-core-API,代码行数:11,代码来源:DPAdaptiveMedianBGS.cpp


示例17: cvOpenFileStorage

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);
}
开发者ID:charithwije,项目名称:nooba-plugin-face_detection,代码行数:11,代码来源:LBSimpleGaussian.cpp


示例18: cvOpenFileStorage

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);
}
开发者ID:2php,项目名称:ShadowDetection,代码行数:11,代码来源:DPGrimsonGMMBGS.cpp


示例19: cvOpenFileStorage

  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
  }
开发者ID:Nuzhny007,项目名称:bgslibrary,代码行数:12,代码来源:PreProcessor.cpp


示例20: cvOpenFileStorage

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);
}
开发者ID:arlesfarias,项目名称:Project_M,代码行数:12,代码来源:WeightedMovingMeanBGS.cpp



注:本文中的cvWriteInt函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ cv_broadcast函数代码示例发布时间:2022-05-30
下一篇:
C++ cvTermCriteria函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap