有谁知道怎么用安卓OpenCV修改图片大小吗?
似乎大小设置到了最大值,我没有设法改变。使用基于JavaCameraView的教程ImageManipulations,这是我能得到的最大分辨率:相机预览大小。Width: 960 Height : 720摄像头图片大小。宽: 640高: 480
问题是我需要更高的图片分辨率(我不关心预览大小)。
也许在opencv论坛上有答案,但我不能访问这个答案,因为那里似乎有作品(OpenCVForum)
发布于 2014-12-12 21:27:39
您可以按如下方式调整Mat的大小:
Size szSource = new Size(640,480);
Size szResized = new Size(2592,1944);
Mat mSource= new Mat(szSource, CvType.CV_8U);// Read or Fill Something in your mSource
Mat mResised = new Mat();
Imgproc.resize( mSource, mResised, szResized,0,0,INTER_NEAREST);//mSource-> Your Source image
interpolation – interpolation method can be any of the above
INTER_NEAREST - a nearest-neighbor interpolation
INTER_LINEAR - a bilinear interpolation (used by default)
INTER_AREA - resampling using pixel area relation. It may be a preferred method for image decimation, as it gives moire’-free results. But when the image is zoomed, it is similar to the INTER_NEAREST method.
INTER_CUBIC - a bicubic interpolation over 4x4 pixel neighborhood
INTER_LANCZOS4 - a Lanczos interpolation over 8x8 pixel neighborhood如需进一步参考,请参阅please see this。
https://stackoverflow.com/questions/27443404
复制相似问题