Last active
March 22, 2021 03:47
-
-
Save trongan93/a35019fb65b1615e3c9067e077915b27 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hueradians = np.deg2rad(hue_16bit) | |
cos_hueradians = np.cos(hueradians) | |
sin_hueradians = np.sin(hueradians) | |
# BEMD in sin value of hue channel | |
bemd2 = BEMD() | |
imfs_sin_hue = bemd2.bemd(sin_hueradians, max_imf=2) | |
# BEMD in cos value of hue channel | |
bemd = BEMD() | |
imfs_cos_hue = bemd.bemd(cos_hueradians, max_imf=2) | |
landslide_feature_img = np.empty_like(hue_16bit) | |
imfs_no = min(imfs_sin_hue.shape[0], imfs_cos_hue.shape[0]) | |
for i in range(0,imfs_no): | |
imf_cos_hue = imfs_cos_hue[i] | |
imf_sin_hue = imfs_sin_hue[i] | |
imf_arctan_hue = np.arctan2(imf_sin_hue,imf_cos_hue) | |
imf_hue_degree = np.rad2deg(imf_arctan_hue) | |
imf_hue_degree_old = np.copy(imf_hue_degree) | |
imf_hue_degree = changeNegativeHueToPositive(imf_hue_degree_old) | |
landslide_feature_img = imf_hue_degree | |
# show final BEMD | |
plt.title("Landslide feature") | |
plt.imshow(landslide_feature_img, cmap='hsv', origin='lower') | |
plt.colorbar() | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment