| 42 | namespace { |
| 43 | |
| 44 | static NVCVPointI pytopoint(py::tuple point) |
| 45 | { |
| 46 | if (point.size() > 2 || point.size() == 0) |
| 47 | throw py::value_error("Invalid point size."); |
| 48 | |
| 49 | NVCVPointI ret; |
| 50 | memset(&ret, 0, sizeof(ret)); |
| 51 | |
| 52 | int *pr = (int *)&ret; |
| 53 | for (size_t i = 0; i < point.size(); ++i) |
| 54 | { |
| 55 | pr[i] = point[i].cast<int>(); |
| 56 | } |
| 57 | return ret; |
| 58 | } |
| 59 | |
| 60 | static NVCVBoxI pytobox(py::tuple box) |
| 61 | { |