Skip to content

superRenh/Earthsquad

Repository files navigation

Earthsquad-Montage Mosaic based on thousands of NASA Astronomical images(以Web為上傳介面,使用6000多張NASA太空照片,製作成一張蒙太奇大圖)


This is the project of NASA Hackthon2018:

Environment setup環境設定(Python3.6)

  1. Install web framework-Flask
    pip install flask
  2. Install googlimagesdownload
    pip install googleimagesdownloads
  3. Install Pillow
    pip install Pillow
  4. others: Requirement.txt

Crawler NASA Image and Video Library爬取NASA公開圖庫

Command line 命令提示字元

python NASAImageCrawler.py -k "earth" -p 3
default saving directory ./downloads/ 圖片默認儲存路徑為 ./downloads/

Command line parameters 參數說明

  • -k --keywords keywords for search 想要搜尋的圖片關鍵字
  • -p --amounts of pages downloaded, 100 images per page 總下載頁數,每一頁有100張圖片

Create your own Montage Mosaic and uploaded interface of Web創建蒙太奇大圖及web上傳介面

Already download 6806 NASA Images to output32 for creating Mosaic block, unless you want to create your own mosaic block database, or you can skip the step of "Crawler NASA Image and Video Library"
已經下載6806張太空圖片到output32資料夾作為馬賽克資料庫,除非你想創造自己的資料庫,否則可以跳過"爬取NASA公開圖庫"這個步驟

Folders and modules 資料夾及模塊說明

output32: 6806 NASA astronomical images, and resize to 32*32 pixel to create Mosaic block database
                   6806張NASA太空圖片,並resize為32*32 pixel的馬賽克塊
download:images that upload from web 從web介面上傳的圖片
img: result of Montage Mosaic consist of thousands mosaic block based on the uploaded image
          存放最後製作好的蒙太奇大圖
puzzle.py:The main module to create Montage and exclude the dark pixel(hsv:v<0.05) to make the clear image
                   創建蒙太奇主程式,並過濾暗色背景(hsv:v<0.05)讓整體圖片效果呈現更好
app.py: The main module of Flask web Servic 網頁介面主程式

Remote Connections to Flask Web Service 允許遠端訪問Flask web

Make sure that your HTTP service is listenning on everywhere(0.0.0.0:80))
設定IP为 0.0.0.0(所有用戶都可以訪問),port最好為80(瀏覽器訪問不指定port)
"host='0.0.0.0',port=80,debug=True"
or if want to limit to local access 或是限制本地端訪問
"host='127.0.0.1',port=5000,debug=False"

Command line 命令提示字元

python app.py

Result 結果展示

Upload the image and show the result上傳底圖並顯示結果

Reference

https://github.com/hardikvasa/google-images-download
https://github.com/ThomasHuai/puzzle
https://gist.github.com/greyli/a643aaac06ea8c23769c0c3d9ccaae79

About

Project of NASA Hackthon 2018: Montage Mosaic

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages