背景介绍
EmguCV和OpenCvSharp都是OpenCV在.Net下的封装,常常会听到有人说EmguCV或OpenCvSharp同样的函数比OpenCV函数运行速度慢,到底是不是真的?博主暂时也没有去一一验证,本文主要对比下三者用指针方法读取像素的速度、耗时情况。
对比实验说明
提供2张图片做测试,分辨率分别是3000 x 3835 和 600 x 676:
分别使用OpenCV、EmguCV和OpenCvSharp指针方法来读取修改像素值,并计算所用时间。
【1】OpenCV测试
代码如下:
// Read_Modify_Piexl_Value.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。
//
#include "pch.h"
#include
#include
using namespace std;
using namespace cv;
Mat readPixelNormal(Mat img, Mat thres)
{
for (int i = 0; i < thres.rows; i++)
{
for (int j = 0; j < thres.cols; j++)
{
if (thres.at(i, j) == 255)
img.at(i, j
Original: https://blog.csdn.net/stq054188/article/details/125770694
Author: Color Space
Title: OpenCV、EmguCV和OpenCvSharp指针访问图像像素值耗时测评(附源码)
原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/702644/
转载文章受原作者版权保护。转载请注明原作者出处!