<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>mayamada</author_name>
  <author_url>https://blog.hatena.ne.jp/mayamada/</author_url>
  <blog_title>HapInS Developers Blog</blog_title>
  <blog_url>https://blog.hapins.net/</blog_url>
  <categories>
    <anon>テックブログ</anon>
    <anon>画像処理</anon>
    <anon>OpenCV</anon>
  </categories>
  <description>経緯 サンプルコード サンプルを試す あとがき 経緯 画像上に文字を書いたとき、画像と文字色の組み合わせによっては見えにくくなってしまうことがあります。 そのため、文字に背景を付けたいと思いましたが、OpenCVのputTextには背景を付けるパラメータがありません。（他のメソッドを組み合わせて作るしかない...） 今回は、文字にピッタリサイズの背景を付ける方法を考えてみました。 （簡単に言うと、文字の座標を計算して、文字の下に矩形を描きます。） サンプルコード def put_text_with_background(img,text,point,font,size,color,thickn…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.hapins.net%2Fentry%2F2023%2F10%2F28%2F085403&quot; title=&quot;【OpenCV】putTextにピッタリサイズの背景をつける - HapInS Developers Blog&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url>https://cdn-ak.f.st-hatena.com/images/fotolife/H/HapInS/20231028/20231028085412.png</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2023-10-28 08:54:03</published>
  <title>【OpenCV】putTextにピッタリサイズの背景をつける</title>
  <type>rich</type>
  <url>https://blog.hapins.net/entry/2023/10/28/085403</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
