Tag: image processing

如何在图像上实现“重塑效果”

在我的IOS应用程序。 我需要在图像上实施“重塑效果”。 我search了很多,但没有得到期望的效果。 我需要这样的影像平移。

用高度信息迭代UIImage的各个像素

我正试图自动裁剪上面和下面有多余白色的图像。 我试图遍历图像的像素来find第一个非白色像素设置为从顶部裁剪适当的高度,然后使用最后一个非白色像素作为合适的高度从底部。 我试图使用CGBitmapContextGetData来生成单个像素,但据我所知,这只能保留图片的RGB颜色,所以像素高度的信息将丢失。 有谁知道任何方式遍历UIImage的个别像素,同时能够访问这些图片的高度信息? 谢谢。

GPUImage:GPUImageToneCurveFilter不起作用

我已经设法在我的应用程序中使用GPUImage,并尝试在button点击时将滤镜放入我的照片中,但还有另一个问题。 GPUImageFilter *selectedFilter; if (sender.tag == 1) { selectedFilter = [[GPUImageFilter alloc] init]; } else if (sender.tag == 2) { selectedFilter = [[GPUImageThresholdEdgeDetection alloc] init]; } else if (sender.tag == 3) { selectedFilter = [[GPUImageSketchFilter alloc] init]; } else if (sender.tag == 4) { selectedFilter = [[GPUImageToneCurveFilter alloc] initWithACV:@"crossprocess.acv"]; } else if (sender.tag == 5) […]

Leptonica申请门槛

我正在尝试使用leptonica的pixOtsuAdaptiveThreshold函数,但运气不大。 我不知道如果我做的是正确的,但我想采取UIImage(objective-C),应用pixOtsuAdaptiveThreshold,然后转换回UIImage。 当我用传入的参数调用pixOtsuAdaptiveThreshold时,它崩溃了。 谁能告诉我我做错了什么? 我一直在为此挣扎2天,我想我正在失去理智。 谢谢! 码 -(void)leptnoica:(UIImage *)image { CGImageRef myCGImage = image.CGImage; CFDataRef data = CGDataProviderCopyData(CGImageGetDataProvider(myCGImage)); const UInt8 *imageData = CFDataGetBytePtr(data); PIX *myPix = (PIX *) malloc(sizeof(PIX)); myPix->w = (int)CGImageGetWidth (myCGImage); myPix->h = (int)CGImageGetHeight (myCGImage); myPix->d = (int)CGImageGetBitsPerComponent(myCGImage); myPix->wpl = (CGImageGetBytesPerRow (myCGImage)/4); // myPix->informat = IFF_TIFF; myPix->informat= IFF_PNG; myPix->data = (l_uint32 *) imageData; […]

如何为iPhone创build一个图像应用程序?

我想知道如何去为iPhone创build一个图像应用程序。 我知道如何创build一个iphone应用程序。 我只是想知道做一个图像应用程序的最佳方式是什么。 我希望用户能够导入一个图像,然后应用程序将添加一个效果,如模糊它或着色或翘曲。 我怎样才能做到这一点? 我一直在寻找永远。 请帮忙。

Monotouch:改变图像的色调,而不仅仅是饱和度

我有以下MonoTouch代码可以改变Saturation ,但我也试图改变Hue 。 float hue = 0; float saturation = 1; if (colorCtrls == null) colorCtrls = new CIColorControls() { Image = CIImage.FromCGImage (originalImage.CGImage) }; else colorCtrls.Image = CIImage.FromCGImage(originalImage.CGImage); colorCtrls.Saturation = saturation; var output = colorCtrls.OutputImage; var context = CIContext.FromOptions(null); var result = context.CreateCGImage(output, output.Extent); return UIImage.FromImage(result);

如何优化这个image processing,用最接近的可用RGBreplace图像上的所有像素?

我试图用最接近的可用RGBreplaceinput图像的所有像素。 我有一个数组包含颜色和input图像。 这里是我的代码,它给我一个预期的输出图像,但它需要很长的时间(约一分钟)来处理一个图像。 任何人都可以帮我改进代码吗? 或者,如果您有任何其他build议,请帮助。 UIGraphicsBeginImageContextWithOptions(CGSizeMake(CGImageGetWidth(sourceImage),CGImageGetHeight(sourceImage)), NO, 0.0f); //Context size I keep as same as original input image size //Otherwise, the output will be only a partial image CGContextRef context; context = UIGraphicsGetCurrentContext(); //This is for flipping up sidedown CGContextTranslateCTM(context, 0, self.imageViewArea.image.size.height); CGContextScaleCTM(context, 1.0, -1.0); // init vars float d = 0; // squared error […]

如何将任何颜色的色度键filter应用于相机馈送ios?

基本上我想将色度键filter应用于ios实时摄像头,但我希望用户select将被另一种颜色replace的颜色。 我发现一些使用绿色屏幕的例子,但我不知道如何dynamicreplace颜色,而不是只是绿色。 任何想法如何才能达到最佳性能?

量化图像,保存剩余颜色列表

有一个我可以使用的图书馆,将允许我量化iPhone上的图像? 我想量化的图像可能是8种颜色,并logging量化后剩余的每种颜色的hex或rgb值。

将CIFiler应用于图像的蒙版部分

我正在寻找一种方法来将CIFilter应用于由掩码定义的图像的一部分。 像这样的东西,给一个图像: 来源http://imageshack.us/scaled/landing/213/browserpreviewtmp1p.jpg 还有一个面具: 我申请了一些变化 CIFilter *filter = [CIFilter filterWithName:@"CIColorControls" keysAndValues: kCIInputImageKey, beginImage,@"inputSaturation", @0, @"inputContrast", @1, @"inputBrightness", @0, nil]; 得到这个: 结果http://imageshack.us/a/img689/5297/browserpreviewtmpd.jpg 我怎样才能做到这一点?