Ich frage mich, ist es möglich, Bild in Blöcke zum Beispiel 8x8 Blöcke (64 pixels per block
) zu teilen und Histogramm-Funktion für jeden Block und speichern Ergebnisse in ein neues Bild nicht zu separaten Bildern?F: Teilen Sie Bild in Blöcke Python
def apply_histogram(block):
h, b = np.histogram(block.flatten(), 256, normed=True)
cdf = h.cumsum()
cdf = 255 * cdf/cdf[-1]
return np.interp(block.flatten(), b[:-1], cdf).reshape(block.shape)
Mögliche Duplikat von [Wie Bild in mehrere Teile in Python nach Split] (https://stackoverflow.com/questions/5953373/How-To-Split-Bild-in-mehrere-Stücke-in-Python) – moritzg
Ich nicht w Ameise, um das Bild zu teilen. Und ich möchte Funktion auf Bild nicht sofort anwenden, ich will Funktion in Bild auf jeden 8x8 Block anwenden. – Streem