Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- __global__ void
- d_calculateShadowness(float * shadowness,
- bool * imMASK,
- float * imBLURRED,
- float * shadowM,
- float * shadowMsum,
- unsigned int imH,
- unsigned int imW
- ){
- //calculate shadowness, obviously
- unsigned int x = threadIdx.x; //0...imW
- float s = 0;
- unsigned int idx;
- for(unsigned int i=imH-1; i>0; i--){
- idx = i*imW+x;
- shadowness[idx] = imMASK[idx]?s/shadowMsum[i]:INVALID_VALUE;
- s += imBLURRED[idx]*shadowM[i];
- }
- }
Add Comment
Please, Sign In to add comment