Hello,
I'm wondering if there's any image manipulation done internally by the Vision framework itself, before the text recognition is performed?
I'm asking because I know there's a CIDocumentEnhancer filter that I could apply to the image before passing it over to the VNRecognizeTextRequest. However, I would like to avoid it, if something similar is already done internally.
If no manipulation is done internally, would you recommend performing something like below?
let capturedImage = CIImage(cvPixelBuffer: pixelBuffer)
let filter = CIFilter(name: "CIDocumentEnhancer")
filter?.setValue(capturedImage, forKey: kCIInputImageKey)
filter?.setValue(5, forKey: kCIInputAmountKey)
let filteredImage = filter?.outputImage
Also, based on my testing, the text recognition request consistently took ~10% longer, when provided with the filtered image vs. the original captured image. Any ideas why?
Looking forward to hearing your thoughts. Thanks!
Post
Replies
Boosts
Views
Activity
Hello,
With support for new languages introduced with VNRecognizeTextRequestRevision2, I'm wondering how should we approach setting the recognitionLanguages when instantiating the VNRecognizeTextRequest.
Question 1
I want my text recognition to support all new languages: ["en-US", "fr-FR", "it-IT", "de-DE", "es-ES", "pt-BR", "zh-Hans", "zh-Hant"], but I don't necessarily always know the language of a text beforehand.
Should we:
1. Set recognitionLanguages to all available languages.
2. Omit setting recognitionLanguages altogether.
3. Try to define the text language beforehand, and: a. set the recognitionLanguages only to that language, or
b. set the recognitionLanguages to all available languages, sorted by the text language first?
Question 2
Also, are there any performance implications for setting multiple recognitionLanguages compared to just one?
Setting persistentIdentifier on an instance of NSUserActivity is not persisted. The activity shows up in spotlight as expected but has a persistentIdentifier of nil (confirmed in onContinueUserActivity).
Moreover, the NSUserActivity.deleteSavedUserActivities(withPersistentIdentifiers:) has no effect (the activity still shows up in spotlight search), which I guess is caused by the persistent identifiers not being persisted in the first place.
Any ideas? Thanks.
Hello there! Really excited about this year's additions to ImageAnalysisInteraction, especially the selectedText. Thank you!
My question is if there's a way to have multiple interactions for a given image analysis. For example, instead of being able to make just one text selection, I would like to support multiple.
In theory, I know multiple UIInteraction-conforming objects can be added to any view but I'm unsure if this is possible with ImageAnalysisInteraction.
I'm willing to create a custom UIInteraction, if you see a potential way forward there (would love to hear any ideas!).
Side question/feature request: UITextSelectionDisplayInteraction, which I assume ImageAnalysisInteraction might be using internally, allows handleViews customizations and others. I would be super useful if that was exposed through ImageAnalysisInteraction as well!
Looking forward to hearing your ideas. TIA!