Skip to content

Commit 7e761e8

Browse files
committed
add max_slope to lhist
and make gaussnoise go via vips8
1 parent 976cbf8 commit 7e761e8

File tree

6 files changed

+23
-11
lines changed

6 files changed

+23
-11
lines changed

ChangeLog

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
started 8.5 24/1/17
2+
- add max_slope to lhist
3+
- gaussnoise goes via vips8 now
24

35
started 8.4.1 25/9/16
46
- simplify nip2-icon.rc build, bgilbert

configure.ac

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,7 @@ AC_OUTPUT([
379379
share/nip2/compat/7.40/Makefile
380380
share/nip2/compat/8.2/Makefile
381381
share/nip2/compat/8.3/Makefile
382+
share/nip2/compat/8.4/Makefile
382383
src/BITMAPS/Makefile
383384
src/Makefile
384385
test/Makefile

share/nip2/start/Filter.def

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -625,13 +625,16 @@ Filter_enhance_item = class
625625

626626
window_width = Expression "Window width" 20;
627627
window_height = Expression "Window height" 20;
628+
max_slope = Scale "Maxium slope" 0 10 0;
628629

629630
_result
630631
= map_unary process x
631632
{
632633
process in
633634
= hist_equalize_local
634-
window_width.expr window_height.expr in;
635+
window_width
636+
window_height
637+
max_slope in;
635638
}
636639
}
637640
}

share/nip2/start/Image.def

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1657,8 +1657,7 @@ Pattern_images_item = class
16571657
mean = Scale "Mean" 0 255 128;
16581658
deviation = Scale "Deviation" 0 128 50;
16591659

1660-
_result = Image (im_gaussnoise
1661-
(to_real nwidth) (to_real nheight)
1660+
_result = Image (gaussnoise nwidth nheight
16621661
mean.value deviation.value);
16631662
}
16641663
}

share/nip2/start/_joe_utilities.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ so_balance ref_meanmax im1 im2 mask gauss
3636
im2_cor = im2_cor_a, gauss == false
3737
= clip2fmt im2_cor_a.format gauss_im
3838
{gauss_im =
39-
im_gaussnoise im2_cor_a.width im2_cor_a.height ref_meanmax?0
39+
gaussnoise im2_cor_a.width im2_cor_a.height ref_meanmax?0
4040
(deviation im2_cor_a);}
4141
result = im_blend (get_image mask) (get_image
4242
im2_cor) (get_image im1);

share/nip2/start/_stdenv.def

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1537,18 +1537,16 @@ hist_match in ref
15371537

15381538
hist_equalize x = hist_map ((hist_norm @ hist_cum @ hist_find) x) x;
15391539

1540-
hist_equalize_local w h image
1540+
hist_equalize_local w h l image
15411541
= oo_unary_function hist_equalize_local_op image, is_class image
1542-
= lhisteq image, is_image image
1542+
= out, is_image image
15431543
= error (_ "bad arguments to " ++ "hist_equalize_local")
15441544
{
15451545
hist_equalize_local_op = Operator "hist_equalize_local"
1546-
(hist_equalize_local w h) Operator_type.COMPOUND_REWRAP false;
1546+
(hist_equalize_local w h l) Operator_type.COMPOUND_REWRAP false;
15471547

1548-
// loop over bands, if necessary
1549-
lhisteq im
1550-
= im_lhisteq im (to_real w) (to_real h), get_bands im == 1
1551-
= (foldl1 join @ map lhisteq @ bandsplit) im;
1548+
[out] = vips_call "hist_local"
1549+
[image, to_real w, to_real h] [$max_slope => to_real l];
15521550
}
15531551

15541552
// find the threshold below which are percent of the image (percent in [0,1])
@@ -2521,3 +2519,12 @@ worley cell width height
25212519
$cell_size => to_real cell
25222520
];
25232521
}
2522+
2523+
gaussnoise width height mean sigma
2524+
= im
2525+
{
2526+
[im] = vips_call "gaussnoise" [to_real width, to_real height] [
2527+
$mean => to_real mean,
2528+
$sigma => to_real sigma
2529+
];
2530+
}

0 commit comments

Comments
 (0)