| 85 | } |
| 86 | |
| 87 | void CVC::preprocess(const Mat& Img, Mat& GrdX) |
| 88 | { |
| 89 | Mat Gray; |
| 90 | cvtColor(Img, Gray, CV_RGB2GRAY ); |
| 91 | |
| 92 | //Sobel filter to compute X gradient |
| 93 | //32 bit float data |
| 94 | if(Img.type() == CV_32FC3) |
| 95 | { |
| 96 | Sobel(Gray, GrdX, CV_32F, 1, 0, 1 ); |
| 97 | GrdX += 0.5; |
| 98 | } |
| 99 | //8 bit unsigned char data |
| 100 | else if(Img.type() == CV_8UC3) |
| 101 | { |
| 102 | Sobel(Gray, GrdX, CV_8U, 1, 0, 1); |
| 103 | //GrdX += 128; |
| 104 | } |
| 105 | else{ |
| 106 | printf("CVC: Error - Unrecognised data type in processing! (preprocess)\n"); |
| 107 | exit(1); |
| 108 | } |
| 109 | return; |
| 110 | } |
| 111 | |
| 112 | void CVC::buildCV_left(const Mat& lImg, const Mat& rImg, const Mat& lGrdX, const Mat& rGrdX, const int d, Mat& costVol) |
| 113 | { |
no outgoing calls
no test coverage detected