gpuimage

How can I colour my sketch using pen tool within the limited edge boundaries using sobel edge detection/canny edge detection in ios swift?

廉价感情. 提交于 2019-11-30 18:48:29
问题 I am using GPUImage to detect the edge and applying GPUImageSobelEdgeDetectionFilter or GPUImageCannyEdgeDetectionFilter . Now my requirement is: How can I take the coordinate points from that image so that I can make drawing within the closed boundaries. Detect Edges from Image var image_p: GPUImagePicture? var filterImageview: UIImageView! // to display images let inputImage = filterImageview.image if let anImage = inputImage { image_p = GPUImagePicture(image: anImage) } let filter1 =

GPUImage Video with transparency over UIView

╄→尐↘猪︶ㄣ 提交于 2019-11-30 17:37:48
问题 I am working on an iOS project that uses AV-Out to show contents in a 1280x720 window on a second screen. I have a MPMoviePlayerController 's view as background and on top of that different other elements like UIImages and UILabels . The background movie plays in a loop. Now I want to overlay the whole view including all visible elements with another fullscreen animation that has transparency so that only parts of the underlying view are visible. I first tried a png animation with UIImageView

Chroma-Filtering video using GPUImage?

纵饮孤独 提交于 2019-11-30 15:58:09
I am attempting to display a video file with transparency inside my application using a transparency key ( RGB: 0x00FF00 , or full green) using @BradLarson's awesome GPUImage toolkit. However, I am experiencing some difficulties with the GPUImageChromaKeyFilter filter, and I don't quite understand why. My source video file is available in my dropbox here (12 KB, 3 seconds long, full green background, just a square on the screen), And I used the sample project titled SimpleVideoFilter . This is the code I attempted to use (I simply replaced -viewDidLoad ): NSURL *sampleURL = [[NSBundle

iOS Determine the corners of a Business Card in realtime

血红的双手。 提交于 2019-11-30 09:32:10
I want to implement a business card detecting functionality like this app ( https://scanbot.io ). The camera should detect a business card and automatically take a picture of it (only the business card). My idea was using BradLarson's GPUImage library, detect the corners (using the Harris corner detection algorithm), calculate the biggest rectangle with the corners obtained and crop the image contained inside the rectangle. Here is my code: - (void)setupFilter { videoCamera = [[GPUImageVideoCamera alloc] initWithSessionPreset:AVCaptureSessionPreset640x480 cameraPosition

GPUImageMovie pause while applying filter

徘徊边缘 提交于 2019-11-30 07:42:00
问题 I am using Brad Larson's great library GPUImage for my application. Currently I am stuck with an issue. My application captures 10 second videos and after that allows filter applying. While applying filters in GPUImageMovie , I am not able to pause the play and apply new filter so that video will play continuously without starting from the beginning. I saw an open github issue here. If anyone faced similar issue and found a solution, please post your answers. Thanks in advance. 回答1: And

Key differences between Core Image and GPUImage

荒凉一梦 提交于 2019-11-29 23:32:05
What are the major differences between the Core Image and GPUImage frameworks (besides GPUImage being open source)? At a glance their interfaces seem pretty similar... Applying a series of filters to an input to create an output. I see a few small differences, such as the easy to use LookupFilter that GPUImage has. I am trying to figure out why someone would choose one over the other for a photo filtering application. Brad Larson As the author of GPUImage, you may want to take what I say with a grain of salt. I should first say that I have a tremendous amount of respect for the Core Image team

Chroma-Filtering video using GPUImage?

谁说我不能喝 提交于 2019-11-29 23:08:00
问题 I am attempting to display a video file with transparency inside my application using a transparency key ( RGB: 0x00FF00 , or full green) using @BradLarson's awesome GPUImage toolkit. However, I am experiencing some difficulties with the GPUImageChromaKeyFilter filter, and I don't quite understand why. My source video file is available in my dropbox here (12 KB, 3 seconds long, full green background, just a square on the screen), And I used the sample project titled SimpleVideoFilter . This

GPUImage简单实用及碰到的问题

六月ゝ 毕业季﹏ 提交于 2019-11-29 20:54:37
正式开始之前先介绍一下GPUImage,这是一款基于OpenGL ES 2.0的开源图像处理库。在iOS上将OpenGL ES的使用封装成Objective-C接口,可以用来给图像、相机视频、视频等添加滤镜等渲染操作。GPUImage一代已经不再维护,OC只能给iOS和Mac使用;同时有GPUImage2使用Swift(基于Swift 3)开发,可以给Mac, iOS和Linux使用;最新的GPUImage3仍在开发完善中,基于Swift4,并且将OpenGL ES替换成苹果的Metal,由于是苹果官方封装GPU方法,可以预见会比使用OpenGL ES的性能效率更高。本文使用的仍是第一代GPUImage。 接入GPUImage使用cocoapods直接接入就行,就不再赘述。下面是一个简单的滤镜使用: GPUImage使用有三个关键点,input, output, filter(filter也是output但主要实现了滤镜,所以分开说)。output一般是用来承载图像内容输出,可以是GPUImageUIElement(通过UIView来创建并承载整个UIView的内容), GPUImagePicture(使用UIImage或者CGImage之类的图像来创建);filter就是所使用的滤镜,可以使用GPUImage自带的比如GPUImageGaussianBlurFilter,

iOS滤镜和贴纸功能

為{幸葍}努か 提交于 2019-11-29 15:39:13
一、iOS自带滤镜 1.CoreImage 使用苹果自带的CoreImage框架对图片进行处理,用CoreImage框架里的CIFilter对图片进行滤镜处理, 首先我们应该了解下CoreImage框架能够对图像进行那些处理和拥有哪些特效。 苹果给我们提供了将近200中滤镜效果 // 这里我们可以看到总共有多少种滤镜 NSArray *filterNames = [CIFilter filterNamesInCategory:@"CICategoryBuiltIn"]; NSLog(@"总共有%ld种滤镜效果:%@",filterNames.count,filterNames); //以一个具体分类中的滤镜信息 NSArray* filters = [CIFilter filterNamesInCategory:kCICategoryDistortionEffect]; for (NSString* filterName in filters) { NSLog(@"filter name:%@",filterName); // 我们可以通过filterName创建对应的滤镜对象 CIFilter* filter = [CIFilter filterWithName:filterName]; NSDictionary* attributes = [filter attributes]

iOS Determine the corners of a Business Card in realtime

萝らか妹 提交于 2019-11-29 14:21:18
问题 I want to implement a business card detecting functionality like this app (https://scanbot.io). The camera should detect a business card and automatically take a picture of it (only the business card). My idea was using BradLarson's GPUImage library, detect the corners (using the Harris corner detection algorithm), calculate the biggest rectangle with the corners obtained and crop the image contained inside the rectangle. Here is my code: - (void)setupFilter { videoCamera = [