Ask Your Question

Buddhisthead's profile - activity

2015-11-01 14:54:19 -0600 received badge  Nice Answer (source)
2014-11-14 15:31:45 -0600 commented question Face recognition performance for iPhone 4 versus iPhone 5s

I am also puzzled by application's performance on iPhone 4. It runs 10x slower than on the 4S and the hardware differences should only predict a 2X difference.

2014-11-14 15:27:29 -0600 commented question iPhone 4(S) vs iPad2 computer vision performance problems

Hello, I have this problem too, except that for me iPhone 4S performance is fine. The iPhone 4 performance is 10x slower. I am wondering if it's a library version issue, tools, or something else, because I have seen good performance on iPhone 4 previously (a year ago). Thanks for any hints.

2014-10-14 10:18:07 -0600 received badge  Teacher (source)
2014-09-15 11:50:14 -0600 received badge  Necromancer (source)
2014-04-24 12:46:28 -0600 asked a question cv::pyrUp and cv::pryDown undefined symbols in arch armv7

Hello. I have an iOS application that links against the opencv2.framework downloaded FMWK, which has worked great so far. But after calls to pryUp/Down, I am experiencing linker errors with these undefined symbols as follows:

call site:

    void ContourAnalyzer::canny(cv::Mat& input, cv::Mat& output, Conditions* conditions)
{
    // Scale down image using pyramid reduction by kChop factor
    cv::pyrDown(input, mHalfTmp);
    cv::pyrDown(mHalfTmp, mQuarterGray);

    // OTSU, then binary threshold
    cv::threshold(mQuarterGray, mHalfTmp2, 0, 255.0, cv::THRESH_OTSU | cv::THRESH_BINARY);
    // Morphological reduction of noise, strengthen lines
    cv::Mat element = cv::getStructuringElement(cv::MORPH_RECT, cv::Size(7, 7));
    cv::dilate(mHalfTmp2, mHalfTmp1, element);
    cv::erode(mHalfTmp1, mHalfTmp2, element);
    // Edge detection
    cv::Canny(mHalfTmp2, output, mCannyThreshold1, mCannyThreshold2);
}

I have linked fine in the past, with such functions as threshold, dilate, erode, etc, canny, etc. But adding calls to the pyramid module has yielded the following unresolved errors. Note that I am using version 2.4.8 of the pre-built iOS framework.

   Undefined symbols for architecture armv7:
  "cv::pyrUp(cv::_InputArray const&, cv::_OutputArray const&, cv::Size_<int> const&)", referenced from:
      ip::ContourAnalyzer::doFullsizeCanny(cv::Mat&) in IPCheckCapture(ContourAnalyzer.o)
  "cv::pyrDown(cv::_InputArray const&, cv::_OutputArray const&, cv::Size_<int> const&)", referenced from:
      ip::ContourAnalyzer::canny(cv::Mat&, cv::Mat&, ip::Conditions*) in IPCheckCapture(ContourAnalyzer.o)
ld: symbol(s) not found for architecture armv7

Thanks for any help.

2014-03-05 21:14:32 -0600 commented question Drawing bounding box in java

Here is also a good reference with it's own good links int he comments: http://stackoverflow.com/questions/19093973/android-opencv-draw-rectangle-on-contours

2014-03-05 21:11:42 -0600 received badge  Editor (source)
2014-03-05 21:07:55 -0600 answered a question Drawing bounding box in java

Once you have your contours, you can walk through them and find the bounding rectangle of each one...

        MatOfPoint2f         approxCurve = new MatOfPoint2f();

    //For each contour found
    for (int i=0; i<contours.size(); i++)
    {
        //Convert contours(i) from MatOfPoint to MatOfPoint2f
        MatOfPoint2f contour2f = new MatOfPoint2f( contours.get(i).toArray() );
        //Processing on mMOP2f1 which is in type MatOfPoint2f
        double approxDistance = Imgproc.arcLength(contour2f, true)*0.02;
        Imgproc.approxPolyDP(contour2f, approxCurve, approxDistance, true);

        //Convert back to MatOfPoint
        MatOfPoint points = new MatOfPoint( approxCurve.toArray() );

        // Get bounding rect of contour
        Rect rect = Imgproc.boundingRect(points);

         // draw enclosing rectangle (all same color, but you could use variable i to make them unique)
        Core.rectangle(contoursFrame, new Point(rect.x,rect.y), new Point(rect.x+rect.width,rect.y+rect.height), (255, 0, 0, 255), 3); 

    }
2012-11-15 15:47:12 -0600 commented answer Build Errors after OpenCV Library Import

This worked for me as well. Thank you very much. The compiler compliance settings need to be 1.6. The old settings had them at 1.5.