I believe this could be relative to Core Image in iOS as well as in Mac OS.
I am able to get a RGB Histogram to show up using CIAreaHistogram + CIHistogramDisplayFilter in Core Image. Is there a way to get just LUMINANCE instead of RGB separately?
I believe this could be relative to Core Image in iOS as well as in Mac OS.
I am able to get a RGB Histogram to show up using CIAreaHistogram + CIHistogramDisplayFilter in Core Image. Is there a way to get just LUMINANCE instead of RGB separately?
Here's how to generate a histogram image (iOS and Mac OS X), provided you've already created a CIImage object (ciImage):
There are a hundred different solutions out there for displaying a histogram; this is simple (merely two lines of code), and works everywhere, flawlessly.
On to outputting the luminance channel only of a color image, and passing it to the histogram-related filters...
Do you know how to create a custom Core Image filter that returns the output of a CIKernel (or CIColorKernel) object? If not, you should; and, I'd be happy to provide you with easy-to-understand instructions for doing that.
Assuming you do, here's the OpenGL ES code that will return only the luminance values of an image it processes:
The above is OpenGL ES code written originally by Apple developers; I modified it to display only the luminance values.
Again: if you don't know how to at least plug-in kernels into a custom Core Image filter, learn how. I can show you.