Repository navigation
Add different skimage.hog blocks normalization methods - #2040
Conversation
skimage.hog normalizationskimage.hog normalization
skimage.hog normalizationskimage.hog normalization
|
@soupault Is the plan to add a test to this PR then? |
|
@stefanv there is one already, which had been added after original PR: https://github.com/soupault/scikit-image/blob/fix_hog_norm/skimage/feature/tests/test_hog.py#L23-L30 . It actually hits the normalization method, that's why I've updated also the reference data In the coming days I'd like to check if there's a divergence of the results with MATLAB/OpenCV ones and will update the PR if any. |
|
Excellent. Then +1 on this. |
|
As for MATLAB, unfortunately, I don't have CV toolbox. As for OpenCV, it supports only uint8 images (both color and grayscale), and only L2-Hys for cell normalization. I've implemented L2-Hys inline and used the results on uint8_grayscale for comparison. Output: Either I'm doing something wrong, or there is a major flaw in the implementation. |
|
@sdsingh I bet you would like to have a look at this. |
|
xref #2011 |
|
OpenCV is a pain 🔪 . Authors of the article are unclear about this: they mention If noone objects, I'm pushing L2-Hys blocks' normalization to this PR, updating the test and that's it. |
|
@scikit-image/core could anyone, please, give some feedback on this? |
|
@scikit-image/core still noone? 😉 |
skimage.hog normalizationskimage.hog blocks normalization methods
|
@scikit-image/core OK, I've made this backward-compatible while still addressing the original issue. Will be really glad to see some reviews. Thanks! |
|
@soupault I like this PR--it's an improvement, it should be merged. But it also feels like an ideal opportunity to expand the Notes section of the docstring to explain what's happening underneath the hood (you mention a lot of useful things in your comments above that I don't see encapsulated in the code itself). |
6866ae6 to
ff063ca
Compare
|
@stefanv Updated. Would you have a time to look through this once again? I also had to change the reference |
| Number of cells in each block. | ||
| block_norm : string, optional | ||
| Block normalization method. | ||
| Has to be one of ('L1', 'L1-sqrt', 'L2', 'L2-Hys'). |
|
@sciunto indeed, thanks! Fixed. |
719f2b0 to
daf82b7
Compare
|
I really hope this goes in one day. |
|
It should! @stefanv We are waiting for your approval :P |
|
@soupault it looks like this needs another rebase! |
daf82b7 to
f94ed4b
Compare
|
@jni Done. Hope you like the PR, and this is the last rebase, as I've already mastered my rebasing skills. :) |
|
🥇 for rebasing skills :) |
b1f34b2 to
b09e35d
Compare
Current coverage is 90.66% (diff: 84.61%)@@ master #2040 diff @@
==========================================
Files 304 304
Lines 21511 21468 -43
Methods 0 0
Messages 0 0
Branches 1853 1848 -5
==========================================
- Hits 19513 19464 -49
- Misses 1658 1661 +3
- Partials 340 343 +3
|
|
JFYI: it required one more rebase. 💪 |
| Normalization using L1-norm, followed by square root. | ||
| ``L2`` | ||
| Normalization using L2-norm. | ||
| ``L2-Hys`` |
|
@soupault please rebase once more and then, I merge it. |
b09e35d to
cdff825
Compare
|
@sciunto Done. |
updated reference npys, renewed deprecation message
|
Champagne! |
|
Yikes, it's quite painful reading this PR history---I'm sorry @soupault that you struggled so much to get feedback. |





References
This PR is catching up #1345 .
UPD: Fixes #2335, #2350.