SHARE
TWEET

Untitled

a guest Jun 23rd, 2019 78 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. %function burningsDetection
  2. function bue
  3.  
  4. preband5 = imread("preB05.tiff"); %band5 (NIR)
  5. preband7 = imread("preB07.tiff"); %band7 (SWIR)
  6. postband5 = imread("postB05.tiff"); %band5
  7. postband7 = imread("postB07.tiff"); %band7
  8.  
  9. pNIR_pre = double(preband5);
  10. pSWIR_pre = double(preband7);
  11. SWVI_pre = (pNIR_pre - pSWIR_pre)./(pNIR_pre + pSWIR_pre);
  12.  
  13. pNIR_post = single(postband5);
  14. pSWIR_post = single(postband7);
  15. SWVI_post = (pNIR_post- pSWIR_post)./(pNIR_post + pSWIR_post);
  16.  
  17. %if ~isempty(find(size(a) > size(b) == 1)), flag = 0; endif
  18. %checkIfEqual(SWVI_pre, SWVI_post);
  19.  
  20. DSWVI = SWVI_pre - SWVI_post;
  21. %DSWVI = double(DSWVI);
  22.   figure,
  23.   imagesc(DSWVIC)
  24.   %colorbar
  25.   %colormap(jet)
  26. %size(DSWVI)
  27.  
  28.  
  29.    
  30.    
  31.    
  32.   [N, M] = size(DSWVI);
  33.   N*M
  34.  
  35.  
  36.  %print -dpng -r300 SWVI_pre_1346.png
  37.   %fire_calculate
  38. end
  39.  
  40.  
  41.  
  42. function AB = checkIfEqual(A, B)
  43.  
  44.   [n1, m1] = size(A); % n1 - stroki
  45.   [n2, m2] = size(B); % m1 - stolbcy
  46.  
  47.   h = abs(n1-n2)
  48.   w = abs(m1-m2)
  49.  
  50.   H = zeros(round(h/2), m1);
  51.   SWVI_post = [SWVI_post; H];
  52.   if n1 < n2
  53.     SWVI_post = SWVI_post(1:n2-h, :);
  54.     flag = 1
  55.   elseif n1 > n2
  56.     SWVI_pre = SWVI_pre(1:n1-h, :);
  57.     flag = 2
  58.   endif
  59.  
  60.   if m1 < m2
  61.     SWVI_post = SWVI_post(:, m2:m2+w-1);
  62.     flag = 3
  63.   elseif m1 > m2
  64.     SWVI_pre = SWVI_pre(:, m1:m1+w-1);
  65.     flag = 4
  66.   endif
  67.  
  68.   AB = [A; B];
  69.  
  70. endfunction
  71.  
  72.  
  73. function fire_calculate
  74.  
  75. Square = 76100;
  76. pict = imread("kalmykia_fire.png");
  77.  
  78. [n, m] = size(pict);
  79. all = n*m;
  80. white = length(find(pict==255));
  81. black = length(find(pict==0));
  82. no_white = all - black - white;
  83.  
  84. fract = no_white/white;
  85. Percent = fract*100;
  86. Territory = Square*fract;
  87. disp(Territory);
  88.  
  89. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top