Spaces:
Sleeping
Sleeping
Update Organoid_Analyzer_AI_zstack2_HF.py
Browse files
Organoid_Analyzer_AI_zstack2_HF.py
CHANGED
|
@@ -354,13 +354,13 @@ def main(args):
|
|
| 354 |
contours = list(contours["contour"])
|
| 355 |
cv2.drawContours(mask, contours, -1, 255, thickness=cv2.FILLED)
|
| 356 |
# Extract all ROIs from the source image at once
|
| 357 |
-
src_image = np.array(files[x])
|
| 358 |
roi = cv2.bitwise_and(src_image, src_image, mask=mask)
|
| 359 |
# Paste the extracted regions onto the destination image
|
| 360 |
-
print("ROI Shape:", roi.shape)
|
| 361 |
-
print("img Shape:", img.shape)
|
| 362 |
-
print("mask Shape:", mask.shape)
|
| 363 |
-
print("mask Shape fixed:", mask.shape)
|
| 364 |
np.copyto(img, roi, where=(mask== 255))
|
| 365 |
try:
|
| 366 |
del x, mask, src_image, roi, best, contours
|
|
|
|
| 354 |
contours = list(contours["contour"])
|
| 355 |
cv2.drawContours(mask, contours, -1, 255, thickness=cv2.FILLED)
|
| 356 |
# Extract all ROIs from the source image at once
|
| 357 |
+
src_image = pad(np.array(files[x]))
|
| 358 |
roi = cv2.bitwise_and(src_image, src_image, mask=mask)
|
| 359 |
# Paste the extracted regions onto the destination image
|
| 360 |
+
#print("ROI Shape:", roi.shape)
|
| 361 |
+
#print("img Shape:", img.shape)
|
| 362 |
+
#print("mask Shape:", mask.shape)
|
| 363 |
+
#print("mask Shape fixed:", mask.shape)
|
| 364 |
np.copyto(img, roi, where=(mask== 255))
|
| 365 |
try:
|
| 366 |
del x, mask, src_image, roi, best, contours
|