Cv::Pango - Pango を使っていろいろな文字を描く
use Cv; use Cv::Pango; my $img = Cv::Mat->new([240, 320], CV_8UC4); $img->putText( "\x{03A0}\x{03B1}\x{03BD}\x{8A9E}", # "Παν語", [20, 200], 'Sans Serif 42', ); $img->showImage; $img->waitKey;
Cv::Pango は、Pango を使用して、いろいろな文字を描きます。 Cv::Arr::PutText() そのものを置き換えます。
Cv::Pango
$img は Cv::Arr のオブジェクトです。$font は Pango::FontDescription の オブジェクトかフォントを識別するための文字列を指定します。InitFont() で 作成したフォントも使えます。PutText のその他のパラメータの詳細は OpenCV の cvPutText() を参照してください。
フォントを識別するための文字列は次のとおり。
"[FAMILY-LIST] [STYLE-OPTIONS] [SIZE]"
具体的には、
"sans bold 12" "serif,monospace bold italic condensed 16" "normal 10"
詳細は pango.FontDescription() を参照してください。
文字列のサイズとベースラインを求めます。サイズは幅と高さです。このサブ ルーチンは Pango::FontDescription に配置されます。行儀が悪いと思うので すが、どうすればいいのか分っていません。
ありません。
いまのところ、CV_8UC1 と CV_8UC4 しか使えません。
このパッケージは、フォントが Pango::FontDescription のオブジェクトにな るので、この名前空間に cvGetTextSize() を置きます。もっと上手なパッチの あて方をご存知の方は教えてください。
Cv::Nihongo
Yuta MASUDA <yuta.masuda@newdaysys.co.jp>
Copyright (c) 2010, 2011, 2012 by Yuta MASUDA.
All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Cv, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Cv
CPAN shell
perl -MCPAN -e shell install Cv
For more information on module installation, please visit the detailed CPAN module installation guide.