{"componentChunkName":"component---src-templates-post-template-js","path":"/posts/computer-vision-libraries","result":{"data":{"markdownRemark":{"id":"86f9efee-b55b-5530-a817-09a25c12ce15","html":"<p>画像処理のライブラリとしては OpenCV が有名だと思いますが、改めて定番のライブラリを調べてみました。</p>\n<p>以下の 5 つについて概要を書いていきます。</p>\n<ul>\n<li>OpenCV</li>\n<li>Pillow</li>\n<li>ImageMagick</li>\n<li>cairo</li>\n<li>Graphviz</li>\n</ul>\n<h2 id=\"opencv\" style=\"position:relative;\"><a href=\"#opencv\" aria-label=\"opencv permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>OpenCV</h2>\n<p>画像処理に関する最も定番のライブラリです。</p>\n<p>C/C++、Java、Python などに対応しています。</p>\n<p>OpenCV でできることなどの概要は、以下のスライドが分かりやすいです。</p>\n<ul>\n<li><a href=\"https://www.slideshare.net/FukushimaNorishige/opencv-67214568\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">画像処理ライブラリ OpenCV で 出来ること・出来ないこと</a></li>\n</ul>\n<h2 id=\"pillow\" style=\"position:relative;\"><a href=\"#pillow\" aria-label=\"pillow permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Pillow</h2>\n<p>Pillow は Python の画像処理ライブラリです。</p>\n<p>OpenCV を使うほどでもない簡単な画像処理でよく使われています。</p>\n<p>参考: <a href=\"https://note.nkmk.me/python-pillow-basic/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Python の画像処理ライブラリ Pillow(PIL)の使い方 | note.nkmk.me</a></p>\n<h2 id=\"imagemagick\" style=\"position:relative;\"><a href=\"#imagemagick\" aria-label=\"imagemagick permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>ImageMagick</h2>\n<p>ImageMagick は、コマンドラインや各種プログラミング言語で利用可能な画像処理ツールです。</p>\n<p>コマンドラインで使えるというのが、ちょっとしたときに便利かもしれないなと思いました。</p>\n<p>ただ、ImageMagick について調べると以下のような記事がすぐヒットするので、利用の際はこれらを読んでしっかり考えたほうがよさそうです。</p>\n<ul>\n<li><a href=\"https://www.itmedia.co.jp/enterprise/articles/1705/23/news070.html\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">米 Yahoo!、メール添付画像流出の脆弱性に対処　「ImageMagick」は引退 - ITmedia エンタープライズ</a></li>\n<li><a href=\"https://blog.cybozu.io/entry/2018/08/21/080000\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">さようなら ImageMagick - Cybozu Inside Out | サイボウズエンジニアのブログ</a></li>\n<li><a href=\"https://qiita.com/yoya/items/2076c1f5137d4041e3aa#comment-fc2892b05f68cf2e15a1\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">「さようなら ImageMagick」の考察 - Qiita</a></li>\n<li><a href=\"https://www.mbsd.jp/blog/20180831.html\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">ImageMagick を使う Web アプリのセキュリティ - 1. 既知の脆弱性、システム情報の漏洩 | MBSD Blog</a></li>\n</ul>\n<h2 id=\"cairo\" style=\"position:relative;\"><a href=\"#cairo\" aria-label=\"cairo permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>cairo</h2>\n<p>cairo はベクトルベースの描画 API です。</p>\n<p>様々なプログラミング言語で利用可能です。</p>\n<p>入門としては、以下の記事が分かりやすいです。</p>\n<ul>\n<li><a href=\"https://magazine.rubyist.net/articles/0019/0019-cairo.html\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">cairo： 2 次元画像描画ライブラリ</a></li>\n</ul>\n<h2 id=\"graphviz\" style=\"position:relative;\"><a href=\"#graphviz\" aria-label=\"graphviz permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Graphviz</h2>\n<p>画像処理とは少し違いますが、グラフの描画と言えば Graphviz です。</p>\n<p>DOT 言語で記述されたグラフ構造を描画できます。</p>\n<h2 id=\"その他のライブラリ\" style=\"position:relative;\"><a href=\"#%E3%81%9D%E3%81%AE%E4%BB%96%E3%81%AE%E3%83%A9%E3%82%A4%E3%83%96%E3%83%A9%E3%83%AA\" aria-label=\"その他のライブラリ permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>その他のライブラリ</h2>\n<p>その他、以下の記事も参考になります。</p>\n<ul>\n<li><a href=\"https://yukoishizaki.hatenablog.com/entry/2019/10/14/143420\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">画像認識でよく使われるライブラリ一覧 - 機械学習 Memo φ(・ω・ )</a></li>\n<li><a href=\"https://it-mint.com/2018/10/16/free-software-for-image-processing-and-ai-1585.html\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">画像処理をサクッと実行できるソフトウェアには何があるの？フリー（無料）ソフトも含めて、サクッとまとめました | 忙しいあなたの代わりに、史上最強の良い本・良い暮らしのご提案</a></li>\n</ul>\n<h2 id=\"cv-と-cg-の違い\" style=\"position:relative;\"><a href=\"#cv-%E3%81%A8-cg-%E3%81%AE%E9%81%95%E3%81%84\" aria-label=\"cv と cg の違い permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>CV と CG の違い</h2>\n<p>ここまで調べていて CV (Computer Vision) と CG (Computer Graphics) の違いが気になったので、それも調べてみました。</p>\n<p>ざっくり言うと、</p>\n<ul>\n<li>CV (Computer Vision) … 画像処理やパターン認識など、画像の操作に関する分野</li>\n<li>CG (Computer Graphics) … コンピュータでグラフィックスを作り出す分野</li>\n</ul>\n<p>ということのようです。</p>\n<p>参考: <a href=\"https://www.tutorialspoint.com/dip/computer_vision_and_graphics.htm\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Computer Vision and Computer Graphics</a></p>\n<h2 id=\"画像処理に入門するには\" style=\"position:relative;\"><a href=\"#%E7%94%BB%E5%83%8F%E5%87%A6%E7%90%86%E3%81%AB%E5%85%A5%E9%96%80%E3%81%99%E3%82%8B%E3%81%AB%E3%81%AF\" aria-label=\"画像処理に入門するには permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>画像処理に入門するには</h2>\n<p>いろいろ調べる中で、画像処理の入門としてはオライリーの『<a href=\"https://amzn.to/3oiUQS8\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">実践 コンピュータビジョン</a>』がとても良さそうでした。</p>\n<p><a href=\"https://www.amazon.co.jp/dp/4873116074/ref=as_li_ss_il?ie=UTF8&linkCode=li1&tag=oshimayuki0d-22&linkId=7e1f61d07fe772c6cdeffef1adb6f64a&language=ja_JP\" target=\"_blank\"><img border=\"0\" src=\"//ws-fe.amazon-adsystem.com/widgets/q?_encoding=UTF8&ASIN=4873116074&Format=_SL110_&ID=AsinImage&MarketPlace=JP&ServiceVersion=20070822&WS=1&tag=oshimayuki0d-22&language=ja_JP\" ></a><img src=\"https://ir-jp.amazon-adsystem.com/e/ir?t=oshimayuki0d-22&amp;language=ja_JP&amp;l=li1&amp;o=9&amp;a=4873116074\" width=\"1\" height=\"1\" border=\"0\" alt=\"\" style=\"border:none !important; margin:0px !important;\"></p>\n<p>後日購入して読もうと思います。</p>","fields":{"slug":"/posts/computer-vision-libraries","tagSlugs":["/tag/computer-vision/"],"autoRecommendPosts":["last-day-of-media-and-xr-lonely-advent-calendar","media-and-xr-lonely-advent-calendar","movie-processing-software","image-file-format-basics"]},"frontmatter":{"date":"2021-12-03T12:37:48.552Z","description":"画像処理のライブラリとしては OpenCV が有名だと思いますが、改めて定番のライブラリを調べてみました。\nOpenCV・Pillow・ImageMagick・cairo・Graphvizの 5 つについて概要を書いていきます。","tags":["computer-vision"],"title":"画像処理ライブラリのざっくりまとめ","socialImage":null,"recommendPosts":null}}},"pageContext":{"slug":"/posts/computer-vision-libraries"}},"staticQueryHashes":["251939775","3942705351","401334301"]}