Skip to content

Commit 1bb7a7e

Browse files
committed
feat: add support for the function 'morphologyDefaultBorderValue'
1 parent cb2be45 commit 1bb7a7e

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
@@ -1108,6 +1108,12 @@ jsi::Object FOCV_Function::invoke(jsi::Runtime& runtime, const jsi::Value* argum
11081108

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

docs/pages/availablefunctions.md

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

1849+
### morphologyDefaultBorderValue
1850+
1851+
@returns "magic" border value for erosion and dilation. It is automatically transformed to Scalar::all(-DBL_MAX) for dilation.
1852+
1853+
```js
1854+
invoke(name: 'morphologyDefaultBorderValue'): Scalar;
1855+
```
1856+
18491857
### morphologyEx
18501858
Performs advanced morphological transformations.
18511859
The function cv::morphologyEx can perform advanced morphological transformations using an erosion and dilation as basic operations.

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)