简体   繁体   English

使用Magic ++获取Pixel

[英]Get Pixel with Magic++

Can anybody show me an example how i get the pixel values of an Image ? 谁能给我一个例子,说明如何获取图像的像素值? I want to read an Image and iterate over it .. and print out the actual "red" value. 我想读取图像并对其进行迭代..并打印出实际的“红色”值。

Can anyone help ? 有人可以帮忙吗? i'm a beginner :( 我是一个初学者:(

There is a direct function in magic++ called read in the image class: magic ++中有一个直接函数,在图像类中称为read:

image::read

ie image.read( 640, 480, "RGB", CharPixel, pixels ); 即image.read(640,480,“ RGB”,CharPixel,pixel);

in which pixels will give you arrays of pixel values... that you can use later. 其中的像素将为您提供像素值的数组...供以后使用。

Or you can access direct low level pixels.. Here is how... http://www.imagemagick.org/Magick++/Image++.html#Raw%20Image%20Pixel%20Access 或者,您也可以访问直接的低级像素。.这是... http://www.imagemagick.org/Magick++/Image++.html#Raw%20Image%20Pixel%20Access

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM