Question

Is there way to process only one channel of IplImage? I need to apply delate/erode functions only for alpha channel. Also, I'm trying to do this as fast as it possible, because I'm working with real-time video processing. PS It'll be cool if any operation (smooth, convertScale, etc) could be applyed to any of channels...

Was it helpful?

Solution

For this I think you will need to split the image into it's separate channels (not an expensive operation) process them individually and then recombine.

Look up cvSplit() and cvMerge().

Of course erode and dilate are not complex operations (particularly if you are using a constant size mask). If you want them to execute on the image without separating the channels then perhaps you should consider implementing your dilate single channel from scratch - or just find an implementation of erode and dilate and edit it to only compute the dilate/erode on one channel.

Hope this helps.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top