Guest User

Untitled

a guest
Dec 17th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. __global__ void
  2. d_calculateShadowness(float * shadowness,
  3. bool * imMASK,
  4. float * imBLURRED,
  5. float * shadowM,
  6. float * shadowMsum,
  7. unsigned int imH,
  8. unsigned int imW
  9. ){
  10. //calculate shadowness, obviously
  11. unsigned int x = threadIdx.x; //0...imW
  12. float s = 0;
  13. unsigned int idx;
  14. for(unsigned int i=imH-1; i>0; i--){
  15. idx = i*imW+x;
  16. shadowness[idx] = imMASK[idx]?s/shadowMsum[i]:INVALID_VALUE;
  17. s += imBLURRED[idx]*shadowM[i];
  18. }
  19. }
Add Comment
Please, Sign In to add comment