├── Code ├── EAMRFm.p ├── Evaluation.p ├── GenerateD_F.p ├── README.txt └── Test.m ├── Datasets └── README.md /Code/EAMRFm.p: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AminMohsenifar/The-EAMRF-forest-change-detection-method/3641cf5bf363dd32751e7f095a31ee816f22f8aa/Code/EAMRFm.p -------------------------------------------------------------------------------- /Code/Evaluation.p: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AminMohsenifar/The-EAMRF-forest-change-detection-method/3641cf5bf363dd32751e7f095a31ee816f22f8aa/Code/Evaluation.p -------------------------------------------------------------------------------- /Code/GenerateD_F.p: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AminMohsenifar/The-EAMRF-forest-change-detection-method/3641cf5bf363dd32751e7f095a31ee816f22f8aa/Code/GenerateD_F.p -------------------------------------------------------------------------------- /Code/README.txt: -------------------------------------------------------------------------------- 1 | 1. Contact and Citation 2 | 3 | * If you utilize any part of the provided codes or datasets in scientific research or as part of a more extensive software system, please provide the following citation in related publications or technical documentation: 4 | 5 | Mohsenifar, A., Mohammadzadeh, A., Moghimi, A. and Salehi, B., 2021, A Novel Unsupervised Forest Change Detection Method Based on The Integration of a Multiresolution Singular Value Decomposition Fusion and an Edge-Aware Markov Random Field Algorithm. International Journal of Remote Sensing, doi:10.1080/01431161.2021.1995075. 6 | 7 | *** If you have any queries, don't hesitate and feel free to contact me at "a.mohsenifar97@gmail.com". 8 | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 9 | 10 | 2. Description 11 | 12 | 2.1. The present closed code contains two major steps. In the first step, an integrated difference image is formed by fusing two difference images computed based on the spectral (reflectance) data (Ds) and vegetation indices (Dv). In this regard, it's worth mentioning that any of the vegetation indices must be normalized between 0 and 1 before they are used to compute the vegetation indices-based difference image (Dv). In the second step, the EAMRF model is applied to the fused difference image in order to produce a binary change map. As a remark, the MATLAB code of the second step (i.e. EAMRF function) could also be evaluated in any unsupervised change detection research as a comparative decision-making algorithm. 13 | 14 | The inputs required to run the code involve the variables 'ImgName1', 'ImgName2', 'TestName', and 'Sensor', where the three formers characterize the names of the tiff-formatted pre-change, post-change, and ground truth images, respectively, and the latter also signifies the satellite sensor name. In detail, the ground truth data signifies the changed and unchanged pixels labeled as 1 and 2, respectively. Moreover, the sensors for which the present code is developed are Sentinel-2 (S2), Landsat-5 (L5), and Landsat-8 (L8), whose bands must be in the following order of priority: 15 | 16 | - Sentinel-2: 1. Coastal aerosol/2. Blue/3. Green/4. Red/5. Red edge/6. Red edge/7. Red edge/8. NIR/8A. Red edge/9. Water vapor/11. SWIR-1/ 12. SWIR-2. 17 | Indeed, the 10th band (i.e. Cirrius) has been removed. 18 | 19 | - Landsat-5: 1. Blue/2. Green/3. Red/4. NIR/5. SWIR-1/6. TIRS/7. SWIR-2. 20 | 21 | - Landsat-8: 1. Coastal aerosol/2. Blue/3. Green/4. Red/5. NIR/6. SWIR-1/7. SWIR-2. 22 | 23 | *** Note that if your sensor type is not of the three above-mentioned ones or its bands don't correspond to the above order of priority, you are kindly requested to contact me at the above email address. I assure you that I'm ready to reconcile my code with your datasets in a few hours. 24 | 25 | 26 | 2.2. The function 'GenerateD_F' takes the variables 'Image1', 'Image2', and 'Sensor' to compute the proposed difference image 'D_F'. 27 | 28 | 2.3. The function 'EAMRFm' returns the binary change map 'L_EAMRF' in which the labels 1 and 2 represent the changed and unchanged areas, respectively. 29 | 30 | 2.4. The function 'Evaluation' compares the produced change map with the ground truth data to provide a quantitative validation report. 31 | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 32 | 33 | Best. 34 | 35 | Amin Mohsenifar 36 | -------------------------------------------------------------------------------- /Code/Test.m: -------------------------------------------------------------------------------- 1 | clc 2 | clear 3 | close all 4 | % Amin Mohsenifar, a.mohsenifar97@gmail.com. 5 | % Please read the file "README" before running the present code. 6 | %% Select the tiff-formatted pre-change, post-change, and ground truth (test) images along with the sensor type 7 | ImgName1='D1_S2_20200625.tif'; 8 | ImgName2='D1_S2_20200630.tif'; 9 | TestName='D1_Test.tif'; 10 | Sensor='S2'; 11 | %-------------------------------------------- 12 | Image1=double(imread(ImgName1)); 13 | Image2=double(imread(ImgName2)); 14 | TestData=imread(TestName); 15 | %% Step 1 16 | tic 17 | [D_F]=GenerateD_F(Image1,Image2,Sensor); 18 | %% Step 2 19 | [L_EAMRF]=EAMRF(D_F); 20 | EAMRFtime=toc; 21 | %% Validation 22 | Evaluation(TestData,L_EAMRF); 23 | -------------------------------------------------------------------------------- /Datasets: -------------------------------------------------------------------------------- 1 | Please copy and paste the link below in your browser's address bar to download the datasets: 2 | https://drive.google.com/file/d/1o7Uz334cF9KDsQ0bj6Y6r4T0JM6DIdG2/view?usp=sharing 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # The edge-aware MRF (EAMRF) forest change detection method 2 | This repository contains the closed MATLAB code of the EAMRF forest change detection method along with some samples of datasets used in our paper (Mohsenifar, A., Mohammadzadeh, A., Moghimi, A. and Salehi, B., 2021, A Novel Unsupervised Forest Change Detection Method Based on The Integration of a Multiresolution Singular Value Decomposition Fusion and an Edge-Aware Markov Random Field Algorithm. International Journal of Remote Sensing, https://doi.org/10.1080/01431161.2021.1995075) to detect changes in forested areas. 3 | Further information about the code has also been elaborated in a notepad file named README.txt in a folder in which the code exists. It's worth noting that I'm working on developing the code of the second paper of my thesis, and after the publication of that, we will release the codes of both the improved MRFs. 4 | # Overview 5 | The closed code has two main steps. In the first step, an integrated difference image is achieved by fusing two difference images computed based on the spectral (reflectance) data (Ds) and vegetation indices (Dv). In this case, it's worth mentioning that any of the vegetation indices must be normalized between 0 and 1 before they are used to compute the vegetation indices-based difference image (Dv). In the second step, the EAMRF model is applied to the fused difference image in order to produce a binary forest change map. 6 | 7 | Being completed and updated ... 8 | --------------------------------------------------------------------------------