Allow histograms (cvCalcHist()) to work with COI and/or iplImageHeader (Feature #2929)


Added by Pierre Chatelier almost 12 years ago. Updated almost 12 years ago.


Status:Cancelled Start date:2013-03-29
Priority:Normal Due date:
Assignee:Vadim Pisarevsky % Done:

0%

Category:core
Target version:3.0
Difficulty: Pull request:

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

Revision e1553d5d
Added by Vadim Pisarevsky over 10 years ago

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

Also available in: Atom PDF