Closed upuil closed 5 years ago
If the input image is gray scale, you should convert gray scale image to RGB image before cvtColor.
You can change cv2.COLOR_BGR2RGB to cv2.COLOR_GRAY2RGB in cv2.cvtColor in line 45
I change it like you said that, but
Traceback (most recent call last):
File "train.py", line 175, in <module> input_image = utils.load_image(train_input_names[id]) File "/home/pu/Tensorflow/Semantic_Segmentation/utils/utils.py", line 45, in load_image image = cv2.cvtColor(cv2.imread(path,-1), cv2.COLOR_GRAY2RGB) cv2.error: OpenCV(3.4.2) /tmp/build/80754af9/opencv-suite_1535558553474/work/modules/imgproc/src/color.hpp:253: error: (-215:Assertion failed) VScn::contains(scn) && VDcn::contains(dcn) && VDepth::contains(depth) in function 'CvtHelper'
change line like this works image = cv2.cvtColor(cv2.imread(path, 0), cv2.COLOR_GRAY2RGB)
The problem is like. #107. How to prevent this problem and The data must be a color image?
File "/home/_/Tensorflow/Semantic_Segmentation/utils/utils.py", line 45, in load_image image = cv2.cvtColor(cv2.imread(path,-1), cv2.COLOR_BGR2RGB) cv2.error: OpenCV(3.4.2) /tmp/build/80754af9/opencv-suite_1535558553474/work/modules/imgproc/src/color.hpp:253: error: (-215:Assertion failed) VScn::contains(scn) && VDcn::contains(dcn) && VDepth::contains(depth) in function 'CvtHelper