I have now been trying for hours to figure out what is wrong in XCode when i try to use findContours. Basically this is my code:
#include <opencv2/opencv.hpp>
int main()
{
Mat img = imread(helper::getImageSequence(3, image_value_temp));
Mat img_gray = Mat(Size(img.cols, img.rows), CV_8UC1);
Mat img_canny;
cvtColor(img, img_gray, CV_BGR2GRAY);
Canny(img_gray, img_canny, someLow, someHigh);
vector<vector<cv::Point> > contours;
vector<Vec4i> hierarchy;
findContours(img_canny, contours, hierarchy, CV_RETR_TREE, CV_CHAIN_APPROX_SIMPLE);
}
When i print contours i get 7905747460161236409, so i wonder if my heap is overflowing?
- XCode version: 4.5.2
- Compiler: Apple LLVM 4.1
So basically the crash traces back to findContours and this is all XCode gives me:

It would be easier to recreate your error if you would provide the full source code and the image that produce this error for you. When I complete your code, so that I can use it:
It runs fine on my system. I do not see a reason why it should not.
The error you posted in the screenshot is not a compiler crash. Your debugger shows that your program crashed during executation.
You have a function circle_fitting_callback obviously written by yourself that produces an error while destructing a vector of cv::points. Your problem is not in the code you posted but in something you are not showing to us.
The best thing would be to learn to use your debugger. I do not know your IDE, but I guess it directly you to the part of your function causing the crash if you click the appropriate line in the call stack (the thing you showed to us).
If you get stuck with this please post a complete code to reproduce the error.