M. Ivanov
M. Ivanov

Reputation: 283

How do I create a border around a rectangle in an image(PIX) in Leptonica?

I have an image in PIX format, and I have a BOX[with the necessary coordinates] too, I would like to draw a border around the content that's in the box, like for example -
example

I've looked around in the documentation, but so far I've only found out how to border the whole image, not just a rectangle inside it.

Upvotes: 2

Views: 1256

Answers (1)

Aditya Kumar Praharaj
Aditya Kumar Praharaj

Reputation: 309

Your method works only for images depth of 3 bpp. Use the pixPaintBoxa or pixDrawBoxa method. See https://tpgit.github.io/Leptonica/boxfunc3_8c.html#a2dca217227f62a99f6003910420b47ba for more details. These methods work for any bpp.

However to use these functions, you have to build leptonica again using static makefiles. See http://www.leptonica.com/source/README.html#DEVELOP for more details.

Upvotes: 1

Related Questions