Tag: gpuimage

iPhone 4S上的GPUImage Kuwahara滤镜

我正在使用Brad Larson的GPUImage框架。 但是,当我试图应用滤波器半径为5.0f kuwahara滤波器,我得到了iPhone 4S的文物。 (在更高性能的设备上工作正常) 源图像大小是2048x2048px. 通过阅读原始开发人员的评论,我了解到有一种看门狗定时器,当GPU花费太长时间运行时会触发。 所以我的问题是,什么是最大可能的分辨率为iPhone 4S我可以申请Kuwahara滤波器半径5.0f没有得到文物?

GPUImage swift iOS 7

有人用Swift和GPUImage为iOS 7+发布了应用程序吗? 当我试图发布一个应用程序,我得到错误(这不是我的屏幕,但我得到相同的) 应用程序在ios 7的所有设备和模拟器上都非常完美,我也通过testflight将其作为adhoc发送,并且仍然可以工作,但是现在我无法发布。

GPUImage混合filter

我正在尝试将混合filter应用于2张图片。 我最近更新GPUImage到最后的版本。 为了使事情变得简单,我修改了SimpleImageFilter的例子。 这里是代码: UIImage * image1 = [UIImage imageNamed:@"PGSImage_0000.jpg"]; UIImage * image2 = [UIImage imageNamed:@"PGSImage_0001.jpg"]; twoinputFilter = [[GPUImageColorBurnBlendFilter alloc] init]; sourcePicture1 = [[GPUImagePicture alloc] initWithImage:image1 ]; sourcePicture2 = [[GPUImagePicture alloc] initWithImage:image2 ]; [sourcePicture1 addTarget:twoinputFilter]; [sourcePicture1 processImage]; [sourcePicture2 addTarget:twoinputFilter]; [sourcePicture2 processImage]; UIImage * image = [twoinputFilter imageFromCurrentFramebuffer]; 返回的图像是nil应用一些断点我可以看到filter内部的方法失败- (CGImageRef)newCGImageFromCurrentlyProcessedOutput的问题是, framebufferForOutput是nil.Im使用模拟器。 我不明白为什么它不工作。

使用GPUImage在OpenGL ES着色器中使用bool返回types

我正在使用GPUImage框架在iOS项目上工作。 我无法让我的着色器编译。 在我的片段着色器中有一个函数: const vec2 boundMin = vec2(0.0, 0.0); const vec2 boundMax = vec2(1.0, 1.0); bool inBounds (vec2 p) { return all(lessThan(boundMin, p)) && all(lessThan(p, boundMax)); } 着色器编译日志: ERROR: 0:1: '_Bool' : syntax error syntax error 当我replace所有的function inBounds(vec2 p) 同 all(lessThan(boundMin, p)) && all(lessThan(p, boundMax)) 它很好用! 问题: OpenGL ES 2.0 Fragment Shader是否支持boolfunction? 如果是这样,我哪里错了? 如果没有,为什么有像all() , […]

现有UIImage上的GPUImage Harrisangular点检测提供了黑屏输出

我已经成功地将一个十字线发生器和哈里斯angular点检测滤镜添加到GPUImageStillCamera输出,以及来自GPUImageVideoCamera实时video。 我现在试图让这个工作在UIImageView上的照片集,但不断得到一个黑屏作为输出。 我一直在阅读GitHub上列出的与Brad Larson的GPUImage项目有关的问题,但是他们似乎更多的是关于混合types的filter,在那里我仍然面临同样的问题。 我已经尝试改变每一行代码以遵循我所见过的各种示例,并遵循Brad示例项目中的Brad示例代码,但结果始终如一。 我目前的代码是,一旦我拍了一张照片(我确认这张照片不仅仅是一张黑色照片): GPUImagePicture *stillImageSource = [[GPUImagePicture alloc] initWithImage:self.photoView.image]; GPUImageHarrisCornerDetectionFilter *cornerFilter1 = [[GPUImageHarrisCornerDetectionFilter alloc] init]; [cornerFilter1 setThreshold:0.1f]; [cornerFilter1 forceProcessingAtSize:self.photoView.frame.size]; GPUImageCrosshairGenerator *crossGen = [[GPUImageCrosshairGenerator alloc] init]; crossGen.crosshairWidth = 15.0; [crossGen forceProcessingAtSize:self.photoView.frame.size]; [cornerFilter1 setCornersDetectedBlock:^(GLfloat* cornerArray, NSUInteger cornersDetected, CMTime frameTime, BOOL endUpdating) { [crossGen renderCrosshairsFromArray:cornerArray count:cornersDetected frameTime:frameTime]; }]; [stillImageSource addTarget:crossGen]; [crossGen addTarget:cornerFilter1]; [crossGen prepareForImageCapture]; [stillImageSource […]

GPUImage遮罩透明度

我在我的应用程序中使用Brad Larson的GPUImage框架,我需要制作mask.jpg和照片的掩码。 所以蒙版图像是黑色背景和白色几何graphics的两种颜色图像。 所以基本上掩蔽工作,问题是我不能做掩码的透明度。 为了使我需要将mask.png的黑色replace为更浅的颜色(更多灰色到白色)。 所以我试图从这里使用代码 想用另一种颜色 – iPhone来改变图像中的特定颜色 但它不起作用,阿尔法设置为0,我不知道为什么。 我试图debugging,一切似乎都很好,但它返回一个UIImage与透明的颜色,而不是黑色。 有没有办法让它没有coregraphics。 也许coreimage?

与GPUImageView混合没有给予预期的结果

当我使用GPUImageView混合时,他们似乎不工作。 例如,将结果抓取到图像中的test1,并把它放到一个imageView的作品…哪里设置GPUImageView作为目标的test2似乎并不工作。 test1给我预期的图像…与我的testing图像test2给我一个黑屏。 + (void)test1:(UIImage*)image imageView:(UIImageView*)imageView { GPUImagePicture *pictureBase = [[GPUImagePicture alloc] initWithImage:image]; GPUImagePicture *pictureOverlay = [[GPUImagePicture alloc] initWithImage:[UIImage imageNamed:@"overlay.png"]]; GPUImageMultiplyBlendFilter *filter = [[GPUImageMultiplyBlendFilter alloc] init]; [pictureBase addTarget:filter]; [pictureOverlay addTarget:filter]; [pictureBase processImage]; [pictureOverlay processImage]; imageView.image = [filter imageFromCurrentlyProcessedOutputWithOrientation:UIImageOrientationUp]; } + (void)test2:(UIImage*)image gpuImageView:(GPUImageView*)gpuImageView { GPUImagePicture *pictureBase = [[GPUImagePicture alloc] initWithImage:image]; GPUImagePicture *pictureOverlay = [[GPUImagePicture alloc] initWithImage:[UIImage […]

GPUImage着色器与“错误:一个或多个附加着色器未成功编译”

我想基于这个Javascript为GPUImage构build一个Vibrancefilter: /** * @filter Vibrance * @description Modifies the saturation of desaturated colors, leaving saturated colors unmodified. * @param amount -1 to 1 (-1 is minimum vibrance, 0 is no change, and 1 is maximum vibrance) */ function vibrance(amount) { gl.vibrance = gl.vibrance || new Shader(null, '\ uniform sampler2D texture;\ uniform float amount;\ varying vec2 […]

GPUImage的GPUImageOpacityFilter行为不如预期,不会更改Alpha通道

我正在尝试使用库存图像的不透明度低于100%的照相机输出的输出来执行库存图像的Overlay Blend 。 我想我可以放置一个GPUImageOpacityFilter在filter堆栈,一切都会好的: GPUImageVideoCamera – > MY_GPUImageOverlayBlendFilter GPUImagePicture – > GPUImageOpacityFilter(Opacity 0.1f) – > MY_GPUImageOverlayBlendFilter MY_GPUImageOverlayBlendFilter – > GPUImageView 但是,结果并不是GPUImagePicture的0.1f alpha版本混合到GPUImageVideoCamera中,它导致了软化GPUImagePicture的颜色/对比度和混合。 所以我做了一些search,并尝试使用imageFromCurrentlyProcessedOutput从GPUImageOpacity筛选器中获取UIImage并将其发送到BlendFilter: GPUImagePicture – > MY_GPUImageOpacityFilter(Opacity 0.1f) [MY_GPUImageOpacityFilter imageFromCurrentlyProcessedOutput] – > MY_alphaedImage GPUImagePicture(MY_alphaedImage) – > MY_GPUImageOverlayBlendFilter GPUImageVideoCamera – > MY_GPUImageOverlayBlendFilter MY_GPUImageOverlayBlendFilter – > GPUImageView 这和我所期望的完全一样。 那么,为什么我必须要imageFromCurrentlyProcessedOutput ,不应该只是发生在线? 这里是上面两个场景的代码片段: 第一: //Create the GPUPicture UIImage *image […]

旋转GPUImageTiltShiftFilter – GPUImage

我想要一个非水平的GPUImageTiltShiftFilter旋转。 我想旋转到任意的旋转angular度。 我也想要filter是快速的,它可以与UIRotationGestureRecongizer用户界面旋转。 我该怎么做呢?