Ok this is the part that I load the image:
frame = cv2.imread(path, cv2.IMREAD_UNCHANGED)
self.img = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
I changed to this:
frame = tiff.imread(path)
self.img = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
And I get this error (either I use .tiff or .jpg file):
self.img = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
cv2.error: OpenCV(3.4.14) /tmp/pip-req-build-m7h7rfem/opencv/modules/imgproc/src/color.simd_helpers.hpp:88: error: (-2:Unspecified error) in function 'cv::impl::{anonymous}::CvtHelper<VScn, VDcn, VDepth, sizePolicy>::CvtHelper(cv::InputArray, cv::OutputArray, int) [with VScn = cv::impl::{anonymous}::Set<3, 4>; VDcn = cv::impl::{anonymous}::Set<3, 4>; VDepth = cv::impl::{anonymous}::Set<0, 2, 5>; cv::impl::{anonymous}::SizePolicy sizePolicy = cv::impl::<unnamed>::NONE; cv::InputArray = const cv::_InputArray&; cv::OutputArray = const cv::_OutputArray&]'
> Invalid number of channels in input image:
> 'VScn::contains(scn)'
> where
> 'scn' is 1
What should I do??
@berak: Yes I think they are double64.
As I said before the .tiff image that I use, is the output of calculations of another 2 or 3 .tiff files…
Also I did this change:
This:
self.img = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
to this:
self.img = cv2.cvtColor(frame, cv2.IMREAD_UNCHANGED)
And I get this
File "code.py", line 412, in getFrame
self.img = cv2.cvtColor(frame, cv2.IMREAD_UNCHANGED)
cv2.error: OpenCV(3.4.14) /tmp/pip-req-build-m7h7rfem/opencv/modules/imgproc/src/color.cpp:352: error: (-206:Bad flag (parameter or structure field)) Unknown/unsupported color conversion code in function 'cvtColor'