Skip to content

Commit 1b0bfbc

Browse files
fix: convex polly type
1 parent 56c9957 commit 1b0bfbc

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

cpp/FOCV_Function.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1020,11 +1020,16 @@ jsi::Object FOCV_Function::invoke(jsi::Runtime& runtime, const jsi::Value* argum
10201020
} break;
10211021
case hashString("fillConvexPoly", 14): {
10221022
auto img = args.asMatPtr(1);
1023-
auto pts = args.asMatVectorPtr(2);
10241023
auto color = args.asScalarPtr(3);
10251024
auto line_type = args.asNumber(4);
10261025

1027-
cv::fillConvexPoly(*img, *pts, *color, line_type);
1026+
if(args.isMat(2)) {
1027+
auto pts = args.asMatPtr(2);
1028+
cv::fillConvexPoly(*img, *pts, *color, line_type);
1029+
} else {
1030+
auto pts = args.asPointVectorPtr(2);
1031+
cv::fillConvexPoly(*img, *pts, *color, line_type);
1032+
}
10281033
} break;
10291034
case hashString("fillPoly", 8): {
10301035
auto img = args.asMatPtr(1);

docs/pages/availablefunctions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1493,7 +1493,7 @@ Fills a convex polygon.
14931493
invoke(
14941494
name: 'fillConvexPoly',
14951495
img: Mat,
1496-
pts: MatVector,
1496+
pts: Mat | PointVector,
14971497
color: Scalar,
14981498
lineType: LineTypes
14991499
): void;

src/functions/ImageProcessing/Drawing.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import type {
33
Mat,
44
MatVector,
55
Point,
6+
PointVector,
67
Scalar,
78
Size,
89
} from '../../objects/Objects';
@@ -135,7 +136,7 @@ export type Drawing = {
135136
invoke(
136137
name: 'fillConvexPoly',
137138
img: Mat,
138-
pts: MatVector,
139+
pts: Mat | PointVector,
139140
color: Scalar,
140141
lineType: LineTypes
141142
): void;

0 commit comments

Comments
 (0)