Ask Your Question

tim obrien's profile - activity

2019-12-02 05:14:07 -0600 received badge  Popular Question (source)
2018-07-20 09:19:32 -0600 received badge  Notable Question (source)
2017-06-30 14:37:53 -0600 received badge  Popular Question (source)
2014-10-28 20:38:02 -0600 asked a question error:Only 8-bit 1-channel and 3-channel input/output images are

Hi, I am creating cv::Mat objects using UIImageToMats from the iOS code. I am getting the error " Only 8-bit 1-channel and 3-channel input/output images are supported in function cvInpaint" from the cvInpaint function invoked in the code snippet below.

How do I make sure that all "input/output" images are 8-bit 1-channel and 3-channel input/output images? thanks Tim

-(UIImage) inpaintLelea:(UIImage) image Mask:(UIImage*) imageMask { cv::Mat src; UIImageToMat(image, src );

cv::Mat mask;
cv::cvtColor(src, mask, CV_BGR2GRAY);
cv::threshold(mask, mask, 220, 255, CV_THRESH_BINARY);


std::vector<std::vector<cv::Point> > contours;
cv::findContours(mask.clone(), contours, CV_RETR_EXTERNAL, CV_CHAIN_APPROX_SIMPLE);

for (int i = 0; i < contours.size(); i++)
{
    cv::Rect r = cv::boundingRect(contours[i]);

    if (std::abs(1 - (src.cols/r.width)) > 0.2)
        cv::drawContours(mask, contours, i, CV_RGB(0,0,0), CV_FILLED);
}

cv::Mat dst;

cv::inpaint(src, mask, dst, 1, cv::INPAINT_TELEA);

return  MatToUIImage(dst);

}

2014-10-01 19:15:10 -0600 commented question OpenCV for iOS with Xcode

I will post my build log

2014-09-24 13:48:42 -0600 asked a question Updated documents for adding openCV version 3.0 to XCode

Hi, I am stuck trying to integrate OpenCV with XCode. Has anyone integrated version 3.0 and if so can you please post a cheat sheet.

I got stuck when the code below caused a file not found error.

#ifdef __cplusplus

import <opencv2 opencv.hpp="">

endif

2014-09-24 13:41:29 -0600 asked a question Where to download older versions of OpenCV

I am looking to download version OpenCV-IOS 2.4.8.

The link below has reverences to older versions but when you click on the link only 2.4.9 and 3.0 are available. http://opencv.org/downloads.html