<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>utgwkk</author_name>
  <author_url>https://blog.hatena.ne.jp/utgwkk/</author_url>
  <blog_title>私が歌川です</blog_title>
  <blog_url>https://blog.utgw.net/</blog_url>
  <categories>
    <anon>技術</anon>
  </categories>
  <description>適当にキャプチャ・トリミングした画像の余白が多くて気になる、という出来事がよくある。こういう余白の多い画像から、余白を最小化するようにトリミングした長方形の画像を入手したい。 なんかいい方法ないのかって思ったけど、画像の凸包ができたらうまくできるのではないか。そんな感じでググったらまさにそのものの回答があった。 stackoverflow.com scikit-learnの凸包のサンプルを参考にしつつやったらできた。 馬の画像の凸包を作り、凸包の上下左右の端を通り、軸に平行な直線を結んでできた長方形で画像をトリミングした様子。なんかうまくいってそう。 きっちり余白を詰めたくないなら数ピクセルだ…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.utgw.net%2Fentry%2F2020%2F02%2F05%2F092111&quot; title=&quot;余白のある画像を自動で余白の少ない長方形にトリミングしたい - 私が歌川です&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/u/utgwkk/20200205/20200205091343.png</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2020-02-05 09:21:11</published>
  <title>余白のある画像を自動で余白の少ない長方形にトリミングしたい</title>
  <type>rich</type>
  <url>https://blog.utgw.net/entry/2020/02/05/092111</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
