cv::cv::minAreaRect(img ,Point(1, 1)); の部分でPointで関数呼び出しの因数が多すぎるとエラーが起きてしまいます。どう書けば解決しますか?
int main(int argc, char** argv) {
int hr = -1;
try {
cv::Mat src, edge, dst, img, gray_ocv, im_threshold, hsv_im, im_comy, image_ocv1;
Mat element = Mat::ones(3, 3, CV_8UC1);
img = imread("geta.JPEG");
if (img.empty()) {
cout << "ファイルが読み込みません";
cin.get();
return -1;
}
int width = 0;// =im.cols;
int height = 0; //= im.rows;
im_threshold = Mat(Size(width, height), CV_8UC1);
image_ocv1 = img.clone(); //cvtColor(img, gray_ocv, COLOR_BGR2GRAY); グレースケールに変換 cvtColor(img, hsv_im, CV_BGR2HSV); //HSV画像へ変換 //BGR→HSVに変換 cv::namedWindow("img", 1);// cv::imshow("img", img);//imgの表示。 inRange(hsv_im, Scalar(95, 234, 106), Scalar(120, 255, 182), im_threshold); dilate(im_threshold, im_threshold, element, Point(-1, -1), 3);//膨張処理3回; cv::minAreaRect(img ,Point(1, 1)); cv::namedWindow("dst", 1); cv::imshow("dst", dst); cv::waitKey(0); hr = 0; } catch (cv::Exception ex) { std::cout << ex.err << std::endl; } //ウインドウの破棄 cv::destroyAllWindows(); return hr;
}
あなたの回答
tips
プレビュー