発生している問題
OpenCVでCV_8UC3を使用したときに画像の高さと幅が半分になってしまいます。
元の高さ、幅で処理を行いたいのですがどのようにすればよいでしょうか。
宜しくお願いします。
元の画像サイズは高さ1353px 幅633pxです。
画像の高さ、幅を出力するコード
C++
1#include <iostream> 2#include <opencv2/opencv.hpp> 3 4//CV_8UC3で読み込み 5cv::Mat image = cv::imread("C:/Users/image.jpg",CV_8UC3); 6 7//そのままで読み込み 8cv::Mat image2 = cv::imread("C:/Users/image2.jpg"); 9 10int main() 11{ 12 std::cout << "cols"<< image.cols << ",rows" << image.rows << std::endl; 13 std::cout << "cols"<< image2.cols << ",rows" << image2.rows << std::endl; 14 15 cv::waitKey(10000); 16 return 0; 17}
出力
C++
1cols677,rows317 2cols1353,rows633 3
環境
Visual Studio 2017
OpenCV 4.11
Windows10

回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。