コード例 #1
0
ファイル: GLCM.cpp プロジェクト: thacdtd/PGLCM
ItemSet GLCM::calF(BinaryMatrix * BM, vector< vector< pair<int,int> > > G1Item, const vector<BinaryMatrix *> & vBM, string freType, int & resFre)
{

	ItemSet is = ItemSet();
	is.clear();
	int BMSize = BM->getSize();
	BinaryMatrix * calFBM = new BinaryMatrix(BMSize);
	calFBM->setContrastTo0(BM);
	if (freType == "gra")
		resFre = calFBM->getActive();
	else {
		vector<int> freMap;
		freMap.clear();
		for (int i = 0; i < BMSize; i++)
		{
			freMap.push_back(-1);
		}
		loop_Chk_Freq(calFBM,freMap);
		resFre = frequentCount(freMap);
	}
	delete calFBM;
	if (resFre < _threshold) return is;

	int G1ItemSize = G1Item.size();
	for (int i = 0; i < G1ItemSize; i++)
	{
		BinaryMatrix tBM = (*vBM[i]);
		tBM &= (*BM);
		if (tBM == (*BM)) is.addItem(i);
	}
	return is;
}