【问题标题】:Any algorithm to check every pixels that contain specific color?. in Android :)任何算法来检查包含特定颜色的每个像素?在安卓中:)
【发布时间】:2011-10-10 18:21:21
【问题描述】:
现在我有一个收集所有颜色像素的二维数组
我有一个一维数组,它收集每个像素都需要用这个数组检查的特定颜色。但是如何检查这 2 个数组
第一个数组是
array_A = new String[bitmap.getWidth()][bitmap.getHeight()];
另一个是 final String[] array_B = { "ffcc33","ffcc00",....} 那么如何检查这两个数组 :)) 提前致谢
【问题讨论】:
标签:
android
algorithm
image-processing
colors
bitmap
【解决方案1】:
希望 sn-ps 对您有所帮助。另外,您可以使用pixel[] = new int [width*height] 从图像中获取像素。
for(int w= 0; w < bitmap.getwidth(); w++)
{
for(int h = 0 ; h < bitmap,getheight() ; h++ )
{
int c = bitmap.getPixel(w, h);
Log.i("Pixels", h+"X"+w);
}
}