I am currently working on a java project on face detection. I am using OpenCV API opencv_310 available at the official site and started writing the program following
this tutorial
But the main problem is that this tutorial was written more than five years ago. So the OpenCV APIs and working procedures have changed over the years. So I encountered a problem regarding the file haarcascade_frontalface_alt.xml.
new CvHaarClassifierCascade(cvLoad(FACE_CASCADE_PATH));
This line of code throws the following exception:
OpenCV Error: Unspecified error (The node does not represent a user object (unknown type?)) in cvRead, file ........\opencv\modules\core\src\persistence.cpp, line 4991
Exception in thread "main" java.lang.RuntimeException: ........\opencv\modules\core\src\persistence.cpp:4991: error: (-2) The node does not represent a user object (unknown type?) in function cvRead
So I browsed the Internet for a while and found this. It says the old C API does not support the newer haarcascade format. It also suggests to try with the C++ API.
What should I do now? I don't know how to try the C++ API. It will be highly appreciable if you can give some instructions on how to deal with the problem.
Thanks.
Try checking this tutorial which is from opencv site. This has a link to the source code. The xml file which you have trouble is the trained data.. if you would like to just download this file, you can find it here
regards
Related
Please excuse me if I ask the question in an incorrect format, it is my first time posting here:
I am trying to run a model build a model primarily using the bartMachine package on r.
I was able to run the script successfully when I had access to a server, so I know the script is fully functional. Unfortunately, I no longer have access to that server, and the script crashes my machine. I decided to try and run the script on google colab using the R runtime (as opposed to using the R magic cells option). When I run the model I get the following error:
"Error in validObject(.Object) :
"invalid class “jobjRef” object: invalid object for slot "jobj" in class
"jobjRef": got class "NULL", should be or extend class "externalptr"
I know that the problem is related to java and I have tried countless fixes, none of which were successful.
Any ideas?
Sean
Hi i would like to create a shapefile(.shp .shx .prj .dbf) based on a KML file on appengine. My project is on java.
I tried to use geotools, and was able to create .shp .shx .prj on Appengine (with some changes on geotools to save on Google Cloud) but was not able to create a .dbf with it. Geotools depends on AWT for creating the dbf, and Appengine restricts AWT.
Any sugestion on this? I´m starting even to consider calling a python module or something(never did anything like this). Or even creating just a dbf from a kml.
Thanks
Edit 1:
When i call ShapefileDatastore.createSchema() i have to pass a SimpleFeatureType as argument.
When i try to create a SimpleFeatureType or even use a BasicFeatureTypes.POLYGON it gave me error:
Caused by:
java.lang.NoClassDefFoundError: java.awt.RenderingHints is a restricted class.
Please see the Google App Engine developer's guide for more details.
at java.awt.RenderingHints.<clinit>(RenderingHints.java)
at org.geotools.factory.FactoryFinder.<clinit>(FactoryFinder.java:35)
at org.geotools.data.store.ContentDataStore.<init>(ContentDataStore.java:173)
at org.geotools.data.shapefile.ShapefileDataStore.<init>
(ShapefileDataStore.java:124)
at org.geotools.data.shapefile.ShapefileDataStoreAppengine.<init>
(ShapefileDataStoreAppengine.java:74)
at brandeira.morholt.web.shared.util.ShapefileHelper.createShapefile(ShapefileHelpe
r.java:121)
I twisted a bit replacing RenderingHints by a non awt RenderingHints and them got another error:
Caused by:
java.lang.NoClassDefFoundError: javax.imageio.spi.ServiceRegistry is a
restricted class. Please see the Google App Engine developer's guide for more details.
at javax.imageio.spi.ServiceRegistry.<clinit>(ServiceRegistry.java)
at
org.geotools.factory.CommonFactoryFinder.getServiceRegistry(CommonFactoryFinder.java:76)
at org.geotools.factory.CommonFactoryFinder.lookup(CommonFactoryFinder.java:346)
at org.geotools.factory.CommonFactoryFinder.getFilterFactory(CommonFactoryFinder.java:300)
at org.geotools.feature.AttributeTypeBuilder.<init>(AttributeTypeBuilder.java:192)
at org.geotools.feature.simple.SimpleFeatureTypeBuilder.<init>(SimpleFeatureTypeBuilder.java:196)
at org.geotools.feature.simple.SimpleFeatureTypeBuilder.<init>(SimpleFeatureTypeBuilder.java:186)
at org.geotools.feature.type.BasicFeatureTypes.<clinit>(BasicFeatureTypes.java:101)
at brandeira.morholt.web.shared.util.ShapefileHelper.createShapefile2(ShapefileHelper.java:290)
It seems to use a lot of this factory methods of AWT (graphics is not the problem here in this case, just the use of AWT things).
I replaced that also and got:
Caused by:
java.lang.NoSuchMethodError:
org.geotools.factory.FactoryRegistry.getServiceProvider(Ljava/lang/Class;Lcom/google/apphosting/runtime/security/shared/stub/javax/imageio/spi/ServiceRegistry$Filter;Lorg/geotools/factory/Hints;Lorg/geotools/factory/Hints$Key;)Ljava/lang/Object;
at org.geotools.factory.CommonFactoryFinder.lookup(CommonFactoryFinder.java:346)
at org.geotools.factory.CommonFactoryFinder.getFilterFactory(CommonFactoryFinder.java:300)
at org.geotools.feature.AttributeTypeBuilder.<init>(AttributeTypeBuilder.java:192)
at org.geotools.feature.simple.SimpleFeatureTypeBuilder.<init>(SimpleFeatureTypeBuilder.java:196)
at org.geotools.feature.simple.SimpleFeatureTypeBuilder.<init>(SimpleFeatureTypeBuilder.java:186)
at org.geotools.feature.type.BasicFeatureTypes.<clinit>(BasicFeatureTypes.java:101)
at brandeira.morholt.web.shared.util.ShapefileHelper.createShapefile2(ShapefileHelper.java:290)
I could not yet find where this javax.imageio.spi.ServiceRegistry (i have replaced all i found) is coming from and am thinking that i twisted this a lot and it doesn´t seem to be the way..
I'm trying to make a control flow graph with the soot API from an Android APK. I have read a lot but i feel a little bit helpless how to start from scratch. I'm using a nighty build of soot (downloaded here: https://ssebuild.cased.de/nightly/soot/lib/) because I read that version 2.5.0 is outdated. I found a lot with google, for example:
https://mailman.cs.mcgill.ca/pipermail/soot-list/2014-September/007303.html
First I need to load the Android APK file. On the link it's done with:
SetupApplication app = new SetupApplication(...)
But thats already the first problem, there is no SetupApplication in the nightly build soot.jar.
I did it with the command line, like here:
http://www.abartel.net/dexpler/
that worked almost, but building the control flow graph is only the first step. After that I have to manipulate the graphs and use it as an input for some other framework. So command line is no option for me. I would prefer to do it with Java!
Can someone help a soot newbie?
For getting call graph through Soot, try the Soot lib located at https://github.com/secure-software-engineering/soot-infoflow-android instead.
Then import soot.jimple.infoflow.android.SetupApplication in your Java source code.
Everything should be fine.
i am relatively new to java programming and programming for android and have been experimenting with android bluetooth comms using the Ketai library for the processing IDE specifically for use with android and tried to run the example program bluetoothcursors.pde that comes with the library but i keep getting the "application has stopped unexpectedly" error and the console indicates a null pointer exception error. The actual output is below:
FATAL EXCEPTION: Animation Thread
java.lang.NullPointerException
at ketai.net.bluetooth.KBluetoothListener.<init>(KBluetoothListener.java:56)
at ketai.net.bluetooth.KetaiBluetooth.start(KetaiBluetooth.java:207)
at processing.test.bluetoothcursors.BluetoothCursors.setup(BluetoothCursors.java:80)
at processing.core.PApplet.handleDraw(Unknown Source)
at processing.core.PGraphicsAndroid2D.requestDraw(Unknown Source)
at processing.core.PApplet.run(Unknown Source)
at java.lang.Thread.run(Thread.java:1019)
However i cant seem to see where the null pointer exception is coming from. I assume the null pointer exception relates to a variable that has not been instantiated properly. I have tried a process of elimination to try and isolate the cause but i get the same error but with slightly different source. I have also posted this question on the processing forum but have not received a reply. I just assumed that since it was part of the examples for the library it would work so maybe the error is being created somewhere else. I have tried other library examples and theses all work fine so i dont think its my setup. I also have other bluetooth programs working on android from processing but these use pure java code and are harder to follow.
I have had a look at some of the similar questions which have been sort-of helpful but i am still stuck.
I have set the correct bluetooth etc permissions and am using android version 2.3.3 and processing version 2.0.
Any help with this is much appreciated.
Cheers.
First of all, im a newbie in Java programming, since i'm actually a PHP Programmer not a Java Programmer. And my team want to build a system using PHP, and Coherence REST.
The first time, i tried to deploy it using using Glassfish, according the article from this url http://docs.oracle.com/cd/E24290_01/coh.371/e22839/rest_deploy.htm#BABBIIEE and i get this error "Trying to upload an illegal war archive. Make sure the archive file contains the descriptor file web.xml."
After that, i try to deploy manually according the article from this url http://docs.oracle.com/cd/E24290_01/coh.371/e22839/rest_example.htm#CHDBDGHG
And i got this error:
Exception in thread "main" java.lang.NoClassDefFoundError: com/tangosol/net/DefaultCacheServer. Could not find the main class: com.tangosol.net.DefaultCacheServer. Program will exit.
Is there anyone who can help me to solve my problem?
Any information will be appreciated. Thanks
My bad, i already found out the solution. I have the wrong environment variables. Newbie mistake. thanks guys