得到我所用的follwing代碼一個圖像的RGB值片斷比較兩個圖像的RGB顏色值的Android
int[] pix = new int[picw * pich];
bitmap.getPixels(pix, 0, picw, 0, 0, picw, pich);
int R, G, B,Y;
for (int y = 0; y < pich; y++){
for (int x = 0; x < picw; x++)
{
int index = y * picw + x;
int R = (pix[index] >> 16) & 0xff; //bitwise shifting
int G = (pix[index] >> 8) & 0xff;
int B = pix[index] & 0xff;
//R,G.B - Red, Green, Blue
//to restore the values after RGB modification, use
//next statement
pix[index] = 0xff000000 | (R << 16) | (G << 8) | B;
}}
我想比較兩個圖像,我知道,比較像素值會比較昂貴。我也分析了OpenCV庫,但我不會 進入我的要求。
是否有任何算法來比較使用Android中的RGB值的圖像?
或
是否有其他方法比較RGB值?
感謝,