Spaces:
Sleeping
Sleeping
Upload Colony_Analyzer_AI_zstack2_HF.py
Browse files
Colony_Analyzer_AI_zstack2_HF.py
CHANGED
|
@@ -284,7 +284,12 @@ def main(args):
|
|
| 284 |
src_image = np.array(files[x])
|
| 285 |
roi = cv2.bitwise_and(src_image, src_image, mask=mask)
|
| 286 |
# Paste the extracted regions onto the destination image
|
| 287 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 288 |
try:
|
| 289 |
del x, mask, src_image, roi, best, contours
|
| 290 |
except:
|
|
|
|
| 284 |
src_image = np.array(files[x])
|
| 285 |
roi = cv2.bitwise_and(src_image, src_image, mask=mask)
|
| 286 |
# Paste the extracted regions onto the destination image
|
| 287 |
+
print("ROI Shape:", roi.shape)
|
| 288 |
+
print("img Shape:", img.shape)
|
| 289 |
+
print("mask Shape:", mask.shape)
|
| 290 |
+
mask = np.repeat(mask[..., None], 3, axis=2)
|
| 291 |
+
print("mask Shape fixed:", mask.shape)
|
| 292 |
+
np.copyto(img, roi, where=(mask== 255))
|
| 293 |
try:
|
| 294 |
del x, mask, src_image, roi, best, contours
|
| 295 |
except:
|