簡體   English   中英

使用RGB在Android應用程序中進行圖像處理

[英]Image Processing in an Android Application using RGB

我將創建一個Android應用程序,該應用程序使用RGB確定肉的新鮮度。 該應用程序的流程為:

  1. 拍攝影像
  2. 通過單擊一個按鈕確定新鮮度
  3. 根據其RGB顯示結果。

我在RGB部分有問題。 希望有人可以幫助我解決這個問題。

如果您正在使用處理,這可能會很有用。

使用“處理”逐像素掃描圖像,以便可以比較它們以查找圖像中的圖案。

PImage sample;

void setup() {
  size(300,300);
  sample = loadImage("sample.jpg");

  sample.loadPixels();
  image(sample,0,0,300,300);
}

void draw() {    
  //Loop to scan the image pixel by pixel
  for (int x=0; x < sample.width; x++){
    for (int y=0; y < sample.height; y++){

      int location = x + (y * sample.width);
      // Whit the location you can get the current color
      color currentColor = sample.pixels[loc];
      //Do something

    }
  }
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM