1use crate::image::{
5 AutoThreshold, BorderMode, ColorConversion, ColorMap, Connectivity, CornerScore, DistanceType,
6 ImageFormat, InterpolationMode, MatchTemplate, NormalizationConfig, PolarMode,
7};
8use crate::{Image, Matrix, Result};
9
10impl Image {
11 pub fn resize(
15 &self,
16 target_width: u32,
17 target_height: u32,
18 interpolation: InterpolationMode,
19 ) -> Result<Self> {
20 crate::image::resize(self, target_width, target_height, interpolation)
21 }
22
23 pub fn crop(&self, x: u32, y: u32, width: u32, height: u32) -> Result<Self> {
27 crate::image::crop(self, x, y, width, height)
28 }
29
30 pub fn flip(&self, horizontal: bool, vertical: bool) -> Result<Self> {
34 crate::image::flip(self, horizontal, vertical)
35 }
36
37 pub fn rotate(&self, degrees: u32) -> Result<Self> {
41 crate::image::rotate(self, degrees)
42 }
43
44 pub fn pad(
48 &self,
49 left: u32,
50 right: u32,
51 top: u32,
52 bottom: u32,
53 border: BorderMode,
54 border_value: f32,
55 ) -> Result<Self> {
56 crate::image::pad(self, left, right, top, bottom, border, border_value)
57 }
58
59 pub fn center_crop(&self, width: u32, height: u32) -> Result<Self> {
63 crate::image::center_crop(self, width, height)
64 }
65
66 pub fn remap(
70 &self,
71 map: &Matrix,
72 interpolation: InterpolationMode,
73 border: BorderMode,
74 border_value: f32,
75 ) -> Result<Self> {
76 crate::image::remap(self, map, interpolation, border, border_value)
77 }
78
79 pub fn warp_affine(
83 &self,
84 transform: &Matrix,
85 width: u32,
86 height: u32,
87 interpolation: InterpolationMode,
88 border: BorderMode,
89 border_value: f32,
90 ) -> Result<Self> {
91 crate::image::warp_affine(
92 self,
93 transform,
94 width,
95 height,
96 interpolation,
97 border,
98 border_value,
99 )
100 }
101
102 pub fn warp_perspective(
106 &self,
107 transform: &Matrix,
108 width: u32,
109 height: u32,
110 interpolation: InterpolationMode,
111 border: BorderMode,
112 border_value: f32,
113 ) -> Result<Self> {
114 crate::image::warp_perspective(
115 self,
116 transform,
117 width,
118 height,
119 interpolation,
120 border,
121 border_value,
122 )
123 }
124
125 pub fn threshold_binary(&self, threshold: f32, max_value: f32) -> Result<Self> {
129 crate::image::threshold_binary(self, threshold, max_value)
130 }
131
132 pub fn threshold_binary_inv(&self, threshold: f32, max_value: f32) -> Result<Self> {
136 crate::image::threshold_binary_inv(self, threshold, max_value)
137 }
138
139 pub fn threshold_truncate(&self, threshold: f32) -> Result<Self> {
143 crate::image::threshold_truncate(self, threshold)
144 }
145
146 pub fn threshold_to_zero(&self, threshold: f32) -> Result<Self> {
150 crate::image::threshold_to_zero(self, threshold)
151 }
152
153 pub fn threshold_to_zero_inv(&self, threshold: f32) -> Result<Self> {
157 crate::image::threshold_to_zero_inv(self, threshold)
158 }
159
160 pub fn in_range(&self, low: f32, high: f32, true_value: f32) -> Result<Self> {
164 crate::image::in_range(self, low, high, true_value)
165 }
166
167 pub fn clamp(&self, low: f32, high: f32) -> Result<Self> {
171 crate::image::clamp(self, low, high)
172 }
173
174 pub fn invert(&self, max_value: f32) -> Result<Self> {
178 crate::image::invert(self, max_value)
179 }
180
181 pub fn brightness_contrast(&self, brightness: f32, contrast: f32) -> Result<Self> {
185 crate::image::brightness_contrast(self, brightness, contrast)
186 }
187
188 pub fn gamma_contrast(&self, gamma: f32, gain: f32) -> Result<Self> {
192 crate::image::gamma_contrast(self, gamma, gain)
193 }
194
195 pub fn solarize(&self, threshold: f32, max_value: f32) -> Result<Self> {
199 crate::image::solarize(self, threshold, max_value)
200 }
201
202 pub fn posterize(&self, levels: u32, low: f32, high: f32) -> Result<Self> {
206 crate::image::posterize(self, levels, low, high)
207 }
208
209 pub fn grayscale(&self) -> Result<Self> {
213 crate::image::grayscale(self)
214 }
215
216 pub fn alpha_blend(&self, right: &Image, alpha: f32) -> Result<Self> {
220 crate::image::alpha_blend(self, right, alpha)
221 }
222
223 pub fn composite(&self, right: &Image, mask: &Image) -> Result<Self> {
227 crate::image::composite(self, right, mask)
228 }
229
230 pub fn erase(&self, x: u32, y: u32, width: u32, height: u32, value: f32) -> Result<Self> {
234 crate::image::erase(self, x, y, width, height, value)
235 }
236
237 pub fn color_twist(&self, transform: &Matrix) -> Result<Self> {
241 crate::image::color_twist(self, transform)
242 }
243
244 pub fn channel_reorder(&self, order: [u32; 4], output_format: ImageFormat) -> Result<Self> {
248 crate::image::channel_reorder(self, order, output_format)
249 }
250
251 pub fn gaussian_noise(&self, mean: f32, stddev: f32, seed: u64) -> Result<Self> {
255 crate::image::gaussian_noise(self, mean, stddev, seed)
256 }
257
258 pub fn salt_pepper_noise(
262 &self,
263 probability: f32,
264 salt_value: f32,
265 pepper_value: f32,
266 seed: u64,
267 ) -> Result<Self> {
268 crate::image::salt_pepper_noise(self, probability, salt_value, pepper_value, seed)
269 }
270
271 pub fn convolve_2d(
275 &self,
276 kernel: &Matrix,
277 border: BorderMode,
278 border_value: f32,
279 ) -> Result<Self> {
280 crate::image::convolve_2d(self, kernel, border, border_value)
281 }
282
283 pub fn separable_convolve_2d(
287 &self,
288 kernel_x: &Matrix,
289 kernel_y: &Matrix,
290 border: BorderMode,
291 border_value: f32,
292 ) -> Result<Self> {
293 crate::image::separable_convolve_2d(self, kernel_x, kernel_y, border, border_value)
294 }
295
296 pub fn average_blur(&self, width: u32, height: u32, border: BorderMode) -> Result<Self> {
300 crate::image::average_blur(self, width, height, border)
301 }
302
303 pub fn sobel(&self, dx: u32, dy: u32, border: BorderMode) -> Result<Self> {
307 crate::image::sobel(self, dx, dy, border)
308 }
309
310 pub fn scharr(&self, dx: u32, dy: u32, border: BorderMode) -> Result<Self> {
314 crate::image::scharr(self, dx, dy, border)
315 }
316
317 pub fn laplacian(&self, border: BorderMode) -> Result<Self> {
321 crate::image::laplacian(self, border)
322 }
323
324 pub fn erode(
328 &self,
329 width: u32,
330 height: u32,
331 border: BorderMode,
332 border_value: f32,
333 ) -> Result<Self> {
334 crate::image::erode(self, width, height, border, border_value)
335 }
336
337 pub fn dilate(
341 &self,
342 width: u32,
343 height: u32,
344 border: BorderMode,
345 border_value: f32,
346 ) -> Result<Self> {
347 crate::image::dilate(self, width, height, border, border_value)
348 }
349
350 pub fn morphology_open(
354 &self,
355 width: u32,
356 height: u32,
357 border: BorderMode,
358 border_value: f32,
359 ) -> Result<Self> {
360 crate::image::morphology_open(self, width, height, border, border_value)
361 }
362
363 pub fn morphology_close(
367 &self,
368 width: u32,
369 height: u32,
370 border: BorderMode,
371 border_value: f32,
372 ) -> Result<Self> {
373 crate::image::morphology_close(self, width, height, border, border_value)
374 }
375
376 pub fn morphology_gradient(
380 &self,
381 width: u32,
382 height: u32,
383 border: BorderMode,
384 border_value: f32,
385 ) -> Result<Self> {
386 crate::image::morphology_gradient(self, width, height, border, border_value)
387 }
388
389 pub fn gaussian_blur(&self, sigma: f32, kernel_size: u32) -> Result<Self> {
393 crate::image::gaussian_blur(self, sigma, kernel_size)
394 }
395
396 pub fn sharpen(&self, amount: f32, border: BorderMode) -> Result<Self> {
400 crate::image::sharpen(self, amount, border)
401 }
402
403 pub fn median_blur(&self, kernel_size: u32, border: BorderMode) -> Result<Self> {
407 crate::image::median_blur(self, kernel_size, border)
408 }
409
410 pub fn bilateral_filter(
414 &self,
415 kernel_size: u32,
416 sigma_color: f32,
417 sigma_space: f32,
418 border: BorderMode,
419 ) -> Result<Self> {
420 crate::image::bilateral_filter(self, kernel_size, sigma_color, sigma_space, border)
421 }
422
423 pub fn unsharp_mask(&self, sigma: f32, amount: f32, kernel_size: u32) -> Result<Self> {
427 crate::image::unsharp_mask(self, sigma, amount, kernel_size)
428 }
429
430 pub fn morphology_top_hat(
434 &self,
435 width: u32,
436 height: u32,
437 border: BorderMode,
438 border_value: f32,
439 ) -> Result<Self> {
440 crate::image::morphology_top_hat(self, width, height, border, border_value)
441 }
442
443 pub fn morphology_black_hat(
447 &self,
448 width: u32,
449 height: u32,
450 border: BorderMode,
451 border_value: f32,
452 ) -> Result<Self> {
453 crate::image::morphology_black_hat(self, width, height, border, border_value)
454 }
455
456 pub fn adaptive_threshold_mean(
460 &self,
461 kernel_size: u32,
462 c: f32,
463 max_value: f32,
464 border: BorderMode,
465 ) -> Result<Self> {
466 crate::image::adaptive_threshold_mean(self, kernel_size, c, max_value, border)
467 }
468
469 pub fn adaptive_threshold_gaussian(
473 &self,
474 kernel_size: u32,
475 c: f32,
476 max_value: f32,
477 sigma: f32,
478 border: BorderMode,
479 ) -> Result<Self> {
480 crate::image::adaptive_threshold_gaussian(self, kernel_size, c, max_value, sigma, border)
481 }
482
483 pub fn normalize(&self, parameters: NormalizationConfig) -> Result<Self> {
487 crate::image::normalize(self, parameters)
488 }
489
490 pub fn convert_color(&self, destination_format: crate::ImageFormat) -> Result<Self> {
494 crate::image::convert_color(self, destination_format)
495 }
496
497 pub fn resize_normalize(
501 &self,
502 width: u32,
503 height: u32,
504 parameters: NormalizationConfig,
505 ) -> Result<Self> {
506 crate::image::resize_normalize(self, width, height, parameters)
507 }
508
509 pub fn segmentation_overlay(&self, mask: &Matrix, palette: &Matrix, alpha: f32) -> Result<Self> {
513 crate::image::segmentation_overlay(self, mask, palette, alpha)
514 }
515
516 pub fn calc_hist(&self, bins: u32, lower: f32, upper: f32) -> Result<Matrix> {
520 crate::image::calc_hist(self, bins, lower, upper)
521 }
522
523 pub fn equalize_hist(&self) -> Result<Self> {
527 crate::image::equalize_hist(self)
528 }
529
530 pub fn pyr_down(&self) -> Result<Self> {
534 crate::image::pyr_down(self)
535 }
536
537 pub fn pyr_up(&self) -> Result<Self> {
541 crate::image::pyr_up(self)
542 }
543
544 pub fn threshold_auto(&self, method: AutoThreshold, max_value: f32) -> Result<(Image, Matrix)> {
548 crate::image::threshold_auto(self, method, max_value)
549 }
550
551 pub fn integral(&self) -> Result<Matrix> {
555 crate::image::integral(self)
556 }
557
558 pub fn cvt_color(&self, conversion: ColorConversion) -> Result<Self> {
562 crate::image::cvt_color(self, conversion)
563 }
564
565 pub fn apply_color_map(&self, colormap: ColorMap) -> Result<Self> {
569 crate::image::apply_color_map(self, colormap)
570 }
571
572 pub fn calc_back_project(&self, histogram: &Matrix, lower: f32, upper: f32) -> Result<Self> {
576 crate::image::calc_back_project(self, histogram, lower, upper)
577 }
578
579 pub fn clahe(&self, clip_limit: f32, tile_width: u32, tile_height: u32) -> Result<Self> {
583 crate::image::clahe(self, clip_limit, tile_width, tile_height)
584 }
585
586 pub fn accumulate(&self, accumulator: &Image) -> Result<Self> {
590 crate::image::accumulate(self, accumulator)
591 }
592
593 pub fn accumulate_weighted(&self, accumulator: &Image, alpha: f32) -> Result<Self> {
597 crate::image::accumulate_weighted(self, accumulator, alpha)
598 }
599
600 pub fn moments(&self) -> Result<Matrix> {
604 crate::image::moments(self)
605 }
606
607 pub fn psnr(&self, second: &Image, peak_value: f32) -> Result<Matrix> {
611 crate::image::psnr(self, second, peak_value)
612 }
613
614 pub fn ssim(&self, second: &Image) -> Result<Matrix> {
618 crate::image::ssim(self, second)
619 }
620
621 pub fn match_template(&self, template: &Image, method: MatchTemplate) -> Result<Matrix> {
625 crate::image::match_template(self, template, method)
626 }
627
628 #[allow(clippy::too_many_arguments)]
632 pub fn warp_polar(
633 &self,
634 center_x: f32,
635 center_y: f32,
636 max_radius: f32,
637 out_width: u32,
638 out_height: u32,
639 mode: PolarMode,
640 interpolation: InterpolationMode,
641 border: BorderMode,
642 border_value: f32,
643 ) -> Result<Self> {
644 crate::image::warp_polar(
645 self,
646 center_x,
647 center_y,
648 max_radius,
649 out_width,
650 out_height,
651 mode,
652 interpolation,
653 border,
654 border_value,
655 )
656 }
657
658 pub fn canny(
662 &self,
663 low_threshold: f32,
664 high_threshold: f32,
665 hysteresis_passes: u32,
666 ) -> Result<Self> {
667 crate::image::canny(self, low_threshold, high_threshold, hysteresis_passes)
668 }
669
670 pub fn connected_components(
674 &self,
675 threshold: f32,
676 connectivity: Connectivity,
677 propagation_passes: u32,
678 ) -> Result<Matrix> {
679 crate::image::connected_components(self, threshold, connectivity, propagation_passes)
680 }
681
682 pub fn distance_transform(
686 &self,
687 threshold: f32,
688 distance: DistanceType,
689 propagation_passes: u32,
690 ) -> Result<Matrix> {
691 crate::image::distance_transform(self, threshold, distance, propagation_passes)
692 }
693
694 pub fn hough_lines(
698 &self,
699 edge_threshold: f32,
700 rho_step: f32,
701 theta_step: f32,
702 threshold: u32,
703 max_lines: u32,
704 ) -> Result<Matrix> {
705 crate::image::hough_lines(
706 self,
707 edge_threshold,
708 rho_step,
709 theta_step,
710 threshold,
711 max_lines,
712 )
713 }
714
715 #[allow(clippy::too_many_arguments)]
719 pub fn hough_lines_p(
720 &self,
721 edge_threshold: f32,
722 rho_step: f32,
723 theta_step: f32,
724 threshold: u32,
725 max_lines: u32,
726 min_line_length: f32,
727 max_line_gap: u32,
728 ) -> Result<Matrix> {
729 crate::image::hough_lines_p(
730 self,
731 edge_threshold,
732 rho_step,
733 theta_step,
734 threshold,
735 max_lines,
736 min_line_length,
737 max_line_gap,
738 )
739 }
740
741 pub fn find_contours(
745 &self,
746 threshold: f32,
747 connectivity: Connectivity,
748 max_contours: u32,
749 max_points: u32,
750 propagation_passes: u32,
751 ) -> Result<(Matrix, Matrix)> {
752 crate::image::find_contours(
753 self,
754 threshold,
755 connectivity,
756 max_contours,
757 max_points,
758 propagation_passes,
759 )
760 }
761
762 #[allow(clippy::too_many_arguments)]
766 pub fn flood_fill(
767 &self,
768 seed_x: u32,
769 seed_y: u32,
770 value: f32,
771 lo_diff: f32,
772 up_diff: f32,
773 connectivity: Connectivity,
774 propagation_passes: u32,
775 ) -> Result<Self> {
776 crate::image::flood_fill(
777 self,
778 seed_x,
779 seed_y,
780 value,
781 lo_diff,
782 up_diff,
783 connectivity,
784 propagation_passes,
785 )
786 }
787
788 pub fn draw_line(
792 &self,
793 x1: f32,
794 y1: f32,
795 x2: f32,
796 y2: f32,
797 color: f32,
798 thickness: f32,
799 ) -> Result<Self> {
800 crate::image::draw_line(self, x1, y1, x2, y2, color, thickness)
801 }
802
803 pub fn draw_rectangle(
807 &self,
808 x: f32,
809 y: f32,
810 width: f32,
811 height: f32,
812 color: f32,
813 thickness: f32,
814 ) -> Result<Self> {
815 crate::image::draw_rectangle(self, x, y, width, height, color, thickness)
816 }
817
818 pub fn draw_circle(
822 &self,
823 cx: f32,
824 cy: f32,
825 radius: f32,
826 color: f32,
827 thickness: f32,
828 ) -> Result<Self> {
829 crate::image::draw_circle(self, cx, cy, radius, color, thickness)
830 }
831
832 pub fn fill_polygon(&self, points: &Matrix, color: f32) -> Result<Self> {
836 crate::image::fill_polygon(self, points, color)
837 }
838
839 pub fn corner_score(&self, block_size: u32, k: f32, score_type: CornerScore) -> Result<Self> {
843 crate::image::corner_score(self, block_size, k, score_type)
844 }
845
846 pub fn corner_fast(&self, arc_length: u32) -> Result<Self> {
850 crate::image::corner_fast(self, arc_length)
851 }
852
853 pub fn good_features_to_track(
857 &self,
858 max_corners: u32,
859 quality: f32,
860 min_distance: f32,
861 ) -> Result<(Matrix, Matrix)> {
862 crate::image::good_features_to_track(self, max_corners, quality, min_distance)
863 }
864
865 pub fn orb(
869 &self,
870 max_features: u32,
871 quality: f32,
872 min_distance: f32,
873 levels: u32,
874 edge: u32,
875 ) -> Result<(Matrix, Matrix, Matrix)> {
876 crate::image::orb(self, max_features, quality, min_distance, levels, edge)
877 }
878}
879
880#[allow(clippy::type_complexity)]
881const _: fn(&Image, u32, u32, InterpolationMode) -> Result<Image> = crate::image::resize;
882#[allow(clippy::type_complexity)]
883const _: fn(&Image, u32, u32, InterpolationMode) -> Result<Image> = Image::resize;
884#[allow(clippy::type_complexity)]
885const _: fn(&Image, u32, u32, u32, u32) -> Result<Image> = crate::image::crop;
886#[allow(clippy::type_complexity)]
887const _: fn(&Image, u32, u32, u32, u32) -> Result<Image> = Image::crop;
888#[allow(clippy::type_complexity)]
889const _: fn(&Image, bool, bool) -> Result<Image> = crate::image::flip;
890#[allow(clippy::type_complexity)]
891const _: fn(&Image, bool, bool) -> Result<Image> = Image::flip;
892#[allow(clippy::type_complexity)]
893const _: fn(&Image, u32) -> Result<Image> = crate::image::rotate;
894#[allow(clippy::type_complexity)]
895const _: fn(&Image, u32) -> Result<Image> = Image::rotate;
896#[allow(clippy::type_complexity)]
897const _: fn(&Image, u32, u32, u32, u32, BorderMode, f32) -> Result<Image> = crate::image::pad;
898#[allow(clippy::type_complexity)]
899const _: fn(&Image, u32, u32, u32, u32, BorderMode, f32) -> Result<Image> = Image::pad;
900#[allow(clippy::type_complexity)]
901const _: fn(&Image, u32, u32) -> Result<Image> = crate::image::center_crop;
902#[allow(clippy::type_complexity)]
903const _: fn(&Image, u32, u32) -> Result<Image> = Image::center_crop;
904#[allow(clippy::type_complexity)]
905const _: fn(&Image, &Matrix, InterpolationMode, BorderMode, f32) -> Result<Image> =
906 crate::image::remap;
907#[allow(clippy::type_complexity)]
908const _: fn(&Image, &Matrix, InterpolationMode, BorderMode, f32) -> Result<Image> = Image::remap;
909#[allow(clippy::type_complexity)]
910const _: fn(&Image, &Matrix, u32, u32, InterpolationMode, BorderMode, f32) -> Result<Image> =
911 crate::image::warp_affine;
912#[allow(clippy::type_complexity)]
913const _: fn(&Image, &Matrix, u32, u32, InterpolationMode, BorderMode, f32) -> Result<Image> =
914 Image::warp_affine;
915#[allow(clippy::type_complexity)]
916const _: fn(&Image, &Matrix, u32, u32, InterpolationMode, BorderMode, f32) -> Result<Image> =
917 crate::image::warp_perspective;
918#[allow(clippy::type_complexity)]
919const _: fn(&Image, &Matrix, u32, u32, InterpolationMode, BorderMode, f32) -> Result<Image> =
920 Image::warp_perspective;
921#[allow(clippy::type_complexity)]
922const _: fn(&Image, f32, f32) -> Result<Image> = crate::image::threshold_binary;
923#[allow(clippy::type_complexity)]
924const _: fn(&Image, f32, f32) -> Result<Image> = Image::threshold_binary;
925#[allow(clippy::type_complexity)]
926const _: fn(&Image, f32, f32) -> Result<Image> = crate::image::threshold_binary_inv;
927#[allow(clippy::type_complexity)]
928const _: fn(&Image, f32, f32) -> Result<Image> = Image::threshold_binary_inv;
929#[allow(clippy::type_complexity)]
930const _: fn(&Image, f32) -> Result<Image> = crate::image::threshold_truncate;
931#[allow(clippy::type_complexity)]
932const _: fn(&Image, f32) -> Result<Image> = Image::threshold_truncate;
933#[allow(clippy::type_complexity)]
934const _: fn(&Image, f32) -> Result<Image> = crate::image::threshold_to_zero;
935#[allow(clippy::type_complexity)]
936const _: fn(&Image, f32) -> Result<Image> = Image::threshold_to_zero;
937#[allow(clippy::type_complexity)]
938const _: fn(&Image, f32) -> Result<Image> = crate::image::threshold_to_zero_inv;
939#[allow(clippy::type_complexity)]
940const _: fn(&Image, f32) -> Result<Image> = Image::threshold_to_zero_inv;
941#[allow(clippy::type_complexity)]
942const _: fn(&Image, f32, f32, f32) -> Result<Image> = crate::image::in_range;
943#[allow(clippy::type_complexity)]
944const _: fn(&Image, f32, f32, f32) -> Result<Image> = Image::in_range;
945#[allow(clippy::type_complexity)]
946const _: fn(&Image, f32, f32) -> Result<Image> = crate::image::clamp;
947#[allow(clippy::type_complexity)]
948const _: fn(&Image, f32, f32) -> Result<Image> = Image::clamp;
949#[allow(clippy::type_complexity)]
950const _: fn(&Image, f32) -> Result<Image> = crate::image::invert;
951#[allow(clippy::type_complexity)]
952const _: fn(&Image, f32) -> Result<Image> = Image::invert;
953#[allow(clippy::type_complexity)]
954const _: fn(&Image, f32, f32) -> Result<Image> = crate::image::brightness_contrast;
955#[allow(clippy::type_complexity)]
956const _: fn(&Image, f32, f32) -> Result<Image> = Image::brightness_contrast;
957#[allow(clippy::type_complexity)]
958const _: fn(&Image, f32, f32) -> Result<Image> = crate::image::gamma_contrast;
959#[allow(clippy::type_complexity)]
960const _: fn(&Image, f32, f32) -> Result<Image> = Image::gamma_contrast;
961#[allow(clippy::type_complexity)]
962const _: fn(&Image, f32, f32) -> Result<Image> = crate::image::solarize;
963#[allow(clippy::type_complexity)]
964const _: fn(&Image, f32, f32) -> Result<Image> = Image::solarize;
965#[allow(clippy::type_complexity)]
966const _: fn(&Image, u32, f32, f32) -> Result<Image> = crate::image::posterize;
967#[allow(clippy::type_complexity)]
968const _: fn(&Image, u32, f32, f32) -> Result<Image> = Image::posterize;
969#[allow(clippy::type_complexity)]
970const _: fn(&Image) -> Result<Image> = crate::image::grayscale;
971#[allow(clippy::type_complexity)]
972const _: fn(&Image) -> Result<Image> = Image::grayscale;
973#[allow(clippy::type_complexity)]
974const _: fn(&Image, &Image, f32) -> Result<Image> = crate::image::alpha_blend;
975#[allow(clippy::type_complexity)]
976const _: fn(&Image, &Image, f32) -> Result<Image> = Image::alpha_blend;
977#[allow(clippy::type_complexity)]
978const _: fn(&Image, &Image, &Image) -> Result<Image> = crate::image::composite;
979#[allow(clippy::type_complexity)]
980const _: fn(&Image, &Image, &Image) -> Result<Image> = Image::composite;
981#[allow(clippy::type_complexity)]
982const _: fn(&Image, u32, u32, u32, u32, f32) -> Result<Image> = crate::image::erase;
983#[allow(clippy::type_complexity)]
984const _: fn(&Image, u32, u32, u32, u32, f32) -> Result<Image> = Image::erase;
985#[allow(clippy::type_complexity)]
986const _: fn(&Image, &Matrix) -> Result<Image> = crate::image::color_twist;
987#[allow(clippy::type_complexity)]
988const _: fn(&Image, &Matrix) -> Result<Image> = Image::color_twist;
989#[allow(clippy::type_complexity)]
990const _: fn(&Image, [u32; 4], ImageFormat) -> Result<Image> = crate::image::channel_reorder;
991#[allow(clippy::type_complexity)]
992const _: fn(&Image, [u32; 4], ImageFormat) -> Result<Image> = Image::channel_reorder;
993#[allow(clippy::type_complexity)]
994const _: fn(&Image, f32, f32, u64) -> Result<Image> = crate::image::gaussian_noise;
995#[allow(clippy::type_complexity)]
996const _: fn(&Image, f32, f32, u64) -> Result<Image> = Image::gaussian_noise;
997#[allow(clippy::type_complexity)]
998const _: fn(&Image, f32, f32, f32, u64) -> Result<Image> = crate::image::salt_pepper_noise;
999#[allow(clippy::type_complexity)]
1000const _: fn(&Image, f32, f32, f32, u64) -> Result<Image> = Image::salt_pepper_noise;
1001#[allow(clippy::type_complexity)]
1002const _: fn(&Image, &Matrix, BorderMode, f32) -> Result<Image> = crate::image::convolve_2d;
1003#[allow(clippy::type_complexity)]
1004const _: fn(&Image, &Matrix, BorderMode, f32) -> Result<Image> = Image::convolve_2d;
1005#[allow(clippy::type_complexity)]
1006const _: fn(&Image, &Matrix, &Matrix, BorderMode, f32) -> Result<Image> =
1007 crate::image::separable_convolve_2d;
1008#[allow(clippy::type_complexity)]
1009const _: fn(&Image, &Matrix, &Matrix, BorderMode, f32) -> Result<Image> =
1010 Image::separable_convolve_2d;
1011#[allow(clippy::type_complexity)]
1012const _: fn(&Image, u32, u32, BorderMode) -> Result<Image> = crate::image::average_blur;
1013#[allow(clippy::type_complexity)]
1014const _: fn(&Image, u32, u32, BorderMode) -> Result<Image> = Image::average_blur;
1015#[allow(clippy::type_complexity)]
1016const _: fn(&Image, u32, u32, BorderMode) -> Result<Image> = crate::image::sobel;
1017#[allow(clippy::type_complexity)]
1018const _: fn(&Image, u32, u32, BorderMode) -> Result<Image> = Image::sobel;
1019#[allow(clippy::type_complexity)]
1020const _: fn(&Image, u32, u32, BorderMode) -> Result<Image> = crate::image::scharr;
1021#[allow(clippy::type_complexity)]
1022const _: fn(&Image, u32, u32, BorderMode) -> Result<Image> = Image::scharr;
1023#[allow(clippy::type_complexity)]
1024const _: fn(&Image, BorderMode) -> Result<Image> = crate::image::laplacian;
1025#[allow(clippy::type_complexity)]
1026const _: fn(&Image, BorderMode) -> Result<Image> = Image::laplacian;
1027#[allow(clippy::type_complexity)]
1028const _: fn(&Image, u32, u32, BorderMode, f32) -> Result<Image> = crate::image::erode;
1029#[allow(clippy::type_complexity)]
1030const _: fn(&Image, u32, u32, BorderMode, f32) -> Result<Image> = Image::erode;
1031#[allow(clippy::type_complexity)]
1032const _: fn(&Image, u32, u32, BorderMode, f32) -> Result<Image> = crate::image::dilate;
1033#[allow(clippy::type_complexity)]
1034const _: fn(&Image, u32, u32, BorderMode, f32) -> Result<Image> = Image::dilate;
1035#[allow(clippy::type_complexity)]
1036const _: fn(&Image, u32, u32, BorderMode, f32) -> Result<Image> = crate::image::morphology_open;
1037#[allow(clippy::type_complexity)]
1038const _: fn(&Image, u32, u32, BorderMode, f32) -> Result<Image> = Image::morphology_open;
1039#[allow(clippy::type_complexity)]
1040const _: fn(&Image, u32, u32, BorderMode, f32) -> Result<Image> = crate::image::morphology_close;
1041#[allow(clippy::type_complexity)]
1042const _: fn(&Image, u32, u32, BorderMode, f32) -> Result<Image> = Image::morphology_close;
1043#[allow(clippy::type_complexity)]
1044const _: fn(&Image, u32, u32, BorderMode, f32) -> Result<Image> = crate::image::morphology_gradient;
1045#[allow(clippy::type_complexity)]
1046const _: fn(&Image, u32, u32, BorderMode, f32) -> Result<Image> = Image::morphology_gradient;
1047#[allow(clippy::type_complexity)]
1048const _: fn(&Image, f32, u32) -> Result<Image> = crate::image::gaussian_blur;
1049#[allow(clippy::type_complexity)]
1050const _: fn(&Image, f32, u32) -> Result<Image> = Image::gaussian_blur;
1051#[allow(clippy::type_complexity)]
1052const _: fn(&Image, f32, BorderMode) -> Result<Image> = crate::image::sharpen;
1053#[allow(clippy::type_complexity)]
1054const _: fn(&Image, f32, BorderMode) -> Result<Image> = Image::sharpen;
1055#[allow(clippy::type_complexity)]
1056const _: fn(&Image, u32, BorderMode) -> Result<Image> = crate::image::median_blur;
1057#[allow(clippy::type_complexity)]
1058const _: fn(&Image, u32, BorderMode) -> Result<Image> = Image::median_blur;
1059#[allow(clippy::type_complexity)]
1060const _: fn(&Image, u32, f32, f32, BorderMode) -> Result<Image> = crate::image::bilateral_filter;
1061#[allow(clippy::type_complexity)]
1062const _: fn(&Image, u32, f32, f32, BorderMode) -> Result<Image> = Image::bilateral_filter;
1063#[allow(clippy::type_complexity)]
1064const _: fn(&Image, f32, f32, u32) -> Result<Image> = crate::image::unsharp_mask;
1065#[allow(clippy::type_complexity)]
1066const _: fn(&Image, f32, f32, u32) -> Result<Image> = Image::unsharp_mask;
1067#[allow(clippy::type_complexity)]
1068const _: fn(&Image, u32, u32, BorderMode, f32) -> Result<Image> = crate::image::morphology_top_hat;
1069#[allow(clippy::type_complexity)]
1070const _: fn(&Image, u32, u32, BorderMode, f32) -> Result<Image> = Image::morphology_top_hat;
1071#[allow(clippy::type_complexity)]
1072const _: fn(&Image, u32, u32, BorderMode, f32) -> Result<Image> =
1073 crate::image::morphology_black_hat;
1074#[allow(clippy::type_complexity)]
1075const _: fn(&Image, u32, u32, BorderMode, f32) -> Result<Image> = Image::morphology_black_hat;
1076#[allow(clippy::type_complexity)]
1077const _: fn(&Image, u32, f32, f32, BorderMode) -> Result<Image> =
1078 crate::image::adaptive_threshold_mean;
1079#[allow(clippy::type_complexity)]
1080const _: fn(&Image, u32, f32, f32, BorderMode) -> Result<Image> = Image::adaptive_threshold_mean;
1081#[allow(clippy::type_complexity)]
1082const _: fn(&Image, u32, f32, f32, f32, BorderMode) -> Result<Image> =
1083 crate::image::adaptive_threshold_gaussian;
1084#[allow(clippy::type_complexity)]
1085const _: fn(&Image, u32, f32, f32, f32, BorderMode) -> Result<Image> =
1086 Image::adaptive_threshold_gaussian;
1087#[allow(clippy::type_complexity)]
1088const _: fn(&Image, NormalizationConfig) -> Result<Image> = crate::image::normalize;
1089#[allow(clippy::type_complexity)]
1090const _: fn(&Image, NormalizationConfig) -> Result<Image> = Image::normalize;
1091#[allow(clippy::type_complexity)]
1092const _: fn(&Image, crate::ImageFormat) -> Result<Image> = crate::image::convert_color;
1093#[allow(clippy::type_complexity)]
1094const _: fn(&Image, crate::ImageFormat) -> Result<Image> = Image::convert_color;
1095#[allow(clippy::type_complexity)]
1096const _: fn(&Image, u32, u32, NormalizationConfig) -> Result<Image> =
1097 crate::image::resize_normalize;
1098#[allow(clippy::type_complexity)]
1099const _: fn(&Image, u32, u32, NormalizationConfig) -> Result<Image> = Image::resize_normalize;
1100#[allow(clippy::type_complexity)]
1101const _: fn(&Image, &Matrix, &Matrix, f32) -> Result<Image> = crate::image::segmentation_overlay;
1102#[allow(clippy::type_complexity)]
1103const _: fn(&Image, &Matrix, &Matrix, f32) -> Result<Image> = Image::segmentation_overlay;
1104#[allow(clippy::type_complexity)]
1105const _: fn(&Image, u32, f32, f32) -> Result<Matrix> = crate::image::calc_hist;
1106#[allow(clippy::type_complexity)]
1107const _: fn(&Image, u32, f32, f32) -> Result<Matrix> = Image::calc_hist;
1108#[allow(clippy::type_complexity)]
1109const _: fn(&Image) -> Result<Image> = crate::image::equalize_hist;
1110#[allow(clippy::type_complexity)]
1111const _: fn(&Image) -> Result<Image> = Image::equalize_hist;
1112#[allow(clippy::type_complexity)]
1113const _: fn(&Image) -> Result<Image> = crate::image::pyr_down;
1114#[allow(clippy::type_complexity)]
1115const _: fn(&Image) -> Result<Image> = Image::pyr_down;
1116#[allow(clippy::type_complexity)]
1117const _: fn(&Image) -> Result<Image> = crate::image::pyr_up;
1118#[allow(clippy::type_complexity)]
1119const _: fn(&Image) -> Result<Image> = Image::pyr_up;
1120#[allow(clippy::type_complexity)]
1121const _: fn(&Image, AutoThreshold, f32) -> Result<(Image, Matrix)> = crate::image::threshold_auto;
1122#[allow(clippy::type_complexity)]
1123const _: fn(&Image, AutoThreshold, f32) -> Result<(Image, Matrix)> = Image::threshold_auto;
1124#[allow(clippy::type_complexity)]
1125const _: fn(&Image) -> Result<Matrix> = crate::image::integral;
1126#[allow(clippy::type_complexity)]
1127const _: fn(&Image) -> Result<Matrix> = Image::integral;
1128#[allow(clippy::type_complexity)]
1129const _: fn(&Image, ColorConversion) -> Result<Image> = crate::image::cvt_color;
1130#[allow(clippy::type_complexity)]
1131const _: fn(&Image, ColorConversion) -> Result<Image> = Image::cvt_color;
1132#[allow(clippy::type_complexity)]
1133const _: fn(&Image, ColorMap) -> Result<Image> = crate::image::apply_color_map;
1134#[allow(clippy::type_complexity)]
1135const _: fn(&Image, ColorMap) -> Result<Image> = Image::apply_color_map;
1136#[allow(clippy::type_complexity)]
1137const _: fn(&Image, &Matrix, f32, f32) -> Result<Image> = crate::image::calc_back_project;
1138#[allow(clippy::type_complexity)]
1139const _: fn(&Image, &Matrix, f32, f32) -> Result<Image> = Image::calc_back_project;
1140#[allow(clippy::type_complexity)]
1141const _: fn(&Image, f32, u32, u32) -> Result<Image> = crate::image::clahe;
1142#[allow(clippy::type_complexity)]
1143const _: fn(&Image, f32, u32, u32) -> Result<Image> = Image::clahe;
1144#[allow(clippy::type_complexity)]
1145const _: fn(&Image, &Image) -> Result<Image> = crate::image::accumulate;
1146#[allow(clippy::type_complexity)]
1147const _: fn(&Image, &Image) -> Result<Image> = Image::accumulate;
1148#[allow(clippy::type_complexity)]
1149const _: fn(&Image, &Image, f32) -> Result<Image> = crate::image::accumulate_weighted;
1150#[allow(clippy::type_complexity)]
1151const _: fn(&Image, &Image, f32) -> Result<Image> = Image::accumulate_weighted;
1152#[allow(clippy::type_complexity)]
1153const _: fn(&Image) -> Result<Matrix> = crate::image::moments;
1154#[allow(clippy::type_complexity)]
1155const _: fn(&Image) -> Result<Matrix> = Image::moments;
1156#[allow(clippy::type_complexity)]
1157const _: fn(&Image, &Image, f32) -> Result<Matrix> = crate::image::psnr;
1158#[allow(clippy::type_complexity)]
1159const _: fn(&Image, &Image, f32) -> Result<Matrix> = Image::psnr;
1160#[allow(clippy::type_complexity)]
1161const _: fn(&Image, &Image) -> Result<Matrix> = crate::image::ssim;
1162#[allow(clippy::type_complexity)]
1163const _: fn(&Image, &Image) -> Result<Matrix> = Image::ssim;
1164#[allow(clippy::type_complexity)]
1165const _: fn(&Image, &Image, MatchTemplate) -> Result<Matrix> = crate::image::match_template;
1166#[allow(clippy::type_complexity)]
1167const _: fn(&Image, &Image, MatchTemplate) -> Result<Matrix> = Image::match_template;
1168#[allow(clippy::type_complexity)]
1169const _: fn(
1170 &Image,
1171 f32,
1172 f32,
1173 f32,
1174 u32,
1175 u32,
1176 PolarMode,
1177 InterpolationMode,
1178 BorderMode,
1179 f32,
1180) -> Result<Image> = crate::image::warp_polar;
1181#[allow(clippy::type_complexity)]
1182const _: fn(
1183 &Image,
1184 f32,
1185 f32,
1186 f32,
1187 u32,
1188 u32,
1189 PolarMode,
1190 InterpolationMode,
1191 BorderMode,
1192 f32,
1193) -> Result<Image> = Image::warp_polar;
1194#[allow(clippy::type_complexity)]
1195const _: fn(&Image, f32, f32, u32) -> Result<Image> = crate::image::canny;
1196#[allow(clippy::type_complexity)]
1197const _: fn(&Image, f32, f32, u32) -> Result<Image> = Image::canny;
1198#[allow(clippy::type_complexity)]
1199const _: fn(&Image, f32, Connectivity, u32) -> Result<Matrix> = crate::image::connected_components;
1200#[allow(clippy::type_complexity)]
1201const _: fn(&Image, f32, Connectivity, u32) -> Result<Matrix> = Image::connected_components;
1202#[allow(clippy::type_complexity)]
1203const _: fn(&Image, f32, DistanceType, u32) -> Result<Matrix> = crate::image::distance_transform;
1204#[allow(clippy::type_complexity)]
1205const _: fn(&Image, f32, DistanceType, u32) -> Result<Matrix> = Image::distance_transform;
1206#[allow(clippy::type_complexity)]
1207const _: fn(&Image, f32, f32, f32, u32, u32) -> Result<Matrix> = crate::image::hough_lines;
1208#[allow(clippy::type_complexity)]
1209const _: fn(&Image, f32, f32, f32, u32, u32) -> Result<Matrix> = Image::hough_lines;
1210#[allow(clippy::type_complexity)]
1211const _: fn(&Image, f32, f32, f32, u32, u32, f32, u32) -> Result<Matrix> =
1212 crate::image::hough_lines_p;
1213#[allow(clippy::type_complexity)]
1214const _: fn(&Image, f32, f32, f32, u32, u32, f32, u32) -> Result<Matrix> = Image::hough_lines_p;
1215#[allow(clippy::type_complexity)]
1216const _: fn(&Image, f32, Connectivity, u32, u32, u32) -> Result<(Matrix, Matrix)> =
1217 crate::image::find_contours;
1218#[allow(clippy::type_complexity)]
1219const _: fn(&Image, f32, Connectivity, u32, u32, u32) -> Result<(Matrix, Matrix)> =
1220 Image::find_contours;
1221#[allow(clippy::type_complexity)]
1222const _: fn(&Image, u32, u32, f32, f32, f32, Connectivity, u32) -> Result<Image> =
1223 crate::image::flood_fill;
1224#[allow(clippy::type_complexity)]
1225const _: fn(&Image, u32, u32, f32, f32, f32, Connectivity, u32) -> Result<Image> =
1226 Image::flood_fill;
1227#[allow(clippy::type_complexity)]
1228const _: fn(&Image, f32, f32, f32, f32, f32, f32) -> Result<Image> = crate::image::draw_line;
1229#[allow(clippy::type_complexity)]
1230const _: fn(&Image, f32, f32, f32, f32, f32, f32) -> Result<Image> = Image::draw_line;
1231#[allow(clippy::type_complexity)]
1232const _: fn(&Image, f32, f32, f32, f32, f32, f32) -> Result<Image> = crate::image::draw_rectangle;
1233#[allow(clippy::type_complexity)]
1234const _: fn(&Image, f32, f32, f32, f32, f32, f32) -> Result<Image> = Image::draw_rectangle;
1235#[allow(clippy::type_complexity)]
1236const _: fn(&Image, f32, f32, f32, f32, f32) -> Result<Image> = crate::image::draw_circle;
1237#[allow(clippy::type_complexity)]
1238const _: fn(&Image, f32, f32, f32, f32, f32) -> Result<Image> = Image::draw_circle;
1239#[allow(clippy::type_complexity)]
1240const _: fn(&Image, &Matrix, f32) -> Result<Image> = crate::image::fill_polygon;
1241#[allow(clippy::type_complexity)]
1242const _: fn(&Image, &Matrix, f32) -> Result<Image> = Image::fill_polygon;
1243#[allow(clippy::type_complexity)]
1244const _: fn(&Image, u32, f32, CornerScore) -> Result<Image> = crate::image::corner_score;
1245#[allow(clippy::type_complexity)]
1246const _: fn(&Image, u32, f32, CornerScore) -> Result<Image> = Image::corner_score;
1247#[allow(clippy::type_complexity)]
1248const _: fn(&Image, u32) -> Result<Image> = crate::image::corner_fast;
1249#[allow(clippy::type_complexity)]
1250const _: fn(&Image, u32) -> Result<Image> = Image::corner_fast;
1251#[allow(clippy::type_complexity)]
1252const _: fn(&Image, u32, f32, f32) -> Result<(Matrix, Matrix)> =
1253 crate::image::good_features_to_track;
1254#[allow(clippy::type_complexity)]
1255const _: fn(&Image, u32, f32, f32) -> Result<(Matrix, Matrix)> = Image::good_features_to_track;
1256#[allow(clippy::type_complexity)]
1257const _: fn(&Image, u32, f32, f32, u32, u32) -> Result<(Matrix, Matrix, Matrix)> =
1258 crate::image::orb;
1259#[allow(clippy::type_complexity)]
1260const _: fn(&Image, u32, f32, f32, u32, u32) -> Result<(Matrix, Matrix, Matrix)> = Image::orb;