Convert between OpenCV Mat and Leptonica Pix

前端 未结 3 1567
清酒与你
清酒与你 2021-02-06 16:06

I need to convert between OpenCV Mat image and Leptonica Pix image formats in C++. This is being used for binarization of 8bit gray images.

3条回答
  •  星月不相逢
    2021-02-06 16:52

    To convert pix to Mat add these line in @loot code before calling pix8toMat.

    Pix *8bitPix = pixConvert1To8(NULL, pixt, 255, 0);
    

    Now send this 8bitPix to mat conversion. [it works for binary image]

提交回复
热议问题