Ask Your Question

mack_emb's profile - activity

2020-04-02 06:14:54 -0600 received badge  Enthusiast
2017-09-28 13:20:23 -0600 received badge  Famous Question (source)
2017-03-04 06:36:05 -0600 received badge  Notable Question (source)
2016-11-27 04:38:55 -0600 received badge  Popular Question (source)
2016-05-20 04:27:25 -0600 received badge  Critic (source)
2016-05-18 07:52:48 -0600 asked a question Basic operations on mat variable in android

Initially i used MATLAB for testing my logic and it works smoothly in matlab.

But now i want to implement the same in android with help of OpenCV.

I am looking for a way to simply access the individual pixel values and do simple mathematical operations on the same (addition and multiplication). I found many answers online, but most of them have their specific set of probelm which they simply solved by using some method already available in openCV.

Any help would be very helpful.

2016-04-09 06:39:52 -0600 received badge  Supporter (source)
2016-04-09 06:37:24 -0600 answered a question Can someone help me and give an android example that use opencv machine learning with java code

Well for starters you can start from here. I hope that helps. Even i am trying to do something similar so keep posting the update/progress.

2016-03-30 08:37:28 -0600 received badge  Student (source)
2015-07-19 06:29:35 -0600 commented question Unable to compile program due to dependencies

@berak can i have your email id. we tried to fresh install openCV and try to compile again but no luck. We came to conclusion of comparing our flags after installation. We compared our CMakeCache.txt files and we find there are huge amount of differences. But i am not sure what that means. So i you can provide me your emailID, i can share the txt files.

2015-07-09 22:02:29 -0600 commented question Unable to compile program due to dependencies

Yes these are just bits of code so it wont compile.

Another thing is i believe there is no problem with the code itself, because the same code without any face:: namespace declaration compiles smoothly on my friends laptop (the system on which we were originally working). I took the codes to test on my end and wasn't even able to compile it. Then i also gave a try of compiling it on different system, but no luck.

2015-07-09 10:58:05 -0600 commented question Unable to compile program due to dependencies

I added the namespace declaration but i keep getting the same error as before.

error: ‘face’ cannot appear in a constant-expression cv::Ptr<face::facerecognizer> model, mouthModel;

and yes i have also added face:: to all the places where its model = createEigenFaceRecognizer(); or

mouthModel = createEigenFaceRecognizer();

2015-07-09 08:35:01 -0600 received badge  Editor (source)
2015-07-09 05:35:27 -0600 asked a question Unable to compile program due to dependencies

Command used to compile the code:-

g++ `fltk-config --cxxflags` disguise_gui_1306.cpp `fltk-config --ldflags --use-images` `pkg-config opencv --cflags --libs` -o disgui

disguise_gui_1306.cpp:102:9: error: ‘FaceRecognizer’ was not declared in this scope cv::Ptr<facerecognizer> model, mouthModel; ^

disguise_gui_1306.cpp:102:23: error: template argument 1 is invalid cv::Ptr<facerecognizer> model, mouthModel; ^

disguise_gui_1306.cpp:102:30: error: invalid type in declaration before ‘,’ token cv::Ptr<facerecognizer> model, mouthModel; ^

disguise_gui_1306.cpp: In function ‘void snapshotCB(Fl_Widget, void)’:

disguise_gui_1306.cpp:233:40: error: base operand of ‘->’ is not a pointer int predictedMouthLabel = mouthModel->predict(testSample); ^

disguise_gui_1306.cpp:243:31: error: base operand of ‘->’ is not a pointer int predictedLabel = model->predict(testSample); ^

disguise_gui_1306.cpp:261:29: error: base operand of ‘->’ is not a pointer int predictedLabel = model->predict(testSample); ^

disguise_gui_1306.cpp: In function ‘void trainFaceRecogniserModel(std::vector<cv::mat>, std::vector<int>)’: disguise_gui_1306.cpp:395:39: error: ‘createEigenFaceRecognizer’ was not declared in this scope model = createEigenFaceRecognizer();
^

disguise_gui_1306.cpp:396:10: error: base operand of ‘->’ is not a pointer model->train(img, lab); ^

disguise_gui_1306.cpp: In function ‘int main(int, char**)’:

disguise_gui_1306.cpp:417:39: error: ‘createEigenFaceRecognizer’ was not declared in this scope model = createEigenFaceRecognizer();
^

disguise_gui_1306.cpp:418:10: error: base operand of ‘->’ is not a pointer model->train(images, labels); ^

disguise_gui_1306.cpp:433:15: error: base operand of ‘->’ is not a pointer mouthModel->train(mouthimages, mouthlabels);

I have tried using:-

cv::Ptr<face::facerecognizer> model, mouthModel;

error: ‘face’ cannot appear in a constant-expression cv::Ptr<face::facerecognizer> model, mouthModel;

The same code compiles perfectly on my friends laptop,and the only difference i am able to understand is he have installed opencv in usr/local while i have the same in downloads folder.

Kindly help,because i have been stuck around this from couple of days. I have even installed extra folders from https://github.com/itseez/opencv_contrib, but no difference.

These are relevant parts of code, I am trying to detect a mouth and face and then create a database of the same.

//
// libraies path:-
#include <opencv2/opencv.hpp>

#include <opencv/highgui.h>

#include <opencv/ml.h>

#include "/home/isenses/Downloads/opencv-3.0.0-rc1/modules/core/include/opencv2/core.hpp"

#include "/home/isenses/Downloads/opencv-3.0.0-rc1/modules/objdetect/include/opencv2/objdetect.hpp"

-#include "/home/isenses/Downloads/opencv-3.0.0-rc1/modules/imgproc/include/opencv2/imgproc.hpp"


cv::Ptr<face::FaceRecognizer> model, mouthModel;

if(predictedMouthLabel == 1){

        pureFaces.push_back(face);

        testSample = face;

        int predictedLabel = model->predict(testSample);

        }


for(int i = 0; i < pureFaces.size(); ++i){

        Mat temp  = pureFaces[i];

        resize(temp, temp, Size(92, 112));

        testSample = temp;    

        int predictedLabel = model->predict(testSample);

        }


void trainFaceRecogniserModel(std::vector<Mat> img, std::vector<int> lab){

    img.clear();

    lab.clear();

    try {

        readdb("database/database.txt", img, lab);

    } catch (cv::Exception& e) {

        cerr << "Error opening file . Reason: " << e.msg << endl;

        exit(1);

    }

    if(!(img.size() >= 2)) {

        string error_message = "This demo needs at least 2 images to work. Please add more images to your data set!";

        CV_Error(CV_StsError, error_message);

    }

    //resize images

    for(int i = 0; i < img.size(); ++i ...
(more)
2015-07-09 05:01:18 -0600 commented question installing extra modules

Ok....I was thinking of the same. Thank you. Appreciate your prompt reply :-)

2015-07-09 04:43:20 -0600 commented question installing extra modules

I actually tried that, but i get the following error.

error: ‘face’ cannot appear in a constant-expression cv::Ptr<face::facerecognizer> model, mouthModel;

2015-07-09 04:10:30 -0600 commented question installing extra modules

I installed the modules successfully. But still i am getting the same error.. ie:It have not solved the problem i was originally facing,which is error: ‘FaceRecognizer’ was not declared in this scope cv::Ptr<facerecognizer> model, mouthModel;

To which i was suggested to install the extra modules. But that doesnt seem to help either.

2015-07-09 02:31:27 -0600 commented question installing extra modules

guidance or explanation of what exactly is happening would be also of great help. thank you

2015-07-09 02:30:59 -0600 asked a question installing extra modules

Hi there, I am facing the same problem. But i am little confused with the instructions.

$ cd <opencv_build_directory>

$ cmake -DOPENCV_EXTRA_MODULES_PATH=<opencv_contrib>/modules <opencv_source_directory>

$ make -j5

which is build directory, opencv contrib and opencv source directoy. As far as i am able to get it

build_directory:- is directory in which i made the build folder while installing opencV. in my case it will be "Downloads/opencv-3.0.0-rc1/build"

opencv_contrib :- is the folder which i downloaded from git. in my case "Downloads/opencv_contrib-master"

source_directory :- i am not getting any clue here,my guess is its in "usr/local/include/opencv2" ??

I have tried options but nothing seem to solve my problem.

Please help me out here. Thank you

2015-07-09 02:30:59 -0600 answered a question Add Modules from opencv_contrib to opencv 3.0

Hi there, I am facing the same problem. But i am little confused with the instructions. $ cd <opencv_build_directory> $ cmake -DOPENCV_EXTRA_MODULES_PATH=<opencv_contrib>/modules <opencv_source_directory> $ make -j5

which is build directory, opencv contrib and opencv source directoy. As far aa i am able to get it build_directory:- is directory in which i made the build folder while installing opencV. opencv_contrib :- is the folder which i downloaded from git. source_directory :- i am not getting any clue here,my guess is its in "usr/local/include/opencv2" ?? Please helpme out here. Thank you