Advertisement
Guest User

Untitled

a guest
Jul 20th, 2018
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. [img_rows,img_cols,img_bands] = size(fr_in);
  2.  
  3. idx = find(fr_in==0);
  4. [r,c] = ind2sub(size(fr_in),idx);
  5. temp = cat(2,r,c);
  6. blocks = zeros(int8(img_rows/sub_blk_size),int8(img_cols/sub_blk_size),img_bands);
  7.  
  8. for b=1:img_bands
  9. for i=1:size(r)
  10. x = temp(i,1);
  11. y = temp(i,2);
  12. blocks(int8(x/5)+1, int8(y/5) + 1, b) = 1;
  13. end
  14. end
  15.  
  16. miss_subblks = [];
  17.  
  18. for r = 1:(img_rows/sub_blk_size)-1
  19. for c = 1:(img_cols/sub_blk_size)-1
  20. for b = 1:img_bands
  21. if blocks(r,c,b) == 1
  22. miss_subblks = [miss_subblks; [(r-1)*sub_blk_size, (c-1)*sub_blk_size]];
  23. end
  24. end
  25. end
  26. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement