OpenCVSharp跑一遍OpenCV官方教程(全为手敲代码,如有雷同都是我的错)
随机数产生及图像上写文字
OpenCV教程链接:https://docs.opencv.org/4.5.0/df/d61/tutorial_random_generator_and_text.html
核心函数:
- RNG
- PutText
using OpenCvSharp;
namespace ConsoleApp1
{
public class tutorial2:ITutorial
{
private int rows = 300, cols = 500;
private int x_1 = 0, x_2 = 500;
private int y_1 = 0, y_2 = 300;
private int NUMBER = 100;
private int showtime = 100;
public void Run()
{
RNG rng = new RNG( 0xFFFFFFFF );
Mat image = Mat.Zeros(rows, cols, MatType.CV_8UC3);
Drawing_Random_Lines(image, "Random Lines", rng);
Displaying_Random_Text(image, "Random Text", rng);
Displaying_Big_End(image, "Big End", rng);
//Cv2.WaitKey(0);
}
private void Drawing_Random_Lines(Mat image, string window_name, RNG rn

最低0.47元/天 解锁文章
2181

被折叠的 条评论
为什么被折叠?



