使用opencv循环遍历像素 [英] Cycle through pixels with opencv

查看:314
本文介绍了使用opencv循环遍历像素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用opencv循环使用图像,就像它是一个2d数组,以获取每个像素的rgb值?

How would I be able to cycle through an image using opencv as if it were a 2d array to get the rgb values of each pixel? Also, would a mat be preferable over an iplimage for this operation?

推荐答案

如果你使用C ++,使用opencv的C ++接口然后您可以通过 http ://docs.opencv.org/2.4/doc/tutorials/core/how_to_scan_images/how_to_scan_images.html#the-efficient-way 或使用cv :: Mat :: at(),例如。

If you use C++, use the C++ interface of opencv and then you can access the members via http://docs.opencv.org/2.4/doc/tutorials/core/how_to_scan_images/how_to_scan_images.html#the-efficient-way or using cv::Mat::at(), for example.

这篇关于使用opencv循环遍历像素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆