用 OpenCVSharp 4.5 跑一遍 OpenCV官方教程
原官方教程链接:OpenCV: Video Input with OpenCV and similarity measurement
using System;
using OpenCvSharp;
namespace ConsoleApp1
{
class tutorial34 : ITutorial
{
public void Run()
{
int psnrTriggerValue = 40, delay = 100;
string sourceReference = @"I:\csharp\videos\Megamind.avi";
string sourceCompareWith = @"I:\csharp\videos\Megamind_bugy.avi";
int frameNum = -1; // Frame counter
VideoCapture captRefrnc = new VideoCapture(sourceReference);
VideoCapture captUndTst = new VideoCapture(sourceCompareWith);
if (!captRefrnc.IsOpened())
{
Console.WriteLine("Could not open reference {0}", sourceReference);
return;
}
if (!captUndTst.IsOpened())
{
Console.WriteLine("Could not open case test {0}", sourceCompareWith);
return;
}
Size refS = new Size((int)captRefrnc.Get(VideoCaptureProperties.FrameWidth),
(int)captRefrnc.Get(Vide

本文通过OpenCVSharp 4.5实现官方教程,展示了如何使用VideoCapture读取视频并进行PSNR和MSSIM测量,以评估视频帧之间的差异。
最低0.47元/天 解锁文章
9315

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



