我必须检查给定的图像是否是旋转图像? [英] I have to check whether the given image is rotated image or not?

查看:135
本文介绍了我必须检查给定的图像是否是旋转图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须解码给定图像中的条形码,我能够使用zxing条形码引擎解码图像中的所有条形码但是当图像处于旋转格式时意味着条形码或不解码所以,我必须检查给定的图像是否旋转如果是旋转格式意味着我们可以旋转图像,我不知道什么条件用于旋转的情况。



我尝试了什么:



我刚尝试旋转图像然后我尝试解码它解码的条形码条码,但我的问题是必须检查条形码图像是否旋转我不知道检查该情况的条件。

I have to decode the barcode from the given image, i can able to decode all the barcode in the image using the zxing barcode engine but when the image is in rotated format means at that time the barcode or not decoding so, i have to check whether given image is rotated or not if it is rotated format means we can rotate the image, i don't know what condition to use for the rotation case.

What I have tried:

I have just tried that i rotated the image and then i tried to decode the barcode it decodes the barcode, but my problem is have to check that barcode image is rotated or not i don't know what condition to check that case.

推荐答案

我想知道你有多大条码图像是 - 以及更简单的方法是否有效



为什么不尝试解码,如果失败,将图像旋转90度并再次尝试解码,重复,直到解码成功,或者,你将图像旋转了3次,即270度(一次更多,它将以原始方向返回)



可避免必须检查条形码旋转图像 - 如果您没有成功解码,那么您将图像标记为错误/报告它 - 如果您确定100%肯定图像只能处于两个方向之一,那么,您可以优化旋转代码来检查这些情况



是吗?完全按照您提出的问题做一件非常重要的事情
I wonder how big your bar-code images are - and whether a simpler approach would work

why not try the decode, if that fails, rotate the image 90 degrees and try the decode again, repeat until either the decode is successful, or, you have rotated the image 3 times ie 270 degrees (one time more and it would be back in the original orientation)

that would avoid having to 'check' if the barcode image is rotated - if you don't get a successful decode then you flag the image as an error/report it - if you know 100% for certain that the image can ONLY be in one of two orientations, then, you could optimise the rotation code to just check for those cases

yes ? it is a non-trivial task to do exactly as you've asked the question


这篇关于我必须检查给定的图像是否是旋转图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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