Ask Your Question

Max3's profile - activity

2019-06-27 09:30:09 -0500 received badge  Notable Question (source)
2018-01-30 09:50:19 -0500 received badge  Popular Question (source)
2016-05-27 07:28:31 -0500 commented question Opencv java web service

Yes. Do you know any tutorial to process an OpenCV mat on server side? It would be useful.

2016-05-26 11:31:22 -0500 asked a question Opencv java web service

Hello, I need to process an image on server side using a restful web service. I'm trying to use Jersey framework but when I use some OpenCV operation i get an error. Something like this:

javax.servlet.ServletException: org.glassfish.jersey.server.ContainerException: java.lang.NoClassDefFoundError: org/opencv/core/Mat

So i believe that I'm not importing in the right way my OpenCV library. Is there a particular code to write in web.xml file?

Thanks in advance

2016-03-24 03:46:27 -0500 asked a question Saving knn training data in java

Hello, I have a KNearest object, i trained it and it works well but I should want to save the training data because I don't want to train my KNearest object everytime I run my app. I've tried to use function but i got this error:

Exception in thread "AWT-EventQueue-0" java.lang.Exception: unknown exception

I've also tried to save my training data Mat as image but when I loaded it and I tried to train I got this error:

OpenCV Error: Assertion failed (samples.type() == CV_32F || samples.type() == CV_32S) in cv::ml::TrainDataImpl::setData, file C:\builds\master_PackSlaveAddon-win64-vc12-static\opencv\modules\ml\src\data.cpp, line 251
Exception in thread "AWT-EventQueue-0" CvException [org.opencv.core.CvException: cv::Exception: C:\builds\master_PackSlaveAddon-win64-vc12-static\opencv\modules\ml\src\data.cpp:251: error: (-215) samples.type() == CV_32F || samples.type() == CV_32S in function cv::ml::TrainDataImpl::setData

But my image is CV_32F type. How can I solve this problem?

2016-03-16 03:55:59 -0500 received badge  Enthusiast
2016-03-15 12:28:40 -0500 received badge  Supporter (source)
2016-03-15 12:28:29 -0500 commented answer How to use KNearest in java?

Perfect explanation! I really thank you! That's what i was looking for!

2016-03-15 12:26:23 -0500 received badge  Scholar (source)
2016-03-12 08:02:55 -0500 commented question How to use KNearest in java?

As you can see java documentation doesn't say much. However I have to detect digits, I can't use third part libraries so I can't use OCR like tesseract or similar. I have 500 image samples for each digit (size 20x20) and I should want to use them to train my KNearest object. I have to use the method:

KNearest.train(Mat samples, int layout, Mat responses);

1) But in which format should I put my samples Mat? And what int layout stay for? Then if I understand I have to use the method:

KNearest.findNearest(Mat samples, int k, Mat results);

2) In this function my Mat samples is the Mat responses of train function, right? But in which format will be my Mat results? Thanks in advance for your answers and sorry for my English^^

2016-03-11 05:34:47 -0500 asked a question How to use KNearest in java?

Hi! I don't know how to use KNearest in OpenCV 3.0 in java. I really can't find any documentation in java. Can someone help me? Thanks in advance!

2016-03-03 08:08:03 -0500 commented answer Training knearest in Java

So feature1, feature2, etc. corresponds to my training images? And in responses.push_back(1); what argument 1 stay for? I know that push_back method accept only a Mat as argument.

2016-03-03 05:15:16 -0500 asked a question Training knearest in Java

Hi everyone, I'm using OpenCV 3.0 Java. I have:

KNearest knn = KNearest.create();

I should want to train knn using the method

knn.train(Mat samples, int layout, Mat responses);

but I can't find how samples and responses are structured. Could someone explain this to me? Thanks in advance