Tlya 1 Жалоба Опубликовано May 29, 2017 Доброго времени! может кто сталкивался... Есть простецкий код, который норм. работает (OpenCV 3.2.0 64bit) int main(int argc, const char** argv) { PROGON(); } void PROGON() { Mat image_pred, gray; image_pred = imread("D:\\222.jpg", 1); Mat image(image_pred.rows*0.6, image_pred.cols*0.6, CV_8UC1, Scalar(255, 255, 255)); resize(image_pred, image, image.size(), 0, 0, 3); Mat beliY(image.rows, image.cols, CV_8UC1, Scalar(255, 255, 255)); cvtColor(image, image, CV_RGB2GRAY); GaussianBlur(image, image, cv::Size(1, 1), 1, 0); threshold(image, gray, 200, 255.0, THRESH_BINARY); vector<vector<cv::Point> > contours; findContours(gray, contours, CV_RETR_LIST, CV_CHAIN_APPROX_NONE, cv::Point(0, 0)); imshow("gray.jpg", gray); } *получаем ч/б картинку С ГЛАЗАМИ* но почему-то тот же самый код если используем в (OpenCV 3.0.0 32bit) меняет изображение (получаем практически тёмное). Если коментим findContours(...), то всё до него работает нормально. КАК findContours() может влиять на конечное изображение? или разница между OpenCV 3.0.0 32bit и OpenCV 3.2.0 64bit так велика? Поделиться сообщением Ссылка на сообщение Поделиться на других сайтах
mrgloom 242 Жалоба Опубликовано May 30, 2017 http://docs.opencv.org/2.4/modules/imgproc/doc/structural_analysis_and_shape_descriptors.html?highlight=findcontours#findcontours Source image is modified by this function. Also, the function does not take into account 1-pixel border of the image (it’s filled with 0’s and used for neighbor analysis in the algorithm), therefore the contours touching the image border will be clipped так что findContours(gray.clone(), contours, CV_RETR_LIST, CV_CHAIN_APPROX_NONE, cv::Point(0, 0)); 1 Поделиться сообщением Ссылка на сообщение Поделиться на других сайтах
Tlya 1 Жалоба Опубликовано May 30, 2017 Спасибо большое за ответ! Поделиться сообщением Ссылка на сообщение Поделиться на других сайтах