Subtract an image to the other
This commit is contained in:
		@@ -14,16 +14,19 @@ def getImageFilePath(imageIndex):
 | 
			
		||||
 | 
			
		||||
def getImageColorChannel(imageIndex, color):
 | 
			
		||||
    imageFilePath = getImageFilePath(imageIndex)
 | 
			
		||||
    return getColorChannel(imageFilePath, color)
 | 
			
		||||
    return getColorChannel(imageFilePath, color).astype(np.int32)
 | 
			
		||||
 | 
			
		||||
colorChannel = getImageColorChannel(IMAGE_INDEX, COLOR)
 | 
			
		||||
print(colorChannel.shape)
 | 
			
		||||
firstColorChannel = getImageColorChannel(IMAGE_INDEX, COLOR)
 | 
			
		||||
secondColorChannel = getImageColorChannel(IMAGE_INDEX + 1, COLOR)
 | 
			
		||||
differenceColorChannel = firstColorChannel - secondColorChannel
 | 
			
		||||
print(differenceColorChannel.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)
 | 
			
		||||
print(colorChannel.shape)
 | 
			
		||||
plt.imshow(colorChannel)
 | 
			
		||||
colorChannelToDisplay = differenceColorChannel
 | 
			
		||||
colorChannelToDisplay = crop(colorChannelToDisplay, INTERESTING_POSITION, Y_RANGE, X_RANGE)
 | 
			
		||||
print(colorChannelToDisplay.shape)
 | 
			
		||||
plt.imshow(colorChannelToDisplay)
 | 
			
		||||
plt.show()
 | 
			
		||||
		Reference in New Issue
	
	Block a user