Skip to content

Commit df954a0

Browse files
committed
add entropy measure
1 parent 7a99a0c commit df954a0

File tree

4 files changed

+22
-2
lines changed

4 files changed

+22
-2
lines changed

ChangeLog

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ started 8.5 24/1/17
55
- parse_float was broken for numbers starting "0."
66
- add alpha section to Image / Band menu ... Flatten, Premultiply,
77
Unpremultiply, Blend
8+
- add Entropy to hist menu
89

910
started 8.4.1 25/9/16
1011
- simplify nip2-icon.rc build, bgilbert

TODO

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
(split is_space x)?0
44

5-
- add entropy menu item
6-
75
- how about adding
86

97
zip2 10 [1..5] == [[10, 1], [10, 2], [10, 3], ..

share/nip2/start/Histogram.def

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,10 @@ Hist_zerox_item = class
162162
}
163163
}
164164

165+
Hist_entropy_item = class Menuaction "Entropy" "calculate histogram entropy" {
166+
action x = hist_entropy x;
167+
}
168+
165169
#separator
166170

167171
Hist_profile_item = class

share/nip2/start/_stdenv.def

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2578,3 +2578,20 @@ unpremultiply x
25782578
}
25792579
}
25802580

2581+
hist_entropy x
2582+
= oo_unary_function hist_entropy_op x, is_class x
2583+
= entropy x, is_image x
2584+
= error (_ "bad arguments to " ++ "hist_entropy")
2585+
{
2586+
hist_entropy_op = Operator "hist_entropy"
2587+
hist_entropy Operator_type.COMPOUND_REWRAP false;
2588+
2589+
entropy x
2590+
= out
2591+
{
2592+
[out] = vips_call "hist_entropy" [x] [
2593+
];
2594+
}
2595+
}
2596+
2597+

0 commit comments

Comments
 (0)