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

报错信息

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

--Status: StsError
--FuncName: __cdecl cv::impl::`anonymous-namespace'::CvtHelper<struct cv::impl::`anonymous namespace'::Set<3,4,-1>,struct cv::impl::A0xdf37c1af::Set<1,-1,-1>,struct cv::impl::A0xdf37c1af::Set<0,2,5>,2>::CvtHelper(const class cv::_InputArray &,const class cv::_OutputArray &,int)
--ErrMsg: > Invalid number of channels in input image:
>     'VScn::contains(scn)'
> where
>     'scn' is 1

--FileName: C:\projects\opencv-files\opencv\modules\imgproc\src\color.simd_helpers.hpp
--Line: 92
StackTrace:
   在 OpenCvSharp.NativeMethods.<>c.<.cctor>b__1600_0(ErrorCode status, String funcName, String errMsg, String fileName, Int32 line, IntPtr userData)
   在 OpenCvSharp.NativeMethods.imgproc_cvtColor(IntPtr src, IntPtr dst, Int32 code, Int32 dstCn)
   在 OpenCvSharp.Cv2.CvtColor(InputArray src, OutputArray dst, ColorConversionCodes code, Int32 dstCn)
   在 DynamicClass.MainWindow.BtnSetAsOriginal_Click(Object sender, RoutedEventArgs e)
   在 System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   在 System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   在 System.Windows.Controls.Primitives.ButtonBase.OnClick()
   在 System.Windows.Controls.Button.OnClick()
   在 System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
   在 System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   在 System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   在 System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   在 System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
   在 System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e)
   在 System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   在 System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   在 System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   在 System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   在 System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
   在 System.Windows.Input.InputManager.ProcessStagingArea()
   在 System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
   在 System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
   在 System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
   在 System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   在 System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   在 MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   在 MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   在 System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   在 System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

 

解决方法

暂无解决方案。

相关信息
1 查看
15天17小时前
Quicker版本
版本 反馈次数
1.45.5 1