ShadowBack::ShadowBack(int iRows, int iCols){
	
	m_iHeight = iRows;
	m_iWidth = iCols;

	vvBackground.resize(m_iHeight);
	for (int i = 0; i < m_iHeight; i++){
		vvBackground[i].resize(m_iWidth);
		for (int j = 0; j < m_iWidth; j++){
			vvBackground[i][j].resize(0);
		}
	}//Initial the 3D vector to record the Background value 

	vvShadow.resize(m_iHeight);
	for (int i = 0; i < m_iHeight; i++){
		vvShadow[i].resize(m_iWidth);
		for (int j = 0; j < m_iWidth; j++){
			vvShadow[i][j].resize(0);
		}
	}//Initial the 3D vector to record the Shadow value 
	
}
ShadowBack::~ShadowBack(){
}

void ShadowBack::Compare(Mat& ori,Mat& com){
	m_Frame = ori;
	m_Comparing = com;
	for (int w = 0; w < m_Frame.cols; w++){
		for (int h = 0; h < m_Frame.rows; h++){
			if ( m_Comparing.at<Vec3b>(h, w)[0] == 255   &&
				 m_Comparing.at<Vec3b>(h, w)[1] == 255  &&
			     m_Comparing.at<Vec3b>(h, w)[2] == 255 
			){
					//foreground
					
			}
			else if (m_Comparing.at<Vec3b>(h, w)[0] == 128 &&
				m_Comparing.at<Vec3b>(h, w)[1] == 128 &&
				m_Comparing.at<Vec3b>(h, w)[2] == 128)
			{
				vvShadow[w][h].push_back(m_Frame.at<Vec3b>(h, w)); //record <Vec3b> to vvShadow[w][h]
				//Shadow 
			}
			else
			{
				vvBackground[w][h].push_back(m_Frame.at<Vec3b>(h, w)); //record <Vec3b> to vvBackground[w][h]
				//Background
			}

		}
	}
	
	
}