我正在尝试使用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)