Update forensics/ela_hybrid.py
Browse files- forensics/ela_hybrid.py +7 -1
forensics/ela_hybrid.py
CHANGED
@@ -60,4 +60,10 @@ def visualize_hybrid(hybrid_array: np.ndarray):
|
|
60 |
# Extract ELA channels (last 3)
|
61 |
ela_image = Image.fromarray((hybrid_array[:, :, 3:] * 255).astype(np.uint8))
|
62 |
|
63 |
-
return [rgb_image, ela_image]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
# Extract ELA channels (last 3)
|
61 |
ela_image = Image.fromarray((hybrid_array[:, :, 3:] * 255).astype(np.uint8))
|
62 |
|
63 |
+
return [rgb_image, ela_image]
|
64 |
+
|
65 |
+
# Function to generate hybrid ELA as list of PIL Images for run_forensic_task
|
66 |
+
def generate_hybrid_ela_func(img):
|
67 |
+
# Convert to numpy array if needed (e.g., from OpenCV BGR to PIL RGB)
|
68 |
+
img_array = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
|
69 |
+
return visualize_hybrid(generate_ela_hybrid(img_array))
|