@@ -306,6 +306,21 @@ public static Scalar Sum(InputArray src)
306306 return ret ;
307307 }
308308
309+ /// <summary>
310+ /// Checks whether the array contains at least one non-zero element. Faster than
311+ /// <see cref="CountNonZero"/> when only the presence of non-zero elements matters.
312+ /// </summary>
313+ /// <param name="src">Single-channel array</param>
314+ /// <returns>true if src has at least one non-zero element</returns>
315+ public static bool HasNonZero ( InputArray src )
316+ {
317+ NativeMethods . HandleException (
318+ NativeMethods . core_hasNonZero ( src . Proxy , out var ret ) ) ;
319+
320+ GC . KeepAlive ( src . Source ) ;
321+ return ret != 0 ;
322+ }
323+
309324 /// <summary>
310325 /// computes the number of nonzero array elements
311326 /// </summary>
@@ -806,6 +821,37 @@ public static void Flip(InputArray src, OutputArray dst, FlipMode flipCode)
806821 GC . KeepAlive ( dst . Source ) ;
807822 }
808823
824+ /// <summary>
825+ /// Flips an n-dimensional array along the given axis.
826+ /// </summary>
827+ /// <param name="src">The source array</param>
828+ /// <param name="dst">The destination array; will have the same size and same type as src</param>
829+ /// <param name="axis">Axis to flip along.</param>
830+ public static void FlipND ( InputArray src , OutputArray dst , int axis )
831+ {
832+ NativeMethods . HandleException (
833+ NativeMethods . core_flipND ( src . Proxy , dst . Proxy , axis ) ) ;
834+
835+ GC . KeepAlive ( src . Source ) ;
836+ GC . KeepAlive ( dst . Source ) ;
837+ }
838+
839+ /// <summary>
840+ /// Broadcasts the given array to the given shape.
841+ /// </summary>
842+ /// <param name="src">input array</param>
843+ /// <param name="shape">target shape. Should be a list of CV_32S numbers. Negative values are not supported.</param>
844+ /// <param name="dst">output array that has the given shape</param>
845+ public static void Broadcast ( InputArray src , InputArray shape , OutputArray dst )
846+ {
847+ NativeMethods . HandleException (
848+ NativeMethods . core_broadcast ( src . Proxy , shape . Proxy , dst . Proxy ) ) ;
849+
850+ GC . KeepAlive ( src . Source ) ;
851+ GC . KeepAlive ( shape . Source ) ;
852+ GC . KeepAlive ( dst . Source ) ;
853+ }
854+
809855 /// <summary>
810856 /// Rotates a 2D array in multiples of 90 degrees.
811857 /// </summary>
@@ -1398,6 +1444,20 @@ public static void PatchNaNs(InputOutputArray a, double val = 0)
13981444 GC . KeepAlive ( a . Source ) ;
13991445 }
14001446
1447+ /// <summary>
1448+ /// Computes a mask of finite (non-NaN, non-Inf) elements, a companion to <see cref="PatchNaNs"/>.
1449+ /// </summary>
1450+ /// <param name="src">input array.</param>
1451+ /// <param name="mask">output mask array of the same size as src, CV_8U type.</param>
1452+ public static void FiniteMask ( InputArray src , OutputArray mask )
1453+ {
1454+ NativeMethods . HandleException (
1455+ NativeMethods . core_finiteMask ( src . Proxy , mask . Proxy ) ) ;
1456+
1457+ GC . KeepAlive ( src . Source ) ;
1458+ GC . KeepAlive ( mask . Source ) ;
1459+ }
1460+
14011461 /// <summary>
14021462 /// implements generalized matrix product algorithm GEMM from BLAS
14031463 /// </summary>
@@ -1461,7 +1521,24 @@ public static void Transpose(InputArray src, OutputArray dst)
14611521 GC . KeepAlive ( src . Source ) ;
14621522 GC . KeepAlive ( dst . Source ) ;
14631523 }
1464-
1524+
1525+ /// <summary>
1526+ /// Transposes an n-dimensional array by permuting its axes according to the given order.
1527+ /// </summary>
1528+ /// <param name="src">The source array</param>
1529+ /// <param name="order">Permutation of axes, e.g. { 1, 0, 2 } to swap the first two axes.</param>
1530+ /// <param name="dst">The destination array</param>
1531+ public static void TransposeND ( InputArray src , int [ ] order , OutputArray dst )
1532+ {
1533+ ArgumentNullException . ThrowIfNull ( order ) ;
1534+
1535+ NativeMethods . HandleException (
1536+ NativeMethods . core_transposeND ( src . Proxy , order , order . Length , dst . Proxy ) ) ;
1537+
1538+ GC . KeepAlive ( src . Source ) ;
1539+ GC . KeepAlive ( dst . Source ) ;
1540+ }
1541+
14651542 /// <summary>
14661543 /// performs affine transformation of each element of multi-channel input matrix
14671544 /// </summary>
@@ -2646,6 +2723,61 @@ public static bool UseOptimized()
26462723 return ret != 0 ;
26472724 }
26482725
2726+ /// <summary>
2727+ /// Returns whether IPP is used for acceleration.
2728+ /// </summary>
2729+ /// <returns></returns>
2730+ public static bool UseIPP ( )
2731+ {
2732+ NativeMethods . HandleException (
2733+ NativeMethods . core_useIPP ( out var ret ) ) ;
2734+ return ret != 0 ;
2735+ }
2736+
2737+ /// <summary>
2738+ /// Turns on/off IPP-based acceleration.
2739+ /// </summary>
2740+ /// <param name="flag"></param>
2741+ public static void SetUseIPP ( bool flag )
2742+ {
2743+ NativeMethods . HandleException (
2744+ NativeMethods . core_setUseIPP ( flag ? 1 : 0 ) ) ;
2745+ }
2746+
2747+ /// <summary>
2748+ /// Returns the current IPP library version.
2749+ /// </summary>
2750+ /// <returns></returns>
2751+ public static string GetIppVersion ( )
2752+ {
2753+ using var buf = new StdString ( ) ;
2754+ NativeMethods . HandleException (
2755+ NativeMethods . core_getIppVersion ( buf . CvPtr ) ) ;
2756+ return buf . ToString ( ) ;
2757+ }
2758+
2759+ /// <summary>
2760+ /// Returns whether IPP is used in "not exact" mode. In this mode IPP may be used even where
2761+ /// it and OpenCV have internal accuracy differences that impact accuracy tests.
2762+ /// </summary>
2763+ /// <returns></returns>
2764+ public static bool UseIppNotExact ( )
2765+ {
2766+ NativeMethods . HandleException (
2767+ NativeMethods . core_useIPP_NotExact ( out var ret ) ) ;
2768+ return ret != 0 ;
2769+ }
2770+
2771+ /// <summary>
2772+ /// Turns on/off IPP "not exact" mode.
2773+ /// </summary>
2774+ /// <param name="flag"></param>
2775+ public static void SetUseIppNotExact ( bool flag )
2776+ {
2777+ NativeMethods . HandleException (
2778+ NativeMethods . core_setUseIPP_NotExact ( flag ? 1 : 0 ) ) ;
2779+ }
2780+
26492781 /// <summary>
26502782 /// Aligns buffer size by the certain number of bytes
26512783 /// This small inline function aligns a buffer size by
0 commit comments