Open marcoramosw opened 3 years ago
Hey @marcoramosw You're passing the size variable as a double...
List<double> size = [100.0, 200.0];
You'll have to pass an integer instead.
List<int> size = [100, 200];
Hey, @AdityaMulgundkar , thank you for the reply but that would be a simple fix that I indeed tried already,
If I pass as integer:
the Function's Parameter outputSize is a double and you can't pass an int:
The argument type 'List<int>' can't be assigned to the parameter type 'List<double>'.
but if you try to use double you get the already mentioned error:
OpenCV Error: java.lang.ClassCastException: java.lang.Double cannot be cast to java.lang.Integer"
Hey @marcoramosw Sorry for making that assumption... Many people miss out on such stuff and create issues, hence the quick response from my end.
I just tried to replicate the error, but couldn't on my end. I think it might be because of casting and autoboxing in java at the same time (at the platform channel level), so I have changed the cast for this one function (warpPerspectiveTransform) and pushed this new version to another branch at https://github.com/AdityaMulgundkar/flutter_opencv/tree/java-cast-test
Could you please help me out by testing this? In case it works out, I can replace all such casts.
You can simply change the version of opencv you're using in your pubspec.yaml as such:
opencv:
git:
url: git://github.com/AdityaMulgundkar/flutter_opencv.git
ref: java-cast-test
Awaiting your response.
Thank you for answering, I will test it as soon as possible!
Aditya Mulgundkar notifications@github.com escreveu no dia segunda, 14/12/2020 à(s) 18:16:
Reopened #18 https://github.com/AdityaMulgundkar/flutter_opencv/issues/18.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/AdityaMulgundkar/flutter_opencv/issues/18#event-4110678620, or unsubscribe https://github.com/notifications/unsubscribe-auth/APILA5HZ5MP77SCZRRD5X6DSUZI6RANCNFSM4UW3U6KA .
still unable to get it to work :( unfortunetly I am a beginner in dart and flutter and can't help you resolve it, here is the error message:
C:\Users\mramos\AppData\Local\flutter\.pub-cache\git\flutter_opencv-046ca6ee193e13ace10d11885638a3d75645687b\android\src\main\java\com\mulgundkar\opencv\core\CVCore.java:748: error: cannot find symbol
Imgproc.warpPerspective(input, destImage, warpMat, new Size(outputSize.get(0).doubleValue(), outputSize.get(1).doubleValue()));
^
symbol: method doubleValue()
location: class Object
C:\Users\mramos\AppData\Local\flutter\.pub-cache\git\flutter_opencv-046ca6ee193e13ace10d11885638a3d75645687b\android\src\main\java\com\mulgundkar\opencv\core\CVCore.java:748: error: cannot find symbol
Imgproc.warpPerspective(input, destImage, warpMat, new Size(outputSize.get(0).doubleValue(), outputSize.get(1).doubleValue()));
^
symbol: method doubleValue()
location: class Object
Note: C:\Users\mramos\AppData\Local\flutter\.pub-cache\git\flutter_opencv-046ca6ee193e13ace10d11885638a3d75645687b\android\src\main\java\com\mulgundkar\opencv\OpenCV4Plugin.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
2 errors
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':opencv:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
hey, any new ideas regarding this issue?
Did it get solved
Describe the bug the following error occurs when using the warpPerspectiveTransform function I/System.out(11892): OpenCV Error: java.lang.ClassCastException: java.lang.Double cannot be cast to java.lang.Integer
To Reproduce