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 pub fn optical_flow_pyr_lk(
883 &self,
884 next: &Image,
885 points: &Matrix,
886 levels: u32,
887 window: u32,
888 iterations: u32,
889 min_eigen: f32,
890 ) -> Result<(Matrix, Matrix, Matrix)> {
891 crate::image::optical_flow_pyr_lk(self, next, points, levels, window, iterations, min_eigen)
892 }
893
894 pub fn optical_flow_farneback(
898 &self,
899 next: &Image,
900 levels: u32,
901 window: u32,
902 iterations: u32,
903 poly_n: u32,
904 poly_sigma: f32,
905 ) -> Result<Matrix> {
906 crate::image::optical_flow_farneback(self, next, levels, window, iterations, poly_n, poly_sigma)
907 }
908
909 pub fn stereo_bm(
913 &self,
914 right: &Image,
915 num_disparities: u32,
916 block_size: u32,
917 uniqueness: u32,
918 ) -> Result<Matrix> {
919 crate::image::stereo_bm(self, right, num_disparities, block_size, uniqueness)
920 }
921
922 pub fn fast_nl_means_denoising(
926 &self,
927 h: f32,
928 template_window: u32,
929 search_window: u32,
930 ) -> Result<Self> {
931 crate::image::fast_nl_means_denoising(self, h, template_window, search_window)
932 }
933
934 pub fn pyr_mean_shift_filtering(&self, sp: f32, sr: f32, max_level: u32) -> Result<Self> {
938 crate::image::pyr_mean_shift_filtering(self, sp, sr, max_level)
939 }
940}
941
942#[allow(clippy::type_complexity)]
943const _: fn(&Image, u32, u32, InterpolationMode) -> Result<Image> = crate::image::resize;
944#[allow(clippy::type_complexity)]
945const _: fn(&Image, u32, u32, InterpolationMode) -> Result<Image> = Image::resize;
946#[allow(clippy::type_complexity)]
947const _: fn(&Image, u32, u32, u32, u32) -> Result<Image> = crate::image::crop;
948#[allow(clippy::type_complexity)]
949const _: fn(&Image, u32, u32, u32, u32) -> Result<Image> = Image::crop;
950#[allow(clippy::type_complexity)]
951const _: fn(&Image, bool, bool) -> Result<Image> = crate::image::flip;
952#[allow(clippy::type_complexity)]
953const _: fn(&Image, bool, bool) -> Result<Image> = Image::flip;
954#[allow(clippy::type_complexity)]
955const _: fn(&Image, u32) -> Result<Image> = crate::image::rotate;
956#[allow(clippy::type_complexity)]
957const _: fn(&Image, u32) -> Result<Image> = Image::rotate;
958#[allow(clippy::type_complexity)]
959const _: fn(&Image, u32, u32, u32, u32, BorderMode, f32) -> Result<Image> = crate::image::pad;
960#[allow(clippy::type_complexity)]
961const _: fn(&Image, u32, u32, u32, u32, BorderMode, f32) -> Result<Image> = Image::pad;
962#[allow(clippy::type_complexity)]
963const _: fn(&Image, u32, u32) -> Result<Image> = crate::image::center_crop;
964#[allow(clippy::type_complexity)]
965const _: fn(&Image, u32, u32) -> Result<Image> = Image::center_crop;
966#[allow(clippy::type_complexity)]
967const _: fn(&Image, &Matrix, InterpolationMode, BorderMode, f32) -> Result<Image> =
968 crate::image::remap;
969#[allow(clippy::type_complexity)]
970const _: fn(&Image, &Matrix, InterpolationMode, BorderMode, f32) -> Result<Image> = Image::remap;
971#[allow(clippy::type_complexity)]
972const _: fn(&Image, &Matrix, u32, u32, InterpolationMode, BorderMode, f32) -> Result<Image> =
973 crate::image::warp_affine;
974#[allow(clippy::type_complexity)]
975const _: fn(&Image, &Matrix, u32, u32, InterpolationMode, BorderMode, f32) -> Result<Image> =
976 Image::warp_affine;
977#[allow(clippy::type_complexity)]
978const _: fn(&Image, &Matrix, u32, u32, InterpolationMode, BorderMode, f32) -> Result<Image> =
979 crate::image::warp_perspective;
980#[allow(clippy::type_complexity)]
981const _: fn(&Image, &Matrix, u32, u32, InterpolationMode, BorderMode, f32) -> Result<Image> =
982 Image::warp_perspective;
983#[allow(clippy::type_complexity)]
984const _: fn(&Image, f32, f32) -> Result<Image> = crate::image::threshold_binary;
985#[allow(clippy::type_complexity)]
986const _: fn(&Image, f32, f32) -> Result<Image> = Image::threshold_binary;
987#[allow(clippy::type_complexity)]
988const _: fn(&Image, f32, f32) -> Result<Image> = crate::image::threshold_binary_inv;
989#[allow(clippy::type_complexity)]
990const _: fn(&Image, f32, f32) -> Result<Image> = Image::threshold_binary_inv;
991#[allow(clippy::type_complexity)]
992const _: fn(&Image, f32) -> Result<Image> = crate::image::threshold_truncate;
993#[allow(clippy::type_complexity)]
994const _: fn(&Image, f32) -> Result<Image> = Image::threshold_truncate;
995#[allow(clippy::type_complexity)]
996const _: fn(&Image, f32) -> Result<Image> = crate::image::threshold_to_zero;
997#[allow(clippy::type_complexity)]
998const _: fn(&Image, f32) -> Result<Image> = Image::threshold_to_zero;
999#[allow(clippy::type_complexity)]
1000const _: fn(&Image, f32) -> Result<Image> = crate::image::threshold_to_zero_inv;
1001#[allow(clippy::type_complexity)]
1002const _: fn(&Image, f32) -> Result<Image> = Image::threshold_to_zero_inv;
1003#[allow(clippy::type_complexity)]
1004const _: fn(&Image, f32, f32, f32) -> Result<Image> = crate::image::in_range;
1005#[allow(clippy::type_complexity)]
1006const _: fn(&Image, f32, f32, f32) -> Result<Image> = Image::in_range;
1007#[allow(clippy::type_complexity)]
1008const _: fn(&Image, f32, f32) -> Result<Image> = crate::image::clamp;
1009#[allow(clippy::type_complexity)]
1010const _: fn(&Image, f32, f32) -> Result<Image> = Image::clamp;
1011#[allow(clippy::type_complexity)]
1012const _: fn(&Image, f32) -> Result<Image> = crate::image::invert;
1013#[allow(clippy::type_complexity)]
1014const _: fn(&Image, f32) -> Result<Image> = Image::invert;
1015#[allow(clippy::type_complexity)]
1016const _: fn(&Image, f32, f32) -> Result<Image> = crate::image::brightness_contrast;
1017#[allow(clippy::type_complexity)]
1018const _: fn(&Image, f32, f32) -> Result<Image> = Image::brightness_contrast;
1019#[allow(clippy::type_complexity)]
1020const _: fn(&Image, f32, f32) -> Result<Image> = crate::image::gamma_contrast;
1021#[allow(clippy::type_complexity)]
1022const _: fn(&Image, f32, f32) -> Result<Image> = Image::gamma_contrast;
1023#[allow(clippy::type_complexity)]
1024const _: fn(&Image, f32, f32) -> Result<Image> = crate::image::solarize;
1025#[allow(clippy::type_complexity)]
1026const _: fn(&Image, f32, f32) -> Result<Image> = Image::solarize;
1027#[allow(clippy::type_complexity)]
1028const _: fn(&Image, u32, f32, f32) -> Result<Image> = crate::image::posterize;
1029#[allow(clippy::type_complexity)]
1030const _: fn(&Image, u32, f32, f32) -> Result<Image> = Image::posterize;
1031#[allow(clippy::type_complexity)]
1032const _: fn(&Image) -> Result<Image> = crate::image::grayscale;
1033#[allow(clippy::type_complexity)]
1034const _: fn(&Image) -> Result<Image> = Image::grayscale;
1035#[allow(clippy::type_complexity)]
1036const _: fn(&Image, &Image, f32) -> Result<Image> = crate::image::alpha_blend;
1037#[allow(clippy::type_complexity)]
1038const _: fn(&Image, &Image, f32) -> Result<Image> = Image::alpha_blend;
1039#[allow(clippy::type_complexity)]
1040const _: fn(&Image, &Image, &Image) -> Result<Image> = crate::image::composite;
1041#[allow(clippy::type_complexity)]
1042const _: fn(&Image, &Image, &Image) -> Result<Image> = Image::composite;
1043#[allow(clippy::type_complexity)]
1044const _: fn(&Image, u32, u32, u32, u32, f32) -> Result<Image> = crate::image::erase;
1045#[allow(clippy::type_complexity)]
1046const _: fn(&Image, u32, u32, u32, u32, f32) -> Result<Image> = Image::erase;
1047#[allow(clippy::type_complexity)]
1048const _: fn(&Image, &Matrix) -> Result<Image> = crate::image::color_twist;
1049#[allow(clippy::type_complexity)]
1050const _: fn(&Image, &Matrix) -> Result<Image> = Image::color_twist;
1051#[allow(clippy::type_complexity)]
1052const _: fn(&Image, [u32; 4], ImageFormat) -> Result<Image> = crate::image::channel_reorder;
1053#[allow(clippy::type_complexity)]
1054const _: fn(&Image, [u32; 4], ImageFormat) -> Result<Image> = Image::channel_reorder;
1055#[allow(clippy::type_complexity)]
1056const _: fn(&Image, f32, f32, u64) -> Result<Image> = crate::image::gaussian_noise;
1057#[allow(clippy::type_complexity)]
1058const _: fn(&Image, f32, f32, u64) -> Result<Image> = Image::gaussian_noise;
1059#[allow(clippy::type_complexity)]
1060const _: fn(&Image, f32, f32, f32, u64) -> Result<Image> = crate::image::salt_pepper_noise;
1061#[allow(clippy::type_complexity)]
1062const _: fn(&Image, f32, f32, f32, u64) -> Result<Image> = Image::salt_pepper_noise;
1063#[allow(clippy::type_complexity)]
1064const _: fn(&Image, &Matrix, BorderMode, f32) -> Result<Image> = crate::image::convolve_2d;
1065#[allow(clippy::type_complexity)]
1066const _: fn(&Image, &Matrix, BorderMode, f32) -> Result<Image> = Image::convolve_2d;
1067#[allow(clippy::type_complexity)]
1068const _: fn(&Image, &Matrix, &Matrix, BorderMode, f32) -> Result<Image> =
1069 crate::image::separable_convolve_2d;
1070#[allow(clippy::type_complexity)]
1071const _: fn(&Image, &Matrix, &Matrix, BorderMode, f32) -> Result<Image> =
1072 Image::separable_convolve_2d;
1073#[allow(clippy::type_complexity)]
1074const _: fn(&Image, u32, u32, BorderMode) -> Result<Image> = crate::image::average_blur;
1075#[allow(clippy::type_complexity)]
1076const _: fn(&Image, u32, u32, BorderMode) -> Result<Image> = Image::average_blur;
1077#[allow(clippy::type_complexity)]
1078const _: fn(&Image, u32, u32, BorderMode) -> Result<Image> = crate::image::sobel;
1079#[allow(clippy::type_complexity)]
1080const _: fn(&Image, u32, u32, BorderMode) -> Result<Image> = Image::sobel;
1081#[allow(clippy::type_complexity)]
1082const _: fn(&Image, u32, u32, BorderMode) -> Result<Image> = crate::image::scharr;
1083#[allow(clippy::type_complexity)]
1084const _: fn(&Image, u32, u32, BorderMode) -> Result<Image> = Image::scharr;
1085#[allow(clippy::type_complexity)]
1086const _: fn(&Image, BorderMode) -> Result<Image> = crate::image::laplacian;
1087#[allow(clippy::type_complexity)]
1088const _: fn(&Image, BorderMode) -> Result<Image> = Image::laplacian;
1089#[allow(clippy::type_complexity)]
1090const _: fn(&Image, u32, u32, BorderMode, f32) -> Result<Image> = crate::image::erode;
1091#[allow(clippy::type_complexity)]
1092const _: fn(&Image, u32, u32, BorderMode, f32) -> Result<Image> = Image::erode;
1093#[allow(clippy::type_complexity)]
1094const _: fn(&Image, u32, u32, BorderMode, f32) -> Result<Image> = crate::image::dilate;
1095#[allow(clippy::type_complexity)]
1096const _: fn(&Image, u32, u32, BorderMode, f32) -> Result<Image> = Image::dilate;
1097#[allow(clippy::type_complexity)]
1098const _: fn(&Image, u32, u32, BorderMode, f32) -> Result<Image> = crate::image::morphology_open;
1099#[allow(clippy::type_complexity)]
1100const _: fn(&Image, u32, u32, BorderMode, f32) -> Result<Image> = Image::morphology_open;
1101#[allow(clippy::type_complexity)]
1102const _: fn(&Image, u32, u32, BorderMode, f32) -> Result<Image> = crate::image::morphology_close;
1103#[allow(clippy::type_complexity)]
1104const _: fn(&Image, u32, u32, BorderMode, f32) -> Result<Image> = Image::morphology_close;
1105#[allow(clippy::type_complexity)]
1106const _: fn(&Image, u32, u32, BorderMode, f32) -> Result<Image> = crate::image::morphology_gradient;
1107#[allow(clippy::type_complexity)]
1108const _: fn(&Image, u32, u32, BorderMode, f32) -> Result<Image> = Image::morphology_gradient;
1109#[allow(clippy::type_complexity)]
1110const _: fn(&Image, f32, u32) -> Result<Image> = crate::image::gaussian_blur;
1111#[allow(clippy::type_complexity)]
1112const _: fn(&Image, f32, u32) -> Result<Image> = Image::gaussian_blur;
1113#[allow(clippy::type_complexity)]
1114const _: fn(&Image, f32, BorderMode) -> Result<Image> = crate::image::sharpen;
1115#[allow(clippy::type_complexity)]
1116const _: fn(&Image, f32, BorderMode) -> Result<Image> = Image::sharpen;
1117#[allow(clippy::type_complexity)]
1118const _: fn(&Image, u32, BorderMode) -> Result<Image> = crate::image::median_blur;
1119#[allow(clippy::type_complexity)]
1120const _: fn(&Image, u32, BorderMode) -> Result<Image> = Image::median_blur;
1121#[allow(clippy::type_complexity)]
1122const _: fn(&Image, u32, f32, f32, BorderMode) -> Result<Image> = crate::image::bilateral_filter;
1123#[allow(clippy::type_complexity)]
1124const _: fn(&Image, u32, f32, f32, BorderMode) -> Result<Image> = Image::bilateral_filter;
1125#[allow(clippy::type_complexity)]
1126const _: fn(&Image, f32, f32, u32) -> Result<Image> = crate::image::unsharp_mask;
1127#[allow(clippy::type_complexity)]
1128const _: fn(&Image, f32, f32, u32) -> Result<Image> = Image::unsharp_mask;
1129#[allow(clippy::type_complexity)]
1130const _: fn(&Image, u32, u32, BorderMode, f32) -> Result<Image> = crate::image::morphology_top_hat;
1131#[allow(clippy::type_complexity)]
1132const _: fn(&Image, u32, u32, BorderMode, f32) -> Result<Image> = Image::morphology_top_hat;
1133#[allow(clippy::type_complexity)]
1134const _: fn(&Image, u32, u32, BorderMode, f32) -> Result<Image> =
1135 crate::image::morphology_black_hat;
1136#[allow(clippy::type_complexity)]
1137const _: fn(&Image, u32, u32, BorderMode, f32) -> Result<Image> = Image::morphology_black_hat;
1138#[allow(clippy::type_complexity)]
1139const _: fn(&Image, u32, f32, f32, BorderMode) -> Result<Image> =
1140 crate::image::adaptive_threshold_mean;
1141#[allow(clippy::type_complexity)]
1142const _: fn(&Image, u32, f32, f32, BorderMode) -> Result<Image> = Image::adaptive_threshold_mean;
1143#[allow(clippy::type_complexity)]
1144const _: fn(&Image, u32, f32, f32, f32, BorderMode) -> Result<Image> =
1145 crate::image::adaptive_threshold_gaussian;
1146#[allow(clippy::type_complexity)]
1147const _: fn(&Image, u32, f32, f32, f32, BorderMode) -> Result<Image> =
1148 Image::adaptive_threshold_gaussian;
1149#[allow(clippy::type_complexity)]
1150const _: fn(&Image, NormalizationConfig) -> Result<Image> = crate::image::normalize;
1151#[allow(clippy::type_complexity)]
1152const _: fn(&Image, NormalizationConfig) -> Result<Image> = Image::normalize;
1153#[allow(clippy::type_complexity)]
1154const _: fn(&Image, crate::ImageFormat) -> Result<Image> = crate::image::convert_color;
1155#[allow(clippy::type_complexity)]
1156const _: fn(&Image, crate::ImageFormat) -> Result<Image> = Image::convert_color;
1157#[allow(clippy::type_complexity)]
1158const _: fn(&Image, u32, u32, NormalizationConfig) -> Result<Image> =
1159 crate::image::resize_normalize;
1160#[allow(clippy::type_complexity)]
1161const _: fn(&Image, u32, u32, NormalizationConfig) -> Result<Image> = Image::resize_normalize;
1162#[allow(clippy::type_complexity)]
1163const _: fn(&Image, &Matrix, &Matrix, f32) -> Result<Image> = crate::image::segmentation_overlay;
1164#[allow(clippy::type_complexity)]
1165const _: fn(&Image, &Matrix, &Matrix, f32) -> Result<Image> = Image::segmentation_overlay;
1166#[allow(clippy::type_complexity)]
1167const _: fn(&Image, u32, f32, f32) -> Result<Matrix> = crate::image::calc_hist;
1168#[allow(clippy::type_complexity)]
1169const _: fn(&Image, u32, f32, f32) -> Result<Matrix> = Image::calc_hist;
1170#[allow(clippy::type_complexity)]
1171const _: fn(&Image) -> Result<Image> = crate::image::equalize_hist;
1172#[allow(clippy::type_complexity)]
1173const _: fn(&Image) -> Result<Image> = Image::equalize_hist;
1174#[allow(clippy::type_complexity)]
1175const _: fn(&Image) -> Result<Image> = crate::image::pyr_down;
1176#[allow(clippy::type_complexity)]
1177const _: fn(&Image) -> Result<Image> = Image::pyr_down;
1178#[allow(clippy::type_complexity)]
1179const _: fn(&Image) -> Result<Image> = crate::image::pyr_up;
1180#[allow(clippy::type_complexity)]
1181const _: fn(&Image) -> Result<Image> = Image::pyr_up;
1182#[allow(clippy::type_complexity)]
1183const _: fn(&Image, AutoThreshold, f32) -> Result<(Image, Matrix)> = crate::image::threshold_auto;
1184#[allow(clippy::type_complexity)]
1185const _: fn(&Image, AutoThreshold, f32) -> Result<(Image, Matrix)> = Image::threshold_auto;
1186#[allow(clippy::type_complexity)]
1187const _: fn(&Image) -> Result<Matrix> = crate::image::integral;
1188#[allow(clippy::type_complexity)]
1189const _: fn(&Image) -> Result<Matrix> = Image::integral;
1190#[allow(clippy::type_complexity)]
1191const _: fn(&Image, ColorConversion) -> Result<Image> = crate::image::cvt_color;
1192#[allow(clippy::type_complexity)]
1193const _: fn(&Image, ColorConversion) -> Result<Image> = Image::cvt_color;
1194#[allow(clippy::type_complexity)]
1195const _: fn(&Image, ColorMap) -> Result<Image> = crate::image::apply_color_map;
1196#[allow(clippy::type_complexity)]
1197const _: fn(&Image, ColorMap) -> Result<Image> = Image::apply_color_map;
1198#[allow(clippy::type_complexity)]
1199const _: fn(&Image, &Matrix, f32, f32) -> Result<Image> = crate::image::calc_back_project;
1200#[allow(clippy::type_complexity)]
1201const _: fn(&Image, &Matrix, f32, f32) -> Result<Image> = Image::calc_back_project;
1202#[allow(clippy::type_complexity)]
1203const _: fn(&Image, f32, u32, u32) -> Result<Image> = crate::image::clahe;
1204#[allow(clippy::type_complexity)]
1205const _: fn(&Image, f32, u32, u32) -> Result<Image> = Image::clahe;
1206#[allow(clippy::type_complexity)]
1207const _: fn(&Image, &Image) -> Result<Image> = crate::image::accumulate;
1208#[allow(clippy::type_complexity)]
1209const _: fn(&Image, &Image) -> Result<Image> = Image::accumulate;
1210#[allow(clippy::type_complexity)]
1211const _: fn(&Image, &Image, f32) -> Result<Image> = crate::image::accumulate_weighted;
1212#[allow(clippy::type_complexity)]
1213const _: fn(&Image, &Image, f32) -> Result<Image> = Image::accumulate_weighted;
1214#[allow(clippy::type_complexity)]
1215const _: fn(&Image) -> Result<Matrix> = crate::image::moments;
1216#[allow(clippy::type_complexity)]
1217const _: fn(&Image) -> Result<Matrix> = Image::moments;
1218#[allow(clippy::type_complexity)]
1219const _: fn(&Image, &Image, f32) -> Result<Matrix> = crate::image::psnr;
1220#[allow(clippy::type_complexity)]
1221const _: fn(&Image, &Image, f32) -> Result<Matrix> = Image::psnr;
1222#[allow(clippy::type_complexity)]
1223const _: fn(&Image, &Image) -> Result<Matrix> = crate::image::ssim;
1224#[allow(clippy::type_complexity)]
1225const _: fn(&Image, &Image) -> Result<Matrix> = Image::ssim;
1226#[allow(clippy::type_complexity)]
1227const _: fn(&Image, &Image, MatchTemplate) -> Result<Matrix> = crate::image::match_template;
1228#[allow(clippy::type_complexity)]
1229const _: fn(&Image, &Image, MatchTemplate) -> Result<Matrix> = Image::match_template;
1230#[allow(clippy::type_complexity)]
1231const _: fn(
1232 &Image,
1233 f32,
1234 f32,
1235 f32,
1236 u32,
1237 u32,
1238 PolarMode,
1239 InterpolationMode,
1240 BorderMode,
1241 f32,
1242) -> Result<Image> = crate::image::warp_polar;
1243#[allow(clippy::type_complexity)]
1244const _: fn(
1245 &Image,
1246 f32,
1247 f32,
1248 f32,
1249 u32,
1250 u32,
1251 PolarMode,
1252 InterpolationMode,
1253 BorderMode,
1254 f32,
1255) -> Result<Image> = Image::warp_polar;
1256#[allow(clippy::type_complexity)]
1257const _: fn(&Image, f32, f32, u32) -> Result<Image> = crate::image::canny;
1258#[allow(clippy::type_complexity)]
1259const _: fn(&Image, f32, f32, u32) -> Result<Image> = Image::canny;
1260#[allow(clippy::type_complexity)]
1261const _: fn(&Image, f32, Connectivity, u32) -> Result<Matrix> = crate::image::connected_components;
1262#[allow(clippy::type_complexity)]
1263const _: fn(&Image, f32, Connectivity, u32) -> Result<Matrix> = Image::connected_components;
1264#[allow(clippy::type_complexity)]
1265const _: fn(&Image, f32, DistanceType, u32) -> Result<Matrix> = crate::image::distance_transform;
1266#[allow(clippy::type_complexity)]
1267const _: fn(&Image, f32, DistanceType, u32) -> Result<Matrix> = Image::distance_transform;
1268#[allow(clippy::type_complexity)]
1269const _: fn(&Image, f32, f32, f32, u32, u32) -> Result<Matrix> = crate::image::hough_lines;
1270#[allow(clippy::type_complexity)]
1271const _: fn(&Image, f32, f32, f32, u32, u32) -> Result<Matrix> = Image::hough_lines;
1272#[allow(clippy::type_complexity)]
1273const _: fn(&Image, f32, f32, f32, u32, u32, f32, u32) -> Result<Matrix> =
1274 crate::image::hough_lines_p;
1275#[allow(clippy::type_complexity)]
1276const _: fn(&Image, f32, f32, f32, u32, u32, f32, u32) -> Result<Matrix> = Image::hough_lines_p;
1277#[allow(clippy::type_complexity)]
1278const _: fn(&Image, f32, Connectivity, u32, u32, u32) -> Result<(Matrix, Matrix)> =
1279 crate::image::find_contours;
1280#[allow(clippy::type_complexity)]
1281const _: fn(&Image, f32, Connectivity, u32, u32, u32) -> Result<(Matrix, Matrix)> =
1282 Image::find_contours;
1283#[allow(clippy::type_complexity)]
1284const _: fn(&Image, u32, u32, f32, f32, f32, Connectivity, u32) -> Result<Image> =
1285 crate::image::flood_fill;
1286#[allow(clippy::type_complexity)]
1287const _: fn(&Image, u32, u32, f32, f32, f32, Connectivity, u32) -> Result<Image> =
1288 Image::flood_fill;
1289#[allow(clippy::type_complexity)]
1290const _: fn(&Image, f32, f32, f32, f32, f32, f32) -> Result<Image> = crate::image::draw_line;
1291#[allow(clippy::type_complexity)]
1292const _: fn(&Image, f32, f32, f32, f32, f32, f32) -> Result<Image> = Image::draw_line;
1293#[allow(clippy::type_complexity)]
1294const _: fn(&Image, f32, f32, f32, f32, f32, f32) -> Result<Image> = crate::image::draw_rectangle;
1295#[allow(clippy::type_complexity)]
1296const _: fn(&Image, f32, f32, f32, f32, f32, f32) -> Result<Image> = Image::draw_rectangle;
1297#[allow(clippy::type_complexity)]
1298const _: fn(&Image, f32, f32, f32, f32, f32) -> Result<Image> = crate::image::draw_circle;
1299#[allow(clippy::type_complexity)]
1300const _: fn(&Image, f32, f32, f32, f32, f32) -> Result<Image> = Image::draw_circle;
1301#[allow(clippy::type_complexity)]
1302const _: fn(&Image, &Matrix, f32) -> Result<Image> = crate::image::fill_polygon;
1303#[allow(clippy::type_complexity)]
1304const _: fn(&Image, &Matrix, f32) -> Result<Image> = Image::fill_polygon;
1305#[allow(clippy::type_complexity)]
1306const _: fn(&Image, u32, f32, CornerScore) -> Result<Image> = crate::image::corner_score;
1307#[allow(clippy::type_complexity)]
1308const _: fn(&Image, u32, f32, CornerScore) -> Result<Image> = Image::corner_score;
1309#[allow(clippy::type_complexity)]
1310const _: fn(&Image, u32) -> Result<Image> = crate::image::corner_fast;
1311#[allow(clippy::type_complexity)]
1312const _: fn(&Image, u32) -> Result<Image> = Image::corner_fast;
1313#[allow(clippy::type_complexity)]
1314const _: fn(&Image, u32, f32, f32) -> Result<(Matrix, Matrix)> =
1315 crate::image::good_features_to_track;
1316#[allow(clippy::type_complexity)]
1317const _: fn(&Image, u32, f32, f32) -> Result<(Matrix, Matrix)> = Image::good_features_to_track;
1318#[allow(clippy::type_complexity)]
1319const _: fn(&Image, u32, f32, f32, u32, u32) -> Result<(Matrix, Matrix, Matrix)> =
1320 crate::image::orb;
1321#[allow(clippy::type_complexity)]
1322const _: fn(&Image, u32, f32, f32, u32, u32) -> Result<(Matrix, Matrix, Matrix)> = Image::orb;
1323#[allow(clippy::type_complexity)]
1324const _: fn(&Image, &Image, &Matrix, u32, u32, u32, f32) -> Result<(Matrix, Matrix, Matrix)> =
1325 crate::image::optical_flow_pyr_lk;
1326#[allow(clippy::type_complexity)]
1327const _: fn(&Image, &Image, &Matrix, u32, u32, u32, f32) -> Result<(Matrix, Matrix, Matrix)> =
1328 Image::optical_flow_pyr_lk;
1329#[allow(clippy::type_complexity)]
1330const _: fn(&Image, &Image, u32, u32, u32, u32, f32) -> Result<Matrix> =
1331 crate::image::optical_flow_farneback;
1332#[allow(clippy::type_complexity)]
1333const _: fn(&Image, &Image, u32, u32, u32, u32, f32) -> Result<Matrix> =
1334 Image::optical_flow_farneback;
1335#[allow(clippy::type_complexity)]
1336const _: fn(&Image, &Image, u32, u32, u32) -> Result<Matrix> = crate::image::stereo_bm;
1337#[allow(clippy::type_complexity)]
1338const _: fn(&Image, &Image, u32, u32, u32) -> Result<Matrix> = Image::stereo_bm;
1339#[allow(clippy::type_complexity)]
1340const _: fn(&Image, f32, u32, u32) -> Result<Image> = crate::image::fast_nl_means_denoising;
1341#[allow(clippy::type_complexity)]
1342const _: fn(&Image, f32, u32, u32) -> Result<Image> = Image::fast_nl_means_denoising;
1343#[allow(clippy::type_complexity)]
1344const _: fn(&Image, f32, f32, u32) -> Result<Image> = crate::image::pyr_mean_shift_filtering;
1345#[allow(clippy::type_complexity)]
1346const _: fn(&Image, f32, f32, u32) -> Result<Image> = Image::pyr_mean_shift_filtering;