I'm developing an Android app which uses a background Service
to programmatically capture a screenshot of whatever is on the screen currently. I obtain the screenshot as a Bitmap
.
Next, I successfully imported OpenCV into my Android project.
What I need to do now is blur a subset of this image, i.e. not the entire image itself, but a [rectangular] area or sub-region within the image. I have an array of Rect
objects representing the rectangular regions that I need to blur within the screenshot.
I've been looking around for a tutorial on doing this with OpenCV in Java, and I haven't found a clear answer. The Mat
and Imgproc
classes are obviously the ones of interest, and there's the Mat.submat()
method, but I've been unable to find a clear, straightforward tutorial on getting this done.
I've googled a lot, and none of the examples I've found are complete. I need to do this in Java, within the Android runtime.
What I need is:
Bitmap
>>>Mat
>>>Imgproc
>>>Rect
>>>Bitmap
with ROI blurred.
Any experienced OpenCV devs out here, can you point me in the right direction? This is the only thing I'm stuck at.
Related:
Gaussian blurring with OpenCV: only blurring a subregion of an image?.