我想擁有一組圖像的所有像素座標。不幸的是,我收到以下錯誤信息:創建從點設置的錯誤
「錯誤C2678:二進制'<':沒有發現操作符需要類型'const cv :: Point'的左側操作數(或沒有可接受的轉換)」
Mat img;
img = imread("[...]\\picture.jpg", 1);
set<Point> pointset;
for(int x = 0 ; x < img.cols ; x++)
{
for (int y = 0 ; y < img.rows ; y++)
{
pointset.insert(Point(x,y));
}
}
我懷疑進入集合的每個類型都必須提供比較函數,而cv :: Point不能這樣做。不幸的是,我是C++和OpenCV的新手,不知道如何檢查我的懷疑是否屬實。
也,[當前OpenCV的文檔是在這裏(http://docs.opencv.org/) – berak
重複的http:// stackoverflow.com/questions/15913857/stdset-insert-wont-compile-with-custom-class和http://stackoverflow.com/questions/14784620/problems-with-c-set-container ... – Jarod42