Add and use isARawImage
This commit is contained in:
@@ -38,7 +38,12 @@ class iterativeMean:
|
||||
self.mean = ((self.mean * self.numberOfElementsInMean) + element) / (self.numberOfElementsInMean + 1)
|
||||
self.numberOfElementsInMean += 1
|
||||
|
||||
def getRawColorChannel(raw):
|
||||
RAW_IMAGE_FILE_EXTENSIONS = [
|
||||
'arw',
|
||||
'nef',
|
||||
]
|
||||
|
||||
def getRawColorChannel(raw, color):
|
||||
colorDesc = raw.color_desc.decode('ascii')
|
||||
assert colorDesc == 'RGBG'
|
||||
assert np.array_equal(raw.raw_pattern, np.array([[0, 1], [3, 2]], dtype = np.uint8))
|
||||
@@ -61,4 +66,7 @@ def getRawColorChannel(raw):
|
||||
imageNpArray = greenBottomRawImageVisible
|
||||
case Color.BLUE:
|
||||
imageNpArray = blueRawImageVisible
|
||||
return imageNpArray
|
||||
return imageNpArray
|
||||
|
||||
def isARawImage(imageFilePath):
|
||||
return any([imageFileName.lower().endswith(f'.{rawImageFileExtension}') for rawImageFileExtension in RAW_IMAGE_FILE_EXTENSIONS])
|
||||
Reference in New Issue
Block a user