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

asked 2016-12-03 15:18:44 -0500

NOOPIE gravatar image

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

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

  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();
    }
}

```

edit retag flag offensive close merge delete