Skip to content

Commit e4d42a0

Browse files
authored
Fix OpenCV contiguous array error in _save_blended_frames (#512) (#513)
Apply the same np.ascontiguousarray fix from #510 to _save_blended_frames, which was also affected by OpenCV 4.12+ requiring C-contiguous arrays for in-place drawing operations like cv2.putText.
1 parent 7eae64e commit e4d42a0

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

samgeo/samgeo3.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5030,6 +5030,7 @@ def _save_blended_frames(
50305030
mask_3d = mask_combined[:, :, np.newaxis]
50315031
blended = frame_np * (1 - mask_3d * alpha) + overlay * (mask_3d * alpha)
50325032
blended = np.clip(blended, 0, 255).astype(np.uint8)
5033+
blended = np.ascontiguousarray(blended)
50335034

50345035
# Draw labels using OpenCV
50355036
for cx, cy, label, color in labels_to_draw:

0 commit comments

Comments
 (0)