0
我幾周前開始使用opencv。我想知道是否有從輪廓列表中找出最亮輪廓並繪製最亮的輪廓的功能。到目前爲止,我設法轉換灰度,閾值圖像和使用findContour函數來查找圖像中的所有輪廓。如何通過亮度過濾輪廓
嘗試使用minMax函數,但無法找到它在java中的使用方式。
public void process(Mat rgbaImage) {
Imgproc.threshold(rgbaImage,rgbaImage,230,255,Imgproc.THRESH_BINARY);
Imgproc.findContours(rgbaImage,contours,mHierarchy,Imgproc.RETR_LIST,Imgproc.CHAIN_APPROX_SIMPLE);
/* for(int id = 0; id < contours.size();id++) {
double area = Imgproc.contourArea(contours.get(id));
if (area > 8000){
Log.i(TAG1, "contents founds at id" + id);
}
} */
}`