<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="FeedCreator 1.8" -->
<?xml-stylesheet href="http://10.8.1.3/class/lib/exe/css.php?s=feed" type="text/css"?>
<rdf:RDF
    xmlns="http://purl.org/rss/1.0/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
    xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel rdf:about="http://10.8.1.3/class/feed.php">
        <title>講義（山本裕樹） - numericalipb</title>
        <description></description>
        <link>http://10.8.1.3/class/</link>
        <image rdf:resource="http://10.8.1.3/class/lib/exe/fetch.php?media=wiki:dokuwiki.svg" />
       <dc:date>2026-08-10T21:47:31+00:00</dc:date>
        <items>
            <rdf:Seq>
                <rdf:li rdf:resource="http://10.8.1.3/class/doku.php?id=numericalipb:ans2&amp;rev=1782911630&amp;do=diff"/>
                <rdf:li rdf:resource="http://10.8.1.3/class/doku.php?id=numericalipb:ans3&amp;rev=1783524092&amp;do=diff"/>
                <rdf:li rdf:resource="http://10.8.1.3/class/doku.php?id=numericalipb:ans4&amp;rev=1784042445&amp;do=diff"/>
                <rdf:li rdf:resource="http://10.8.1.3/class/doku.php?id=numericalipb:lecture1&amp;rev=1781106632&amp;do=diff"/>
                <rdf:li rdf:resource="http://10.8.1.3/class/doku.php?id=numericalipb:lecture2&amp;rev=1782885342&amp;do=diff"/>
                <rdf:li rdf:resource="http://10.8.1.3/class/doku.php?id=numericalipb:lecture3&amp;rev=1782970187&amp;do=diff"/>
                <rdf:li rdf:resource="http://10.8.1.3/class/doku.php?id=numericalipb:lecture4&amp;rev=1783559174&amp;do=diff"/>
                <rdf:li rdf:resource="http://10.8.1.3/class/doku.php?id=numericalipb:lecture5&amp;rev=1784074989&amp;do=diff"/>
                <rdf:li rdf:resource="http://10.8.1.3/class/doku.php?id=numericalipb:lecture6&amp;rev=1784160766&amp;do=diff"/>
                <rdf:li rdf:resource="http://10.8.1.3/class/doku.php?id=numericalipb:top&amp;rev=1775403210&amp;do=diff"/>
            </rdf:Seq>
        </items>
    </channel>
    <image rdf:about="http://10.8.1.3/class/lib/exe/fetch.php?media=wiki:dokuwiki.svg">
        <title>講義（山本裕樹）</title>
        <link>http://10.8.1.3/class/</link>
        <url>http://10.8.1.3/class/lib/exe/fetch.php?media=wiki:dokuwiki.svg</url>
    </image>
    <item rdf:about="http://10.8.1.3/class/doku.php?id=numericalipb:ans2&amp;rev=1782911630&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2026-07-01T13:13:50+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>【数値情報処理b】第2回の答え</title>
        <link>http://10.8.1.3/class/doku.php?id=numericalipb:ans2&amp;rev=1782911630&amp;do=diff</link>
        <description>【数値情報処理b】第2回の答え

課題

gradient_forward.R を書き換えて、画像（人によって異なる）をダウンロードしてグレースケール画像にした後にSobelフィルタで輪郭抽出を行うプログラムを作って提出しなさい。</description>
    </item>
    <item rdf:about="http://10.8.1.3/class/doku.php?id=numericalipb:ans3&amp;rev=1783524092&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2026-07-08T15:21:32+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>【数値情報処理b】第3回の答え</title>
        <link>http://10.8.1.3/class/doku.php?id=numericalipb:ans3&amp;rev=1783524092&amp;do=diff</link>
        <description>【数値情報処理b】第3回の答え

課題

gaussianfilter.R を書き換えて、$\sigma=1$ でサイズが $5\times 5$ のガウシアン・フィルタの畳み込み演算を5回くり返すプログラムを作成しなさい。

	*  $5\times 5$ のフィルタを作成して $\mathrm{Bi}(4,0.5)$$\mathrm{Bi}(4,0.5)$\[
f(x)=_{4}C_{x}(0.5)^{4}=_{4}C_{x}\times\frac{1}{16}
\]$x=0,1,2,3,4$\[
\left(
\begin{array}{c}
_{4}C_{0}(0.5)^{4}\\
_{4}C_{1}(0.5)^{4}\\
_{4}C_{2}(0.5)^{4}\\
_{4}C_{3}(0.5)^{4}\\
_{4}C_{4}(0.5)^{4}
\end{array}
\right)
=
\left(
\begin{array}{c}
1/16\\
4/16\\
6/16\\
4/16\\
1/16
\end{array}
\right)
\]\begin{eqnarray*}
…</description>
    </item>
    <item rdf:about="http://10.8.1.3/class/doku.php?id=numericalipb:ans4&amp;rev=1784042445&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2026-07-14T15:20:45+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>【数値情報処理b】第4回の答え</title>
        <link>http://10.8.1.3/class/doku.php?id=numericalipb:ans4&amp;rev=1784042445&amp;do=diff</link>
        <description>【数値情報処理b】第4回の答え

課題

boats の画像を「右上角を中心に-20度回転したあと垂直反転」して表示するプログラムを作成しなさい。

講義のプログラムと同様に for で一つ一つの画素を処理し、\begin{eqnarray}
x_{0}&amp;=&amp;\left\{x_{1}-c_{x}(1-\cos\theta)-c_{y}\sin\theta\right\}\cos\theta+\left\{y_{1}+c_{x}\sin\theta-c_{y}(1-\cos\theta)\right\}\sin\theta\\
y_{0}&amp;=&amp;-\left\{x_{1}-c_{x}(1-\cos\theta)-c_{y}\sin\theta\right\}\sin\theta+\left\{y_{1}+c_{x}\sin\theta-c_{y}(1-\cos\theta)\right\}\cos\theta
\end{eqnarray}\begin{eqnarray}
x_{0}&amp;=&amp;\left(x_{1}-c_{x}\right)\cos\theta+\left(y_{1}-c_{y}…</description>
    </item>
    <item rdf:about="http://10.8.1.3/class/doku.php?id=numericalipb:lecture1&amp;rev=1781106632&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2026-06-10T15:50:32+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>【数値情報処理b】第1回 デジタル画像について</title>
        <link>http://10.8.1.3/class/doku.php?id=numericalipb:lecture1&amp;rev=1781106632&amp;do=diff</link>
        <description>【数値情報処理b】第1回 デジタル画像について

数値情報処理b について

コンピュータで扱う画像はデジタルデータである。
画像を見やすくしたり、画像から情報を抽出することは画像処理ソフトウェアを使えば簡単にできるが、その画像処理の原理を知らなければソフトウェアを使いこなすことができない。
本講義では R と imager を使って様々な画像処理の方法の原理について学ぶ$y$$(x,y)$$(1,1)$$(0,0)$$2^{8}=256$$256^{3}=16777216$$(x,y)$$(x,y)$$w$$h$$w\times h$$w\times h\times 3$\[
2000\times 1000\times 3=6\times 10^{6}\mathrm{bytes}=6\mathrm{Mbytes}
\]$4/10=0.4=40\%$…</description>
    </item>
    <item rdf:about="http://10.8.1.3/class/doku.php?id=numericalipb:lecture2&amp;rev=1782885342&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2026-07-01T05:55:42+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>【数値情報処理b】第2回 輪郭抽出</title>
        <link>http://10.8.1.3/class/doku.php?id=numericalipb:lecture2&amp;rev=1782885342&amp;do=diff</link>
        <description>【数値情報処理b】第2回 輪郭抽出

画像処理で輪郭を抽出することを輪郭抽出（エッジ抽出）という。

画像で輪郭というと物体と物体の境目、あるいは物体と背景の境目である。
画像の濃度や色に急な変化があるところが輪郭に見えることを利用して、輪郭を抽出する。$f$$x$$y$$(x,y)$$g$$f$$(g*f)(x,y)$\[
(g*f)(x,y)=\sum_{i=1}^{3}\sum_{j=1}^{3}g(x+i-2,y+j-2)f(i,j)
\]\begin{align*}
\small
&amp;=\ \ g(x-1,y-1)f(1,1)&amp;&amp;+g(x,y-1)f(2,1)&amp;&amp;+g(x+1,y-1)f(3,1)\\
&amp;\ \ \ +g(x-1,y\ \ \ \ \ \ \ )f(1,2)&amp;&amp;+g(x,y\ \ \ \ \ \ \ )f(2,2)&amp;&amp;+g(x+1,y\ \ \ \ \ \ \ )f(3,2)\\
&amp;\ \ \ +g(x-1,y+1)f(1,3)&amp;&amp;+g(x,y+1)f(2,3)&amp;&amp;+g(x+1,y+1)f(3,3)
\end{align*}$f(i,j)$$f$$g(x,y)$…</description>
    </item>
    <item rdf:about="http://10.8.1.3/class/doku.php?id=numericalipb:lecture3&amp;rev=1782970187&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2026-07-02T05:29:47+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>【数値情報処理b】第3回 画像の平滑化</title>
        <link>http://10.8.1.3/class/doku.php?id=numericalipb:lecture3&amp;rev=1782970187&amp;do=diff</link>
        <description>【数値情報処理b】第3回 画像の平滑化

前回の課題

【数値情報処理b】第2回の答え

ノイズと平滑化

ノイズ

夜や暗い場所においてデジカメやスマホで写真を撮ると、画像にざらざらした邪魔なものがたくさん見えたことはないだろうか。
この邪魔なものは$y=10$\[
\frac{1}{9}\times(0.1+0.2+0.1+0.4+0.9+0.3+0.1+0.3+0.3)=0.3
\]$(x,y)$$3\times 3$\begin{align*}
&amp;\frac{1}{9}\{\ g(x-1,y-1)&amp;&amp;+g(x,y-1)&amp;&amp;+g(x+1,y-1)\\
&amp;\ \ \ +g(x-1,y\ \ \ \ \ \ \ )&amp;&amp;+g(x,y\ \ \ \ \ \ \ )&amp;&amp;+g(x+1,y\ \ \ \ \ \ \ )\\
&amp;\ \ \ +g(x-1,y+1)&amp;&amp;+g(x,y+1)&amp;&amp;+g(x+1,y+1)\}
\end{align*}\[
\left(
\begin{array}{ccc}
f(1,1)&amp;f(2,1)&amp;f(3,1)\\
f(1,2)&amp;f(2,2)&amp;f(3,2)\\
f(1,3…</description>
    </item>
    <item rdf:about="http://10.8.1.3/class/doku.php?id=numericalipb:lecture4&amp;rev=1783559174&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2026-07-09T01:06:14+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>【数値情報処理b】第4回 変形</title>
        <link>http://10.8.1.3/class/doku.php?id=numericalipb:lecture4&amp;rev=1783559174&amp;do=diff</link>
        <description>【数値情報処理b】第4回 変形

前回の課題

【数値情報処理b】第3回の答え

変形

画像の変形の方法は色々あるが、ここでは基本となるリサイズ（拡大・縮小）、平行移動、鏡映、回転について扱う。

ここでは画素の座標と画素値を以下のようにする。$(x_{0},y_{0})$$g_{0}(x_{0},y_{0})$$(x_{1},y_{1})$$g_{1}(x_{1},y_{1})$\begin{align*}
x_{1}&amp;=a_{x}x_{0}\\
y_{1}&amp;=a_{y}y_{0}
\end{align*}$a_{x}, a_{y}$$x, y$$(x_{1},y_{1})$\[
\left(\begin{array}{c}x_{1}\\y_{1}\end{array}\right)
=
\left(\begin{array}{cc}a_{x}&amp;0\\0&amp;a_{y}\end{array}\right) 
\left(\begin{array}{c}x_{0}\\y_{0}\end{array}\right)
=
\left(\begin{array}{c}a_{x}x_{0}\\a…</description>
    </item>
    <item rdf:about="http://10.8.1.3/class/doku.php?id=numericalipb:lecture5&amp;rev=1784074989&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2026-07-15T00:23:09+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>【数値情報処理b】第5回 2値化と物体検出</title>
        <link>http://10.8.1.3/class/doku.php?id=numericalipb:lecture5&amp;rev=1784074989&amp;do=diff</link>
        <description>【数値情報処理b】第5回 2値化と物体検出

前回の課題

【数値情報処理b】第4回の答え

しきい値処理

画像の各画素について、画素値が一定値以上の場合にそれを抜き出す方法がある。
この基準となる値をしきい値という。
具体的には、画像の画素値がしきい値未満なら画素値 0（黒）、しきい値以上なら画素値 1（白）を割り当てる処理を行う。
このように画素値を 0 か 1 のどちらかに割り当てる処理を\[
\frac{5}{5}+\frac{4}{5}+\frac{6}{5}+\frac{1}{5}+\frac{9}{5}=\frac{5+4+6+1+9}{5}=5.0
\]\[
\frac{4}{5}+\frac{6}{5}+\frac{1}{5}+\frac{9}{5}+\frac{3}{5}=\frac{4+6+1+9+3}{5}=4.6
\]$p$$100p$$100p$$100p$…</description>
    </item>
    <item rdf:about="http://10.8.1.3/class/doku.php?id=numericalipb:lecture6&amp;rev=1784160766&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2026-07-16T00:12:46+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>【数値情報処理b】第6回 色空間</title>
        <link>http://10.8.1.3/class/doku.php?id=numericalipb:lecture6&amp;rev=1784160766&amp;do=diff</link>
        <description>【数値情報処理b】第6回 色空間

色と色空間

電磁波は電場と磁場が波として伝わるものである。
電磁波は波長によって性質が異なる。
電磁波のうち、380 nm から 770 nm あたりの波長が人間の眼に見える光で、$(R,G,B)$$[0,1]$\[
\begin{array}{ccccc}
青 &amp;&amp; 黄 &amp;&amp; 白\\
(0,0,1)&amp;+&amp;(1,1,0)&amp;=&amp;(1,1,1)
\end{array}
\]\[
\begin{array}{ccccc}
白 &amp;&amp; 青 &amp;&amp; 黄\\
(1,1,1)&amp;-&amp;(0,0,1)&amp;=&amp;(1,1,0)
\end{array}
\]$R, G, B$$[0,1]$$Y, C_{b}, C_{r}$$[0,255]$\begin{align*}
r&amp;=255R\\
g&amp;=255G\\
b&amp;=255B\\
Y&amp;=\frac{66r+129g+25b+128}{256}+16\\
C_{b}&amp;=\frac{-38r-74g+112b+128}{256}+128\\
C_{r}&amp;=\frac{112r-94g-18b+128}{256}+128
\end{ali…</description>
    </item>
    <item rdf:about="http://10.8.1.3/class/doku.php?id=numericalipb:top&amp;rev=1775403210&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2026-04-05T15:33:30+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>数値情報処理b</title>
        <link>http://10.8.1.3/class/doku.php?id=numericalipb:top&amp;rev=1775403210&amp;do=diff</link>
        <description>数値情報処理b

	*  【数値情報処理b】第1回 デジタル画像について
	*  【数値情報処理b】第2回 輪郭抽出
	*  【数値情報処理b】第3回 画像の平滑化
	*  【数値情報処理b】第4回 変形
	*  【数値情報処理b】第5回 2値化と物体検出
	*  【数値情報処理b】第6回 色空間

	*  学内 RStudio サーバ1（学内限定）
	*  学内 RStudio サーバ2（学内限定）

質問がある場合は s4 かメールで連絡してください。

	*  s4 2026年度 数値情報処理b
	*  e-mail:[email]…</description>
    </item>
</rdf:RDF>
