gtaylor / python-colormath

A python module that abstracts common color math operations. For example, converting from CIE L*a*b to XYZ, or from RGB to CMYK
python-colormath.readthedocs.org
BSD 3-Clause "New" or "Revised" License
456 stars 82 forks source link

de2000中有错误 #103

Open vip594nb opened 4 years ago

vip594nb commented 4 years ago

def delta_e_cie2000(lab_color_vector, lab_color_matrix, Kl=1, Kc=1, Kh=1): R_C = numpy.sqrt((numpy.power(avg_C1p_C2p, 7.0)) / (numpy.power(avg_C1p_C2p, 7.0) + numpy.power(25.0, 7.0))) 应该为 R_C = 2*(numpy.sqrt((numpy.power(avg_C1p_C2p, 7.0)) / (numpy.power(avg_C1p_C2p, 7.0) + numpy.power(25.0, 7.0)))) 少乘以2了

KelSolaar commented 4 years ago

Hi @vip594nb,

Would it be possible to update/re-post in english please?

Cheers,

Thomas

JensBloemer commented 4 years ago

It says

def delta_e_cie2000(lab_color_vector, lab_color_matrix, Kl=1, Kc=1, Kh=1): R_C = numpy.sqrt((numpy.power(avg_C1p_C2p, 7.0)) / (numpy.power(avg_C1p_C2p, 7.0) + numpy.power(25.0, 7.0))) should be R_C = 2*(numpy.sqrt((numpy.power(avg_C1p_C2p, 7.0)) / (numpy.power(avg_C1p_C2p, 7.0) + numpy.power(25.0, 7.0)))) (multiply by 2)

s51517765 commented 3 years ago

I don't think this is a mistake. The 2 in this case is contained in R_T. R_T = -2 R_C numpy.sin(2 * numpy.radians(delta_ro))

So, R_C = numpy.sqrt((numpy.power(avg_C1p_C2p, 7.0)) / (numpy.power(avg_C1p_C2p, 7.0) + numpy.power(25.0, 7.0))) is OK.

s51517765 commented 3 years ago

@vip594nb @KelSolaar I have checked. It all matches (4 decimal places) with TABLE 1. of the following paper, and I think it is correct. http://www2.ece.rochester.edu/~gsharma/ciede2000/ciede2000noteCRNA.pdf