-
Notifications
You must be signed in to change notification settings - Fork 164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add histogram class and related functionality #499
Conversation
53c6fee
to
6f9be17
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have some objections with the code format(template parameters) I don't find the really appealing to the eyes but I maybe wrong. @mloskot what are your suggestions on it!
* Shifted type traits to gil/concepts/detail/histogram.hpp * Added binning logic for unmutable container * Added missing endline, changed parameter name etc.
I have ideas I would like to share further on the current approach. This approach might ease extending the implementation design in the future to support both multi dimensional histograms and external containers.
So basically the first overloads make sure appropriate type checks are performed on both image and container type. The second overload would choose to call the overload specific to the requirements and the third overload can be easily extended to support higher dimensional containers (of any type). |
A new histogram class proposed with close suuport for gil image constructs. Code Refactor : - Shift current stl implmentation to extension to serve as example for overloading fill_histogram
7a1fa45
to
cb69be7
Compare
29ba68b
to
deb9f0f
Compare
b0963c8
to
6d7697e
Compare
6d7697e
to
4606a17
Compare
@codejaeger I'm reviewing this PR, but please feel free to apply any changes you need. @codejaeger A bit of update to my comment: The
Finally, for the example, I'd suggest to stick to the 1D histogram and grayscale image. @lpranam What's your take on this PR, I recall you had objections to some of the design choices. Please, forgive me that I had not reacted to that discussion in timely manner and that I can't remember exactly what was that about. |
@mloskot I agree it is difficult enough to read for anyone. The file started as an example and became more of a test in the later revisions. I will update it at once. I could also add block comments to separate out different sections of implementations (like create a histogram, fill it etc.). Although I don't expect anyone to come to this file for reference since I aim to make the docs self sufficient, I will make the changes required. Thanks for the suggestion. |
Yes, that is quite common approach.
What you can do is to use the file to combine the snippets from the docs, so you can be sure they compile. Ideally, if the examples in the docs are self-contained and are compile-tested when the docs are built, but I don't know how to achieve it in Sphinx. That is one of reasons why we may consider switch to AsciiDoc as some point in future |
3fa0941
to
27c9351
Compare
- Separate histogram fill tests from utilities - Add helper impl tuple limit
27c9351
to
5f10c81
Compare
262d8a7
to
897778d
Compare
@codejaeger Thanks for the update. Something is wrong with the histogram example, see https://ci.appveyor.com/project/stefanseefeld/gil/builds/34407783/job/fw3u0ba7yno9rdui The last build job of AppVeyor is CMake-based which builds examples too. |
Thanks @mloskot for pointing out the bug. I hope it gets fixed with the last commit. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have any major issues to report about this PR, so I'm happy to approve it.
The only 'unresolved' comments are about the x<space><space>=<space>y
formatting due to use of the clang-format
and pointed out by @lpranam which I'd consider not a stopper issue that can be addressed after the merge along with other updates or improvements that are applicable post-merge.
@codejaeger Once again, thanks for your contributions
A new histogram class proposed with close suport for gil image constructs. Shift the stl support implmentation to extension to serve as example for overloading fill_histogram. Add cumulative histogram and histogram normalization. Co-authored-by: debabrata1 <debabrata@goodhealthapp.com>
A new histogram class proposed with close suport for gil image constructs. Shift the stl support implmentation to extension to serve as example for overloading fill_histogram. Add cumulative histogram and histogram normalization. Co-authored-by: debabrata1 <debabrata@goodhealthapp.com>
Description
This contains the initial implementation of histogram functionality for STL containers for GIL images. Basic tests checking for correctness of histogram have been provided. Usage syntax and distinction between compatible and incompatible containers have been illustrated in a example file.
There was some dicussion regarding the name of the function (which now is image_histogram) in the mailing thread (link). I chose on 'image_histogram' since the name 'histogram' is used as the class name in Boost.Histogram and might cause problems in namespace mix-up. Another option could be histogram_1d since these functions are meant for that purpose.
Dependency
Optional - Docs for the this implementation are running in a parallel PR #503.
References
Discussions on boost-gil mailing threads.
Tasklist