Xilinx / xfopencv

Other
321 stars 144 forks source link

How to do pixel-wise computation? #58

Closed 3togo closed 5 years ago

3togo commented 5 years ago

In previous version, the following will work but the newest version won't.

for (int i = 0; i < HEIGHT; i++){
 for (int j = 0; j < WIDTH; j++){
      c.data[i*WIDTH+j] = a.data[i*WIDTH+j] / b.data[i*WIDTH+j];

}

bgouthamb commented 5 years ago

@3togo This has been mentioned in the ChangeLog in points 10 and 11. The new way is as follows:

float val= a.read(i*WIDTH+j) / b.read(i*WIDTH+j); c.write(i*WIDTH+j, val);

3togo commented 5 years ago

@bgouthamb ,

Many thanks