zhysora/PSGan-Family

Consulting for Q8 metric

Opened this issue · 0 comments

Dear!
Thank for your nice work.
I would like to use your metric.py module to assess Q2n index for WorldView3 imagery with 8 MS bands.
But I am not sure how to rewrite your Q4 function, specifically the following part:

def product(a, b):
    a = a.reshape(a.shape[0],1)
    b = b.reshape(b.shape[0],1)
    R = np.dot(a, b.transpose())
    r = np.zeros(4)
    r[0] = R[0, 0] - R[1, 1] - R[2, 2] - R[3, 3]
    r[1] = R[0, 1] + R[1, 0] + R[2, 3] - R[3, 2]
    r[2] = R[0, 2] - R[1, 3] + R[2, 0] + R[3, 1]
    r[3] = R[0, 3] + R[1, 2] - R[2, 1] + R[3, 0]
    return r

I apologize for taking your time and look forward to your reply.

Best regards,