Skip to content

Commit 3acf7bc

Browse files
committed
feat: add support for the function 'morphologyDefaultBorderValue'
1 parent 2cc7ffb commit 3acf7bc

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

cpp/FOCV_Function.cpp

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

11081108
cv::medianBlur(*src, *dst, ksize);
11091109
} break;
1110+
case hashString("morphologyDefaultBorderValue", 28): {
1111+
auto scalar = cv::morphologyDefaultBorderValue();
1112+
std::string id = FOCV_Storage::save(scalar);
1113+
1114+
return FOCV_JsiObject::wrap(runtime, "scalar", id);
1115+
} break;
11101116
case hashString("morphologyEx", 12): {
11111117
auto src = args.asMatPtr(1);
11121118
auto dst = args.asMatPtr(2);

docs/pages/availablefunctions.md

+8
Original file line numberDiff line numberDiff line change
@@ -1899,6 +1899,14 @@ The function smoothes an image using the median filter with the 𝚔𝚜𝚒𝚣
18991899
invoke(name: 'medianBlur', src: Mat, dst: Mat, ksize: number): void;
19001900
```
19011901

1902+
### morphologyDefaultBorderValue
1903+
1904+
@returns "magic" border value for erosion and dilation. It is automatically transformed to Scalar::all(-DBL_MAX) for dilation.
1905+
1906+
```js
1907+
invoke(name: 'morphologyDefaultBorderValue'): Scalar;
1908+
```
1909+
19021910
### morphologyEx
19031911

19041912
Performs advanced morphological transformations.

src/functions/ImageProcessing/ImageFiltering.ts

+5
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,11 @@ export type ImageFiltering = {
237237
*/
238238
invoke(name: 'medianBlur', src: Mat, dst: Mat, ksize: number): void;
239239

240+
/**
241+
* returns "magic" border value for erosion and dilation. It is automatically transformed to Scalar::all(-DBL_MAX) for dilation.
242+
*/
243+
invoke(name: 'morphologyDefaultBorderValue'): Scalar;
244+
240245
/**
241246
* Performs advanced morphological transformations.
242247
* The function cv::morphologyEx can perform advanced morphological transformations using an erosion and dilation as basic operations.

0 commit comments

Comments
 (0)