intersectConvexConvex
import { intersectConvexConvex } from '@banou/opencv-wasm'Use after await initOpenCV(). See the initialization and named imports guide.
example: samples/cpp/snippets/intersectExample.cpp Examples of how intersectConvexConvex works Finds intersection of two convex polygons
Note: intersectConvexConvex doesn't confirm that both polygons are convex and will return invalid results if they aren't.
intersectConvexConvex(p1: Mat, p2: Mat, p12: Mat, handleNested: boolean): number;2 available overloads
intersectConvexConvex(p1: Mat, p2: Mat, p12: Mat): number;intersectConvexConvex(p1: Mat, p2: Mat, p12: Mat, handleNested: boolean): number;p1First polygon
p2Second polygon
p12Output destination, filled by the native operation. Output polygon describing the intersecting area
handleNestedWhen true, an intersection is found if one of the polygons is fully enclosed in the other. When false, no intersection is found. If the polygons share a side or the vertex of one polygon lies on an edge of the other, they are not considered nested and an intersection will be found regardless of the value of handleNested.
Area of intersecting polygon. May be negative, if algorithm has not converged, e.g. non-convex input.
These signatures describe this package. Upstream documentation can mention optional backends that are absent from this build. Check runtime compatibility before choosing a backend or file format.