检测数字并处理它们?
我正在尝试检测网格上写的数字,然后使用 iPhone 摄像头处理它们。到目前为止我发现了一些很好的例子,例如:
http://blog.damiles.com/? p=93
http:// /cmgresearch.blogspot.com/2010/01/augmented-reality-on-iphone-how-to_01.html
虽然我能够在很大程度上在覆盖视图上绘制数字,但仍然无法检测到这些数字是什么。
编辑
大家好,我在 http://github.com 上找到了一个链接/nolanbrown/Tesseract-iPhone-Demo 从我下载代码并开始测试的地方,但它只运行一次但没有给出任何输出,从那时起它的崩溃给了我以下错误日志:
#0 0x0007b718 in TessBaseAPI::HistogramRect ()
#1 0x0007bc04 in TessBaseAPI::OtsuThreshold ()
#2 0x0007c4a8 in TessBaseAPI::CopyImageToTesseract ()
#3 0x0007cd8c in TessBaseAPI::TesseractRect ()
#4 0x0006cdb4 in -[OCRDemoViewController ocrImage:] (self=0x31ec40, _cmd=0x201ba7, uiImage=0x34ed00) at /Users/madhup/Tesseract-iPhone-Demo/OCRDemo/Classes/OCRDemoViewController.mm:131
#5 0x0006c6d0 in -[OCRDemoViewController imagePickerController:didFinishPickingImage:editingInfo:] (self=0x31ec40, _cmd=0x334fcf80, picker=0x348ba0, image=0x35c470, editingInfo=0x0) at /Users/ngamacbook/Tesseract-iPhone-Demo/OCRDemo/Classes/OCRDemoViewController.mm:213
#6 0x32d103ec in -[UIImagePickerController _imagePickerDidCompleteWithInfo:] ()
#7 0x3296ceac in PLNotifyImagePickerOfImageAvailability ()
#8 0x3297e49e in -[PLUICameraViewController cameraView:photoSaved:] ()
#9 0x3294d134 in -[PLCameraView cropOverlay:didFinishSaving:] ()
#10 0x3294d344 in -[PLCameraView cropOverlayWasOKed:] ()
#11 0x3295dfb2 in -[PLCropOverlay cropOverlayBottomBarDoneButtonClicked:] ()
#12 0x329801e0 in -[PLCropOverlayBottomBar doneButtonClicked:] ()
#13 0x32569ee4 in -[NSObject performSelector:withObject:withObject:] ()
#14 0x32ba2064 in -[UIApplication sendAction:to:from:forEvent:] ()
#15 0x32ba2004 in -[UIApplication sendAction:toTarget:fromSender:forEvent:] ()
#16 0x32ba1fd6 in -[UIControl sendAction:to:forEvent:] ()
#17 0x32ba1d30 in -[UIControl(Internal) _sendActionsForEvents:withEvent:] ()
#18 0x32ba2644 in -[UIControl touchesEnded:withEvent:] ()
#19 0x32ba165c in -[UIWindow _sendTouchesForEvent:] ()
#20 0x32ba1038 in -[UIWindow sendEvent:] ()
#21 0x32b9d92e in -[UIApplication sendEvent:] ()
#22 0x32b9d3a6 in _UIApplicationHandleEvent ()
#23 0x32913b78 in PurpleEventCallback ()
#24 0x32567c2c in CFRunLoopRunSpecific ()
#25 0x3256735c in CFRunLoopRunInMode ()
#26 0x32912cbe in GSEventRunModal ()
#27 0x32912d6a in GSEventRun ()
#28 0x32b6276e in -[UIApplication _run] ()
#29 0x32b61472 in UIApplicationMain ()
#30 0x0006c2cc in main (argc=1, argv=0x2ffff5dc) at /Users/madhup/Tesseract-iPhone-Demo/OCRDemo/main.mm:14
现在正在上线131 我找到了,
char* text = tess->TesseractRect(imageData,(int)bytes_per_pixel,(int)bytes_per_line, 0, 0,(int) imageSize.height,(int) imageSize.width);
但我无法介入或找到任何方法来解决问题,任何人知道这一点请帮忙。在过去的四天里,我一直在关注这个问题,但没有向前迈出一步。
谢谢, 马杜普
I am trying to detect the numbers written on a grid and then process them using the iPhone camera. What i have found till yet are some good examples like:
http://cmgresearch.blogspot.com/2010/01/augmented-reality-on-iphone-how-to_01.html
Although I am able to draw the numbers on the overlay view to a good extent but still not able to detect what these numbers are.
Edit
Hi guys I found a link on http://github.com/nolanbrown/Tesseract-iPhone-Demo from where I downloaded the code and started testing, but it only ran once but didn't gave any output and since then its crashing give me the following error logs:
#0 0x0007b718 in TessBaseAPI::HistogramRect ()
#1 0x0007bc04 in TessBaseAPI::OtsuThreshold ()
#2 0x0007c4a8 in TessBaseAPI::CopyImageToTesseract ()
#3 0x0007cd8c in TessBaseAPI::TesseractRect ()
#4 0x0006cdb4 in -[OCRDemoViewController ocrImage:] (self=0x31ec40, _cmd=0x201ba7, uiImage=0x34ed00) at /Users/madhup/Tesseract-iPhone-Demo/OCRDemo/Classes/OCRDemoViewController.mm:131
#5 0x0006c6d0 in -[OCRDemoViewController imagePickerController:didFinishPickingImage:editingInfo:] (self=0x31ec40, _cmd=0x334fcf80, picker=0x348ba0, image=0x35c470, editingInfo=0x0) at /Users/ngamacbook/Tesseract-iPhone-Demo/OCRDemo/Classes/OCRDemoViewController.mm:213
#6 0x32d103ec in -[UIImagePickerController _imagePickerDidCompleteWithInfo:] ()
#7 0x3296ceac in PLNotifyImagePickerOfImageAvailability ()
#8 0x3297e49e in -[PLUICameraViewController cameraView:photoSaved:] ()
#9 0x3294d134 in -[PLCameraView cropOverlay:didFinishSaving:] ()
#10 0x3294d344 in -[PLCameraView cropOverlayWasOKed:] ()
#11 0x3295dfb2 in -[PLCropOverlay cropOverlayBottomBarDoneButtonClicked:] ()
#12 0x329801e0 in -[PLCropOverlayBottomBar doneButtonClicked:] ()
#13 0x32569ee4 in -[NSObject performSelector:withObject:withObject:] ()
#14 0x32ba2064 in -[UIApplication sendAction:to:from:forEvent:] ()
#15 0x32ba2004 in -[UIApplication sendAction:toTarget:fromSender:forEvent:] ()
#16 0x32ba1fd6 in -[UIControl sendAction:to:forEvent:] ()
#17 0x32ba1d30 in -[UIControl(Internal) _sendActionsForEvents:withEvent:] ()
#18 0x32ba2644 in -[UIControl touchesEnded:withEvent:] ()
#19 0x32ba165c in -[UIWindow _sendTouchesForEvent:] ()
#20 0x32ba1038 in -[UIWindow sendEvent:] ()
#21 0x32b9d92e in -[UIApplication sendEvent:] ()
#22 0x32b9d3a6 in _UIApplicationHandleEvent ()
#23 0x32913b78 in PurpleEventCallback ()
#24 0x32567c2c in CFRunLoopRunSpecific ()
#25 0x3256735c in CFRunLoopRunInMode ()
#26 0x32912cbe in GSEventRunModal ()
#27 0x32912d6a in GSEventRun ()
#28 0x32b6276e in -[UIApplication _run] ()
#29 0x32b61472 in UIApplicationMain ()
#30 0x0006c2cc in main (argc=1, argv=0x2ffff5dc) at /Users/madhup/Tesseract-iPhone-Demo/OCRDemo/main.mm:14
Now going on line 131 I find
char* text = tess->TesseractRect(imageData,(int)bytes_per_pixel,(int)bytes_per_line, 0, 0,(int) imageSize.height,(int) imageSize.width);
but I am not able to step-in or find any way to resolve the issue, any body know this please help. I am into this for last 4 days and not moved a single step ahead.
Thanks,
Madhup
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用非常好的 tesseract 开源 OCR 引擎。只需进行图像处理,提取您猜测是数字的内容并将它们提供给超正方体即可。 Tesseract 应该可以在 iPhone 上编译,但是应该已经有一些预编译的二进制文件了。我不知道它在手写内容上的表现如何,但数字可能没问题。然而,我假设你总是会遇到区分例如 2 和 7 的麻烦......
You can use the very nice tesseract open-source OCR engine. Just do your image processing as extracting stuff which you guess are numbers and feed them to tesseract. Tesseract should compile on iPhone, but there should be some precompiled binaries out already. I do not know how it performs on hand-written stuff, but numbers might be ok. However, I assume you'll always get troubles to differ between e.g. 2 and 7...