使用QCView和iSight捕获图像
我有一个 QCView,它加载一个 Quartz 文件,该文件为您提供 iSights 反馈(基本上像 QTCaptureView)
一切都显示良好
按钮只需使用以下简单的代码行拍摄快照
- (void)takePicture:(id)sender {NSImage *currentImage = [outputView valueForOutputKey:@"ImageOutput"];
[[currentImage TIFFRepresentation] writeToFile:@"/Users/hendo13/Desktop/capture.tiff" atomically:NO];}
然而,导出的图像有一些非常奇怪的着色问题,如下所示: http://kttns.org/gjhnj
未应用任何类型的过滤器。有谁知道是什么原因造成的?
I have a QCView that loads a Quartz file which gives you iSights feedback (basically like a QTCaptureView)
Everything displays fine
The button simply takes a snapshot using the following simple lines of code
- (void)takePicture:(id)sender {NSImage *currentImage = [outputView valueForOutputKey:@"ImageOutput"];
[[currentImage TIFFRepresentation] writeToFile:@"/Users/hendo13/Desktop/capture.tiff" atomically:NO];}
The exported image however has some very wonky colouring issues like so:
http://kttns.org/gjhnj
No filters of any sort have been applied. Does anyone know what is causing this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
它是颠倒的。您可以使用 CIInvert 过滤器来纠正它(假设无法纠正 QC 视图的实际输出)。
哦,我认为蓝色和
绿色alpha 通道也是错误的(可能是字节序问题?)。如果您使用 CIInvert 解决方案,则可以使用 CIColorMatrix 重新排列通道,将蓝色和绿色交换回正确的位置。 这是一个我为它编写的教程 - 我为 Core Image Fun House 中的用户界面编写了它,但是一旦您了解了过滤器的工作原理,以编程方式使用它应该不会太难。It's inverted. You can use the CIInvert filter to correct it (assuming there's no way to correct the actual output of the QC view).
Oh, and I think the blue and
greenalpha channels are the wrong way around, too (possibly an endianness problem?). If you go with the CIInvert solution, you can use CIColorMatrix to rearrange the channels, swapping blue and green back to their proper places. Here's a tutorial I wrote for it—I wrote it for the user interface in Core Image Fun House, but using it programmatically shouldn't be too hard once you understand how the filter works.