fork download
  1. ShadowBack::ShadowBack(int iRows, int iCols){
  2.  
  3. m_iHeight = iRows;
  4. m_iWidth = iCols;
  5.  
  6. vvBackground.resize(m_iHeight);
  7. for (int i = 0; i < m_iHeight; i++){
  8. vvBackground[i].resize(m_iWidth);
  9. for (int j = 0; j < m_iWidth; j++){
  10. vvBackground[i][j].resize(0);
  11. }
  12. }//Initial the 3D vector to record the Background value
  13.  
  14. vvShadow.resize(m_iHeight);
  15. for (int i = 0; i < m_iHeight; i++){
  16. vvShadow[i].resize(m_iWidth);
  17. for (int j = 0; j < m_iWidth; j++){
  18. vvShadow[i][j].resize(0);
  19. }
  20. }//Initial the 3D vector to record the Shadow value
  21.  
  22. }
  23. ShadowBack::~ShadowBack(){
  24. }
  25.  
  26. void ShadowBack::Compare(Mat& ori,Mat& com){
  27. m_Frame = ori;
  28. m_Comparing = com;
  29. for (int w = 0; w < m_Frame.cols; w++){
  30. for (int h = 0; h < m_Frame.rows; h++){
  31. if ( m_Comparing.at<Vec3b>(h, w)[0] == 255 &&
  32. m_Comparing.at<Vec3b>(h, w)[1] == 255 &&
  33. m_Comparing.at<Vec3b>(h, w)[2] == 255
  34. ){
  35. //foreground
  36.  
  37. }
  38. else if (m_Comparing.at<Vec3b>(h, w)[0] == 128 &&
  39. m_Comparing.at<Vec3b>(h, w)[1] == 128 &&
  40. m_Comparing.at<Vec3b>(h, w)[2] == 128)
  41. {
  42. vvShadow[w][h].push_back(m_Frame.at<Vec3b>(h, w)); //record <Vec3b> to vvShadow[w][h]
  43. //Shadow
  44. }
  45. else
  46. {
  47. vvBackground[w][h].push_back(m_Frame.at<Vec3b>(h, w)); //record <Vec3b> to vvBackground[w][h]
  48. //Background
  49. }
  50.  
  51. }
  52. }
  53.  
  54.  
  55. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:1:1: error: 'ShadowBack' does not name a type
 ShadowBack::ShadowBack(int iRows, int iCols){
 ^
prog.cpp:23:1: error: 'ShadowBack' does not name a type
 ShadowBack::~ShadowBack(){
 ^
prog.cpp:26:6: error: 'ShadowBack' has not been declared
 void ShadowBack::Compare(Mat& ori,Mat& com){
      ^
prog.cpp:26:26: error: variable or field 'Compare' declared void
 void ShadowBack::Compare(Mat& ori,Mat& com){
                          ^
prog.cpp:26:26: error: 'Mat' was not declared in this scope
prog.cpp:26:31: error: 'ori' was not declared in this scope
 void ShadowBack::Compare(Mat& ori,Mat& com){
                               ^
prog.cpp:26:35: error: 'Mat' was not declared in this scope
 void ShadowBack::Compare(Mat& ori,Mat& com){
                                   ^
prog.cpp:26:40: error: 'com' was not declared in this scope
 void ShadowBack::Compare(Mat& ori,Mat& com){
                                        ^
stdout
Standard output is empty