Community
cancel
Showing results for 
Search instead for 
Did you mean: 
dario_ramos
Beginner
78 Views

IPL::ComputeHisto for signed images

Hi guys,

I'm trying to use IPL's (version 2.5) ComputeHisto function for a signed image. At first, I got a "key < 0" error. I solved it passing IPL_DEPTH_16S to iplCreateImageHeader (the image is 16 bits signed). But now I get this:

(srcImage->depth & IPL_DEPTH_SIGN) || (srcImage->depth == IPL_DEPTH_32F)

If I understood right, this means IPL can't compute a histogram for signed images... Is this really true? If it is, could anyone suggest an alternative?

0 Kudos
2 Replies
dario_ramos
Beginner
78 Views

RTFM! In the IPL Reference, Appendix A, Table A-9, it says that ComputeHisto only supports 1u, 8u, and 16u. So I'll have to implement this myself...
renegr
New Contributor I
78 Views

Where's the problem? You can use also the unsigned histogram function and interpret the lower half as the positive values, the upper half as the negative ones (1->1; 2->2; ...; 32767->32767; 65535->-1; 65534->-2 ...)
Reply