import cv2
import numpy as np
combined = np.load('puzzle_image.npy')
height = combined.shape[0]
width_each = combined.shape[1] // 3
b_shifted = combined[:, :width_each]
g_inv = combined[:, width_each:2*width_each]
r_rot = combined[:, 2*width_each:]
def unshift_rows(channel, shift_val):
unshifted = np.zeros_like(channel)
for i in range(channel.shape[0]):
unshifted[i] = np.roll(channel[i], -shift_val)
return unshifted
b = unshift_rows(b_shifted, 10)
g = 255 - g_inv
r = cv2.rotate(r_rot, cv2.ROTATE_90_COUNTERCLOCKWISE)
reconstructed = cv2.merge((b, g, r))
cv2.imwrite('reconstructed_image.png', reconstructed)
جواب نهایی و راهبرد رسیدن بهش، که با تعداد شرکت کننده ۰ نفر، چالش خوبی بود😂🤝
