Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for(int i = 0; i < depthmap->height; i=i+1){
- for(int j = 0; j < depthmap->width; j=j+1){
- //if(cvGet2D(depthmap, i, j).val[0] > 90 && cvGet2D(depthmap, i, j).val[0] < 160){
- if(cvGet2D(depthmap, i, j).val[0] > 25){
- float depth = 255.0*25.0/(cvGet2D(depthmap, i, j).val[0]+1);
- //if(depth > 3) depth = 3;
- cvSet2D(depthmap, i, j, cvScalarAll(depth));
- }
- else{
- cvSet2D(depthmap, i, j, cvScalarAll(255));
- }
- }
- }
- cvNormalize(depthmap,depthmap,0,255,CV_MINMAX);
- cvNot(depthmap, depthmap);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement