0

我有一个项目图像处理来测量标尺的精度。

因此,我想尽可能快地对 4k 图像进行图像处理。

但我无法使用 OpenCV 获得 4k 图像。

我在“activity_main.xml”中创建了“JavaCameraView”并连接了 mOpenCvCameraView 和 JavaCameraView

mOpenCvCameraView = (CameraBridgeViewBase)findViewById(R.id.activity_surface_view);

即使我更改了有关相机的一些设置,我也只能获得 1920 x 1080 的分辨率。

当然,My Android Phone 支持的分辨率更多。

D/CameraBridge: trying size: 4000x3000
D/CameraBridge: trying size: 3264x2448
D/CameraBridge: trying size: 3280x2464
D/CameraBridge: trying size: 3840x2160
D/CameraBridge: trying size: 3264x1836
D/CameraBridge: trying size: 2576x1932
D/CameraBridge: trying size: 1920x1080
D/CameraBridge: trying size: 1280x720
D/CameraBridge: trying size: 3264x1468
D/CameraBridge: trying size: 2400x1080
D/CameraBridge: trying size: 1440x1080
D/CameraBridge: trying size: 1280x960
D/CameraBridge: trying size: 1088x1088
D/CameraBridge: trying size: 960x720
D/CameraBridge: trying size: 720x480
D/CameraBridge: trying size: 640x480
D/CameraBridge: trying size: 352x288
D/CameraBridge: trying size: 320x240
D/CameraBridge: trying size: 176x144
I/JavaCameraView: Selected preview size to 1920x1080

所以,我重新设计,用 CameraX 拍摄图像,用 OpenCV 进行图像处理。

它可以工作,但是 CameraX(takepicture api)需要太多时间(500~600msec)才能获取图像。

也许 CvCameraViewListener 是快速获取图像的唯一方法。(如果需要,我不需要预览窗口。输出只能是文本)

如果有人有任何意见可以解决我的问题,请告诉我。

谢谢你。

4

0 回答 0