I wish to combine Magick++ with Tesseract OCR. I couldn't send Magick++
Image
object to Tesseract
setImage(const uchar*,int width,int height,int byte_per_pixel,int byte_per_line);
method. It doesnt have byte_per_line information.
Thanks for any help.
Edit: with the help of emcconville i organized my code and it seems working.
Magick::Image* imgptr = mat2Image(frame); // cv::Mat
Geometry size = imgptr->size();
imgptr->density(Geometry(300,300));
size_t area = frame.rows * frame.cols;
uchar* data = new uchar[3 * CharPixel * area];
imgptr->write(0,0,frame.cols,frame.rows, "BGR",CharPixel,data);
api- >SetImage(data,size.width(),size.height(),3*CharPixel,3*CharPixel*size.width());
delete [] data;
delete imgptr;