using OpenCvSharp;
using OpenCvSharp.Extensions;
using DlibDotNet;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace app
{
public partial class FrmMain : Form
{
public FrmMain()
{
InitializeComponent();
}
/// <summary>
/// 归一化
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btnNormalize_Click(object sender, EventArgs e)
{
Mat src = Cv2.ImRead(@"img\jzh.png");
Cv2.ImShow("原图", src);
Mat normalize_add = new Mat();
Mat normalize_reduce = new Mat();
// 归一化 加强亮度
Cv2.Normalize(src, normalize_add, 0, 300, NormTypes.MinMax);
Cv2.ImShow("归一化 增加亮度", normalize_add);
// 归一化 加强亮度
Cv2.Normalize(src, normalize_reduce, 0, 150, NormTypes.MinMax);
Cv2.ImShow("归一化 降低亮度", normalize_reduce);
}
}
}
using OpenCvSharp;
using OpenCvSharp.Extensions;
using DlibDotNet;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace app
{
public partial class FrmMain : Form
{
public FrmMain()
{
InitializeComponent();
}
/// <summary>
/// 归一化
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btnNormalize_Click(object sender, EventArgs e)
{
Mat src = Cv2.ImRead(@"img\jzh.png");
Cv2.ImShow("原图", src);
Mat normalize_add = new Mat();
Mat normalize_reduce = new Mat();
// 归一化 加强亮度
Cv2.Normalize(src, normalize_add, 0, 300, NormTypes.MinMax);
Cv2.ImShow("归一化 增加亮度", normalize_add);
// 归一化 加强亮度
Cv2.Normalize(src, normalize_reduce, 0, 150, NormTypes.MinMax);
Cv2.ImShow("归一化 降低亮度", normalize_reduce);
}
}
}
using OpenCvSharp; using OpenCvSharp.Extensions; using DlibDotNet; using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace app { public partial class FrmMain : Form { public FrmMain() { InitializeComponent(); } /// <summary> /// 归一化 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnNormalize_Click(object sender, EventArgs e) { Mat src = Cv2.ImRead(@"img\jzh.png"); Cv2.ImShow("原图", src); Mat normalize_add = new Mat(); Mat normalize_reduce = new Mat(); // 归一化 加强亮度 Cv2.Normalize(src, normalize_add, 0, 300, NormTypes.MinMax); Cv2.ImShow("归一化 增加亮度", normalize_add); // 归一化 加强亮度 Cv2.Normalize(src, normalize_reduce, 0, 150, NormTypes.MinMax); Cv2.ImShow("归一化 降低亮度", normalize_reduce); } } }