Its another OpenCV question. I love this stuff, but it seriously can drive you bonkers.
The problem: I am working on a project with, yes OpenCV, in iOS for iPhone. I don't know if I have a bad framework or what.
This works:
cv::Canney()
cv::adaptiveThreshold()
But, when I try
"cvGet2D()" (without previous "cv::")
I get the error: no matching function for call to 'cvGet2D'
When I just type "cvGet2D()" it shows up in code hinting, suggesting its a least finding the headers? When I try to type "cv::get2D" or "cv::cvGet2D", nothing shows up. I'm frustrated because the OpenCV framework I installed still feels like a blackbox that I don't understand.
Specifically, do you think it could have anything do to with development vs. not and linking of the proper libraries? Just throwing things out there.
Thank you all so very much. I really appreciate and can't wait until I get smart enough to give back some.
EDIT:
So, latest attempt for clarity.
cv::cvGet2D(results,0,0);
New error is : "no member named "cvGet2D" in namespace 'cv';
Any ideas here?
More EDITS:
Thanks again for your responses... 4 hours later, and several cups of coffee, I'm still perplexed. If I'm screwing up the namespace, why would something like cv::adaptiveThreshold work but cv::get2D not show up? It's seriously causing a brain bleed.
So, looks like I should go with either a C or C++ version of this solution. Any tips are suggested. I will add that I have in my interface: #import <OpenCV/opencv2/opencv.hpp>
. This then imports the core library where I can see cvGet2D's structure. Thanks again.
PROGRESS!!
These are my new thoughts.
cv::Mat tempMat = [self.imageView.image CVMat];
cv::Mat testMat = tempMat(cv::Rect(0,0,2591, 1));
cv::Mat templateMat = tempMat(cv::Rect(0,0,100,1));
cv::Mat results;
cv::matchTemplate(testMat, templateMat, results, CV_TM_CCOEFF_NORMED);
typedef Vec<float, 2> Vec2f;
Vec2f& elem = results.at<Vec2f>( 0 , 35 );
float value1 = elem[0];
float value2 = elem[1];
So, perhaps it is .at that should be using? Tangent? Maybe, but it seems to be doing something. New questions, wtf does a matchTemplate output? Its 1 row and in this case 2492 columns. I guess my question is, should the value at (0,35) be more than one number? What does elem[0] and elem[1] represent? As you might be able to tell, I'm simply taking 1 row from a picture, and using a small chunk of it as the template. the photo contains vertical lines so I am hoping to determine the distance the lines are from each other. Yes, its convoluted. But, for purposes of this discussion, There really should only be 1 row, and a series of columns that outputs a correlation coefficient for each comparison as it is shifted correct?
Thanks again blokes, mates, lads, lasses, and all you smart masses!