Quantcast
Channel: OpenCV Q&A Forum - Latest question feed
Viewing all articles
Browse latest Browse all 19555

Divide picture into vertical blocks and get pixel by x, y coordinate.

$
0
0
Hi. I’m new at OpenCV. Especially, I’m learning android at the same time, so I’m struggling to make an android application that using OpenCV. I wanna divide picture into vertical blocks(groups of matOfKeyPoints) and get pixel(by x, y coordinate) to compare with another coulmn's pixel. ![image description](/upfiles/14807985843339901.png) I got gray colored and cropped image. And made the image black&white by adaptiveThreshold(). I got MatOfKeyPoint by FeatureDetector.FAST as 3rd image(It's a result of drawKeyPoints(Default flag)). ![image description](/upfiles/14807986017055522.png) 1. I need to get representative coulmn by user’s selection. So I wanna divide points groups vertically. 2. Then I wanna get values *red ones* that computed from comparison with representative column’s points’ x, y coordinate. (The representative column has values *blue ones* input by user.) Below code is Detection(Button)'s OnClickListener. Thank you. ```java private class findButtonOnClickListener implements View.OnClickListener { MatOfKeyPoint matOfKeyPoints; FeatureDetector endDetector; @Override public void onClick(View view) { matOfKeyPoints = new MatOfKeyPoint(); endDetector = FeatureDetector.create(FeatureDetector.FAST); endDetector.detect(mat, matOfKeyPoints); Scalar color = new Scalar(0, 0, 255); // BGR Features2d.drawKeypoints(mat, matOfKeyPoints, mat, color, 0); Utils.matToBitmap(mat, bitmap); bitmap = bitmap.copy(Bitmap.Config.ARGB_8888, true); procImage.setImageBitmap(bitmap); procImage.invalidate(); bitmap = bitmapOrigin.copy(bitmapOrigin.getConfig(), true); mat = matOrigin.clone(); } } ```

Viewing all articles
Browse latest Browse all 19555

Trending Articles