I've been trying to use FCN to segment medical images. In the Evaluation part, I need to transfer the output of the network into a binary matrix with a threshold.
I tried to use cv2.threshold
pred_bin = cv2.threshold(pred,0.95,255,cv2.THRESH_BINARY)
pred is the Output of the FCN(probability), with the size [batch_size,240,240,1] However, I got the error
pred_bin = cv2.threshold(pred,0.95,255,cv2.THRESH_BINARY)
TypeError: src is not a numpy array, neither a scalar
So what should I do?