Dim m as OCVMat '' Let's assume m contains the camera preview image, in the resolution you have chosen.
Dim mROI, mROIresized As OCVMat
Dim mROIRect As OCVRect
mROIRect.Initialize(x,y,w,h) ' <-- the rectangular ROI that must be within the original OCVMat dimensions
mROI.Initialize7(m, mROIRect) ' <-- Here you get a reference to the chosen region in the original Mat
Dim mFinalSize as OCVSize
mFinalSize.initialize2( Array as double(400, 400)) '<-- The final fize
' At this moment I don't remember if mROIResized should be previously initialized, or the 'resize' sub takes care of it.
mImgProc.resize(mROI, mROIResized, mFinalSize, 0, 0, mImgProc.INTER_NEAREST) '<-- Now you'll have the chosen region with the size you want in mROIResized