Using OpenCV, how to find the values of HSV channels of the "masked region" in a masked image?
<p>Using OpenCV4Android, how can I get the HSV channels of the first pixel of the <em>masked region</em> in a masked image (<code>dilatedMat</code> in the following snippet)? <strong>I know that we'd get the HSV channel values of first pixel by <code>hsvMat.get(0,0)</code> but I don't know how to apply this to the masked region only, rather than the entire <code>Mat</code>.</strong></p>

<p>For example, following is a function to which a camera frame is passed as an argument, and I have generated a mask, but how should I proceed from there?</p>

<p><strong><em>NOTE:</strong> Please keep in mind that the masked region is Not a rectangle, it has an irregular shape.</em></p>

<pre><code>private void detectColoredBlob (Mat rgbaFrame) { 
        Mat hsvImage = new Mat(); 
        Imgproc.cvtColor(rgbaFrame, hsvImage, Imgproc.COLOR_RGB2HSV_FULL);

        Mat maskedImage = new Mat(); 
        Scalar lowerThreshold = new Scalar(85, 50, 20); 
        Scalar upperThreshold = new Scalar(135, 255, 77); 
        Core.inRange(hsvImage, lowerThreshold, upperThreshold, maskedImage);

        Mat dilatedMat= new Mat(); 
        Imgproc.dilate(maskedImage, dilatedMat, new Mat() ); 

        //****************WHAT NOW???**************
     }
</code></pre>