diff options
Diffstat (limited to 'SD-VBS/benchmarks/disparity/src/c/getDisparity.c')
| -rw-r--r-- | SD-VBS/benchmarks/disparity/src/c/getDisparity.c | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/SD-VBS/benchmarks/disparity/src/c/getDisparity.c b/SD-VBS/benchmarks/disparity/src/c/getDisparity.c new file mode 100644 index 0000000..3246e97 --- /dev/null +++ b/SD-VBS/benchmarks/disparity/src/c/getDisparity.c | |||
| @@ -0,0 +1,43 @@ | |||
| 1 | /******************************** | ||
| 2 | Author: Sravanthi Kota Venkata | ||
| 3 | ********************************/ | ||
| 4 | |||
| 5 | #include <stdio.h> | ||
| 6 | #include <stdlib.h> | ||
| 7 | #include "disparity.h" | ||
| 8 | |||
| 9 | I2D* getDisparity(I2D* Ileft, I2D* Iright, int win_sz, int max_shift, | ||
| 10 | I2D* minSAD, I2D* retDisp, I2D* halfWin, | ||
| 11 | I2D* IrightPadded, I2D* IleftPadded, I2D* Iright_moved, | ||
| 12 | F2D* retSAD, F2D* SAD, F2D* integralImg, | ||
| 13 | I2D* range) | ||
| 14 | { | ||
| 15 | int nr, nc, k; | ||
| 16 | int half_win_sz, rows, cols; | ||
| 17 | |||
| 18 | nr = Ileft->height; | ||
| 19 | nc = Ileft->width; | ||
| 20 | half_win_sz=win_sz/2; | ||
| 21 | |||
| 22 | |||
| 23 | fResetArray(minSAD, nr, nc, 255.0*255.0); | ||
| 24 | iResetArray(retDisp, nr, nc,max_shift); | ||
| 25 | iResetArray(halfWin, 1,2,half_win_sz); | ||
| 26 | |||
| 27 | rows = IleftPadded->height; | ||
| 28 | cols = IleftPadded->width; | ||
| 29 | fResetArray(SAD, rows, cols,255); | ||
| 30 | fResetArray(integralImg, rows, cols,0); | ||
| 31 | //fResetArray(retSAD,rows-win_sz, cols-win_sz, 0); | ||
| 32 | iResetArray(Iright_moved, rows, cols, 0); | ||
| 33 | |||
| 34 | for( k=0; k<max_shift; k++) | ||
| 35 | { | ||
| 36 | correlateSAD_2D(IleftPadded, IrightPadded, Iright_moved, win_sz, k, SAD, integralImg, retSAD, range); | ||
| 37 | findDisparity(retSAD, minSAD, retDisp, k, nr, nc); | ||
| 38 | } | ||
| 39 | |||
| 40 | |||
| 41 | return retDisp; | ||
| 42 | } | ||
| 43 | |||
