vigra icon indicating copy to clipboard operation
vigra copied to clipboard

Accumulators: add per-channel histograms for multi-channel inputs

Open ukoethe opened this issue 11 years ago • 2 comments

ukoethe avatar Apr 12 '13 09:04 ukoethe

Hello ukoethe, I'd like to work on this issue . Can you please provide some description ? I understand it but i can't figure out how to proceed.

thanks chaithuzz2

chaithuzz2 avatar Feb 25 '14 07:02 chaithuzz2

Thanks for offering your help. Unfortunately, this is not an easy issue. The relevant code is in accumulator.hxx, starting at line 5288. You will see that the assumption of scalar data is hard-wired in the histogram classes. To generalize, the histograms must become MultiArray<2, double> (instead of TinyVector<doubel, BinCount> or MultiArray<1, double>). Moreover, the members left_outliers, right_outliers, scale_, offset_ and inverse_scale_ must become vectors of length equal to the number of channels. All functions (including setMinMax() and computeStandardQuantiles()) must be rewritten or overloaded to handle non-scalar data.

To refactor in a systematic way, I suggest the following steps:

  1. Change the types as described, but hard code array size initializion for scalar data only. Then get the test suite (which is in test/objectfeatures) running again.
  2. Implement a reshape() function similar to the one in some other accumulators that appropriately adjusts the array shapes. Get the tests running again, and add a test for proper reshape on multi-channel input.
  3. Implement the generalized function versions and correspoonding tests. It may be necessary to temporally comment out some functionality (e.g. the quantile stuff and corresponding tests) to get the tests running for intermediate code states.

Finally, it is also necessary to generalize the Python bindings, but we can talk about this later.

ukoethe avatar Feb 27 '14 17:02 ukoethe