Ask Your Question

beckp's profile - activity

2016-10-15 09:06:39 -0600 asked a question Does imshow work using OpenCV 3 on ios?

I am trying to produce the Simple Blob Detector in iOS using OpenCV. I get an error related to highgui not being installed. When I comment out the code, the offender is imshow.

imshow("keypoints", im_with_keypoints);

A presentation from ICVS 2013 states that highgui is not implemented in iOS so imshow will not work. Doe anyone know whether this works yet or if there is a good workaround?

http://opencv.org/wp-content/uploads/...

2016-10-14 17:12:31 -0600 asked a question No member named 'Blender' in namespace 'cv::detail' stitching.hpp error when using Simple Blob Detector

I am trying to use the Simple Blog Detector with Swift and an OpenCV Objective C++ wrapper using OpenCV 3.1.0 for iOS. However, I am getting several errors. I do not understand them as they imply that I am using stitching.hpp, but I am not. Any suggestions? I cannot figure out why it would be calling the stitching.hpp blenders and exposure compensate.

The errors are: No member named 'ExposureCompensator' in namespace 'cv::detail' stitching.hpp and: No member named 'Blender' in namespace 'cv::detail' stitching.hpp

Headers were added to the beginning as I was originally getting Parse Issues from the Expected Identifier ‘NO’ in the macro. By adding these headers, I removed the Parse Issues as recommended in the source files, but this resulted in the new errors as described above.

I removed all the number symbols before code lines as I could not figure out how to keep they symbols from enlarging and bolding the code.

ifndef OPENCV_STITCHING_BLENDERS_HPP define OPENCV_STITCHING_BLENDERS_HPP if defined(NO) warning Detected Apple 'NO' macro definition, it can cause build conflicts. Please, include this header before any Apple headers. endif

ifndef OPENCV_STITCHING_EXPOSURE_COMPENSATE_HPP define OPENCV_STITCHING_EXPOSURE_COMPENSATE_HPP if defined(NO) warning Detected Apple 'NO' macro definition, it can cause build conflicts. Please, include this header before any Apple headers. endif

import "OpenWrapper.h" import <opencv2 opencv.hpp=""> import <opencv2 core="" core.hpp=""> import <opencv2 imgcodecs="" ios.h=""> import <opencv2 imgproc.hpp="">

using namespace std; using namespace cv; @implementation OpenWrapper

+(UIImage *) makeGrayscale:(UIImage *)myImage{

// Convert UIImage to Mat Mat imageMat; UIImageToMat(myImage, imageMat);

// Convert from color to grayscale image Mat graymat; cvtColor(imageMat, graymat, CV_BGR2GRAY);

// Set up Simple Blob Parameters SimpleBlobDetector::Params params;

params.minThreshold = 10; params.maxThreshold = 200; params.filterByArea = true; params.minArea = 1500; params.filterByCircularity = true; params.minConvexity = 0.87; params.filterByInertia = true; params.minInertiaRatio = 0.01;

// Create dectector with keypoints vector<keypoint> keypoints; Ptr<simpleblobdetector> detector = SimpleBlobDetector::create(params); detector->detect(graymat, keypoints);

// Mat im_with_keypoints; Mat im_with_keypoints;

drawKeypoints(graymat, keypoints, im_with_keypoints, Scalar(0,0,255), DrawMatchesFlags::DRAW_RICH_KEYPOINTS);

// Show blobs imshow("keypoints", im_with_keypoints ); waitKey(0);

// Output results as UIIMage return MatToUIImage(graymat);

}

endif endif