久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

在 iOS5 中從 CIImage 創(chuàng)建 UIImage 時(shí)遇到問(wèn)題

Having trouble creating UIImage from CIImage in iOS5(在 iOS5 中從 CIImage 創(chuàng)建 UIImage 時(shí)遇到問(wèn)題)
本文介紹了在 iOS5 中從 CIImage 創(chuàng)建 UIImage 時(shí)遇到問(wèn)題的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

問(wèn)題描述

限時(shí)送ChatGPT賬號(hào)..

我正在使用 AVFoundation 框架.在我的示例緩沖區(qū)委托中,我有以下代碼:

I'm using the AVFoundation framework. In my sample buffer delegate I have the following code:

-(void)captureOutput:(AVCaptureOutput *)captureOutput didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer fromConnection:(AVCaptureConnection *)connection{
     CVPixelBufferRef pb = CMSampleBufferGetImageBuffer(sampleBuffer);
     CIImage *ciImage = [CIImage imageWithCVPixelBuffer:pb];
     self.imageView.image = [UIImage imageWithCIImage:ciImage];
}

我可以使用 CIImage 來(lái)運(yùn)行人臉檢測(cè)器等,但它沒(méi)有顯示在 UIImageView 中……imageView 仍然是白色的.關(guān)于這個(gè)問(wèn)題的任何想法?我正在使用以下內(nèi)容來(lái)設(shè)置我的會(huì)話:

I am able to use the CIImage to run the face detector etc. but it does not show up in the UIImageView ... the imageView remains white. Any ideas as to the problem? I am using the following to setup my session:

    self.session = [[AVCaptureSession alloc] init];
self.session.sessionPreset = AVCaptureSessionPreset640x480;
self.videoDevice = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo];
self.videoInput = [AVCaptureDeviceInput deviceInputWithDevice:videoDevice error:nil]; 
self.frameOutput = [[AVCaptureVideoDataOutput alloc] init];
self.frameOutput.videoSettings = [NSDictionary dictionaryWithObject:[NSNumber numberWithInt:kCVPixelFormatType_32BGRA] forKey:(id)kCVPixelBufferPixelFormatTypeKey];

推薦答案

這可能會(huì)有所幫助.這段代碼我遇到了同樣的問(wèn)題(圖像沒(méi)有被繪制到屏幕上):

This might help. I was having the same issue (image not being drawn to screen) with this code:

CIImage *image = [[CIImage alloc] initWithImage:[UIImage imageNamed:@"mushroom.jpg"]];

theImageView.image = [UIImage imageWithCIImage:image];

但是,在將代碼更改為此之后,它現(xiàn)在可以正常工作了:

However, after changing the code to this, it now works correctly:

CIImage *image = [[CIImage alloc] initWithImage:[UIImage imageNamed:@"mushroom.jpg"]];

CIContext *context = [CIContext contextWithOptions:nil];

theImageView.image = [UIImage imageWithCGImage:[context createCGImage:image fromRect:image.extent]];

要了解有關(guān) CIContext 的更多信息,請(qǐng)查看此處:http://developer.apple.com/library/ios/#DOCUMENTATION/GraphicsImaging/Reference/QuartzCoreFramework/Classes/CIContext_Class/Reference/Reference.html#//apple_ref/occ/cl/CIContext

To read more about CIContext take a look here: http://developer.apple.com/library/ios/#DOCUMENTATION/GraphicsImaging/Reference/QuartzCoreFramework/Classes/CIContext_Class/Reference/Reference.html#//apple_ref/occ/cl/CIContext

這篇關(guān)于在 iOS5 中從 CIImage 創(chuàng)建 UIImage 時(shí)遇到問(wèn)題的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來(lái)源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問(wèn)題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!

相關(guān)文檔推薦

Using Instruments to test an iOS app without having source code to the application(在沒(méi)有應(yīng)用程序源代碼的情況下使用 Instruments 測(cè)試 iOS 應(yīng)用程序)
KIF: How to auto-run/stress test an iOS app to find the cause of a rare UI bug?(KIF:如何自動(dòng)運(yùn)行/壓力測(cè)試 iOS 應(yīng)用程序以找出罕見(jiàn) UI 錯(cuò)誤的原因?)
Can#39;t change target membership visibility in Xcode 4.5(無(wú)法更改 Xcode 4.5 中的目標(biāo)成員身份可見(jiàn)性)
UITableView: Handle cell selection in a mixed cell table view static and dynamic cells(UITableView:在混合單元格表視圖靜態(tài)和動(dòng)態(tài)單元格中處理單元格選擇)
How to remove Address Bar in Safari in iOS?(如何在 iOS 中刪除 Safari 中的地址欄?)
iOS 5 SDK is gone after upgrade to Xcode 4.5(升級(jí)到 Xcode 4.5 后,iOS 5 SDK 消失了)
主站蜘蛛池模板: 一区在线观看视频 | 夜夜肉她怀孕h周君彦 | 九九热视频在线观看 | 久久久久一区 | 国产三级在线免费观看 | 国产精品美女久久 | 99热在线免费观看 | 欧美精品乱码99久久蜜桃 | 国产成人亚洲精品自产在线 | 国产91视频在线观看 | 五月激情丁香 | 国产一区二区三区精品视频 | 亚洲综合伊人 | 日本黄色中文字幕 | 日本免费观看视频 | www.色婷婷 | 亚洲免费在线视频 | 午夜激情福利视频 | 亚洲天天 | 久久精品视频一区二区 | 亚洲免费观看视频 | 精品视频免费在线观看 | 中文字幕视频在线 | 欧美二三区| 日本在线视频观看 | 成人三级在线 | 成人午夜视频在线观看 | 欧美午夜精品一区二区三区 | 能看的毛片 | 中文字幕av网 | 天天草天天草 | av在线免费观看网站 | 婷婷中文网 | 不卡免费视频 | 美日韩精品| 日韩一区二区三区在线 | 9.1成人看片免费版 999在线视频 | 91在线成人 | 欧美视频精品 | 国产午夜视频在线观看 | 日韩综合久久 |