小编1re*_*esu的帖子

为什么BoofCV会不断向左侧旋转相机预览?

我正在尝试使用BoofCV Android Demo中的给定示例进行BoofCV线路检测.为此,我复制了这些类,并使用Android的Camera API设置了所有内容.虽然演示正在使用横​​向方向,但我的活动需要在纵向,但设置时相机向左旋转90°.当我尝试相应地设置相机时,没有任何反应.我用了:

  • Camera.setDisplayOrientation(90)
  • Camera.setParameters("orientation", "portrait")

过了一会儿,我发现它不是设备相关的(在不同的设备和API级别上测试),它也与Camera API没有任何关系(因为我在评论VideoProcessor.init()功能时设法得到了它).

尝试了一段时间后,我仍然无法弄清楚为什么VideoProcessor不断向左旋转图像......

这是我的代码VideoProcessor:

public class LineProcessor extends Thread implements VideoProcessing {

    /**
     * Lock for reading and writing images with processing and render
     */
    private final Object lockGui = new Object();

    /**
     * Lock used when converting the video stream.
     */
    private final Object lockConvert = new Object();

    private Paint mPaint;
    private ImageType<GrayU8> imageType;
    private GrayU8 image;
    private GrayU8 image2;
    private volatile boolean requestStop …
Run Code Online (Sandbox Code Playgroud)

android android-camera android-canvas boofcv

5
推荐指数
1
解决办法
122
查看次数

标签 统计

android ×1

android-camera ×1

android-canvas ×1

boofcv ×1