Getting or Setting Pixels

The safe (slow) way

  • Suppose you are working on an Image<Bgr, Byte>. You can obtain the pixel on the y-th row and x-th column by calling
Bgr color = img[y, x];
  • Setting the pixel on the y-th row and x-th column is also simple
img[y,x] = color;

The fast way

The Image pixels values are stored in the Data property, a 3D array. Use this property if you need to iterate through the pixel values of the image.

For example, in an grayscale image (Image<Gray, Byte>), instead of doing this:

Gray byCurrent = imageGray[x, y];

You would do this:

Byte byCurrent = imageGray.Data[x, y, 0];

Getting or Setting Pixels的更多相关文章

  1. Unity3D脚本中文系列教程(十五)

    http://dong2008hong.blog.163.com/blog/static/4696882720140322449780/ Unity3D脚本中文系列教程(十四) ◆ LightRend ...

  2. WikiBooks/Cg Programming

    https://en.wikibooks.org/wiki/Cg_Programming Basics Minimal Shader(about shaders, materials, and gam ...

  3. (转) Deep Reinforcement Learning: Pong from Pixels

    Andrej Karpathy blog About Hacker's guide to Neural Networks Deep Reinforcement Learning: Pong from ...

  4. Setting up the data and the model

    Table of Contents: Setting up the data and the model Data Preprocessing Weight Initialization Batch ...

  5. Intel Media SDK H264 encoder GOP setting

    1 I帧,P帧,B帧,IDR帧,NAL单元 I frame:帧内编码帧,又称intra picture,I 帧通常是每个 GOP(MPEG 所使用的一种视频压缩技术)的第一个帧,经过适度地压缩,做为随 ...

  6. ABP源码分析七:Setting 以及 Mail

    本文主要说明Setting的实现以及Mail这个功能模块如何使用Setting. 首先区分一下ABP中的Setting和Configuration. Setting一般用于需要通过外部配置文件(或数据 ...

  7. ABP源码分析四十一:ZERO的Audit,Setting,Background Job

    AuditLog: 继承自Entity<long>的实体类.封装AuditLog的信息. AuditingStore: 实现了IAuditingStore接口,实现了将AuditLog的信 ...

  8. [LeetCode] Smallest Rectangle Enclosing Black Pixels 包含黑像素的最小矩阵

    An image is represented by a binary matrix with 0 as a white pixel and 1 as a black pixel. The black ...

  9. Oracle EBS - Profile Setting

    EBS Profile Setting (Personalization Basics): Personalization Basics For R12 Forms Enable personaliz ...

随机推荐

  1. lintcode-100-删除排序数组中的重复数字

    100-删除排序数组中的重复数字 素只出现一次,并且返回新的数组的长度. 不要使用额外的数组空间,必须在原地没有额外空间的条件下完成. 样例 给出数组A =[1,1,2],你的函数应该返回长度2,此时 ...

  2. ArcGIS Server中创建的两个账户有什么区别

    新手常常有这样的疑问: 在安装ArcGIS Server的时候创建的账户和在ArcGIS Server Manager上面创建的账户有什么区别? 解答:前者是是为ArcGIS Server创建的操作系 ...

  3. 写一篇Hook Driver.

    关于Hook,有一本书讲的比较清楚,最近刚刚看完,<Rootkits: Subverting the Windows Kernel> http://www.amazon.com/Rootk ...

  4. NIO Q&A(持续补充。。。。)

    Q:NIO是非阻塞的.但调用的selector.select()方法会阻塞.这和NIO非阻塞岂不是矛盾了? A:非阻塞指的是 IO 事件本身不阻塞,但是获取 IO 事件的 select 方法是需要阻塞 ...

  5. Python数据分析(一)pandas数据切片

    1.获取行或列数据 loc——通过行标签索引行数据 iloc——通过行号索引行数据 ix——通过行标签或者行号索引行数据(基于loc和iloc 的混合) 同理,索引列数据也是如此! import pa ...

  6. 【题解】SDOI2018战略游戏

    被CNST的大小卡了好久.一定要开到18呀…… 首先,遇到这种带各种各样环的图先考虑是不是可以建立圆方树,在圆方树上求出答案.然后转化为圆方树之后,我们就将图转化到了树上.答案非常的明显:只要一个圆点 ...

  7. [NOIP2017 TG D2T2]宝藏(模拟退火)

    题目大意:$NOIPD2T2$宝藏 题解:正常做法:状压DP .这次模拟退火,随机一个排列,$O(n^2)$贪心按排列的顺序加入生成树 卡点:没开$long\;long$,接受较劣解时判断打错,没判$ ...

  8. [Leetcode] Same tree判断是否为相同树

    Given two binary trees, write a function to check if they are equal or not. Two binary trees are con ...

  9. BZOJ 3545 / 洛谷 P4197 Peaks 解题报告

    P4197 Peaks 题目描述 在\(\text{Bytemountains}\)有\(N\)座山峰,每座山峰有他的高度\(h_i\).有些山峰之间有双向道路相连,共\(M\)条路径,每条路径有一个 ...

  10. centos7 mysql cluster集群搭建基于docker

    1.准备 mn:集群管理服务器用于管理集群的其他节点.我们可以从管理节点创建和配置集群上的新节点.重新启动.删除或备份节点. db2/db3:这是节点间同步和数据复制的过程发生的层. db4/db5: ...