Skip to content

Instantly share code, notes, and snippets.

@typebrook
Last active July 30, 2022 03:22
Show Gist options
  • Save typebrook/31cc4dbcfd90c1bfa3154627e66e5d39 to your computer and use it in GitHub Desktop.
Save typebrook/31cc4dbcfd90c1bfa3154627e66e5d39 to your computer and use it in GitHub Desktop.
Slide for coscup 2022
dist/
plugin/
css/
*.html
assets/
{
"slideNumber": "c/t"
}
title theme separator slideNumber
帶著 360 相機拍街景
serif
====
c/t

About me

  • 謝晉凡 / Pham
  • OSM-TW Community member
  • Hiker

Contacts:

Note:

  • 比較像是讀書心得
  • 相機生手,不吝指教

Index

  1. 緣起
  2. 認識街景服務平台
  3. 認識 360 相機
  4. 處理全景照片
  5. FFMPEG
  6. 上傳步驟

====

緣起


維基媒體聯盟基金支持那些能夠為維基媒體運動的策略方向做出貢獻的組織, ... 我們強調在運動中代表性不足的社群和歷史上被邊緣化的社群需要獲得他們所需的資源以實現他們的目標。 與使命一致的組織和團體的計劃可以專注於支持貢獻者、編輯、內容、凝聚力、 技能培養倡議、宣傳工作、策略規劃以及與當地維基媒體社群和維基媒體項目發展穩定的夥伴關系。

翻譯:我們有相機啦!

Note: 但是,歹誌嘸家尼呀乾單


相關連結

====

街景服務平台


Note: Talk about OSM


街景服務平台

  • No Google !
  • Easy API

Billing!


Mapillary

Note:

  • Facebook
  • API

Note:

  • 覆蓋較少

API & TOOLS


API & TOOLS

  • Sequencce
    • A collection of photos captured continuously
  • Dashboard

Note: A sequence is a collection of photos captured continuously by an OpenStreetCam user. Available connected-resources: attachments, rawdatas, photos, videos. Available joining resources for : photo(first photo of the sequence used for thumbnails), attachment(first attachment of the sequence specific cases like ), user(owner of the sequence). Available joining resources for one resource request: Photo list, Attachment list, RawData list, Video list. Restricted access on GET list if there isn't at least one query parameter provided from the following: id, idInterval, region, startDate, userId, tLeft, bRight, withAttachments, withPhotos.

Represents a sequence of Image IDs ordered by capture time.

====

360 相機



Note:

  • 視野較好(比較)
  • 背包示範




Insta360 APP

Note:

  • scrcpy

截取相片

/DCIM
├── Camera04
│   ├── IMG_20220522_115803_00_001.insp
│   ├── IMG_20220522_115803_00_002.insp
│   ├── ...
│   └── Thumb
│       ├── IMG_20220529_095231_00_119.bmp
│       ├── ...
│
├── Camera05
│   ├── IMG_20220619_104522_00_001.insp
│   ├── IMG_20220619_104522_00_002.insp
│   ├── ...
│   └── Thumb
│       ├── IMG_20220619_113507_00_336.bmp
│       ├── ...

====

雙魚眼鏡頭的轉換


360 相機原理

Note: 略過細節,我也還沒準備把它裝到腦袋裡


全景/周視圖(Panorama)


Cubic Map

====

FFMPEG

  • Free, open-source software for multimedia editing, conversion, …
  • Started in 2000
  • The best solution for video (in most of the cases)

How it works?


讀取圖片

ffmpeg 
    -f image2 \
    -pattern_type glob \
    -i input/'*.insp'
    output/'%03d.jpg'

AllTogether

ffmpeg 
    -y -hide_banner \
    -f image2 \
    -pattern_type glob \
    -i input/'*.insp'
    -vf <name>=<option1>=<value1>:<option2>=<value2>
    output/'%03d.jpg'

filter v360

  • yaw
  • pitch
  • roll

filter v360

Note: 轉頭示範


filter v360

  • format
    • equirect
    • c3x2
    • c6x1
    • c1x6
    • rectilinear
    • dfisheye
    • fisheye
    • ...

v360=input=dfisheye:equirect:ih_fov=190:iv_fov=190

ffmpeg -y -hide_banner \
    -f image2 \
    -pattern_type glob \
    -i input/'*.insp' \
    -vf "v360=input=dfisheye:$(OUTPUT):ih_fov=$(FOV):iv_fov=$(FOV):yaw=0:pitch=0:roll=90" \
    -threads 8 \
    output/'%03d.jpg'

ffmpeg
    -i front.mp4 
    -i fusion2sphere0_x.pgm -i fusion2sphere0_y.pgm 
    -i frontmask.png 
    -i back.mp4 
    -i fusion2sphere1_x.pgm -i fusion2sphere1_y.pgm 
    -i backmask.png 
    -filter_complex "
        [0:v][1:v][2:v] remap [front]; 
        [4:v][5:v][6:v] remap [back]; 
        [front] format=rgba [frontrgb]; 
        [back] format=rgba [backrgb]; 
        [frontrgb][3:v] blend=all_mode='multiply':all_opacity=1 [frontmask]; 
        [backrgb][7:v] blend=all_mode='multiply':all_opacity=1 [backmask]; 
        [frontmask][backmask]
    blend=all_mode='addition':all_opacity=1, format=rgba" -pix_fmt yuv420p 
    output.mp4

Remap: pgm files

P2
10 10
255
0 255 255 255 255 255 255 255 255 255
255 0 255 255 255 255 255 255 255 255
255 255 0 255 255 255 255 255 255 255
255 255 255 0 255 255 255 255 255 255
255 255 255 255 0 255 255 255 255 255
255 255 255 255 255 0 255 255 255 255
255 255 255 255 255 255 0 255 255 255
255 255 255 255 255 255 255 0 255 255
255 255 255 255 255 255 255 255 0 255
255 255 255 255 255 255 255 255 255 0 


鏡頭校正-lensfun

https://lensfun.github.io/

====

其它工具-hugin


其它工具-fusion2sphere

====

上傳 360 相片


EXIF for 360

exiftool
  -overwrite_original \
  -UsePanoramaViewer=TRUE \
  -ProjectionType="equirectangular" \
  -tagsFromFile input.jpg output.jpg \

====

難點


相機的限制

  • 電池/熱當
  • 控制器
  • 使用模式
  • 記憶容量
  • 定位問題

====

Reference


Reference

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment