我正在使用iOS开发iPhone应用程序.我需要添加GPUImage框架,我按照这个url添加目的.http://www.sunsetlakesoftware.com/2012/02/12/introducing-gpuimage-framework
现在我将GPUImage xcodeproject文件拖放到我的项目中.在此项目产品文件夹中有libGPImage.a文件.它显示空文件夹,在此文件中丢失.它显示为红色.我无法访问GPUImage类文件.为什么会这样.
谢谢,
我的应用程序在二进制图像上使用opencv的cv :: findContours.我现在需要实时.GPUImage有一个cannyedge过滤器,但我找不到任何与findContours相关的东西.GPUImage有什么与findContours非常相似的东西吗?如果没有,有人可以提出替代方案吗?谢谢
这是对先前但只有轻微相关问题的后续行动
我正在使用GPUImage库将滤镜应用到我的相机应用中的静态照片和视频.几乎所有东西都运转良好.我无法解决的另一个问题如下:
保存到该新网址的是具有正确持续时间但没有移动的视频.当我点击播放时,它只是一个静止图像,我认为是视频的第一帧.每当我将任何过滤器应用于从文件系统检索的视频时,都会发生这种情况.将过滤器应用于实时录制视频可以正常工作.我的代码如下.
任何人都可以告诉我如何修改这个以保存整个原始视频应用过滤器?
- (void)applyProcessingToVideoAtIndexPath:(NSIndexPath *)indexPath withFilter:(GPUImageFilter *)selectedFilter
{
NSArray *urls = [self.videoURLsByIndexPaths objectForKey:self.indexPathForDisplayedImage];
NSURL *url = [urls lastObject];
self.editedMovie = [[GPUImageMovie alloc] initWithURL:url];
assert(!!self.editedMovie);
[self.editedMovie addTarget:selectedFilter]; // apply the user-selected filter to the file
NSURL *movieURL = [self generatedMovieURL];
// A different movie writer than the one I was using for live video capture.
movieWriter = [[GPUImageMovieWriter alloc] initWithMovieURL:movieURL size:CGSizeMake(640.0, 640.0)];
[selectedFilter addTarget:movieWriter];
movieWriter.shouldPassthroughAudio = YES;
self.editedMovie.audioEncodingTarget = movieWriter;
[self.editedMovie enableSynchronizedEncodingUsingMovieWriter:movieWriter];
[movieWriter …Run Code Online (Sandbox Code Playgroud) 我试图通过将图像效果应用到屏幕截图来在我的玻璃中使用iOS 7风格的玻璃效果MKMapView.Apple提供的这个UIImage类别是我用作基线的.此方法使用输入值对源图像进行去饱和处理,应用色调颜色并大量模糊:
[image applyBlurWithRadius:10.0
tintColor:[UIColor colorWithRed:229/255.0f green:246/255.0f blue:255/255.0f alpha:0.33]
saturationDeltaFactor:0.66
maskImage:nil];
Run Code Online (Sandbox Code Playgroud)
这会产生我正在寻找的效果,但需要太长时间 - 在iPhone 4上渲染的时间.3和.5秒数之间.

我想使用优秀的,GPUImage因为我的初步尝试速度提高了大约5-10倍,但我似乎无法做到这一点.
GPUImagePicture *stillImageSource = [[GPUImagePicture alloc] initWithImage:image];
GPUImageSaturationFilter *saturationFilter = [[GPUImageSaturationFilter alloc] init];
saturationFilter.saturation = 0.33; // 1.0 - 0.66;
[stillImageSource addTarget:saturationFilter];
GPUImageMonochromeFilter *monochromeFilter = [[GPUImageMonochromeFilter alloc] init];
[monochromeFilter setColor:(GPUVector4){229/255.0f, 246/255.0f, 1.0f, 0.33f}];
[monochromeFilter setIntensity:0.2];
[saturationFilter addTarget:monochromeFilter];
GPUImageFastBlurFilter *blurFilter = [[GPUImageFastBlurFilter alloc] init];
blurFilter.blurSize = 2;
blurFilter.blurPasses = 3;
[monochromeFilter addTarget:blurFilter];
[saturationFilter prepareForImageCapture];
[monochromeFilter prepareForImageCapture]; …Run Code Online (Sandbox Code Playgroud) 我想使用GPUImage Android来实时处理视频.我看到使用不同的滤镜创建图片的示例,但我没有找到任何使用滤镜录制视频的示例.这可能与GPUImage Android有关吗?
我正在尝试为GPUImage项目创建绑定,但没有一个绑定类正在工作.例如,GPUImageView:
在ObjC中它被声明为这样(git中的头文件):
@interface GPUImageView : UIView <GPUImageInput>
//then some fields, properties and methods I'm not interested in
Run Code Online (Sandbox Code Playgroud)
所以,我的ApiDefinition.cs看起来像这样:
namespace GPUImage
{
[BaseType (typeof(NSObject))]
[Model]
interface GPUImageInput {
}
[BaseType (typeof(UIView))]
interface GPUImageView : GPUImageInput {
[Export ("initWithFrame:")]
IntPtr Constructor(RectangleF frame);
}
}
Run Code Online (Sandbox Code Playgroud)
LinkWithAttributes:
[assembly: LinkWith ("libGPUImage.a", LinkTarget.Simulator | LinkTarget.ArmV7 | LinkTarget.ArmV7s, ForceLoad = true, Frameworks = "CoreMedia CoreVideo OpenGLES QuartzCore AVFoundation UIKit Foundation")]
Run Code Online (Sandbox Code Playgroud)
它构建好并创建DLL.但是当我尝试在我的项目中使用它时:
var iv = new GPUImageView (new RectangleF (0, 0, 100, 100));
Run Code Online (Sandbox Code Playgroud)
抛出异常: …
当然,为背景设置纯色是微不足道的:
现在,使用"模糊"或"阴天"背景作为应用程序中的设计功能,而不是使用"普通灰色".
例如,这里有一对"模糊"的背景 - 它只是一种简单的颜色,可能有一些噪音,也可能是模糊的.
你可以看到这样的背景,考虑流行的饲料应用程序(whassapp等).这是我们今天的"时尚".
它发生在我身上,如果你能在Swift的代码中做到这一点,那就太棒了
注意:从PNG开始并不是一个优雅的解决方案:
希望可以从头开始以编程方式生成所有内容.
如果Inspector有一个IBDesignable风格的滑块,"添加时尚'颗粒'背景......",那将是很棒的- 在新时代应该是可能的!
image-processing ios dynamic-image-generation gpuimage swift
难以尝试调整特定通道的色调(或者更具体地说,特定范围的颜色 - 在这种情况下,红色).看着色调过滤器,我想也许我可能会通过注释掉绿色和蓝色修饰符来获得某个地方,只影响红色通道上的变化:
precision highp float;
varying highp vec2 textureCoordinate;
uniform sampler2D inputImageTexture;
uniform mediump float hueAdjust;
const highp vec4 kRGBToYPrime = vec4 (0.299, 0.587, 0.114, 0.0);
const highp vec4 kRGBToI = vec4 (0.595716, -0.274453, -0.321263, 0.0);
const highp vec4 kRGBToQ = vec4 (0.211456, -0.522591, 0.31135, 0.0);
const highp vec4 kYIQToR = vec4 (1.0, 0.9563, 0.6210, 0.0);
const highp vec4 kYIQToG = vec4 (1.0, -0.2721, -0.6474, 0.0);
const highp vec4 kYIQToB = vec4 (1.0, -1.1070, 1.7046, 0.0);
void main () …Run Code Online (Sandbox Code Playgroud) 我需要使用蒙版从完整图像剪切并创建蒙版图像.
+
=
我尝试了以下方法:
UIImage *imgMask = [UIImage imageNamed:@"Mask.png"];
UIImage *imgBgImage = [UIImage imageNamed:@"Full.png"];
GPUImageMaskFilter *maskingFilter = [[GPUImageMaskFilter alloc] init];
GPUImagePicture * maskGpuImage = [[GPUImagePicture alloc] initWithImage:imgMask ];
GPUImagePicture *FullGpuImage = [[GPUImagePicture alloc] initWithImage:imgBgImage ];
[maskGpuImage addTarget:maskingFilter];
[maskGpuImage processImage];
[maskingFilter useNextFrameForImageCapture];
[FullGpuImage addTarget:maskingFilter];
[FullGpuImage processImage];
UIImage *OutputImage = [maskingFilter imageFromCurrentFramebuffer];
Run Code Online (Sandbox Code Playgroud)
但是,我生成的输出图像是: 
请伙计们携起手来.干杯.
还有,感谢BradLarson.
我正在与cocoapods合作开发一个Swift项目.这是Podfile:
pod 'GPUImage', '~> 0.1.4'
Run Code Online (Sandbox Code Playgroud)
运行后pod install,我尝试得到导入文件的错误:
导入GPUImage

我从podfile中卸载了GPUImage,然后尝试第二个解决方案,我得到了不同的错误.
这个链接是github上的项目指令.我的步骤是:
将GPUImage.xcodeproj复制并粘贴到项目根目录中,并将其添加到我的项目中.
转到" 构建设置 " - >" 构建阶段 " - >" 目标依赖项 ",添加PUImageFramework,在Link Binary With Libraries部分,添加了GPUImage.framework.
但我得到一个错误:
error: unable to read module map contents from 'Source/iOS/Framework/module.modulemap': Error Domain=NSCocoaErrorDomain Code=260 "The file “module.modulemap” couldn’t be opened because there is no such file." UserInfo=0x7f872cfb0b80 {NSFilePath=/Users/william/A/muguang-ios/Source/iOS/Framework/module.modulemap, NSUnderlyingError=0x7f87413f4dd0 "The operation couldn’t be completed. No such file or directory"}
Run Code Online (Sandbox Code Playgroud)
任何帮助,thx!
编辑:
现在的错误是:
dyld: Library …Run Code Online (Sandbox Code Playgroud) gpuimage ×10
ios ×6
objective-c ×3
swift ×2
android ×1
binding ×1
core-image ×1
frameworks ×1
iphone ×1
mkmapview ×1
opencv ×1
opengl-es ×1
uiimage ×1
xamarin.ios ×1