Open Juddd opened 6 years ago
https://github.com/creatale/node-dv/blob/3b0c5265d74bfb0f4b811fde525d76aad7126169/src/image.cc#L164-L175
I know this code can convert the pix into Mat
Pix *p = pixRead("mytif.tif"); Mat mat1 = pix8ToMat(p);
But this code will fail to convert the Pix into Mat
Mat image = imread("danger_module.png", 0); cvtColor(image, image, CV_GRAY2BGR); api->SetImage(image.data, image.cols, image.rows, 3, 3 * image.cols); Pix* page_pix = api->GetThresholdedImage(); Mat mat2 = pix8ToMat(page_pix);
I just can view the page_pix by pixWrite("tessinput.png", page_pix, IFF_PNG); now. I think the question is derive from your pix8ToMat. Help please.
page_pix
pixWrite("tessinput.png", page_pix, IFF_PNG);
pix8ToMat
https://github.com/creatale/node-dv/blob/3b0c5265d74bfb0f4b811fde525d76aad7126169/src/image.cc#L164-L175
I know this code can convert the pix into Mat
But this code will fail to convert the Pix into Mat
I just can view the
page_pix
bypixWrite("tessinput.png", page_pix, IFF_PNG);
now. I think the question is derive from yourpix8ToMat
. Help please.