I have an incoming stream of RGB Mat objects (all with the same dimensions and depth); the processFrame method is called for each new Mat. For each new RGB Mat, I wish to convert to HSV, get some information from the HSV Mat without changing it, then move on. My code looks like this:
public class MyProcessor implements Processor
{
Mat hsvMat = new Mat();
public void processFrame(Mat rgbMat)
{
Imgproc.cvtColor(rgbMat, hsvMat, RGB2HSV);
// Now, get some information from the HSV mat, without changing it, and report it in some way
}
}
Obviously, the first call to cvtColor will result in memory allocation for hsvMat.
For subsequent calls to cvtColor, will the same block of memory be used, or will reallocation occur?