I found a single quite simple function from Leptonica that its output(compiled for ios) differ to the regular version. The function is pixRotateBinaryNice .. Digging in the function I think the cause for discrepancy is one of the following:
1) different floating point behavior. 2) different implementation of sin cos function 3) possible undefined behaviour of shift left operation on a signed integer with possible overflow (line 165 rotateamlow.c xp = xcen + (xpm >> 4);) xpm is a signed integer running from -w/2 to w/2 where w is the image width. I don't have direct access to an ios development platform(Mac) so if someone can verify this it could help. Alternatively someone could try adding some -fsanitize flags to the build script in Robert Mathews github By the way Robert excellent work and I appreciate it very much that you share it. On Sunday, March 2, 2014 1:57:51 PM UTC+2, Tsur Herman wrote: > > I am experiencing the same issues.. and found difference in Leptonica also > from regular version to ios version. > I don't have alue yet what is causing this .. maybe compiler optimization? > floating point definition? > > did anybody find something .. help! :-) > > On Tuesday, January 7, 2014 11:48:47 AM UTC+2, Aleksander Grzyb wrote: >> >> Thank you very much for your project, I downloaded it and tested and >> unfortunately results for me are still different... >> >> Could you take look of a sample I am using (image is after preprocessing): >> >> >> <https://lh6.googleusercontent.com/-FiiBgjL_wec/UsvLPUJBXII/AAAAAAAAAMU/67Frq1lGkGk/s1600/1.JPG> >> >> I am using polish language to detect words in the above image, I >> downloaded the language data from: >> https://code.google.com/p/tesseract-ocr/downloads/detail?name=tesseract-ocr-3.02.pol.tar.gz&can=2&q= >> >> I application I set language to "pol", "tessedit_pageseg_mode" to "2" and >> I don't resize the image, because it is already small (514x104) and the >> output from console command (tesseract 1.JPG output -l pol) gives me result >> "PARAGON FISKALNY" which is perfect and iOS appliaction gives me "PHRHGON >> FISKHLNY" which is really strange because every letter "A" changes to "H". >> I think my next step is to create file "unicharambigs" and use >> combine_tessdata, but it is very strange that console version gives me >> different result than iOS version, I tried every parameter and tried to >> resize photo, but with no results. Do you have any ideas what can cause >> problem? >> >> >> >> >> >> >> >> W dniu niedziela, 5 stycznia 2014 03:50:39 UTC+1 użytkownik Robert >> Mathews napisał: >>> >>> read my thread more carefully. i did recompile against tesseract 3.02 >>> >>> Typos courtesy of my iPhone >>> >>> On Jan 4, 2014, at 6:15 PM, Benjamin Sølberg <[email protected]> >>> wrote: >>> >>> Hi Robert >>> >>> You probably already know this but your project uses an old >>> version/snapshot of tesseract. >>> Just a heads up as I was hoping that that you were using the latest code >>> :-) >>> There have been at least one fix regarding the osx version. >>> >>> Benjamin >>> >>> Den fredag den 3. januar 2014 21.20.27 UTC+1 skrev Robert Mathews: >>>> >>>> I recompiled against the latest tesseract and leptonica-1.69 >>>> >>>> You can see the project I used to compile here: >>>> https://github.com/robmathews/compile-tesseract >>>> >>>> Then, I updated the sample ios app to >>>> - use tesseract 3.02 + leptonica-1.69 >>>> - allow choosing a photo from the photo library >>>> >>>> and checked into this fork: >>>> https://github.com/robmathews/OCR-iOS-Example >>>> >>>> And that's all I know. >>>> >>>> >>>> -- >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "tesseract-ocr" group. >>> To post to this group, send email to [email protected] >>> To unsubscribe from this group, send email to >>> [email protected] >>> For more options, visit this group at >>> http://groups.google.com/group/tesseract-ocr?hl=en >>> >>> --- >>> You received this message because you are subscribed to the Google >>> Groups "tesseract-ocr" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to [email protected]. >>> For more options, visit https://groups.google.com/groups/opt_out. >>> >>> -- -- You received this message because you are subscribed to the Google Groups "tesseract-ocr" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/tesseract-ocr?hl=en --- You received this message because you are subscribed to the Google Groups "tesseract-ocr" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.

