如何从图像倾斜角度 [英] How to get skew angle from image

查看:200
本文介绍了如何从图像倾斜角度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我面临的问题得到。我现在用的tesseract API进行图像处理的图像倾斜角度。我已经搜索网络上很多,但没有合适的解决方案中。我用下面的code:

  Pix的测试= ReadFile.readBitmap(bitmap.createBitmap(400,400,Config.ARGB_8888));
浮角= Skew.findSkew(试验);

从上面code,我得到的角度值0.0。请帮我解决这个问题,或者显示
正确的方向来解决这个问题。


解决方案

  TessBaseAPI baseApi =新TessBaseAPI();
baseApi.setImage(位图);
Pix的测试= baseApi.getThresholdedImage();
浮动= Skew.findSkew(试验);

有时得到0.0,一般工作。但我不知道正确的。

I am facing problem to get the skew angle from image .I am using tesseract api for image processing. I have searched a lot on web but no appropriate solution found. I have used following code:

Pix test=ReadFile.readBitmap(bitmap.createBitmap(400, 400, Config.ARGB_8888));
float angle=Skew.findSkew(test);

from above code I get angle value 0.0. Please help me to resolve this problem or show the right direction to resolve this problem.

解决方案

TessBaseAPI baseApi = new TessBaseAPI();
baseApi.setImage(bitmap);    
Pix test = baseApi.getThresholdedImage();
float a = Skew.findSkew(test);

Sometimes get 0.0, generally work. But I'm not sure of the correct.

这篇关于如何从图像倾斜角度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆