簡體   English   中英

無法根據opencv RotatedRect教程獲得相同的圖像結果

[英]Can't get the same image result based on opencv RotatedRect tutorial

我使用了Ubuntu14.04 LTS和opencv 3.0,我在鏈接中遵循以下代碼。 在控制台中,我獲得了init opengl。 但是,我得到的圖像與以下鏈接中的圖像完全不同。 任何人都可以幫我解決這個問題嗎? 謝謝。 http://docs.opencv.org/2.4/modules/core/doc/basic_structures.html#RotatedRect

Mat image(200, 200, CV_8UC3, Scalar(0));
RotatedRect rRect = RotatedRect(Point2f(100,100), Size2f(100,50), 30);

Point2f vertices[4];
rRect.points(vertices);
for (int i = 0; i < 4; i++)
    line(image, vertices[i], vertices[(i+1)%4], Scalar(0,255,0));

Rect brect = rRect.boundingRect();
rectangle(image, brect, Scalar(255,0,0));

imshow("rectangles", image);
waitKey(0);

我的結果

我基於http://rodrigoberriel.com/2014/10/installing-opencv-3-0-0-on-ubuntu-14-04/重建了opencv3.0,然后我得到了與教程相同的結果。 它現在對我有用。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM