You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
you should fix the "create_laplacian_image_pyramid" in the pyramid.py .
it should be like this
def create_laplacian_image_pyramid(image, pyramid_levels):
gauss_pyramid = []
laplacian_pyramid = []
gauss_pyramid.append(image) # Start with the original image
for i in range(pyramid_levels):
down_image = cv2.pyrDown(gauss_pyramid[i])
gauss_pyramid.append(down_image)
for i in range(pyramid_levels):
# Convert to 3 channels before subtraction (KEY CHANGE)
current_level = gauss_pyramid[i]
if current_level.ndim == 3 and current_level.shape[2] == 4: #Check if it has 4 channels
current_level = current_level[:,:,:3] #Slice to 3 channels
if i < pyramid_levels - 1: #Only upsample if it's not the last level
higher_level_upsampled = cv2.pyrUp(gauss_pyramid[i + 1])
if higher_level_upsampled.ndim == 3 and higher_level_upsampled.shape[2] == 4: #Check if it has 4 channels
higher_level_upsampled = higher_level_upsampled[:,:,:3] #Slice to 3 channels
laplacian_pyramid.append((current_level - higher_level_upsampled) + 0) # Add 0 for type consistency.
else:
laplacian_pyramid.append(current_level) # The last level is just the last Gaussian level.
return laplacian_pyramid
The text was updated successfully, but these errors were encountered:
you should fix the "create_laplacian_image_pyramid" in the pyramid.py .
it should be like this
The text was updated successfully, but these errors were encountered: