Methods to acquire, analyze and understand images using mathematical approaches.
Questions tagged [vision]
664 questions
2
votes
0 answers
iOS Attention Aware Features usage
How can I detect if the user's attention is on iphone. The same function as the faceID, detect if the user is looking at the iphone.
Tried the vision framework but I was not successfull. Any code or documentation would be very helpful.

XCozi
- 23
- 2
2
votes
1 answer
Trouble assigning text recognized by Swift's Vision library to the instance attribute of a struct for display
I am trying to read text from an image using Swift's Vision library. I followed this guide - https://developer.apple.com/documentation/vision/recognizing_text_in_images.
With respect to my code, the image in question is self.image, which is a…

Jaiz
- 23
- 4
2
votes
2 answers
Quantize Image using PIL and numpy
I have an image that I want to perform quantization on it. I want to use PIL and Numpy libraries and the original image is:
and I expect the output for 2-level quantization to be like this:
but the output is like this:
What am I doing wrong?
from…

Shadow23548
- 33
- 3
2
votes
1 answer
Enable/Disable torch with DataScannerViewController
On iOS16, I try to use the DataScannerViewController (for barcode reading) to remplace old way with Vision but when I enable the torch, DataScannerViewController is freezing...
The code to enable/disable torch :
guard let device =…

neilaur
- 71
- 6
2
votes
0 answers
How to calculate binary segmentation metrics?
I am working on a binary segmentation problem using Pytorch. I want to know the correct way of calculating metrics like precision, recall, f1-score, mIOU, etc for my test set. From many of the online codes available, I found different ways of…

Vanshali
- 21
- 1
2
votes
0 answers
VNSequenceRequestHandler VNTrackRectangleRequest iOS16 limit error
On iOS 15 and lower all good, issue appear only on iOS 16.
+ (void)load
{
// test image with rect
CIImage * image = [ [ CIImage alloc ] initWithData:[ NSData dataWithContentsOfURL:[ NSURL…

Alexandr Hotko
- 73
- 6
2
votes
1 answer
Vertical text recognition with VNRecognizeTextRequest
During some tests on a iOS app (written in Swift 5) I’m working on I found problems with the recognition of text written vertically with VNRecognizeTextRequest. I also examined the modifiable parameters of VNRecognizeTextRequest but nothing…

Federico Rotoli
- 71
- 3
2
votes
1 answer
Swift iOS - Vision framework text recognition and rectangles
I was trying to draw rectangles on the text area found using the Vision framework but they are always a little bit off. I am doing it like this:
public func drawOccurrencesOnImage(_ occurrences: [CGRect], _ image: UIImage) -> UIImage? {
…

Filip Z
- 59
- 5
2
votes
1 answer
What do the values in a CVPixelBuffer mean that is returned from a VNGeneratePersonSegmentationRequest?
I use Apple's Vision Framework to create a matte image for a person that is found in a user provided image. I want to analyze the results from a VNGeneratePersonSegmentationRequest to understand, for example, if the request has found a person at all…

Theo
- 3,826
- 30
- 59
2
votes
1 answer
TextClassification/ Extraction from image How to get single text frame and string Using Core ML from a Image
Need to mark the rec boxes around string and then to get that string after tapping

Hritik Singh
- 101
- 7
2
votes
1 answer
Google Cloud Vision not recognizing Tibetan Characters
Hi i want to recognize Tibetan text from image, but it extracts garbage text..
Is there a way to fix this issue? this is image i used to extract text on that

rajesh monogaran
- 21
- 1
2
votes
3 answers
How to detect barcode using Apple Vision in CGRect only?
I have an app that uses a CGRect(x: 0, y: 0, width: 335, height: 150) to show the camera for barcode scanning. However when presented a barcode off camera (not in the CGRect) will get scanned. How can I limit the area for scanning to the CGRect in…

Paul S.
- 1,342
- 4
- 22
- 43
2
votes
1 answer
Create a LabVIEW IMAQ image from a binary buffer/file with and without NI Vision
Assume you have a binary buffer or file which represents a 2-dimensional image.
How can you convert the binary data into a IMAQ image for further processing using LabVIEW?

John
- 1,313
- 9
- 21
2
votes
2 answers
Python & OpenCV: How to crop half-formed bounding boxes
I have a script that creates gridlines for a gridless table:
Before script:
After script:
Is there a simple way, using OpenCV, to crop the "after script" image so that it includes only the four-sided bounding boxes? Sample output:
EDIT:
I'm…

mmz
- 1,011
- 1
- 8
- 21
2
votes
4 answers
iPhone capture session: Set custom frame-rate
I've set up a captureSession and am now trying to set the framerate to 60. I am using an iPhone 12 Pro Max.
I am trying to set the frame rate with:
videoDevice?.activeVideoMinFrameDuration = CMTimeMake(value: 1, timescale: 60)
However, printing my…