v0.7.6.2 Release

v0.7.6.2 Release
This commit is contained in:
jdsouza90
2021-09-13 09:02:33 -07:00
parent c4154fa68f
commit 3bd2be62a4
27 changed files with 521 additions and 258 deletions

View File

@@ -52,9 +52,9 @@ void draw_wireframe(const cv::Mat& image, const NvAR_FaceMesh& mesh, const NvAR_
glm::project({mesh.vertices[triangle.vec[2]].vec[0], mesh.vertices[triangle.vec[2]].vec[1], mesh.vertices[triangle.vec[2]].vec[2]},
modelview, projection, viewport);
if (are_vertices_ccw_in_screen_space(glm::vec2(p1), glm::vec2(p2), glm::vec2(p3))) {
cv::line(image, cv::Point(p1.x, p1.y), cv::Point(p2.x, p2.y), color);
cv::line(image, cv::Point(p2.x, p2.y), cv::Point(p3.x, p3.y), color);
cv::line(image, cv::Point(p3.x, p3.y), cv::Point(p1.x, p1.y), color);
cv::line(image, cv::Point2f(p1.x, p1.y), cv::Point2f(p2.x, p2.y), color);
cv::line(image, cv::Point2f(p2.x, p2.y), cv::Point2f(p3.x, p3.y), color);
cv::line(image, cv::Point2f(p3.x, p3.y), cv::Point2f(p1.x, p1.y), color);
}
}
};

View File

@@ -58,21 +58,22 @@ inline void CVWrapperForNvCVImage(const NvCVImage *nvcvIm, cv::Mat *cvIm) {
// Wrap a cv::Mat in an NvCVImage.
inline void NVWrapperForCVMat(const cv::Mat *cvIm, NvCVImage *nvcvIm) {
static const NvCVImage_PixelFormat nvFormat[] = { NVCV_FORMAT_UNKNOWN, NVCV_Y, NVCV_YA, NVCV_BGR, NVCV_BGRA };
static const NvCVImage_ComponentType nvType[] = { NVCV_U8, NVCV_TYPE_UNKNOWN, NVCV_U16, NVCV_S16, NVCV_S32, NVCV_F32, NVCV_F64 };
static const NvCVImage_ComponentType nvType[] = {NVCV_U8, NVCV_TYPE_UNKNOWN, NVCV_U16, NVCV_S16,
NVCV_S32, NVCV_F32, NVCV_F64, NVCV_TYPE_UNKNOWN};
nvcvIm->pixels = cvIm->data;
nvcvIm->width = cvIm->cols;
nvcvIm->height = cvIm->rows;
nvcvIm->pitch = (unsigned)cvIm->step1();
nvcvIm->pixelFormat = nvFormat[cvIm->channels()];
nvcvIm->componentType = nvType[cvIm->depth()];
nvcvIm->pitch = (int)cvIm->step[0];
nvcvIm->pixelFormat = nvFormat[cvIm->channels() <= 4 ? cvIm->channels() : 0];
nvcvIm->componentType = nvType[cvIm->depth() & 7];
nvcvIm->bufferBytes = 0;
nvcvIm->deletePtr = nullptr;
nvcvIm->deleteProc = nullptr;
nvcvIm->pixelBytes = (unsigned char)cvIm->elemSize();
nvcvIm->pixelBytes = (unsigned char)cvIm->step[1];
nvcvIm->componentBytes = (unsigned char)cvIm->elemSize1();
nvcvIm->numComponents = (unsigned char)cvIm->channels();
nvcvIm->planar = 0;
nvcvIm->gpuMem = 0;
nvcvIm->planar = NVCV_CHUNKY;
nvcvIm->gpuMem = NVCV_CPU;
nvcvIm->reserved[0] = 0;
nvcvIm->reserved[1] = 0;
}