当前位置: 首页>>代码示例>>C++>>正文


C++ CImg::AttachFromFile方法代码示例

本文整理汇总了C++中CImg::AttachFromFile方法的典型用法代码示例。如果您正苦于以下问题:C++ CImg::AttachFromFile方法的具体用法?C++ CImg::AttachFromFile怎么用?C++ CImg::AttachFromFile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CImg的用法示例。


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

示例1: main

int main() {
	CImg* pImg = create_image();
	//BOOL rt = pImg->AttachFromFile("..//imgs//2-1-0.bmp");
	//BOOL rt = pImg->AttachFromFile("..//imgs//code-test-23.bmp");
	BOOL rt = pImg->AttachFromFile("..//imgs//TEST//origin.bmp");
	if (!rt)
		return -1;

	Func(pImg);

	getchar();
	return 0;
}
开发者ID:XDG-Personal,项目名称:GrayImageProcess,代码行数:13,代码来源:gray_image_simple_sharpen.cpp

示例2: main

int main() {
	//OneDBarcodeGrading OneDgrading;
	//CImg* pImg2 = create_image();
	//BOOL rt2 = pImg2->AttachFromFile("..//imgs//barcodes//TEST2//Minimal Edge Contrast_0__0_12_4.bmp");
	//if (!rt2)
	//	return -1;

	//OneDgrading.Grading(pImg2, OneDBarCodeType::EAN_128);
	//OneDgrading.SetDECODEGrade(4);


	//cout << "SC: " << OneDgrading.GetSCGrade() << endl;
	//cout << "MOD: " << OneDgrading.GetMODGrade() << endl;
	//cout << "Rmin: " << OneDgrading.GetRminGrade() << endl;
	//cout << "ECmin: " << OneDgrading.GetECminGrade() << endl;
	//cout << "Decfects: " << OneDgrading.GetDefectsGrade() << endl;
	//cout << "Decodability: " << OneDgrading.GetDecodabilityGrade() << endl;
	//cout << "DECODE: " << OneDgrading.GetDECODEGrade() << endl;

	TwoDBarcodeGrading TwoDgrading;
	CImg* pImg = create_image();
	BOOL rt = pImg->AttachFromFile("..//imgs//5.bmp");
	if (!rt)
		return -1;

	//CImg* rImg = NULL;
	//string code;

	//DecodeAndClipRegion(pImg, rImg, code);


	//TwoDgrading.Grading(rImg, 30, TwoDBarCodeType::DataMatrix);

	//CImg* img = NULL;//create_image();
	//unsigned char** InfoTable = NULL;
	//long Twidth = 0, Theight = 0;

	//TwoDgrading.SetContrastMValue(3.5);
	//TwoDgrading.GetInfoTable(pImg, img, InfoTable, Twidth, Theight);

	//for (unsigned long i = 0; i < Theight; ++i) {
	//	delete[] InfoTable[i];
	//}
	//delete[] InfoTable;
	//InfoTable = NULL;

	TwoDgrading.SetContrastMValue(3.5);
	TwoDgrading.SetDECODEGrade(4);
	TwoDgrading.SetUECScore(0, 30);

	TwoDgrading.Grading(pImg, 30, TwoDBarCodeType::DataMatrix);

	//rt = img->SaveToFile("..//results//dqt//Grid2.bmp");
	//if (rt == false)
	//	return false;

	cout << "SC: " << TwoDgrading.GetSCGrade() << endl;
	cout << "MOD: " << TwoDgrading.GetMODGrade() << endl;
	cout << "AN: " << TwoDgrading.GetANGrade() << endl;
	cout << "GN: " << TwoDgrading.GetGNGrade() << endl;
	cout << "FPD: " << TwoDgrading.GetFPDGrade() << endl;
	cout << "UEC: " << TwoDgrading.GetUECGrade() << endl;
	cout << "DECODE: " << TwoDgrading.GetDECODEGrade() << endl;

	getchar();
	return 0;
}
开发者ID:XDG-Personal,项目名称:GrayImageProcess,代码行数:67,代码来源:Source.cpp


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