Jeffries Matusita in HSI analysis #52559
Replies: 1 comment
-
🕒 Discussion Activity Reminder 🕒 This Discussion has been labeled as dormant by an automated system for having no activity in the last 60 days. Please consider one the following actions: 1️⃣ Close as Out of Date: If the topic is no longer relevant, close the Discussion as 2️⃣ Provide More Information: Share additional details or context — or let the community know if you've found a solution on your own. 3️⃣ Mark a Reply as Answer: If your question has been answered by a reply, mark the most helpful reply as the solution. Note: This dormant notification will only apply to Discussions with the Thank you for helping bring this Discussion to a resolution! 💬 |
Beta Was this translation helpful? Give feedback.
-
Select Topic Area
Question
Body
I'm trying to calculate JM distance with Python for bands in the Indian Pines data. Below is my code. Any comments? Results seem correct?
The code downloads Indian Pines and stores it in a numpy array. Calculates Bhattacharya and then uses that for Jeffries Matusita:
Import necessary and appropriate packages
import numpy as np
import os
import pandas as pd
import requests
from scipy.io import loadmat # MATlab data files
import matplotlib.pyplot as plt
from matplotlib import cm
from matplotlib.ticker import LinearLocator
from mpl_toolkits.mplot3d import Axes3D
from sklearn.metrics import normalized_mutual_info_score, mutual_info_score
from sklearn.feature_selection import mutual_info_regression
from IPython.core.display import json
def getIndianPinesData():
def computeBhattacharyya(bands):
numberOfBands = bands.shape[2]
BHdistances = np.zeros((numberOfBands, numberOfBands))
for i in range(numberOfBands):
for j in range(numberOfBands):
# Get the two bands
band1 = bands[:,:,i]
band2 = bands[:,:,j]
def computeJM(BH):
def main():
#loadHSIdatafile()
#checkFile()
A, b = getIndianPinesData()
BHdistances = computeBhattacharyya(A)
print(BHdistances.shape)
computeJM(BHdistances)
if name == 'main':
main()
%%%%%%%%%%%%%%%%%
%
Does this look correct?
Beta Was this translation helpful? Give feedback.
All reactions