Advertisement
onilink_

Untitled

Jun 28th, 2022
892
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.47 KB | None
  1. for(unsigned j=0; j<_size.hei; ++j)
  2. {
  3.     for(unsigned i=ks_2; i+ks_2<_size.wid; ++i)
  4.     {
  5.         float v = 0;
  6.         for(unsigned x=0; x<kernel_size; ++x)
  7.         {
  8.             int px = x + i - kernel_size/2;
  9.             const unsigned index = px + j*_size.wid;
  10.             assert(index < s);
  11.             v += in[index] * kernel_x[x];
  12.         }
  13.        
  14.         const unsigned index = i + j*_size.wid;
  15.         assert(index < s);
  16.         t[index] = v;
  17.     }
  18. }
Advertisement
RAW Paste Data Copied
Advertisement