junqiangchen / LiTS---Liver-Tumor-Segmentation-Challenge

LiTS - Liver Tumor Segmentation Challenge
MIT License
234 stars 73 forks source link

Lead over .mp4 creation from predicted results. #18

Closed sindhuchava closed 4 years ago

sindhuchava commented 4 years ago

Hi junqiangchen,

Can you provide a lead over the conversion of prediction results to .mp4 format?

junqiangchen commented 4 years ago

Hi junqiangchen, Can you provide a lead over the conversion of prediction results to .mp4 format?

you can save prediction results into png files,and using the follow code to convert files to video `import cv2

fourcc = cv2.VideoWriter_fourcc(*'XVID')

videoWriter = cv2.VideoWriter('aa.avi', fourcc, 10, (512,512)) for i in range(1, 200):
image_number = i img12 = cv2.imread(str(i)+ '.png')

cv2.imshow('img', img12)

#cv2.waitKey(1)
videoWriter.write(img12)

videoWriter.release()`