谷歌应用程序引擎如何操作图像数据?你怎么操纵像素数据? [英] How does google app engine manipulate image data? How can you manipulate pixel data?

查看:113
本文介绍了谷歌应用程序引擎如何操作图像数据?你怎么操纵像素数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想要访问低级像素数据以使用GAE完成信号处理算法(这消除了BufferedImages和Java.awt.image类的使用)

您可以通过以下方式访问图像数据:

  ImagesService imagesService = ImagesServiceFactory.getImagesService(); 
Image oldImage = ImagesServiceFactory.makeImageFromBlob(blobKey);
byte [] imageData = oldImage.getImageData();

所以问题在这里:

彩色图像有4个波段(aRGB),但是当您将图像数据变为1D字节的数组时。

1)GAE如何将图像数据存储到字节中? (我想它只是把2D数据放到一维数组中,它是灰度的吗?)



2)如何操纵单个颜色带和像素图片?

解决方案

在这种情况下imageData是整个图像的原始字节,无论图像的格式如何,包括标题,数据块等等。



它不是未压缩格式的像素数据。


I want to get access to the low level pixel data to complete signal processing algorithms using GAE (which elimiated the use of BufferedImages and Java.awt.image classes)

You can access the Image data by:

ImagesService imagesService = ImagesServiceFactory.getImagesService();       
Image oldImage = ImagesServiceFactory.makeImageFromBlob(blobKey);
byte[] imageData = oldImage.getImageData();

So here is the issue:

Color Images have 4 Bands (aRGB) but when you get the Image Data its a 1D byte array.

1) How does GAE store the image data into the bytes? (I imagine its just taking the 2D data and putting it into a 1D array, is it grayscale?)

2) How would you manipulate the individual color bands and pixels of the image?

解决方案

imageData in this case is the raw bytes of the entire image in whatever format the image is in, including headers, data chunks etc.

It is not the pixel data in uncompressed format.

这篇关于谷歌应用程序引擎如何操作图像数据?你怎么操纵像素数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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