I've been toying around with a gamma correction curve for the AG6200 using Kuro Houous measurements (thnx)
...hoping I could get better results than by setting the ini hdmi_limited=2 (16..255) for the cheap dongles..
However.. I can't really say if initial value when correcting should start from 16 or 0 ?
That is, if we had more measuring points in the original mV between 0 and 24, (0 24 98 170 248 344 414 486 562 632 700)
Would it be closer to a very steep 0 [20,24,24] 24 or a more interpolated 0 [6,12,18,24] 24 ?
Code: Select all
corrected_std_dev_8bit = np.array([ 16, 38, 64, 88, 111, 127, 153, 176, 202, 227, 252])
corrected_std_dev_8bit = np.array([ 0, 38, 64, 88, 111, 127, 153, 176, 202, 227, 252])
Code: Select all
import numpy as np
from scipy.interpolate import interp1d
import matplotlib.pyplot as plt
# Corrected values
corrected_std_dev_8bit = np.array([ 16, 38, 64, 88, 111, 127, 153, 176, 202, 227, 252])
corrected_median_8bit = np.array([ 16, 39, 63, 88, 113, 129, 155, 181, 206, 231, 255])
# Reference points (IRE levels) corresponding to the 8-bit values
ire_levels = np.linspace(0, 255, len(corrected_std_dev_8bit))
# Cubic interpolation function
f_std_dev = interp1d(ire_levels, corrected_std_dev_8bit, kind='cubic')
f_median = interp1d(ire_levels, corrected_median_8bit, kind='cubic')
# Generate new points for interpolation (0 to 255)
new_ire_levels = np.arange(0, 256)
# Interpolated values
std_dev_interpolated = f_std_dev(new_ire_levels)
median_interpolated = f_median(new_ire_levels)
# Printing the interpolated values
print("Interpolated Corrected Standard Deviation Values (0 to 255):")
print(std_dev_interpolated.astype(int))
print("\nInterpolated Corrected Median Values (0 to 255):")
print(median_interpolated.astype(int))
# Plotting the interpolated values
plt.figure(figsize=(12, 8))
plt.plot(new_ire_levels, std_dev_interpolated, label='Interpolated Corrected Standard Deviation Curve', color='red')
plt.plot(new_ire_levels, median_interpolated, label='Interpolated Corrected Median Curve', color='green')
plt.xlabel('IRE Level')
plt.ylabel('8-bit Value')
plt.title('Cubic Interpolation of Corrected Values')
plt.legend(loc='upper left')
plt.grid(True)
plt.show()