Ease support for single or multiple colors
This commit is contained in:
@@ -10,11 +10,14 @@ import csv
|
|||||||
import rawpy
|
import rawpy
|
||||||
from utils import Color
|
from utils import Color
|
||||||
|
|
||||||
imagesFolderPath = '/mnt/HDD0/raise'
|
imagesFolderPath = 'rafael/arw'
|
||||||
imagesFolderPathFileName = imagesFolderPath.replace('/', '_')
|
imagesFolderPathFileName = imagesFolderPath.replace('/', '_')
|
||||||
denoiser = 'wavelet'
|
denoiser = 'bilateral'
|
||||||
|
|
||||||
raiseNotFlatFields = False
|
raiseNotFlatFields = False
|
||||||
|
singleColorChannel = Color.GREEN_RIGHT
|
||||||
|
|
||||||
|
colors = Color if singleColorChannel is None else [singleColorChannel]
|
||||||
|
|
||||||
denoise = getattr(skimage.restoration, f'denoise_{denoiser}')
|
denoise = getattr(skimage.restoration, f'denoise_{denoiser}')
|
||||||
|
|
||||||
@@ -33,7 +36,7 @@ if raiseNotFlatFields:
|
|||||||
|
|
||||||
SKY = range(2_699, 2_807)
|
SKY = range(2_699, 2_807)
|
||||||
WALL = range(2_807, 2_912)
|
WALL = range(2_807, 2_912)
|
||||||
#imagesFileNames = [f'DSC0{imageIndex}.ARW' for imageIndex in SKY]
|
imagesFileNames = [f'DSC0{imageIndex}.ARW' for imageIndex in SKY]
|
||||||
|
|
||||||
minColor = None
|
minColor = None
|
||||||
maxColor = None
|
maxColor = None
|
||||||
@@ -102,7 +105,7 @@ def treatImage(imageFileName, computeExtremes = False, color = None):
|
|||||||
|
|
||||||
# Assuming same intensity scale across color channels.
|
# Assuming same intensity scale across color channels.
|
||||||
for imageFileName in tqdm(imagesFileNames, 'Computing extremes of images'):
|
for imageFileName in tqdm(imagesFileNames, 'Computing extremes of images'):
|
||||||
for color in Color:
|
for color in colors:
|
||||||
treatImage(imageFileName, computeExtremes = True, color = color)
|
treatImage(imageFileName, computeExtremes = True, color = color)
|
||||||
|
|
||||||
# To skip this step next time.
|
# To skip this step next time.
|
||||||
@@ -110,7 +113,7 @@ for imageFileName in tqdm(imagesFileNames, 'Computing extremes of images'):
|
|||||||
print(f'{minColor=}')
|
print(f'{minColor=}')
|
||||||
print(f'{maxColor=}')
|
print(f'{maxColor=}')
|
||||||
|
|
||||||
for color in Color:
|
for color in colors:
|
||||||
mean = None
|
mean = None
|
||||||
numberOfImagesInMean = 0
|
numberOfImagesInMean = 0
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user