Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cv2 error, fly_seg #10

Open
DrinkAstragalus opened this issue Nov 16, 2023 · 2 comments
Open

cv2 error, fly_seg #10

DrinkAstragalus opened this issue Nov 16, 2023 · 2 comments

Comments

@DrinkAstragalus
Copy link

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.

@DrinkAstragalus
Copy link
Author

It should be
bg = sx[0]
in line 278 in fly_seg.py,
as 'keepdims' is set to false by default in stats.mode in SciPy v1.11.3.

@azzhu
Copy link
Owner

azzhu commented Nov 20, 2023

Thank you for your feedback! This issue has been fixed, you can update easyFlyTracker and use it:
pip install --upgrade easyFlyTrakcer
Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants