革博士程序V1仓库
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

38 行
936 B

  1. using LeatherApp.Utils;
  2. using OpenCvSharp;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.ComponentModel;
  6. using System.Data;
  7. using System.Drawing;
  8. using System.Linq;
  9. using System.Text;
  10. using System.Threading.Tasks;
  11. using System.Windows.Forms;
  12. namespace LeatherApp
  13. {
  14. public partial class Form1 : Form
  15. {
  16. public Form1()
  17. {
  18. InitializeComponent();
  19. }
  20. private void button1_Click(object sender, EventArgs e)
  21. {
  22. try
  23. {
  24. Mat mat0 = Cv2.ImRead(this.textBox1.Text.Trim());
  25. int marginWidth0;
  26. mat0 = OpenCVUtil.getMaxInsetRect2(mat0, true, 0, out marginWidth0);
  27. this.label1.Text = "边缘宽度:" + marginWidth0;
  28. }
  29. catch(Exception ex)
  30. {
  31. MessageBox.Show(ex.Message);
  32. }
  33. }
  34. }
  35. }