-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathaveraging.html
More file actions
59 lines (55 loc) · 4.13 KB
/
Copy pathaveraging.html
File metadata and controls
59 lines (55 loc) · 4.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: module averaging</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head><body bgcolor="#f0f0f8">
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"> <br><big><big><strong>averaging</strong></big></big></font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/Users/tnal/hoge/averaging.py">/Users/tnal/hoge/averaging.py</a></font></td></tr></table>
<p><tt>画像データを平滑化するプログラム。<br>
画像データはピクセルごとに0〜255のグレイスケール値を取る。</tt></p>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#aa55cc">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
<tr><td bgcolor="#aa55cc"><tt> </tt></td><td> </td>
<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="copy.html">copy</a><br>
</td><td width="25%" valign=top><a href="matplotlib.pyplot.html">matplotlib.pyplot</a><br>
</td><td width="25%" valign=top></td><td width="25%" valign=top></td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#eeaa77">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Functions</strong></big></font></td></tr>
<tr><td bgcolor="#eeaa77"><tt> </tt></td><td> </td>
<td width="100%"><dl><dt><a name="-averaging"><strong>averaging</strong></a>(img, w, h, window_size)</dt><dd><tt>対象画素値を周囲画素値の平均値に置き換えることで滑らかにする(平滑化)。<br>
<br>
Argments:<br>
img (list): 画像データ。plot_image参照。<br>
w (int): 平滑化する中心の横座標(横インデックス)。<br>
h (int): 平滑化する中心の縦座標(縦インデックス)。<br>
window_size (int): 平滑化サイズ。<br>
Returns:<br>
result (float): 平滑化した値。</tt></dd></dl>
<dl><dt><a name="-blur_filter"><strong>blur_filter</strong></a>(image, window_size=1)</dt><dd><tt>平滑化フィルタ。<br>
<br>
Arguments:<br>
image (list): 画像データ。plot_image参照。<br>
window_size (int): 平滑化時の周辺参照サイズ。<br>
Returns:<br>
new_image (list): 平滑化した画像データ。形式はimageと同一。</tt></dd></dl>
<dl><dt><a name="-plot_image"><strong>plot_image</strong></a>(image1, image2)</dt><dd><tt>2つの画像を横に並べて描画。<br>
<br>
Argments:<br>
image1 (list): 横方向に並んだピクセル値を一つのリストとして保持し、そのリストを複数保持した2重リスト。<br>
image2 (list): 同上。</tt></dd></dl>
</td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#55aa55">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr>
<tr><td bgcolor="#55aa55"><tt> </tt></td><td> </td>
<td width="100%"><strong>data</strong> = [[0.0, 0.0, 0.0, 0.0, 15.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 15.0, 15.0, 0.0, 0.0, 0.0], [0.0, 0.0, 15.0, 15.0, 15.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 15.0, 15.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 15.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 15.0, 15.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 15.0, 15.0, 0.0, 0.0, 0.0], [0.0, 0.0, 15.0, 15.0, 15.0, 15.0, 0.0, 0.0]]</td></tr></table>
</body></html>