使用QCView和iSight捕获图像

发布于 2024-08-11 11:55:21 字数 503 浏览 3 评论 0原文

我有一个 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

情仇皆在手 2024-08-18 11:55:21

它是颠倒的。您可以使用 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 green alpha 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文