跳至內容

File:Integral image example.png

頁面內容不支援其他語言。
這個檔案來自維基共享資源
維基百科,自由的百科全書
Integral_image_example.png (32 × 20 像素,檔案大小:466位元組,MIME 類型:image/png


摘要

描述 Integral image (right half) of a 2-bit greyscale pixel art (left half), normalised for visibility, by CMG Lee.
來源 自己的作品
作者 Cmglee
Display like so:
Integral image (right half) of a 2-bit greyscale pixel art (left half), normalised and magnified for visibility

Python script to generate image with png.py

#!/usr/bin/env python
data = '''\
    +++++
  +++:+++++
 +++::::+++
 ++:::@@@+++
 +@@::+@.@++
  +@::::::+++
  +:+:::::++++
  +::@+::++++
 +++::::++++++
 +++++::::..++
  ++.::::....++
   ......::..
    :....::.
    :...::++
   +:::::++++
  +++::.++++++
  +:.....:++++
  ..:++:....:++
 ..:@@+++@@:...
.:@@++@@@++@@@:.'''
maps   = {' ':0,'@':0,'+':1,':':2,'.':3}
datass = [[maps[char] for char in (row + '       ')[:16][::-1]] for row in data.split('\n')]
height = len(datass)
width  = len(datass[0]) * 2
pixels = [0] * (width * height)
import  png, copy
integralss = copy.deepcopy(datass)

def draw_pixel(pixels, width, x, y, luma): pixels[width * y + x] = luma
def tabbify(cellss, separator='|'):
 cellpadss = [list(rows) + [''] * (len(max(cellss, key=len)) - len(rows)) for rows in cellss]
 fmts = ['%%%ds' % (max([len(str(cell)) for cell in cols])) for cols in zip(*cellpadss)]
 return '\n'.join([separator.join(fmts) % tuple(rows) for rows in cellpadss])

for  (y, datas) in enumerate(datass):
 for (x, data ) in enumerate(datas ):
  integralss[y][x] = (data
   + (0 if y < 1          else integralss[y - 1][x    ])
   + (0 if          x < 1 else integralss[y    ][x - 1])
   - (0 if y < 1 or x < 1 else integralss[y - 1][x - 1]))
integral_max = max(max(integralss))
print(tabbify(integralss))
print(integral_max)
for  (y, datas) in enumerate(datass):
 for (x, data ) in enumerate(datas ):
  draw_pixel(pixels, width, x             , y, data * 85)
  draw_pixel(pixels, width, x + width // 2, y, 255 * integralss[y][x] // integral_max)
png.Writer(width=width, height=height, alpha=False, greyscale=True).write_array(
 open('%s.png' % (__file__[:__file__.rfind('.')]), 'wb'), pixels)

授權條款

我,本作品的著作權持有者,決定用以下授權條款發佈本作品:
w:zh:共享創意
姓名標示 相同方式分享
您可以自由:
  • 分享 – 複製、發佈和傳播本作品
  • 重新修改 – 創作演繹作品
惟需遵照下列條件:
  • 姓名標示 – 您必須指名出正確的製作者,和提供授權條款的連結,以及表示是否有對內容上做出變更。您可以用任何合理的方式來行動,但不得以任何方式表明授權條款是對您許可或是由您所使用。
  • 相同方式分享 – 若要根據本素材進行再混合、轉換或創作,則必須以與原作相同或相容的授權來發布您的作品。
GNU head 已授權您依據自由軟體基金會發行的無固定段落、封面文字和封底文字GNU自由文件授權條款1.2版或任意後續版本,對本檔進行複製、傳播和/或修改。該協議的副本列在GNU自由文件授權條款中。
您可以選擇您需要的授權條款。

說明

添加單行說明來描述出檔案所代表的內容

在此檔案描寫的項目

描繪內容

沒有維基數據項目的某些值

著作權狀態 繁體中文 (已轉換拼寫)

有著作權 繁體中文 (已轉換拼寫)

檔案來源 Chinese (Taiwan) (已轉換拼寫)

上傳者的原創作品 繁體中文 (已轉換拼寫)

檔案歷史

點選日期/時間以檢視該時間的檔案版本。

日期/時間縮⁠圖尺寸用戶備⁠註
目前2025年5月20日 (二) 09:12於 2025年5月20日 (二) 09:12 版本的縮圖32 × 20​(466位元組)CmgleeHorizontally flip table
2025年5月6日 (二) 21:40於 2025年5月6日 (二) 21:40 版本的縮圖32 × 20​(480位元組)Cmglee{{Information |Description=Integral image (right half) of a 2-bit greyscale pixel art (left half), normalised for visibility, by CMG Lee. |Source={{own}} |Date= |Author= Cmglee |Permission= |other_versions= }} Category:Four-color pixel art Category:Image processing

下列頁面有用到此檔案:

全域檔案使用狀況

以下其他 wiki 使用了這個檔案: