作者cliffchang2 (cliffchang2)
看板C_and_CPP
標題[問題] OPENCV中Rect角落座標
時間Wed Aug 31 22:42:57 2016
開發平台(Platform): (Ex: VC++, GCC, Linux, ...)
VC++
額外使用到的函數庫(Library Used): (Ex: OpenGL, ...)
OpenCV 3.0
問題(Question):
使用findContours尋找輪廓後畫出矩形
並試圖使用.br().x與.br().y找出矩形右下角座標
餵入的資料(Input):
預期的正確結果(Expected Output):
分別正確顯示該點座標x、y值
錯誤結果(Wrong Output):
1.使用.br().x時的結果與未加x輸出相同,使用y時才正確輸出y座標
2.輸出為兩個數字(預期為只有一個y座標)
程式碼(Code):(請善用置底文網頁, 記得排版)
bounding_rect=boundingRect(contours[i]);
printf("%d ",bounding_rect.br().y);
右下角座標為(760,798)
理論上應該只出現798的值
但輸出結果卻為1079 798
請問是哪裡出了問題?
補充說明(Supplement):
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 140.120.90.230
※ 文章網址: https://webptt.com/m.aspx?n=bbs/C_and_CPP/M.1472654579.A.60B.html
1F:→ cliffchang2: 已自行解決 09/01 00:44