Question: Now let's try colorizing the high-resolution image 01047u.tif. This image is of size 9656 x 3741. Therefore, exhaustive search over all possible displacements will become
Now let's try colorizing the high-resolution image 01047u.tif. This image is of size 9656 x 3741. Therefore, exhaustive search over all possible displacements will become prohibitively expensive. To deal with this case, we can implement a faster search procedure using an image pyramid. An image pyramid represents the image at multiple scales (usually scaled by a factor of 2) and the processing is done sequentially starting from the coarsest scale (smallest image) and going down the pyramid, updating your estimate as you go. It is very easy to implement by adding recursive calls to your original single-scale implementation. The running time of your implementation should be less than 1 minute.
Update the below code without any additional libraries and functions:
def colorize_image_recursively(b:np.array,g:np.array,r:np.array)->(np.array,list):
"""
Align the high-resolution three color channel images. Return the colored image
and a list of the displacement vector for each channel.
:param b: the high-resolution blue channel image, which is a 3218x3741 numpy array.
:param g: the high-resolution greeb channel image, which is a 3218x3741 numpy array.
:param r: the high-resolution red channel image, which is a 3218x3741 numpy array.
:return: a tuple of (colored_image, displacements). ''colored_image'' is a 3218x3741x3 numpy array.
''displacements'' is a list of the displacement vector for each channel.
"""
colored_img=None
displacements=[]
# ADD YOUR CODE HERE (15 pts)
return colored_img,displacements
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
