目录
1.添加小圆圈
2.添加小矩形
3.添加线段
4.添加文本
1.添加小圆圈
#include#include #include #include using namespace cv; using namespace std; int main() { Mat img(512, 512, CV_8UC3, Scalar(255, 255, 255)); circle(img, Point(256, 256), 155, Scalar(100, 200, 0), 5); imshow("Image", img); waitKey(0); return 0; }
来一个全填充满的图
2.添加小矩形#include3.添加线段#include #include #include using namespace cv; using namespace std; int main() { Mat img(512, 512, CV_8UC3, Scalar(255, 255, 255)); circle(img, Point(256, 256), 155, Scalar(100, 200, 0), FILLED); rectangle(img, Point(130, 226), Point(382, 286), Scalar(255, 255, 255), FILLED); imshow("Image", img); waitKey(0); return 0; }
#include4.添加文本#include #include #include using namespace cv; using namespace std; int main() { Mat img(512, 512, CV_8UC3, Scalar(255, 255, 255)); circle(img, Point(256, 256), 155, Scalar(100, 200, 0), FILLED); rectangle(img, Point(130, 226), Point(382, 286), Scalar(255, 255, 255), FILLED); line(img, Point(130, 296), Point(382, 296), Scalar(255, 255, 255), 2); imshow("Image", img); waitKey(0); return 0; }
#include#include #include #include using namespace cv; using namespace std; int main() { Mat img(512, 512, CV_8UC3, Scalar(255, 255, 255)); circle(img, Point(256, 256), 155, Scalar(100, 200, 0), FILLED); rectangle(img, Point(130, 226), Point(382, 286), Scalar(255, 255, 255), FILLED); line(img, Point(130, 296), Point(382, 296), Scalar(255, 255, 255), 2); putText(img, "Heihei_study", Point(157, 262), FONT_HERSHEY_DUPLEX, 1, Scalar(100, 200, 0), 2); imshow("Image", img); waitKey(0); return 0; }
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)