Ask Your Question

Nihar Rao's profile - activity

2018-06-07 05:22:28 -0600 received badge  Student (source)
2017-06-11 13:24:32 -0600 asked a question getting Error when detecting and computing descriptors with GFTT

Hello, I am doing a project which uses the GFTTDetector

here is the part of code,where I get the error:-

Ptr<gfttdetector> myobject = cv::GFTTDetector::create(maxCorners,qualityLevel,minDistance,blockSize,useHarris,K); try { image.convertTo(image, CV_8U); myobject->detectAndCompute(image,mask,myPoints,descriptor,false); numBits = descriptor.size[1]; numFeatures = descriptor.size[0];

        featureVector = (double*)malloc(sizeof(double)*descriptor.size[0]*descriptor.size[1]);
        for( int i=0; i<descriptor.size[0]; i++)
            for( int j=0; j<descriptor.size[1]; j++)
            {
                *(featureVector + j*descriptor.size[0] + i) = int( descriptor.at<uchar>(i,j));
            }
            feature_rows = descriptor.size[0];
            feature_cols = descriptor.size[1];    
    }
    catch(cv::Exception &e)
    {
        const char *err = e.what();
        cout<<err;
        return 0;
    }

Here is the exceptioon dump:- /home/nihar/Desktop/opencv/modules/features2d/src/feature2d.cpp:154: error: (-213) in function detectAndCompute

2017-05-31 05:14:15 -0600 received badge  Enthusiast
2017-05-10 13:54:44 -0600 commented question how to install extra modules for openCV 3.2.0?

@berak,I only need lopencv_face,is there a way where I can add it manually?

2017-05-10 13:54:11 -0600 commented question how to install extra modules for openCV 3.2.0?

this is a error

2017-05-10 13:53:57 -0600 commented question how to install extra modules for openCV 3.2.0?

/usr/bin/ld: CMakeFiles/opencv_python2.dir/__/src2/cv2.cpp.o: relocation R_X86_64_PC32 against undefined symbol `_Z13pyopencv_fromIN2cv4MatxIdLi4ELi4EEEEP7_objectRKT_' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: final link failed: Bad value collect2: error: ld returned 1 exit status modules/python2/CMakeFiles/opencv_python2.dir/build.make:358: recipe for target 'lib/cv2.so' failed

2017-05-10 13:53:12 -0600 commented question how to install extra modules for openCV 3.2.0?

the error occcurs at 96% due to wrong building of a python file.

2017-05-10 13:51:49 -0600 commented question how to install extra modules for openCV 3.2.0?

I get an error while make command.I only need lopen_face,but it's not showing up when I type pkg-config --libs opencv

2017-05-10 13:01:15 -0600 asked a question how to install extra modules for openCV 3.2.0?

Hi,I downloaded the openCV-contrib repo and this is my cmake command cmake -DOPENCV_EXTRA_MODULES_PATH=/home/nihar/Desktop/opencv_contrib-master/modules .. the path is correct(I have cross checked 1000 times :)).I am in my build directory.

2017-03-26 10:53:36 -0600 received badge  Editor (source)
2017-03-26 10:52:16 -0600 asked a question Can we use this method to read images for training using FaceRecognizer class?

here is the code

int train_ellen(vector<Mat>& images)
{

   Mat image=imread("ellen1.jpg", CV_LOAD_IMAGE_GRAYSCALE);


   if(image.empty)
   {images.push_back(image);

    labels.push_back(0);
   }

   else
   return 0;
   image=imread("ellen2.jpg", CV_LOAD_IMAGE_GRAYSCALE);
   if(image.data)
   {
images.push_back(image); 
labels.push_back(1);}
   else
   return 0;
   image=imread("ellen3.jpg", CV_LOAD_IMAGE_GRAYSCALE);
   if(image.data)
   {images.push_back(image); labels.push_back(2);}
   else
   return 0;
   for(int i=0; i < images.size(); i++)
   {

     resize(images[i],images[0],images[0].size(),1.0,1.0, INTER_NEAREST );
    }

    model->train(images, labels);
    return 1;
}

all three images are in the project folder.

2017-03-26 05:36:51 -0600 commented question Hi,I am getting this error Program1.cpp|| undefined reference to `cv::face::FaceRecognizer::predict(cv::_InputArray const&) const'|

sorry for my bad english

2017-03-26 05:36:27 -0600 commented question Hi,I am getting this error Program1.cpp|| undefined reference to `cv::face::FaceRecognizer::predict(cv::_InputArray const&) const'|

I schecked lopecv_flags is not in my cflags

2017-03-26 05:35:10 -0600 commented question Hi,I am getting this error Program1.cpp|| undefined reference to `cv::face::FaceRecognizer::predict(cv::_InputArray const&) const'|

the default bnaries have already been built, To make the code work in codeblocks I need to have lopencv_flag in linker options but I am gettig lopen_flags not found

2017-03-26 05:33:27 -0600 commented question Hi,I am getting this error Program1.cpp|| undefined reference to `cv::face::FaceRecognizer::predict(cv::_InputArray const&) const'|

bro I guess I fucked up my installaton ,I switched to ubuntu and the face module comes in extra modules so I want to add those modules

I tried this but it gives me error cmake -DOPENCV_EXTRA_MODULES_PATH=../opencv_contrib-master/modules ..

the paths are correct

2017-03-26 05:08:03 -0600 commented question Hi,I am getting this error Program1.cpp|| undefined reference to `cv::face::FaceRecognizer::predict(cv::_InputArray const&) const'|

I noticed that face flag s not there ,how to add tat ?

2017-03-26 03:49:07 -0600 commented question Hi,I am getting this error Program1.cpp|| undefined reference to `cv::face::FaceRecognizer::predict(cv::_InputArray const&) const'|

I am getting this error now i codebocks face.hpp should be buit as a c++ file

I am building it as a cpp file then why the error?

2017-03-25 08:06:30 -0600 commented question Hi,I am getting this error Program1.cpp|| undefined reference to `cv::face::FaceRecognizer::predict(cv::_InputArray const&) const'|

I am a complete newbie ,just started working on opencv 2 days back

2017-03-25 08:05:22 -0600 commented question Hi,I am getting this error Program1.cpp|| undefined reference to `cv::face::FaceRecognizer::predict(cv::_InputArray const&) const'|

OpenCV 3.2.0 ,windows 10 ,actually I am compiling with codeblocks ,so where should I look for makefile? Thanks

2017-03-25 06:33:44 -0600 commented question Hi,I am getting this error Program1.cpp|| undefined reference to `cv::face::FaceRecognizer::predict(cv::_InputArray const&) const'|

can u please tell more about the the opencv_face lib

2017-03-25 06:33:05 -0600 commented question Hi,I am getting this error Program1.cpp|| undefined reference to `cv::face::FaceRecognizer::predict(cv::_InputArray const&) const'|

yeah the error predict is coming as FaceRecognizer is not getting detected,I have included face.hpp

2017-03-24 14:21:17 -0600 asked a question Hi,I am getting this error Program1.cpp|| undefined reference to `cv::face::FaceRecognizer::predict(cv::_InputArray const&) const'|

here is my code snippet

#include <opencv2/core/core.hpp>
#include "opencv2/core.hpp"
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/opencv.hpp>
#include "opencv2/imgcodecs.hpp"
#include "opencv2/imgproc.hpp"
#include "opencv2/objdetect.hpp"
#include "opencv2/face/facerec.hpp"
#include "opencv2/face.hpp"
#include<bits/stdc++.h>

using namespace cv;
using namespace std;
using namespace cv::face;


/*declaration of global variables */


int image_flag=1;//flag for depicting success/failure of reading a image
CascadeClassifier face_cascade;
CascadeClassifier eyes_cascade;
String face_cascade_name, eyes_cascade_name;
vector<int> labels;
Ptr<face::FaceRecognizer> model = face::createFisherFaceRecognizer();

thanks in advance!