Ask Your Question

pronikinator's profile - activity

2014-09-05 17:47:36 -0500 answered a question image comparison with a database

@Guanta Can you please help me how to go about the step 4 if my aim is just to find similar images and not to train? How to go about it once I have completed steps 1-3 and have the descriptors. Please help

2013-12-19 07:41:11 -0500 asked a question program crashes during cv::findcontours execution
 std::vector<std::vector<cv::Point> > contours;

std::vector<cv::Vec4i> hierarchy;

cv::findContours(ThreshIm,contours, hierarchy, CV_RETR_TREE, CV_CHAIN_APPROX_NONE);

cv::fillPoly(ThreshIm,contours,Scalar(255)); cv::drawContours(frame,contours,-1,Scalar(0,255,0),3);

// cv::RotatedRect box= cv::minAreaRect(Mat(contours[0]));

While taking a live input from camera, the program runs successfully until the cv::RotatatedRect is not included in the code,but as soon as the program is run with this line, the program crashes. What might be happening?

2013-12-18 23:55:34 -0500 asked a question cv::minAreaRect initialization error

std::vector<cv::point> points;

      cv::Mat_<uchar>::iterator it = ThreshIm.begin<uchar>();
      cv::Mat_<uchar>::iterator end = ThreshIm.end<uchar>();
      for (; it != end; ++it)
        if (*it)
          points.push_back(it.pos());

        cv::RotatedRect box;

           box = cv::minAreaRect(Mat(points));

The program builds successfully but then upon running(on qt-creator IDE)the following error is shown:

what(): /build/buildd/opencv-2.3.1/modules/imgproc/src/utils.cpp:53: error: (-5) Input array is not a valid matrix in function cvPointSeqFromMat

The program has unexpectedly finished.

What might be going wrong?

2013-12-15 12:37:38 -0500 asked a question openCV capturefromcamera loop working

I'm using the following code (in qtcreator IDE) for taking live input video from webcam

void MainWindow::on_pushButton_clicked() {

cv::VideoCapture cap(0); cv::Mat frame; ui->horizontalSlider->setRange(0,255); while(true){

cap >> frame;

cv::cvtColor(frame,frame,CV_BGR2GRAY);
cv::cvtColor(frame,frame,CV_GRAY2RGB);
QImage img= QImage((const unsigned char*)(frame.data),
frame.cols,frame.rows,QImage::Format_RGB888);

ui->label->setPixmap(QPixmap::fromImage(img));

ui->label->resize(ui->label->pixmap()->size());

int j= ui->horizontalSlider->value(); ui->label_2->setNum(j);

double l=0; l++; std::cout<<l; ui-="">label_3->setNum(l); cv::waitKey(30);

} } The problem is that value of l is not updating,i.e. it updates to 1 once and then stops updating, how is the while loop running then?