Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -: 0:Source:computeSAD.c
- -: 0:Graph:computeSAD.gcno
- -: 0:Data:computeSAD.gcda
- -: 0:Runs:1
- -: 0:Programs:1
- -: 1:/********************************
- -: 2:Author: Sravanthi Kota Venkata
- -: 3:********************************/
- -: 4:
- -: 5:#include <stdio.h>
- -: 6:#include <stdlib.h>
- -: 7:#include "disparity.h"
- -: 8:
- 64: 9:void computeSAD(I2D *Ileft, I2D* Iright_moved, F2D* SAD)
- -: 10:{
- -: 11: int rows, cols, i, j, diff;
- -: 12:
- 64: 13: rows = Ileft->height;
- 64: 14: cols = Ileft->width;
- -: 15:
- 123456: 16: for(i=0; i<rows; i++)
- -: 17: {
- 134250496: 18: for(j=0; j<cols; j++)
- -: 19: {
- 134250496: 20: diff = subsref(Ileft,i,j) - subsref(Iright_moved,i,j);
- 134250496: 21: subsref(SAD,i,j) = diff * diff;
- -: 22: }
- -: 23: }
- -: 24:
- 64: 25: return;
- -: 26:}
- -: 27:
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement