Use crop
for multipleColorsImage
to verify ORIGINAL_INTERESTING_POSITION
This commit is contained in:
parent
24b6971632
commit
95d4d841c4
@ -5,8 +5,8 @@ from utils import Color, getColorChannel
|
||||
IMAGE_FILE_PATH = '../rafael/240424/photos/DSC03294.ARW'
|
||||
Y_RANGE = 5
|
||||
X_RANGE = 25
|
||||
ORIGINAL_INTERESTING_POSITION = (5752, 1695)
|
||||
INTERESTING_POSITION = np.array(ORIGINAL_INTERESTING_POSITION)[::-1] // 2
|
||||
ORIGINAL_INTERESTING_POSITION = [5752, 1695][::-1]
|
||||
INTERESTING_POSITION = np.array(ORIGINAL_INTERESTING_POSITION) // 2
|
||||
|
||||
colorChannel = getColorChannel(IMAGE_FILE_PATH, Color.RED)
|
||||
print(colorChannel.shape)
|
||||
@ -14,8 +14,8 @@ print(colorChannel.shape)
|
||||
def crop(image, interestingPosition, yRange, xRange):
|
||||
return image[interestingPosition[0] - yRange: interestingPosition[0] + yRange, interestingPosition[1] - xRange: interestingPosition[1] + xRange]
|
||||
|
||||
#colorChannel = crop(multipleColorsImage, ORIGINAL_INTERESTING_POSITION, Y_RANGE, X_RANGE)
|
||||
colorChannel = crop(colorChannel, INTERESTING_POSITION, Y_RANGE, X_RANGE)
|
||||
colorChannel = colorChannel[INTERESTING_POSITION[0] - Y_RANGE: INTERESTING_POSITION[0] + Y_RANGE, INTERESTING_POSITION[1] - X_RANGE: INTERESTING_POSITION[1] + X_RANGE]
|
||||
print(colorChannel.shape)
|
||||
plt.imshow(colorChannel)
|
||||
plt.show()
|
Loading…
x
Reference in New Issue
Block a user