Implementation of the [Kittler and Illingworth, 1986] min error thresholding in Scikit-image

704 views
Skip to first unread message

Hakim Benoudjit

unread,
Dec 9, 2016, 3:46:17 PM12/9/16
to scikit-image
Hi,

I'm just wondering whether there's an implementation of the min error thresholding algorithm proposed by Kittler and J. Illingworth in Scikit-image?
See: Kittler and J. Illingworth, "Minimum error thresholding," Pattern Recognition, vol. 19, pp. 41-47, 1986.

I've found this java implementation online in ImageJ, but I'd rather work with Python:
ImageJ thresholding implementation

Thanks.

Stefan van der Walt

unread,
Dec 13, 2016, 1:27:19 PM12/13/16
to Hakim Benoudjit, scikit-image
Hi Hakim

On Fri, Dec 9, 2016, at 12:46, Hakim Benoudjit wrote:
I'm just wondering whether there's an implementation of the min error thresholding algorithm proposed by Kittler and J. Illingworth in Scikit-image?
See: Kittler and J. Illingworth, "Minimum error thresholding," Pattern Recognition, vol. 19, pp. 41-47, 1986.

Not yet, but it would make for a welcome addition.

Best regards
Stéfan

Hakim Benoudjit

unread,
Dec 15, 2016, 7:45:28 PM12/15/16
to scikit-image, h.ben...@gmail.com
Hi Stéfan,

I've found this implementation in matlab: https://github.com/carandraug/histthresh/blob/master/toolbox/th_minerror_iter.m
That I've translated to python: https://github.com/h4k1m0u/scikit-image-clustering-scripts/blob/master/thresholding/minimium_error_thresholding2.py
The resulting threshold for a gray-scale lena was the same for both the python script, and the original matlab script.

Let me know if there are still few details to revise in the source code. And if it's interesting, I'd be happy to make a pull request to include it in scikit-image.

Hakim.

Josh Warner

unread,
Dec 16, 2016, 11:12:44 PM12/16/16
to scikit-image
Hi Hakim,

Unfortunately the Matlab source you derived from has an incompatible license with ours: it is GPL v3+. That license is 'viral' meaning it applies also to derivative works, thus your Python translation is also under the GPL v3+.

There is no way around this. As a result we can't include that port in scikit-image without relicensing the entire project.

When doing a port, it's essential that the source be under a compatible license ideally before you start working. On the other hand, implementing from scratch out of a publication avoids this - so long as patents aren't involved.

Sorry if that is disappointing. This is a confusing area to be sure.

Josh

François Boulogne

unread,
Dec 20, 2016, 3:27:13 AM12/20/16
to scikit...@googlegroups.com
Hi,

> Unfortunately the Matlab source you derived from has an incompatible license with ours: it is GPL v3+. That license is 'viral' meaning it applies also to derivative works, thus your Python translation is also under the GPL v3+.
>
> There is no way around this. As a result we can't include that port in scikit-image without relicensing the entire project.
>
>

Developers who are using GPL licenses are not evil. It is possible to
explain the situation and to kindly ask the permission to reuse the code
to port it in Python. The original author has the full rights to do
that. I had to face a license issue several times and we could find a
satisfactory compromise for everyone all the time.

Best.
François.
Reply all
Reply to author
Forward
0 new messages