IOS: Ambiguous use of init (CGImage)

I am trying to convert CGImage to CIImage ; however it does not work.

This line of code:

 let personciImage = CIImage(CGImage: imageView.image!.CGImage!) 

produces the following error

Ambiguous use of 'init (CGImage)'

I am really confused about what this error means.

I need to do this conversion because CIDetector.featuresInImage() from the CoreImage built-in framework requires CIImage

+5
source share
1 answer

I decided it myself.

Turns out I misused CGImage. The code should really read:

 let personciImage = CIImage(cgImage: imageView.image!.cgImage!) 

This does not cause errors.

+14
source

Source: https://habr.com/ru/post/1269953/


All Articles