Advertisement
lamiastella

computeSAD

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