Problem with CreateCLAHE in Unity
Hi
I am trying to use CLAHE in Unity (OpenCvSharp 3.0.0 in Unity 5.2.3 x86)
And I am getting the same error as in issue https://github.com/shimat/opencvsharp/issues/153
Hope there are some way to get around this, in advance Thanks
--- Error: ------
ArrayTypeMismatchException: Source array type cannot be assigned to destination array type.
(wrapper stelemref) object:stelemref (object,intptr,object)
System.Collections.Generic.Dictionary2[System.Type,OpenCvSharp.Ptr1+ReleaseFunc[OpenCvSharp.CLAHE]].Add (System.Type key, OpenCvSharp.ReleaseFunc value) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Collections.Generic/Dictionary.cs:429)
OpenCvSharp.Ptr1[OpenCvSharp.CLAHE]..cctor () Rethrow as TypeInitializationException: An exception was thrown by the type initializer for OpenCvSharp.Ptr1
OpenCvSharp.CLAHE..ctor (IntPtr p)
OpenCvSharp.CLAHE.Create (Double clipLimit, Nullable1 tileGridSize) OpenCvSharp.Cv2.CreateCLAHE (Double clipLimit, Nullable1 tileGridSize)
BoxDetection.Start () (at Assets/BoxDetection.cs:18)
I have tracked down the problem. You can see some of the details here. https://github.com/shimat/opencvsharp/issues/159#event-477078645
Unfortunately, anything that return this error in Unity will need a Unity specific method added to the NativeMethods to work around the problem.
If your comfortable with the process of method wrapping and would like to add it yourself let me know and I can provide some example code.
Hi Tharyn.
Thanks for tracking down the problem. I am interested in trying your method, so some examples would be great. I am new to C#, but comfortable to method wrapping in other languages so I am ready to try.
I'm making a basic implementation tutorial, NativeFunctions + Unity Workaround, over the next several days. When I have it done and posted I will reply to this thread :)
HI DrDecipher, I'll make my final project at graduation with this, so this tutorial will be great =]
@DrDecipher @shimat Im getting this error for MSER, OpenCvSharp.XFeatures2D.
Can You please provide this example ?