Skip to content

Commit 94a9295

Browse files
feat: merge function
1 parent 9c03fd1 commit 94a9295

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed

cpp/FOCV_Function.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -590,6 +590,12 @@ jsi::Object FOCV_Function::invoke(jsi::Runtime& runtime, const jsi::Value* argum
590590

591591
cv::normalize(*src, *dst, alpha, normType);
592592
} break;
593+
case hashString("merge", 5): {
594+
auto src = args.asMatVectorPtr(1);
595+
auto dst = args.asMatPtr(2);
596+
597+
cv::merge(*src, *dst);
598+
} break;
593599
case hashString("patchNaNs", 9): {
594600
auto alpha = args.asNumber(2);
595601

docs/pages/availablefunctions.md

+10
Original file line numberDiff line numberDiff line change
@@ -882,6 +882,16 @@ invoke(
882882
normType: NormTypes
883883
): void;
884884
```
885+
### normalize
886+
887+
Merges several arrays to make a single multi-channel array
888+
889+
- channels input vector of matrices to be merged; all the matrices in mv must have the same size and the same depth.
890+
- dst output array of the same size and the same depth as mv[0]; The number of channels will be the total number of channels in the matrix array.
891+
892+
```js
893+
invoke(name: 'merge', channels: MatVector, dst: Mat): void;
894+
```
885895

886896
### patchNaNs
887897

src/functions/Core.ts

+8
Original file line numberDiff line numberDiff line change
@@ -712,6 +712,14 @@ export type Core = {
712712
normType: NormTypes
713713
): void;
714714

715+
/**
716+
* Merges several arrays to make a single multi-channel array.
717+
* @param name Function name.
718+
* @param channels input vector of matrices to be merged; all the matrices in mv must have the same size and the same depth.
719+
* @param dst output array of the same size and the same depth as mv[0]; The number of channels will be the total number of channels in the matrix array.
720+
*/
721+
invoke(name: 'merge', channels: MatVector, dst: Mat): void;
722+
715723
/**
716724
* converts NaNs to the given number
717725
* @param name Function name.

0 commit comments

Comments
 (0)