Questions tagged [cidetector]

A CIDetector object uses image processing to search for and identify notable features (faces, rectangles, and barcodes) in a still image or video. Detected features are represented by CIFeature objects that provide more information about each feature. This is available in iOS 5.0 and later

CIDetector class can maintain many state variables that can impact performance. So for best performance, reuse CIDetector instances instead of creating new ones.

Example:

 CIDetector* detector = [CIDetector detectorOfType:CIDetectorTypeFace
       context:nil options:[NSDictionary dictionaryWithObject:CIDetectorAccuracyHigh forKey:CIDetectorAccuracy]];

Detector Types

Strings used to declare the detector for which you are interested.

Declaration

OBJECTIVE-C

  NSString* const CIDetectorTypeFace;
  NSString* const CIDetectorTypeRectangle;
  NSString* const CIDetectorTypeQRCode;
  NSString* const CIDetectorTypeText;
48 questions
22
votes
2 answers

Represent CIRectangleFeature with UIBezierPath - Swift

Currently I am using a CIDetector to detect rectangles in my UIImage. I am doing the suggested way in which you pass the coordinates into a filter to get back a CIImage to put over the taken UIImage. It looks like this: func…
John55
  • 301
  • 2
  • 11
6
votes
0 answers

Why isn't my face detection code using CIDetector working properly?

I'm trying to detect faces in my iOS camera app, but it doesn't work properly, while it works properly in Camera.app. Notice that: The first face isns't detected in my app, only in Camera.app. For the third face — the east asian woman — Camera.app…
Kartick Vaddadi
  • 4,818
  • 6
  • 39
  • 55
6
votes
2 answers

How to crop detected rectangle in Image with CIDetector and Swift

I am working on an app that detect id cards and i am trying to use CIDetector built in ios to detect rectangle shape objects on live preview. i am using the solution explained in this tutorial here CoreImage Detectors i am getting the flowing result…
Ayoub
  • 138
  • 1
  • 3
  • 8
6
votes
1 answer

CIDetector Perspective And Crop in Swift

I've implemented a CIDetector in my app to detect rectangles on a image, but now how can i use the returned CGPoint's to crop the image so that i can display it back? For the perspective i've tried applying the CIPerspectiveCorrection filter, but…
Sam Bing
  • 2,794
  • 1
  • 19
  • 29
5
votes
0 answers

CIDetector won't release memory - swift

After the face detection is done the memory will not release, is there is a way I could release it (the memory stay at 300MB after the process is done). autoreleasepool{ manager.requestImageData(for: asset, options: option){ (data,…
Idan Aviv
  • 1,253
  • 2
  • 13
  • 23
4
votes
3 answers

Using CIDetector to scan bar Codes (1 and 2 dimentional)

I want to scan qr and bar codes both from live camera and from image. I previously used ZBar library to scan codes. It doesn't scan specific types of qr and bar codes. Also Apple's AVFoundation framework seems like more fast and accurate while…
Jaffer Sheriff
  • 1,444
  • 13
  • 33
4
votes
1 answer

How to change CIDetector orientation?

So I am trying to make a text detector using CIDetector in Swift. When I point my phone at a piece of text, it doesn't detect it. However, if I turn my phone to the side, it works and detects the text. How can I change it so that it detects text at…
Henry P.
  • 222
  • 1
  • 2
  • 9
4
votes
1 answer

CIDetectorTypeRectangle to detect multiple rectangles

when using CIDetectorTypeRectangle I can only (hardly) detect only one rectangle in my camera image, but I want to detect multiples rectangles. Its possible to detecte multiple rectangle as is possible to detect multiple faces ??
otitserip
  • 61
  • 4
3
votes
0 answers

Android Image Rectangle Detection with NO OpenCV

I'm baffled that on Android we have to import a 30 MB OpenCV library to detect rectangles in images / video frames. On iOS that is pretty easy using CIDetector. Has anyone found a solution that isn't OpenCV based? Maybe using Renderscript? I've…
harry248
  • 591
  • 5
  • 8
3
votes
1 answer

Translate detected rectangle from portrait CIImage to landscape CIImage

I am modifying code found here. In the code we are capturing video from the phone camera using AVCaptureSession and using CIDetector to detect a rectangle in the image feed. The feed has an image which is 640x842 (iphone5 in portrait). We then do…
Avner
  • 4,286
  • 2
  • 35
  • 42
3
votes
1 answer

Can CIDetector returns more than one CIFeature of type CIDetectorTypeRectangle?

I also found this question on Apple Dev Forum. Is it possible for a CIDetector set with CIDetectorTypeRectangle to return more than just one rectangle? At the moment, this code always return a feature.count of 0 or 1, even if the picture is full of…
Tulleb
  • 8,919
  • 8
  • 27
  • 55
3
votes
1 answer

How to draw detected rectangle path on live camera feed using CAShapeLayer and UIBezeirPath

I am developing an application to detect rectangles in a live camera feed and highlight the detected rectangle. I did camera thing using AVFoundation and used below methods in order to do detect and highlight the detected rectangle. var detector:…
Hanushka Suren
  • 723
  • 3
  • 10
  • 32
3
votes
0 answers

CIDetector RectOfInterest

What I need todo is make a Scanner to scan the documents. Currently I am using CIDetector to detect any rectangle using type CIDetectorTypeRectangle func detectRectangleInScanner() -> CIDetector { let options: [String: AnyObject] =…
Himanshu Joshi
  • 3,391
  • 1
  • 19
  • 32
3
votes
1 answer

Does CIDetector For other Barcode Types

I am looking at CIDetectorTypeQRCode. How can I detect other types of barcodes? I can read other barcode types via AVMetadataObjectType, however I want to do the same with CIDetector. I am trying to achieve real time highlighting of the…
Theopile
  • 868
  • 3
  • 14
  • 30
3
votes
0 answers

CIDetectorTypeQRCode typed CIDetector doesn't instantiate properly

I try to scan a QR code from an image with the following code. Basically my problem is that "prepareQRCodeDetector" returns nil (at least on iPhone 5s, didn't test on another device yet) Notice that CIDetectorTypeFace returns a working…
Mikael
  • 2,355
  • 1
  • 21
  • 45
1
2 3 4