Skip to content

cv2 error, fly_seg #10

@DrinkAstragalus

Description

@DrinkAstragalus

Hi, I met an error recently when the program calculated background image:
Traceback (most recent call last):
File "", line 198, in run_module_as_main
File "", line 88, in run_code
File "C:\Users\huang\micromamba\envs\mpy\Scripts\easyFlyTracker.exe_main
.py", line 7, in
File "C:\Users\huang\micromamba\envs\mpy\Lib\site-packages\easyFlyTracker\cli.py", line 50, in easyFlyTracker

f = FlySeg(**params_filter)
^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\huang\micromamba\envs\mpy\Lib\site-packages\easyFlyTracker\src_code\fly_seg.py", line 123, in init
self.comp_bg()
File "C:\Users\huang\micromamba\envs\mpy\Lib\site-packages\easyFlyTracker\src_code\fly_seg.py", line 286, in comp_bg
self.gray_bg_int16 = cv2.cvtColor(bg, cv2.COLOR_BGR2GRAY).astype(np.int16)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
cv2.error: OpenCV(4.8.1) d:\a\opencv-python\opencv-python\opencv\modules\imgproc\src\color.simd_helpers.hpp:92: error: (-2:Unspecified error) in function '__cdecl cv::impl::anonymous-namespace'::CvtHelper<struct cv::impl::anonymous namespace'::Set<3,4,-1>,struct cv::impl::A0xd8611878::Set<1,-1,-1>,struct cv::impl::A0xd8611878::Set<0,2,5>,3>::CvtHelper(const class cv::_InputArray &,const class cv::_OutputArray &,int)'

Invalid number of channels in input image:
'VScn::contains(scn)'
where
'scn' is 1

It seems there is an error of color channels.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions