Earthsquad-Montage Mosaic based on thousands of NASA Astronomical images(以Web為上傳介面,使用6000多張NASA太空照片,製作成一張蒙太奇大圖)
This is the project of NASA Hackthon2018:
- Visit our space app page:https://2018.spaceappschallenge.org/challenges/help-others-discover-earth/artify-earth/teams/earthsquad/project
- Our website:https://rensyuan.wixsite.com/earthsquad
- What is Montage Mosaic? 什麼是蒙太奇照片拼圖?
A composite picture made by combining several separate pictures.
簡單來說,所謂蒙太奇拼圖效果,就是指用很多張小圖片拼組成一張全新的圖片。
- Install web framework-Flask
pip install flask - Install googlimagesdownload
pip install googleimagesdownloads - Install Pillow
pip install Pillow - others: Requirement.txt
python NASAImageCrawler.py -k "earth" -p 3
default saving directory ./downloads/ 圖片默認儲存路徑為 ./downloads/
- -k --keywords keywords for search 想要搜尋的圖片關鍵字
- -p --amounts of pages downloaded, 100 images per page 總下載頁數,每一頁有100張圖片
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公開圖庫"這個步驟
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 網頁介面主程式
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"
python app.py
Upload the image and show the result上傳底圖並顯示結果
https://github.com/hardikvasa/google-images-download
https://github.com/ThomasHuai/puzzle
https://gist.github.com/greyli/a643aaac06ea8c23769c0c3d9ccaae79
