2017-09-11 04:27:19 -0600 | commented answer | svm.save() is not working opencv4android According to the discussion above, saved model using 2.4 is not compatible with 3.2. My solution was to do everything in |
2017-09-08 06:31:36 -0600 | commented question | image quality test @Ziri No, I did not solve this. Do you have any idea? |
2017-08-22 09:58:39 -0600 | commented question | image quality test I think I can use Hough Circle Transform to detect the circles inside the plate. Shall I count the number of circles afterward? |
2017-08-22 07:11:39 -0600 | asked a question | image quality test I would like to do an image quality test before process the image with my app. I would like first to identify if the image of specific type for example my app reads Elisa plates with 96 wells. If the user take image of another thing, the app will not allow this. Is this possible using opencv. Any hints or links is appreciated. |
2017-07-26 11:11:09 -0600 | commented question | Strange XML file behaviour Thank you so much @berak for the support. I knew the problem now: it is because I put the constructor after defining the SVM parameters. It seems I have now good accuracy and I changed the c variables and it makes difference. |
2017-07-25 08:17:19 -0600 | commented question | Strange XML file behaviour Thanks. I did not know that even the constructor will train the model with out calling the method .train(). The problem why the number of support vector in the first case is 1 while in the second case is 78 which exactly equal to my training data. the other problem in the first case all the predictions will be -1 while on the second case the predictions will be 1. |
2017-07-25 07:10:33 -0600 | commented question | Strange XML file behaviour Thanks for your comment. I passed them in the constructor but it doesn't work. I explained this in the question. classifier = new CvSVM(trainingData, classes, new Mat(), new Mat(), params); classifier.save(XML1.toString()); classifier.train(trainingData, classes); classifier.save(XML.toString()); |
2017-07-25 06:50:55 -0600 | asked a question | Strange XML file behaviour I trained the svm classifier using the following code and it gave me wrong classification and when i looked at the saved xml file, i found strange contents. Only one vector is in the xml file and the classification is -1 for all the test data. I found that the classifier will be the same before and after classifier.train(...). Here is the code: Here the xml file: (more) |
2017-07-24 08:20:29 -0600 | commented question | SVM cross validation parameters optimisation and accuracy Sorry for any inconvenience I caused. I will delete my comment as it seems inappropriate. |
2017-07-20 07:15:35 -0600 | commented question | SVM cross validation parameters optimisation and accuracy Thanks, we will try this. |
2017-07-20 04:43:03 -0600 | commented question | SVM cross validation parameters optimisation and accuracy The problem is that my colleague who work on matlab get nearly 97% accuracy with this data. Is the problem with the opencv and android as they are open source or other criteria. however, my app is a diagnosis app which give result of a disease based on analyzing colors in image. |
2017-07-20 03:12:42 -0600 | commented question | SVM cross validation parameters optimisation and accuracy Thanks @StevenPuttemans, I will try to increase my data but my question is can I get at 90% accuracy with this data as we need it for real testing or it will be difficult?. |
2017-07-18 09:23:03 -0600 | commented question | SVM cross validation parameters optimisation and accuracy Thanks @StevenPuttemans for your comment. I have 88 record with 40 negative images and 48 positive images. I suppose this due to the parameters as I have all the predictions of the test dataset 1. |
2017-07-18 08:31:05 -0600 | marked best answer | find contours miss some objects I use the following code to read through all objects that I segmented from my image which should be ordered in row and columns as semi-circle (because of segmentation and morphological processing for reducing noise): however, the loop can not read important objects in my image even canny image is correct and can identify all the objects. My questions are: in which order find contours read objects? and also is there another way in Opencv to read through all objects in the image other than find contours? last question i used the size of contours to differentiate between the objects and the noise, so is this Ok or you can suggest other methods. Attached is the result image and the one with red circles correctly identified while the others which I need not being identified. Any help is appreciated |
2017-07-18 08:30:59 -0600 | received badge | ● Self-Learner (source) |
2017-07-17 06:52:28 -0600 | asked a question | SVM cross validation parameters optimisation and accuracy I use the following code to train the svm using k-fold cross-validation but the prediction accuracy is low. What I am doing wrong and how to programmatically calculate the accuracy of the classifier using cross-validation. Log.i(TAG,"Training..."); params.set_svm_type(CvSVM.C_SVC); params.set_kernel_type(CvSVM.RBF); params.set_C(1.0); params.set_degree(0.0); params.set_coef0(0.0); params.set_gamma(1.0); params.set_term_crit(new TermCriteria(TermCriteria.EPS, 10000, 1e-12)); |
2017-07-13 09:04:50 -0600 | answered a question | find contours miss some objects I threshold the image for other processing before finding contours then I applied Canny and this causes my problem and after removing canny and use RETR_CCOMP mode which gives 2 level of hierarchy, I can now get the correct result. |
2017-07-12 10:05:51 -0600 | commented question | find contours miss some objects If I change the retrieval mode to RETR_LIST or RETR_CCOMP, I can get all the objects but with redundancy then how to get rid of redundant objects is my question. |
2017-07-12 08:54:54 -0600 | commented question | find contours miss some objects @berak, do you know how I can find the objects myself by using the findnonezero() or countnonezero() functions to read all the objects and how to calculate the black distance between white objects. Please help. |
2017-07-07 09:57:09 -0600 | commented question | svm.save() is not working opencv4android I used this function but no luck. Thanks for your care. I really appreciate it. |
2017-07-07 09:24:07 -0600 | commented question | svm.save() is not working opencv4android Here is the result of debugging provided by a user countering the same problem: cause= Exception, detailMessage= "Unknown Exception" , stackTrace=> StackTraceElement[0] , suppressedExeptions= Collections$UnmodifiableRandomAccessList, Details are in here |
2017-07-07 08:01:18 -0600 | commented question | svm.save() is not working opencv4android Thanks @berak to save my time. Sadly, I will degrade to version 2.4 as it seems there is no straightforward solutions to save and load svm in opencv 3.x. |
2017-07-07 07:01:26 -0600 | commented question | svm.save() is not working opencv4android @berak One of the solutions I tried is to use opencv 2.4 to train the model because it allow me to save the model to Android sd without any problems and then load the saved model in my previous app which uses opencv3.2 to load the model and do the predictions but i countered this error: OpenCV Error: Assertion failed (samples.cols == var_count && samples.type() == CV_32F) in virtual float cv::ml::SVMImpl::predict(cv::InputArray, cv::OutputArray, int) const, file /build/master_pack-android/opencv/modules/ml/src/svm.cpp, line 1930 ml::predict_10() caught cv::Exception: /build/master_pack-android/opencv/modules/ml/src/svm.cpp:1930: error: (-215) samp Does the saved model using opencv 2.4 differes from opencv 3.2. Any hints regarding this. |
2017-07-05 07:39:50 -0600 | commented answer | cannot save SVM in OpenCV4Android 3.2 after upgrade: Fatal signal 11 @wes.y.w. Have you found a solution for this. I am suffering from the same error. |
2017-07-05 07:37:06 -0600 | commented question | svm.save() is not working opencv4android here is some additional information about the crash: 07-05 13:30:07.298 9699-9699/? A/DEBUG: * * 07-05 13:30:07.299 9699-9699/? A/DEBUG: Build fingerprint: 'samsung/hero2ltexx/hero2lte:7.0/NRD90M/G935FXXU1DQD7:user/release-keys' 07-05 13:30:07.299 9699-9699/? A/DEBUG: Revision: '9' 07-05 13:30:07.299 9699-9699/? A/DEBUG: ABI: 'arm64' 07-05 13:30:07.299 9699-9699/? A/DEBUG: pid: 8798, tid: 8798, name: esar.opencvtest >>> com.example.antesar.opencvtest <<< 07-05 13:30:07.299 9699-9699/? A/DEBUG: signal 7 (SIGBUS), code 1 (BUS_ADRALN), fault addr 0x7b00000001 07-05 13:30:07.300 9699-9699/? A/DEBUG: x0 0000007b326cc340 x1 0000007fd02c4580 x2 0000007b00000001 x3 0000007b4114e1b2 07-05 13:30:07.300 9699-9699/? A/DEBUG: |
2017-07-05 06:03:10 -0600 | commented question | svm.save() is not working opencv4android I knew that, I just added the function save( ) again in the SVM class which already exist in org.opencv.core.algorithm but no change. I thought if I add it to the SVM class, it can work as the load function. |
2017-07-05 05:42:08 -0600 | commented question | svm.save() is not working opencv4android In the SVM class I also added to add the function save() as in load() but nothing changed. |
2017-07-05 05:40:30 -0600 | commented question | svm.save() is not working opencv4android I tried to call all the functions in public class Algorithm but all of them gives me SIGSEGV error not only the save() when using SVM: |
2017-07-05 05:30:19 -0600 | asked a question | Train, save, and load svm classifier out of Android Is there any way to train a dataset outside of Android and then save it and uploaded to Android as I counter a problem in using the save() function to save to serialize and store SVM to disk. Any suggestions or solution to my problem. |
2017-07-05 05:25:09 -0600 | commented question | svm.save() is not working opencv4android @berak please can you suggest any thing based on the last findings, I tried to access all the functions in Algorithm (getDefaultName(), Clear(), save(), and finalize()) and all of them gave me the same segmentation fault and this can be due to calling functions from wrong places or if there is no constructor. Is there any idea solving this as this is the fourth day of the problem and i can not resolve it? |
2017-07-05 05:20:12 -0600 | commented question | svm.save() is not working opencv4android For svm.load(), I upgraded to opencv version 3.2 and I found the required function and it is working fine. |
2017-07-03 10:07:05 -0600 | commented answer | Color based classification using SVM which website? |
2017-07-03 08:06:42 -0600 | asked a question | svm.save() is not working opencv4android I trained the SVM classifier which is working perfectly fine but when I tried to save the classifier, it gave me this error: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x0 in tid 17404. After exploration i thing it seems to be a bug in Opencv 3.10 for Android but I can not find a proper solution. Unanswered question is in here. I use opencv 3.10 for Android, one proposed solution is to downgrade to 2.4 and I do not want to degrade as I have done lots of things using this version. I would like to update the information here: save() in opencv is inherited from org.opencv.core.algorithms and there is no implementation of the function in the svm html description. svm.load() also does not work as there is no implementation in Opencv 3.10, so please suggest me to downgrade to 2.4 or not? Any help is more than appreciated. |
2017-07-03 06:35:50 -0600 | commented answer | Color based classification using SVM I think the bug is still exist and is not solved and there is a solution in here but I can not apply this as I only see svm.java and i cannot see the svm.cpp in my Android studio app. |
2017-07-03 06:11:27 -0600 | commented question | [android] Save and load model in opencv 3.0.0 android I have exactly the same problem like you @Minerva, have you found any solution to your problem? |
2017-07-03 05:44:32 -0600 | marked best answer | Color based classification using SVM I would like to ask a question about how to use SVM to classify images based on colors: I have a dataset which contains 15 features extracted using simple image histogram includes mean, stddev, mode, and other statistics accompanied with a label in the same dataset. How I can proceed from this dataset and how to change it to xml file store and load it in my Android app. Do I need to separate the dataset into training and label data, etcl. I know there is lots of material in the website but a kind help from you will save my time. Here the code I developed and I have this error: E/cv::error(): OpenCV Error: Assertion failed (samples.cols == var_count && samples.type() == CV_32F) in virtual float cv::ml::SVMImpl::predict(cv::InputArray, cv::OutputArray, int) const, file /Volumes/Linux/builds/master_pack-android/opencv/modules/ml/src/svm.cpp, line 1930 |
2017-07-03 05:44:29 -0600 | commented answer | Color based classification using SVM Many thanks, I will try to solve this. |