Allow histograms (cvCalcHist()) to work with COI and/or iplImageHeader (Feature #2929)
Description
Currently, computing the R,G,B histograms for a color image requires the use of cvSplit(), and full copy for each channel.
If it is still compatible with the inner code of cvCalcHist(), I think it would be interesting to make it compatible with COI and IplImageHeader. The following lazy code could then be applied, requiring no data copy and better performance :
IplImage* srcImage3Channels = ...;
IplImage* channel1 = cvCreateImageHeader(...);
cvSetData(channel1 , srcImage3Channels->data,...);
cvSetImageCOI(channel1 , 1);
IplImage* channel2 = cvCreateImageHeader(...);
cvSetData(channel2 , srcImage3Channels->data,...);
cvSetImageCOI(channel2 , 2);
IplImage* channel3 = cvCreateImageHeader(...);
cvSetData(channel3 , srcImage3Channels->data,...);
cvSetImageCOI(channel3 , 3);
cvCalcHist(channel1...);
cvCalcHist(channel2...);
cvCalcHist(channel3...);
Associated revisions
Merge pull request #2929 from ilya-lavrenov:sse_pow
History
Updated by Andrey Kamaev almost 12 years ago
cvCalcHist
is part of legacy API and it is unlikely that it will be extended.
So I'm cancelling this feature request.
- Status changed from Open to Cancelled