问题标签 [ciimage]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
1275 浏览

ios - 为什么 CIImage 的 properties 方法返回 nil

我正在使用 coreImage 框架开发一个应用程序。我从 UIImage 创建了一个 CIImage。

这里 self.canvasImage 是一个 UIImage,我对其进行调试,并且对象图像正在由编译器创建并具有一些内存。

我正在使用以下代码创建由属性方法返回的 NSDictionary 对象。

这里我的 opts 对象被赋值为nil

我搜索了它但没有找到解决方案,为什么 properties 方法返回 nil 值?

0 投票
1 回答
181 浏览

ios - 使用相机拍照并将图像过滤器应用于图片但过滤器需要时间来应用于图像

使用相机拍照并将图像过滤器应用于图片但过滤器需要时间才能应用于图像。过滤器非常慢。任何人都可以建议减少过滤时间。

我已经使用以下链接实现了过滤器。 https://github.com/esilverberg/ios-image-filters

请建议我最快的方式,如 Instagram 过滤器。

0 投票
0 回答
1010 浏览

ios - CIDetector在ios7中没有检测到人脸

我想检测面部并从中裁剪面部,但是当我使用 imagePicker 捕获图像时,检测后的面部特征数组会给出一个空数组。但是,当我过去提供示例图像(jpg)时,已检测到脸部。

我检测面部特征的代码

任何帮助表示赞赏。

0 投票
2 回答
1873 浏览

ios - CGImageCreateWithMaskingColors 返回 null

我有一个带有黑色文本的视图,我想围绕它创建一个白色的“发光”。我想我可以通过截取屏幕截图、反转颜色(只有黑色和白色)、将黑色遮盖为透明,然后在每个方向上“抖动”生成的图像来做到这一点。当我尝试用 CGImageCreateWithMaskingColors 掩盖黑色时,我得到一个空的 CGImageRef。到目前为止,这就是我所拥有的。

我知道 alpha 通道会破坏作品,但我真的不认为我在这里有任何 alpha 通道。只是为了检查我做CGImageGetColorSpace(ref)了并得到了kCGColorSpaceDeviceRGB,没有 alpha 通道。

有人可以告诉我哪里出错了吗?可选地,帮助我理解 UIImage、CIImage 和 CGI​​mage 之间差异的快速评论会很棒。

0 投票
2 回答
7466 浏览

ios - CIImage内存泄漏

我正在使用下面的方法来模糊一些图像。使用 CIImage 泄漏的工具。我尝试将它们包装在@autoreleasepool 中,但没有运气。有任何想法吗?

0 投票
13 回答
27195 浏览

objective-c - 将黑白滤镜应用于 UIImage

我需要在 UIImage 上应用黑白滤镜。我有一个视图,其中有一张用户拍摄的照片,但我对转换图像的颜色没有任何想法。

我怎样才能做到这一点?

0 投票
1 回答
4646 浏览

ios - 什么是用于人脸检测的 kCGImagePropertyOrientation?

https://developer.apple.com/library/ios/documentation/graphicsimaging/Conceptual/CoreImaging/ci_detect_faces/ci_detect_faces.html

@ 清单 2-1 创建人脸检测器

4.建立一个选项字典来寻找面孔。让 Core Image 知道图像方向很重要,这样检测器才能知道在哪里可以找到直立的面孔。大多数时候,您将从图像本身读取图像方向,然后将该值提供给选项字典。

这个图像道具的方向应该是什么?
什么样的对象?
我该如何设置?

0 投票
2 回答
713 浏览

objective-c - 来自 NSURL 的 CGImage 可以工作,但不能来自 UIImage

我在将滤镜应用于图像时遇到了一些问题。以下代码在使用 CIImage:imageWithContentsOfURL 时完美运行:

Filter 只是一个持有过滤器名称和 CIFilter 的模型:

但是当我尝试使用以下代码加载本地 UIImage 时:

过滤后的图像只会变白(或消失)。我究竟做错了什么?

0 投票
2 回答
3602 浏览

macos - Adding filters to video with AVFoundation (OSX) - how do I write the resulting image back to AVWriter?

Setting the scene

I am working on a video processing app that runs from the command line to read in, process and then export video. I'm working with 4 tracks.

  1. Lots of clips that I append into a single track to make one video. Let's call this the ugcVideoComposition.
  2. Clips with Alpha which get positioned on a second track and using layer instructions, is set composited on export to play back over the top of the ugcVideoComposition.
  3. A music audio track.
  4. An audio track for the ugcVideoComposition containing the audio from the clips appended into the single track.

I have this all working, can composite it and export it correctly using AVExportSession.

The problem

What I now want to do is apply filters and gradients to the ugcVideoComposition.

My research so far suggests that this is done by using AVReader and AVWriter, extracting a CIImage, manipulating it with filters and then writing that out.

I haven't yet got all the functionality I had above working, but I have managed to get the ugcVideoComposition read in and written back out to disk using the AssetReader and AssetWriter.

As you can see, I can even get the CIImage from the CMSampleBuffer, and I'm confident I can work out how to manipulate the image and apply any effects etc. I need. What I don't know how to do is put the resulting manipulated image BACK into the SampleBuffer so I can write it out again.

The question

Given a CIImage, how can I put that into a sampleBuffer to append it with the assetWriter?

Any help appreciated - the AVFoundation documentation is terrible and either misses crucial points (like how to put an image back after you've extracted it, or is focussed on rendering images to the iPhone screen which is not what I want to do.

Much appreciated and thanks!

0 投票
1 回答
225 浏览

core-image - xcode5:如何使用内置的 Core Image 过滤器?

我是开发 iOS 应用程序的新手。我想在我的应用程序中使用内置的核心图像过滤器。但我不知道如何使用它们。我已经创建了“CISephiaTon”过滤器。现在我想创建“CIPhotoEffectTransfer”过滤器。但我不知道我该怎么做=(有没有人知道一个很好的教程或者可以给我一个在 xcode 5 中应用核心图像过滤器的教程?

这是我要添加的过滤器。有人可以给我这个过滤器的代码吗?

希望可以有人帮帮我。