PDA

View Full Version : Image Procesing Sharpness on UIImageView with a Slider




rickjackson
May 19, 2011, 01:36 AM
Hello to all,

I am new to iPhone Development and even new to Image Processing but guyz i all of your help I am learning Image Processing in Bits and Pieces What i have learned so far is that how can i obtain the Actual pixel data from CGImage object and how to create a new modified image here is the code :


CGImageRef sourceImage = theImage.image.CGImage;

CFDataRef theData;

theData = CGDataProviderCopyData(CGImageGetDataProvider(sourceImage));

UInt8 *pixelData = (UInt8 *) CFDataGetBytePtr(theData);

int dataLength = CFDataGetLength(theData);

But right now i am struck at a point how can i increase/Decrease the sharpness of UIIMageView With a Slider.

Please share your thoughts with us so it will benefit all of us in someway.........

Regards,



dantastic
May 19, 2011, 02:08 AM
Have a look at the sample project GLImageProcessing. I think it has what you are after.

rickjackson
May 19, 2011, 03:21 AM
Have a look at the sample project GLImageProcessing. I think it has what you are after.

Hello Dantastic thanks for your reply........

Since i have not worked on OpenGL so its hard to understand that code but i have found this article which explains about image processing but not in detail here is the link [URL="Hello Felz Since i have not worked on OpenGL so its hard to understand that code but i have found this article which explains about image processing but not in detail here is the link http://www.fiveminutes.eu/iphone-image-processing if any 1 points me to some algorithm for brightness, saturation, hur, sharpness and contrast then it will be very good.

dantastic
May 19, 2011, 03:47 AM
If it's core image you want to use have a look at the Documentation (http://developer.apple.com/library/mac/#documentation/GraphicsImaging/Reference/CoreImageFilterReference/Reference/reference.html). There are a few methods there to sharpen and blur an image. Pick the one that would suit your needs.

I suggest retaining the original image at slider mid point and when values are at the lower end of the slider use a blur function and at the higher end a sharpening function. make sure to always use the original image so you don't compound the effects.

rickjackson
May 19, 2011, 03:49 AM
If it's core image you want to use have a look at the Documentation (http://developer.apple.com/library/mac/#documentation/GraphicsImaging/Reference/CoreImageFilterReference/Reference/reference.html). There are a few methods there to sharpen and blur an image. Pick the one that would suit your needs.

I suggest retaining the original image at slider mid point and when values are at the lower end of the slider use a blur function and at the higher end a sharpening function. make sure to always use the original image so you don't compound the effects.

Hello Dantastic I have found information about Core Image and its not available in iPhone check this link out : http://stackoverflow.com/questions/2105475/iphone-core-image-filter

xStep
May 19, 2011, 07:11 PM
... but i have found this article which explains about image processing but not in detail here is the link http://www.fiveminutes.eu/iphone-image-processing if any 1 points me to some algorithm for brightness, saturation, hur, sharpness and contrast then it will be very good.

That link is interesting. The guy is changing a CGImage when Apple says that CGImages are immutable; here (http://developer.apple.com/library/mac/#qa/qa2001/qa1276.html) and here (http://developer.apple.com/library/mac/#documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/dq_images/dq_images.html). I suppose since he isn't actually displaying the input image that it might be safe, but I wonder if it would have been safer to do the change by writing the altered bytes into a new image buffer that CGBitmapContextCreate() could have created for him which is rather quick. Can someone with more CG experience shed some further opinion on this please?

Regarding the rest. A verbal discussion I was in lately suggested that since Apple doesn't supply Core Image in iOS, that you're on your own to create or find a library that does those things. In my case, I'm looking for methods to feather CG strokes in realtime.