├── requirements.txt ├── 图片1.png ├── 图片2.png ├── data ├── cat │ ├── cat.0.tga │ ├── cat.1.tga │ ├── cat.10.tga │ ├── cat.11.tga │ ├── cat.2.tga │ ├── cat.3.tga │ ├── cat.4.tga │ ├── cat.5.tga │ ├── cat.6.tga │ ├── cat.7.tga │ ├── cat.8.tga │ ├── cat.9.tga │ └── cat.mask.tga ├── owl │ ├── owl.0.tga │ ├── owl.1.tga │ ├── owl.10.tga │ ├── owl.11.tga │ ├── owl.2.tga │ ├── owl.3.tga │ ├── owl.4.tga │ ├── owl.5.tga │ ├── owl.6.tga │ ├── owl.7.tga │ ├── owl.8.tga │ ├── owl.9.tga │ └── owl.mask.tga ├── gray │ ├── gray.0.tga │ ├── gray.1.tga │ ├── gray.10.tga │ ├── gray.11.tga │ ├── gray.2.tga │ ├── gray.3.tga │ ├── gray.4.tga │ ├── gray.5.tga │ ├── gray.6.tga │ ├── gray.7.tga │ ├── gray.8.tga │ ├── gray.9.tga │ └── gray.mask.tga ├── horse │ ├── horse.0.tga │ ├── horse.1.tga │ ├── horse.2.tga │ ├── horse.3.tga │ ├── horse.4.tga │ ├── horse.5.tga │ ├── horse.6.tga │ ├── horse.7.tga │ ├── horse.8.tga │ ├── horse.9.tga │ ├── horse.10.tga │ ├── horse.11.tga │ └── horse.mask.tga ├── rock │ ├── rock.0.tga │ ├── rock.1.tga │ ├── rock.10.tga │ ├── rock.11.tga │ ├── rock.2.tga │ ├── rock.3.tga │ ├── rock.4.tga │ ├── rock.5.tga │ ├── rock.6.tga │ ├── rock.7.tga │ ├── rock.8.tga │ ├── rock.9.tga │ └── rock.mask.tga ├── buddha │ ├── buddha.0.tga │ ├── buddha.1.tga │ ├── buddha.2.tga │ ├── buddha.3.tga │ ├── buddha.4.tga │ ├── buddha.5.tga │ ├── buddha.6.tga │ ├── buddha.7.tga │ ├── buddha.8.tga │ ├── buddha.9.tga │ ├── buddha.10.tga │ ├── buddha.11.tga │ ├── buddha.mask.tga │ └── buddha.albedo.tga ├── chrome │ ├── chrome.0.tga │ ├── chrome.1.tga │ ├── chrome.2.tga │ ├── chrome.3.tga │ ├── chrome.4.tga │ ├── chrome.5.tga │ ├── chrome.6.tga │ ├── chrome.7.tga │ ├── chrome.8.tga │ ├── chrome.9.tga │ ├── chrome.10.tga │ ├── chrome.11.tga │ └── chrome.mask.tga ├── cat.txt ├── owl.txt ├── lights.txt ├── gray.txt ├── rock.txt ├── horse.txt ├── buddha.txt └── chrome.txt ├── data_processed ├── cat │ ├── cat.0.png │ ├── cat.1.png │ ├── cat.10.png │ ├── cat.11.png │ ├── cat.2.png │ ├── cat.3.png │ ├── cat.4.png │ ├── cat.5.png │ ├── cat.6.png │ ├── cat.7.png │ ├── cat.8.png │ ├── cat.9.png │ └── cat.mask.png ├── owl │ ├── owl.0.png │ ├── owl.1.png │ ├── owl.10.png │ ├── owl.11.png │ ├── owl.2.png │ ├── owl.3.png │ ├── owl.4.png │ ├── owl.5.png │ ├── owl.6.png │ ├── owl.7.png │ ├── owl.8.png │ ├── owl.9.png │ └── owl.mask.png ├── gray │ ├── gray.0.png │ ├── gray.1.png │ ├── gray.10.png │ ├── gray.11.png │ ├── gray.2.png │ ├── gray.3.png │ ├── gray.4.png │ ├── gray.5.png │ ├── gray.6.png │ ├── gray.7.png │ ├── gray.8.png │ ├── gray.9.png │ └── gray.mask.png ├── horse │ ├── horse.0.png │ ├── horse.1.png │ ├── horse.2.png │ ├── horse.3.png │ ├── horse.4.png │ ├── horse.5.png │ ├── horse.6.png │ ├── horse.7.png │ ├── horse.8.png │ ├── horse.9.png │ ├── horse.10.png │ ├── horse.11.png │ └── horse.mask.png ├── rock │ ├── rock.0.png │ ├── rock.1.png │ ├── rock.10.png │ ├── rock.11.png │ ├── rock.2.png │ ├── rock.3.png │ ├── rock.4.png │ ├── rock.5.png │ ├── rock.6.png │ ├── rock.7.png │ ├── rock.8.png │ ├── rock.9.png │ └── rock.mask.png ├── buddha │ ├── buddha.0.png │ ├── buddha.1.png │ ├── buddha.2.png │ ├── buddha.3.png │ ├── buddha.4.png │ ├── buddha.5.png │ ├── buddha.6.png │ ├── buddha.7.png │ ├── buddha.8.png │ ├── buddha.9.png │ ├── buddha.10.png │ ├── buddha.11.png │ └── buddha.mask.png ├── chrome │ ├── chrome.0.tga │ ├── chrome.1.tga │ ├── chrome.2.tga │ ├── chrome.3.tga │ ├── chrome.4.tga │ ├── chrome.5.tga │ ├── chrome.6.tga │ ├── chrome.7.tga │ ├── chrome.8.tga │ ├── chrome.9.tga │ ├── chrome.10.tga │ ├── chrome.11.tga │ └── chrome.mask.tga ├── cat.txt ├── owl.txt ├── lights.txt ├── gray.txt ├── rock.txt ├── horse.txt ├── buddha.txt └── chrome.txt ├── results └── normal files │ ├── cat.jpg │ ├── gray.jpg │ ├── owl.jpg │ ├── rock.jpg │ ├── buddha.jpg │ └── horse.jpg ├── tools ├── visualization.py └── tga2png.py ├── SurfNorm.py ├── LICENSE ├── README.md ├── .gitignore ├── Photometric_Stereo.py └── HeightMap.py /requirements.txt: -------------------------------------------------------------------------------- 1 | opencv-python 2 | numpy 3 | scipy 4 | PIL 5 | sklearn -------------------------------------------------------------------------------- /图片1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/图片1.png -------------------------------------------------------------------------------- /图片2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/图片2.png -------------------------------------------------------------------------------- /data/cat/cat.0.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data/cat/cat.0.tga -------------------------------------------------------------------------------- /data/cat/cat.1.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data/cat/cat.1.tga -------------------------------------------------------------------------------- /data/cat/cat.10.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data/cat/cat.10.tga -------------------------------------------------------------------------------- /data/cat/cat.11.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data/cat/cat.11.tga -------------------------------------------------------------------------------- /data/cat/cat.2.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data/cat/cat.2.tga -------------------------------------------------------------------------------- /data/cat/cat.3.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data/cat/cat.3.tga -------------------------------------------------------------------------------- /data/cat/cat.4.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data/cat/cat.4.tga -------------------------------------------------------------------------------- /data/cat/cat.5.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data/cat/cat.5.tga -------------------------------------------------------------------------------- /data/cat/cat.6.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data/cat/cat.6.tga -------------------------------------------------------------------------------- /data/cat/cat.7.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data/cat/cat.7.tga -------------------------------------------------------------------------------- /data/cat/cat.8.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data/cat/cat.8.tga -------------------------------------------------------------------------------- /data/cat/cat.9.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data/cat/cat.9.tga -------------------------------------------------------------------------------- /data/owl/owl.0.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data/owl/owl.0.tga -------------------------------------------------------------------------------- /data/owl/owl.1.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data/owl/owl.1.tga -------------------------------------------------------------------------------- /data/owl/owl.10.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data/owl/owl.10.tga -------------------------------------------------------------------------------- /data/owl/owl.11.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data/owl/owl.11.tga -------------------------------------------------------------------------------- /data/owl/owl.2.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data/owl/owl.2.tga -------------------------------------------------------------------------------- /data/owl/owl.3.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data/owl/owl.3.tga -------------------------------------------------------------------------------- /data/owl/owl.4.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data/owl/owl.4.tga -------------------------------------------------------------------------------- /data/owl/owl.5.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data/owl/owl.5.tga -------------------------------------------------------------------------------- /data/owl/owl.6.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data/owl/owl.6.tga -------------------------------------------------------------------------------- /data/owl/owl.7.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data/owl/owl.7.tga -------------------------------------------------------------------------------- /data/owl/owl.8.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data/owl/owl.8.tga -------------------------------------------------------------------------------- /data/owl/owl.9.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data/owl/owl.9.tga -------------------------------------------------------------------------------- /data/cat/cat.mask.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data/cat/cat.mask.tga -------------------------------------------------------------------------------- /data/gray/gray.0.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data/gray/gray.0.tga -------------------------------------------------------------------------------- /data/gray/gray.1.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data/gray/gray.1.tga -------------------------------------------------------------------------------- /data/gray/gray.10.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data/gray/gray.10.tga -------------------------------------------------------------------------------- /data/gray/gray.11.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data/gray/gray.11.tga -------------------------------------------------------------------------------- /data/gray/gray.2.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data/gray/gray.2.tga -------------------------------------------------------------------------------- /data/gray/gray.3.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data/gray/gray.3.tga -------------------------------------------------------------------------------- /data/gray/gray.4.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data/gray/gray.4.tga -------------------------------------------------------------------------------- /data/gray/gray.5.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data/gray/gray.5.tga -------------------------------------------------------------------------------- /data/gray/gray.6.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data/gray/gray.6.tga -------------------------------------------------------------------------------- /data/gray/gray.7.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data/gray/gray.7.tga -------------------------------------------------------------------------------- /data/gray/gray.8.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data/gray/gray.8.tga -------------------------------------------------------------------------------- /data/gray/gray.9.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data/gray/gray.9.tga -------------------------------------------------------------------------------- /data/horse/horse.0.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data/horse/horse.0.tga -------------------------------------------------------------------------------- /data/horse/horse.1.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data/horse/horse.1.tga -------------------------------------------------------------------------------- /data/horse/horse.2.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data/horse/horse.2.tga -------------------------------------------------------------------------------- /data/horse/horse.3.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data/horse/horse.3.tga -------------------------------------------------------------------------------- /data/horse/horse.4.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data/horse/horse.4.tga -------------------------------------------------------------------------------- /data/horse/horse.5.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data/horse/horse.5.tga -------------------------------------------------------------------------------- /data/horse/horse.6.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data/horse/horse.6.tga -------------------------------------------------------------------------------- /data/horse/horse.7.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data/horse/horse.7.tga -------------------------------------------------------------------------------- /data/horse/horse.8.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data/horse/horse.8.tga -------------------------------------------------------------------------------- /data/horse/horse.9.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data/horse/horse.9.tga -------------------------------------------------------------------------------- /data/owl/owl.mask.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data/owl/owl.mask.tga -------------------------------------------------------------------------------- /data/rock/rock.0.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data/rock/rock.0.tga -------------------------------------------------------------------------------- /data/rock/rock.1.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data/rock/rock.1.tga -------------------------------------------------------------------------------- /data/rock/rock.10.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data/rock/rock.10.tga -------------------------------------------------------------------------------- /data/rock/rock.11.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data/rock/rock.11.tga -------------------------------------------------------------------------------- /data/rock/rock.2.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data/rock/rock.2.tga -------------------------------------------------------------------------------- /data/rock/rock.3.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data/rock/rock.3.tga -------------------------------------------------------------------------------- /data/rock/rock.4.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data/rock/rock.4.tga -------------------------------------------------------------------------------- /data/rock/rock.5.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data/rock/rock.5.tga -------------------------------------------------------------------------------- /data/rock/rock.6.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data/rock/rock.6.tga -------------------------------------------------------------------------------- /data/rock/rock.7.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data/rock/rock.7.tga -------------------------------------------------------------------------------- /data/rock/rock.8.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data/rock/rock.8.tga -------------------------------------------------------------------------------- /data/rock/rock.9.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data/rock/rock.9.tga -------------------------------------------------------------------------------- /data/buddha/buddha.0.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data/buddha/buddha.0.tga -------------------------------------------------------------------------------- /data/buddha/buddha.1.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data/buddha/buddha.1.tga -------------------------------------------------------------------------------- /data/buddha/buddha.2.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data/buddha/buddha.2.tga -------------------------------------------------------------------------------- /data/buddha/buddha.3.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data/buddha/buddha.3.tga -------------------------------------------------------------------------------- /data/buddha/buddha.4.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data/buddha/buddha.4.tga -------------------------------------------------------------------------------- /data/buddha/buddha.5.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data/buddha/buddha.5.tga -------------------------------------------------------------------------------- /data/buddha/buddha.6.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data/buddha/buddha.6.tga -------------------------------------------------------------------------------- /data/buddha/buddha.7.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data/buddha/buddha.7.tga -------------------------------------------------------------------------------- /data/buddha/buddha.8.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data/buddha/buddha.8.tga -------------------------------------------------------------------------------- /data/buddha/buddha.9.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data/buddha/buddha.9.tga -------------------------------------------------------------------------------- /data/chrome/chrome.0.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data/chrome/chrome.0.tga -------------------------------------------------------------------------------- /data/chrome/chrome.1.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data/chrome/chrome.1.tga -------------------------------------------------------------------------------- /data/chrome/chrome.2.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data/chrome/chrome.2.tga -------------------------------------------------------------------------------- /data/chrome/chrome.3.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data/chrome/chrome.3.tga -------------------------------------------------------------------------------- /data/chrome/chrome.4.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data/chrome/chrome.4.tga -------------------------------------------------------------------------------- /data/chrome/chrome.5.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data/chrome/chrome.5.tga -------------------------------------------------------------------------------- /data/chrome/chrome.6.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data/chrome/chrome.6.tga -------------------------------------------------------------------------------- /data/chrome/chrome.7.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data/chrome/chrome.7.tga -------------------------------------------------------------------------------- /data/chrome/chrome.8.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data/chrome/chrome.8.tga -------------------------------------------------------------------------------- /data/chrome/chrome.9.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data/chrome/chrome.9.tga -------------------------------------------------------------------------------- /data/gray/gray.mask.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data/gray/gray.mask.tga -------------------------------------------------------------------------------- /data/horse/horse.10.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data/horse/horse.10.tga -------------------------------------------------------------------------------- /data/horse/horse.11.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data/horse/horse.11.tga -------------------------------------------------------------------------------- /data/rock/rock.mask.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data/rock/rock.mask.tga -------------------------------------------------------------------------------- /data/buddha/buddha.10.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data/buddha/buddha.10.tga -------------------------------------------------------------------------------- /data/buddha/buddha.11.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data/buddha/buddha.11.tga -------------------------------------------------------------------------------- /data/buddha/buddha.mask.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data/buddha/buddha.mask.tga -------------------------------------------------------------------------------- /data/chrome/chrome.10.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data/chrome/chrome.10.tga -------------------------------------------------------------------------------- /data/chrome/chrome.11.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data/chrome/chrome.11.tga -------------------------------------------------------------------------------- /data/chrome/chrome.mask.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data/chrome/chrome.mask.tga -------------------------------------------------------------------------------- /data/horse/horse.mask.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data/horse/horse.mask.tga -------------------------------------------------------------------------------- /data/buddha/buddha.albedo.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data/buddha/buddha.albedo.tga -------------------------------------------------------------------------------- /data_processed/cat/cat.0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data_processed/cat/cat.0.png -------------------------------------------------------------------------------- /data_processed/cat/cat.1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data_processed/cat/cat.1.png -------------------------------------------------------------------------------- /data_processed/cat/cat.10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data_processed/cat/cat.10.png -------------------------------------------------------------------------------- /data_processed/cat/cat.11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data_processed/cat/cat.11.png -------------------------------------------------------------------------------- /data_processed/cat/cat.2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data_processed/cat/cat.2.png -------------------------------------------------------------------------------- /data_processed/cat/cat.3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data_processed/cat/cat.3.png -------------------------------------------------------------------------------- /data_processed/cat/cat.4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data_processed/cat/cat.4.png -------------------------------------------------------------------------------- /data_processed/cat/cat.5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data_processed/cat/cat.5.png -------------------------------------------------------------------------------- /data_processed/cat/cat.6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data_processed/cat/cat.6.png -------------------------------------------------------------------------------- /data_processed/cat/cat.7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data_processed/cat/cat.7.png -------------------------------------------------------------------------------- /data_processed/cat/cat.8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data_processed/cat/cat.8.png -------------------------------------------------------------------------------- /data_processed/cat/cat.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data_processed/cat/cat.9.png -------------------------------------------------------------------------------- /data_processed/owl/owl.0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data_processed/owl/owl.0.png -------------------------------------------------------------------------------- /data_processed/owl/owl.1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data_processed/owl/owl.1.png -------------------------------------------------------------------------------- /data_processed/owl/owl.10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data_processed/owl/owl.10.png -------------------------------------------------------------------------------- /data_processed/owl/owl.11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data_processed/owl/owl.11.png -------------------------------------------------------------------------------- /data_processed/owl/owl.2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data_processed/owl/owl.2.png -------------------------------------------------------------------------------- /data_processed/owl/owl.3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data_processed/owl/owl.3.png -------------------------------------------------------------------------------- /data_processed/owl/owl.4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data_processed/owl/owl.4.png -------------------------------------------------------------------------------- /data_processed/owl/owl.5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data_processed/owl/owl.5.png -------------------------------------------------------------------------------- /data_processed/owl/owl.6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data_processed/owl/owl.6.png -------------------------------------------------------------------------------- /data_processed/owl/owl.7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data_processed/owl/owl.7.png -------------------------------------------------------------------------------- /data_processed/owl/owl.8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data_processed/owl/owl.8.png -------------------------------------------------------------------------------- /data_processed/owl/owl.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data_processed/owl/owl.9.png -------------------------------------------------------------------------------- /results/normal files/cat.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/results/normal files/cat.jpg -------------------------------------------------------------------------------- /results/normal files/gray.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/results/normal files/gray.jpg -------------------------------------------------------------------------------- /results/normal files/owl.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/results/normal files/owl.jpg -------------------------------------------------------------------------------- /results/normal files/rock.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/results/normal files/rock.jpg -------------------------------------------------------------------------------- /data_processed/cat/cat.mask.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data_processed/cat/cat.mask.png -------------------------------------------------------------------------------- /data_processed/gray/gray.0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data_processed/gray/gray.0.png -------------------------------------------------------------------------------- /data_processed/gray/gray.1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data_processed/gray/gray.1.png -------------------------------------------------------------------------------- /data_processed/gray/gray.10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data_processed/gray/gray.10.png -------------------------------------------------------------------------------- /data_processed/gray/gray.11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data_processed/gray/gray.11.png -------------------------------------------------------------------------------- /data_processed/gray/gray.2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data_processed/gray/gray.2.png -------------------------------------------------------------------------------- /data_processed/gray/gray.3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data_processed/gray/gray.3.png -------------------------------------------------------------------------------- /data_processed/gray/gray.4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data_processed/gray/gray.4.png -------------------------------------------------------------------------------- /data_processed/gray/gray.5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data_processed/gray/gray.5.png -------------------------------------------------------------------------------- /data_processed/gray/gray.6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data_processed/gray/gray.6.png -------------------------------------------------------------------------------- /data_processed/gray/gray.7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data_processed/gray/gray.7.png -------------------------------------------------------------------------------- /data_processed/gray/gray.8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data_processed/gray/gray.8.png -------------------------------------------------------------------------------- /data_processed/gray/gray.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data_processed/gray/gray.9.png -------------------------------------------------------------------------------- /data_processed/horse/horse.0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data_processed/horse/horse.0.png -------------------------------------------------------------------------------- /data_processed/horse/horse.1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data_processed/horse/horse.1.png -------------------------------------------------------------------------------- /data_processed/horse/horse.2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data_processed/horse/horse.2.png -------------------------------------------------------------------------------- /data_processed/horse/horse.3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data_processed/horse/horse.3.png -------------------------------------------------------------------------------- /data_processed/horse/horse.4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data_processed/horse/horse.4.png -------------------------------------------------------------------------------- /data_processed/horse/horse.5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data_processed/horse/horse.5.png -------------------------------------------------------------------------------- /data_processed/horse/horse.6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data_processed/horse/horse.6.png -------------------------------------------------------------------------------- /data_processed/horse/horse.7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data_processed/horse/horse.7.png -------------------------------------------------------------------------------- /data_processed/horse/horse.8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data_processed/horse/horse.8.png -------------------------------------------------------------------------------- /data_processed/horse/horse.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data_processed/horse/horse.9.png -------------------------------------------------------------------------------- /data_processed/owl/owl.mask.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data_processed/owl/owl.mask.png -------------------------------------------------------------------------------- /data_processed/rock/rock.0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data_processed/rock/rock.0.png -------------------------------------------------------------------------------- /data_processed/rock/rock.1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data_processed/rock/rock.1.png -------------------------------------------------------------------------------- /data_processed/rock/rock.10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data_processed/rock/rock.10.png -------------------------------------------------------------------------------- /data_processed/rock/rock.11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data_processed/rock/rock.11.png -------------------------------------------------------------------------------- /data_processed/rock/rock.2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data_processed/rock/rock.2.png -------------------------------------------------------------------------------- /data_processed/rock/rock.3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data_processed/rock/rock.3.png -------------------------------------------------------------------------------- /data_processed/rock/rock.4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data_processed/rock/rock.4.png -------------------------------------------------------------------------------- /data_processed/rock/rock.5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data_processed/rock/rock.5.png -------------------------------------------------------------------------------- /data_processed/rock/rock.6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data_processed/rock/rock.6.png -------------------------------------------------------------------------------- /data_processed/rock/rock.7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data_processed/rock/rock.7.png -------------------------------------------------------------------------------- /data_processed/rock/rock.8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data_processed/rock/rock.8.png -------------------------------------------------------------------------------- /data_processed/rock/rock.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data_processed/rock/rock.9.png -------------------------------------------------------------------------------- /results/normal files/buddha.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/results/normal files/buddha.jpg -------------------------------------------------------------------------------- /results/normal files/horse.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/results/normal files/horse.jpg -------------------------------------------------------------------------------- /data_processed/buddha/buddha.0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data_processed/buddha/buddha.0.png -------------------------------------------------------------------------------- /data_processed/buddha/buddha.1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data_processed/buddha/buddha.1.png -------------------------------------------------------------------------------- /data_processed/buddha/buddha.2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data_processed/buddha/buddha.2.png -------------------------------------------------------------------------------- /data_processed/buddha/buddha.3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data_processed/buddha/buddha.3.png -------------------------------------------------------------------------------- /data_processed/buddha/buddha.4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data_processed/buddha/buddha.4.png -------------------------------------------------------------------------------- /data_processed/buddha/buddha.5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data_processed/buddha/buddha.5.png -------------------------------------------------------------------------------- /data_processed/buddha/buddha.6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data_processed/buddha/buddha.6.png -------------------------------------------------------------------------------- /data_processed/buddha/buddha.7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data_processed/buddha/buddha.7.png -------------------------------------------------------------------------------- /data_processed/buddha/buddha.8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data_processed/buddha/buddha.8.png -------------------------------------------------------------------------------- /data_processed/buddha/buddha.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data_processed/buddha/buddha.9.png -------------------------------------------------------------------------------- /data_processed/chrome/chrome.0.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data_processed/chrome/chrome.0.tga -------------------------------------------------------------------------------- /data_processed/chrome/chrome.1.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data_processed/chrome/chrome.1.tga -------------------------------------------------------------------------------- /data_processed/chrome/chrome.2.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data_processed/chrome/chrome.2.tga -------------------------------------------------------------------------------- /data_processed/chrome/chrome.3.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data_processed/chrome/chrome.3.tga -------------------------------------------------------------------------------- /data_processed/chrome/chrome.4.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data_processed/chrome/chrome.4.tga -------------------------------------------------------------------------------- /data_processed/chrome/chrome.5.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data_processed/chrome/chrome.5.tga -------------------------------------------------------------------------------- /data_processed/chrome/chrome.6.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data_processed/chrome/chrome.6.tga -------------------------------------------------------------------------------- /data_processed/chrome/chrome.7.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data_processed/chrome/chrome.7.tga -------------------------------------------------------------------------------- /data_processed/chrome/chrome.8.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data_processed/chrome/chrome.8.tga -------------------------------------------------------------------------------- /data_processed/chrome/chrome.9.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data_processed/chrome/chrome.9.tga -------------------------------------------------------------------------------- /data_processed/gray/gray.mask.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data_processed/gray/gray.mask.png -------------------------------------------------------------------------------- /data_processed/horse/horse.10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data_processed/horse/horse.10.png -------------------------------------------------------------------------------- /data_processed/horse/horse.11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data_processed/horse/horse.11.png -------------------------------------------------------------------------------- /data_processed/rock/rock.mask.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data_processed/rock/rock.mask.png -------------------------------------------------------------------------------- /data_processed/buddha/buddha.10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data_processed/buddha/buddha.10.png -------------------------------------------------------------------------------- /data_processed/buddha/buddha.11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data_processed/buddha/buddha.11.png -------------------------------------------------------------------------------- /data_processed/buddha/buddha.mask.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data_processed/buddha/buddha.mask.png -------------------------------------------------------------------------------- /data_processed/chrome/chrome.10.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data_processed/chrome/chrome.10.tga -------------------------------------------------------------------------------- /data_processed/chrome/chrome.11.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data_processed/chrome/chrome.11.tga -------------------------------------------------------------------------------- /data_processed/chrome/chrome.mask.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data_processed/chrome/chrome.mask.tga -------------------------------------------------------------------------------- /data_processed/horse/horse.mask.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Robin-WZQ/Photometric-Stereo/HEAD/data_processed/horse/horse.mask.png -------------------------------------------------------------------------------- /data/cat.txt: -------------------------------------------------------------------------------- 1 | 12 2 | psmImages/cat/cat.0.tga 3 | psmImages/cat/cat.1.tga 4 | psmImages/cat/cat.2.tga 5 | psmImages/cat/cat.3.tga 6 | psmImages/cat/cat.4.tga 7 | psmImages/cat/cat.5.tga 8 | psmImages/cat/cat.6.tga 9 | psmImages/cat/cat.7.tga 10 | psmImages/cat/cat.8.tga 11 | psmImages/cat/cat.9.tga 12 | psmImages/cat/cat.10.tga 13 | psmImages/cat/cat.11.tga 14 | psmImages/cat/cat.mask.tga 15 | -------------------------------------------------------------------------------- /data/owl.txt: -------------------------------------------------------------------------------- 1 | 12 2 | psmImages/owl/owl.0.tga 3 | psmImages/owl/owl.1.tga 4 | psmImages/owl/owl.2.tga 5 | psmImages/owl/owl.3.tga 6 | psmImages/owl/owl.4.tga 7 | psmImages/owl/owl.5.tga 8 | psmImages/owl/owl.6.tga 9 | psmImages/owl/owl.7.tga 10 | psmImages/owl/owl.8.tga 11 | psmImages/owl/owl.9.tga 12 | psmImages/owl/owl.10.tga 13 | psmImages/owl/owl.11.tga 14 | psmImages/owl/owl.mask.tga 15 | -------------------------------------------------------------------------------- /data_processed/cat.txt: -------------------------------------------------------------------------------- 1 | 12 2 | psmImages/cat/cat.0.tga 3 | psmImages/cat/cat.1.tga 4 | psmImages/cat/cat.2.tga 5 | psmImages/cat/cat.3.tga 6 | psmImages/cat/cat.4.tga 7 | psmImages/cat/cat.5.tga 8 | psmImages/cat/cat.6.tga 9 | psmImages/cat/cat.7.tga 10 | psmImages/cat/cat.8.tga 11 | psmImages/cat/cat.9.tga 12 | psmImages/cat/cat.10.tga 13 | psmImages/cat/cat.11.tga 14 | psmImages/cat/cat.mask.tga 15 | -------------------------------------------------------------------------------- /data_processed/owl.txt: -------------------------------------------------------------------------------- 1 | 12 2 | psmImages/owl/owl.0.tga 3 | psmImages/owl/owl.1.tga 4 | psmImages/owl/owl.2.tga 5 | psmImages/owl/owl.3.tga 6 | psmImages/owl/owl.4.tga 7 | psmImages/owl/owl.5.tga 8 | psmImages/owl/owl.6.tga 9 | psmImages/owl/owl.7.tga 10 | psmImages/owl/owl.8.tga 11 | psmImages/owl/owl.9.tga 12 | psmImages/owl/owl.10.tga 13 | psmImages/owl/owl.11.tga 14 | psmImages/owl/owl.mask.tga 15 | -------------------------------------------------------------------------------- /data/lights.txt: -------------------------------------------------------------------------------- 1 | 12 2 | 0.403259 0.480808 0.778592 3 | 0.0982272 0.163712 0.981606 4 | -0.0654826 0.180077 0.98147 5 | -0.127999 0.431998 0.892745 6 | -0.328606 0.485085 0.810377 7 | -0.110339 0.53593 0.837021 8 | 0.239071 0.41439 0.878138 9 | 0.0642302 0.417497 0.906406 10 | 0.12931 0.339438 0.931698 11 | 0.0323953 0.340151 0.939813 12 | 0.0985318 0.0492659 0.993914 13 | -0.16119 0.354617 0.921013 14 | -------------------------------------------------------------------------------- /data_processed/lights.txt: -------------------------------------------------------------------------------- 1 | 12 2 | 0.403259 0.480808 0.778592 3 | 0.0982272 0.163712 0.981606 4 | -0.0654826 0.180077 0.98147 5 | -0.127999 0.431998 0.892745 6 | -0.328606 0.485085 0.810377 7 | -0.110339 0.53593 0.837021 8 | 0.239071 0.41439 0.878138 9 | 0.0642302 0.417497 0.906406 10 | 0.12931 0.339438 0.931698 11 | 0.0323953 0.340151 0.939813 12 | 0.0985318 0.0492659 0.993914 13 | -0.16119 0.354617 0.921013 14 | -------------------------------------------------------------------------------- /data/gray.txt: -------------------------------------------------------------------------------- 1 | 12 2 | psmImages/gray/gray.0.tga 3 | psmImages/gray/gray.1.tga 4 | psmImages/gray/gray.2.tga 5 | psmImages/gray/gray.3.tga 6 | psmImages/gray/gray.4.tga 7 | psmImages/gray/gray.5.tga 8 | psmImages/gray/gray.6.tga 9 | psmImages/gray/gray.7.tga 10 | psmImages/gray/gray.8.tga 11 | psmImages/gray/gray.9.tga 12 | psmImages/gray/gray.10.tga 13 | psmImages/gray/gray.11.tga 14 | psmImages/gray/gray.mask.tga 15 | -------------------------------------------------------------------------------- /data/rock.txt: -------------------------------------------------------------------------------- 1 | 12 2 | psmImages/rock/rock.0.tga 3 | psmImages/rock/rock.1.tga 4 | psmImages/rock/rock.2.tga 5 | psmImages/rock/rock.3.tga 6 | psmImages/rock/rock.4.tga 7 | psmImages/rock/rock.5.tga 8 | psmImages/rock/rock.6.tga 9 | psmImages/rock/rock.7.tga 10 | psmImages/rock/rock.8.tga 11 | psmImages/rock/rock.9.tga 12 | psmImages/rock/rock.10.tga 13 | psmImages/rock/rock.11.tga 14 | psmImages/rock/rock.mask.tga 15 | -------------------------------------------------------------------------------- /data_processed/gray.txt: -------------------------------------------------------------------------------- 1 | 12 2 | psmImages/gray/gray.0.tga 3 | psmImages/gray/gray.1.tga 4 | psmImages/gray/gray.2.tga 5 | psmImages/gray/gray.3.tga 6 | psmImages/gray/gray.4.tga 7 | psmImages/gray/gray.5.tga 8 | psmImages/gray/gray.6.tga 9 | psmImages/gray/gray.7.tga 10 | psmImages/gray/gray.8.tga 11 | psmImages/gray/gray.9.tga 12 | psmImages/gray/gray.10.tga 13 | psmImages/gray/gray.11.tga 14 | psmImages/gray/gray.mask.tga 15 | -------------------------------------------------------------------------------- /data_processed/rock.txt: -------------------------------------------------------------------------------- 1 | 12 2 | psmImages/rock/rock.0.tga 3 | psmImages/rock/rock.1.tga 4 | psmImages/rock/rock.2.tga 5 | psmImages/rock/rock.3.tga 6 | psmImages/rock/rock.4.tga 7 | psmImages/rock/rock.5.tga 8 | psmImages/rock/rock.6.tga 9 | psmImages/rock/rock.7.tga 10 | psmImages/rock/rock.8.tga 11 | psmImages/rock/rock.9.tga 12 | psmImages/rock/rock.10.tga 13 | psmImages/rock/rock.11.tga 14 | psmImages/rock/rock.mask.tga 15 | -------------------------------------------------------------------------------- /data/horse.txt: -------------------------------------------------------------------------------- 1 | 12 2 | psmImages/horse/horse.0.tga 3 | psmImages/horse/horse.1.tga 4 | psmImages/horse/horse.2.tga 5 | psmImages/horse/horse.3.tga 6 | psmImages/horse/horse.4.tga 7 | psmImages/horse/horse.5.tga 8 | psmImages/horse/horse.6.tga 9 | psmImages/horse/horse.7.tga 10 | psmImages/horse/horse.8.tga 11 | psmImages/horse/horse.9.tga 12 | psmImages/horse/horse.10.tga 13 | psmImages/horse/horse.11.tga 14 | psmImages/horse/horse.mask.tga 15 | -------------------------------------------------------------------------------- /data_processed/horse.txt: -------------------------------------------------------------------------------- 1 | 12 2 | psmImages/horse/horse.0.tga 3 | psmImages/horse/horse.1.tga 4 | psmImages/horse/horse.2.tga 5 | psmImages/horse/horse.3.tga 6 | psmImages/horse/horse.4.tga 7 | psmImages/horse/horse.5.tga 8 | psmImages/horse/horse.6.tga 9 | psmImages/horse/horse.7.tga 10 | psmImages/horse/horse.8.tga 11 | psmImages/horse/horse.9.tga 12 | psmImages/horse/horse.10.tga 13 | psmImages/horse/horse.11.tga 14 | psmImages/horse/horse.mask.tga 15 | -------------------------------------------------------------------------------- /data/buddha.txt: -------------------------------------------------------------------------------- 1 | 12 2 | psmImages/buddha/buddha.0.tga 3 | psmImages/buddha/buddha.1.tga 4 | psmImages/buddha/buddha.2.tga 5 | psmImages/buddha/buddha.3.tga 6 | psmImages/buddha/buddha.4.tga 7 | psmImages/buddha/buddha.5.tga 8 | psmImages/buddha/buddha.6.tga 9 | psmImages/buddha/buddha.7.tga 10 | psmImages/buddha/buddha.8.tga 11 | psmImages/buddha/buddha.9.tga 12 | psmImages/buddha/buddha.10.tga 13 | psmImages/buddha/buddha.11.tga 14 | psmImages/buddha/buddha.mask.tga 15 | -------------------------------------------------------------------------------- /data/chrome.txt: -------------------------------------------------------------------------------- 1 | 12 2 | psmImages/chrome/chrome.0.tga 3 | psmImages/chrome/chrome.1.tga 4 | psmImages/chrome/chrome.2.tga 5 | psmImages/chrome/chrome.3.tga 6 | psmImages/chrome/chrome.4.tga 7 | psmImages/chrome/chrome.5.tga 8 | psmImages/chrome/chrome.6.tga 9 | psmImages/chrome/chrome.7.tga 10 | psmImages/chrome/chrome.8.tga 11 | psmImages/chrome/chrome.9.tga 12 | psmImages/chrome/chrome.10.tga 13 | psmImages/chrome/chrome.11.tga 14 | psmImages/chrome/chrome.mask.tga 15 | -------------------------------------------------------------------------------- /data_processed/buddha.txt: -------------------------------------------------------------------------------- 1 | 12 2 | psmImages/buddha/buddha.0.tga 3 | psmImages/buddha/buddha.1.tga 4 | psmImages/buddha/buddha.2.tga 5 | psmImages/buddha/buddha.3.tga 6 | psmImages/buddha/buddha.4.tga 7 | psmImages/buddha/buddha.5.tga 8 | psmImages/buddha/buddha.6.tga 9 | psmImages/buddha/buddha.7.tga 10 | psmImages/buddha/buddha.8.tga 11 | psmImages/buddha/buddha.9.tga 12 | psmImages/buddha/buddha.10.tga 13 | psmImages/buddha/buddha.11.tga 14 | psmImages/buddha/buddha.mask.tga 15 | -------------------------------------------------------------------------------- /data_processed/chrome.txt: -------------------------------------------------------------------------------- 1 | 12 2 | psmImages/chrome/chrome.0.tga 3 | psmImages/chrome/chrome.1.tga 4 | psmImages/chrome/chrome.2.tga 5 | psmImages/chrome/chrome.3.tga 6 | psmImages/chrome/chrome.4.tga 7 | psmImages/chrome/chrome.5.tga 8 | psmImages/chrome/chrome.6.tga 9 | psmImages/chrome/chrome.7.tga 10 | psmImages/chrome/chrome.8.tga 11 | psmImages/chrome/chrome.9.tga 12 | psmImages/chrome/chrome.10.tga 13 | psmImages/chrome/chrome.11.tga 14 | psmImages/chrome/chrome.mask.tga 15 | -------------------------------------------------------------------------------- /tools/visualization.py: -------------------------------------------------------------------------------- 1 | import scipy.io as sio 2 | import numpy as np 3 | 4 | def visualize(file_path,class_name): 5 | depth = np.load(file_path) 6 | r, c = depth.shape 7 | 8 | f = open("results/obj files/"+class_name+'.obj', 'w') 9 | 10 | for i in range(r): 11 | for j in range(c): 12 | if depth[i, j] > 0: 13 | seq = 'v' + ' ' + str(float(i)) + ' ' + str(float(j)) + ' ' + str(depth[i, j]) + '\n' 14 | f.writelines(seq) 15 | 16 | f.close() 17 | -------------------------------------------------------------------------------- /SurfNorm.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | from sklearn.preprocessing import normalize 3 | 4 | def compute_surfNorm(I, L, mask): 5 | '''compute the surface normal vector''' 6 | N = np.linalg.lstsq(L, I, rcond=-1)[0].T 7 | N = normalize(N, axis=1) 8 | return N 9 | 10 | def show_surfNorm(img,steps=3): 11 | height,width,_ = img.shape 12 | dst=np.zeros((height,width,3),np.float64) 13 | for i in range(3): 14 | for x in range(0,height,steps): 15 | for y in range(0,width,steps): 16 | dst[x][y][i]=img[x][y][i] 17 | 18 | return dst 19 | -------------------------------------------------------------------------------- /tools/tga2png.py: -------------------------------------------------------------------------------- 1 | from PIL import Image 2 | 3 | def tga2gpg(class_names): 4 | '''tga2png''' 5 | for class_name in class_names: 6 | for i in range(12): 7 | file_path = 'E:/大三/计算机视觉/作业/光度立体视觉/学习资料/photometric-stereo-master/psmImages/'+class_name+'/'+class_name+'.'+str(i)+'.tga' 8 | im = Image.open(file_path) 9 | output_path = 'E:/大三/计算机视觉/作业/光度立体视觉/code/data_processed/'+class_name+'/'+class_name+'.'+str(i)+'.png' 10 | im.save(output_path) 11 | mask_path = 'E:/大三/计算机视觉/作业/光度立体视觉/学习资料/photometric-stereo-master/psmImages/'+class_name+'/'+class_name+'.mask.tga' 12 | im = Image.open(mask_path) 13 | output_path = 'E:/大三/计算机视觉/作业/光度立体视觉/code/data_processed/'+class_name+'/'+class_name+'.mask.png' 14 | im.save(output_path) 15 | 16 | def main(): 17 | classes = ['buddha','cat','gray','horsr','owl','rock'] 18 | tga2gpg(classes) 19 | 20 | if __name__ == "__main__": 21 | main() 22 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Robin-WZQ 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Photometric-Stereo 2 | A python implementation of the Basic Photometric Stereo Algorithm 3 | 4 | ## Result 5 | 6 | (a) noraml vector 7 | 8 | (b) depth map 9 | 10 | (c) point cloud picture (observed from the front view) 11 | 12 | (d) point cloud picture (observed from the side view) [By Meshlab] 13 | 14 | ![图片1](%E5%9B%BE%E7%89%871.png) 15 | 16 | ![图片2](%E5%9B%BE%E7%89%872.png) 17 | 18 | 19 | ## Usage 20 | 21 | run Photometric_Stereo.py 22 | 23 | ## Code Tree 24 | 25 | |data #raw data,tga format 26 | 27 | |data_processed #processed data,png format 28 | 29 | |results 30 | 31 | -----|normal files # noraml vector pictures 32 | 33 | -----|obj files # 3D point cloud image 34 | 35 | |tools 36 | 37 | -----|tga2png.py #tga2png function 38 | 39 | -----|visualization.py # point cloud visualize function 40 | 41 | est_depth.npy #the numpy file of point cloud 42 | 43 | HeightMap.py #set of height map computed functions 44 | 45 | Photometric_Stereo.py # main function 46 | 47 | README.md # description file 48 | 49 | requirements.txt # dependence 50 | 51 | SurfNorm.py # set of surface noraml vector computed functions 52 | 53 | ## Reference 54 | 借鉴大神的博客 55 | https://blog.csdn.net/SZU_Kwong/article/details/112757354 56 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | wheels/ 23 | pip-wheel-metadata/ 24 | share/python-wheels/ 25 | *.egg-info/ 26 | .installed.cfg 27 | *.egg 28 | MANIFEST 29 | 30 | # PyInstaller 31 | # Usually these files are written by a python script from a template 32 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 33 | *.manifest 34 | *.spec 35 | 36 | # Installer logs 37 | pip-log.txt 38 | pip-delete-this-directory.txt 39 | 40 | # Unit test / coverage reports 41 | htmlcov/ 42 | .tox/ 43 | .nox/ 44 | .coverage 45 | .coverage.* 46 | .cache 47 | nosetests.xml 48 | coverage.xml 49 | *.cover 50 | *.py,cover 51 | .hypothesis/ 52 | .pytest_cache/ 53 | 54 | # Translations 55 | *.mo 56 | *.pot 57 | 58 | # Django stuff: 59 | *.log 60 | local_settings.py 61 | db.sqlite3 62 | db.sqlite3-journal 63 | 64 | # Flask stuff: 65 | instance/ 66 | .webassets-cache 67 | 68 | # Scrapy stuff: 69 | .scrapy 70 | 71 | # Sphinx documentation 72 | docs/_build/ 73 | 74 | # PyBuilder 75 | target/ 76 | 77 | # Jupyter Notebook 78 | .ipynb_checkpoints 79 | 80 | # IPython 81 | profile_default/ 82 | ipython_config.py 83 | 84 | # pyenv 85 | .python-version 86 | 87 | # pipenv 88 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 89 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 90 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 91 | # install all needed dependencies. 92 | #Pipfile.lock 93 | 94 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow 95 | __pypackages__/ 96 | 97 | # Celery stuff 98 | celerybeat-schedule 99 | celerybeat.pid 100 | 101 | # SageMath parsed files 102 | *.sage.py 103 | 104 | # Environments 105 | .env 106 | .venv 107 | env/ 108 | venv/ 109 | ENV/ 110 | env.bak/ 111 | venv.bak/ 112 | 113 | # Spyder project settings 114 | .spyderproject 115 | .spyproject 116 | 117 | # Rope project settings 118 | .ropeproject 119 | 120 | # mkdocs documentation 121 | /site 122 | 123 | # mypy 124 | .mypy_cache/ 125 | .dmypy.json 126 | dmypy.json 127 | 128 | # Pyre type checker 129 | .pyre/ 130 | -------------------------------------------------------------------------------- /Photometric_Stereo.py: -------------------------------------------------------------------------------- 1 | ''' 2 | @file_name:Photometric_Stereo 3 | @file_function: Photometric Stereo algorathim 4 | @time: 2021/9/24 5 | @author: Wang Zhongqi 6 | @software: VSCode 7 | ''' 8 | import cv2 9 | import numpy as np 10 | from PIL import Image 11 | 12 | from HeightMap import compute_depth, disp_depthmap, save_depthmap 13 | from SurfNorm import compute_surfNorm 14 | from tools.visualization import visualize 15 | 16 | 17 | def main(Image_name = 'cat'): 18 | 19 | # =================read the information in MASK================= 20 | mask = cv2.imread('data_processed/'+Image_name+"/"+Image_name+'.mask.png') 21 | mask2 = cv2.cvtColor(mask, cv2.COLOR_BGR2GRAY) 22 | height,width,_=mask.shape 23 | dst=np.zeros((height,width,3),np.uint8) 24 | for k in range(3): 25 | for i in range(height): 26 | for j in range(width): 27 | dst[i,j][k]=255-mask[i,j][k] 28 | 29 | # ================obtain the light vector================= 30 | file_path = "data_processed/lights.txt" 31 | file = open(file_path,'r') 32 | L=[] 33 | i=0 34 | while 1: 35 | line = file.readline() 36 | if not line: 37 | break 38 | if(i!=0): 39 | line = line.split(" ") 40 | line[2] = line[2].replace("\n",'') 41 | for l in range(3): 42 | line[l] = float(line[l]) 43 | L.append(tuple(line)) 44 | i+=1 45 | file.close() 46 | L = np.array(L) 47 | 48 | # =================obtain picture infor================= 49 | I = [] 50 | for i in range(12): 51 | picture = np.array(Image.open('data_processed/'+Image_name+"/"+Image_name+'.'+str(i)+'.png'),'f') 52 | picture = cv2.cvtColor(picture,cv2.COLOR_RGB2GRAY) 53 | height, width = picture.shape #(340, 512) 54 | picture = picture.reshape((-1,1)).squeeze(1) 55 | I.append(picture) 56 | I = np.array(I) 57 | 58 | # =================compute surface normal vector================= 59 | normal = compute_surfNorm(I, L,mask) 60 | N = np.reshape(normal.copy(),(height, width, 3)) 61 | # RGB to BGR 62 | N[:,:,0], N[:,:,2] = N[:,:,2], N[:,:,0].copy() 63 | N = (N + 1.0) / 2.0 64 | result = N + dst 65 | cv2.imshow('normal map', result) 66 | cv2.waitKey() 67 | cv2.destroyAllWindows() 68 | result = result * 255 69 | cv2.imwrite("results/normal files/"+Image_name+".jpg",result) 70 | 71 | # =================compute depth map================= 72 | Z = compute_depth(mask=mask2.copy(),N=normal.copy()) 73 | save_depthmap(Z,filename="./est_depth") 74 | disp_depthmap(depth=Z,name="height") 75 | 76 | # =================generate the obj file to visualize================= 77 | visualize('est_depth.npy',Image_name) 78 | 79 | if __name__ == "__main__": 80 | things = ["buddha","gray",'cat','gray','horse','owl','rock'] 81 | i=0 82 | for thing in things: 83 | i+=1 84 | print("progress:{}/{}".format(i,len(things))) 85 | main(thing) 86 | -------------------------------------------------------------------------------- /HeightMap.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import scipy 3 | import cv2 4 | 5 | def compute_depth(mask,N): 6 | """ 7 | compute the depth picture 8 | """ 9 | im_h, im_w = mask.shape 10 | N = np.reshape(N, (im_h, im_w, 3)) 11 | 12 | # =================get the non-zero index of mask================= 13 | obj_h, obj_w = np.where(mask != 0) 14 | no_pix = np.size(obj_h) #37244 15 | full2obj = np.zeros((im_h, im_w)) 16 | for idx in range(np.size(obj_h)): 17 | full2obj[obj_h[idx], obj_w[idx]] = idx 18 | 19 | M = scipy.sparse.lil_matrix((2*no_pix, no_pix)) 20 | v = np.zeros((2*no_pix, 1)) 21 | 22 | # ================= fill the M&V ================= 23 | for idx in range(no_pix): 24 | # obtain the 2D coordinate 25 | h = obj_h[idx] 26 | w = obj_w[idx] 27 | # obtian the surface normal vector 28 | n_x = N[h, w, 0] 29 | n_y = N[h, w, 1] 30 | n_z = N[h, w, 2] 31 | 32 | row_idx = idx * 2 33 | if mask[h, w+1]: 34 | idx_horiz = full2obj[h, w+1] 35 | M[row_idx, idx] = -1 36 | M[row_idx, idx_horiz] = 1 37 | if n_z==0: 38 | v[row_idx] = 0 39 | else: 40 | v[row_idx] = -n_x / n_z 41 | elif mask[h, w-1]: 42 | idx_horiz = full2obj[h, w-1] 43 | M[row_idx, idx_horiz] = -1 44 | M[row_idx, idx] = 1 45 | if n_z==0: 46 | v[row_idx] = 0 47 | else: 48 | v[row_idx] = -n_x / n_z 49 | 50 | row_idx = idx * 2 + 1 51 | if mask[h+1, w]: 52 | idx_vert = full2obj[h+1, w] 53 | M[row_idx, idx] = 1 54 | M[row_idx, idx_vert] = -1 55 | if n_z==0: 56 | v[row_idx] = 0 57 | else: 58 | v[row_idx] = -n_y / n_z 59 | elif mask[h-1, w]: 60 | idx_vert = full2obj[h-1, w] 61 | M[row_idx, idx_vert] = 1 62 | M[row_idx, idx] = -1 63 | if n_z==0: 64 | v[row_idx] = 0 65 | else: 66 | v[row_idx] = -n_y / n_z 67 | 68 | # =================sloving the linear equations Mz = v================= 69 | MtM = M.T @ M 70 | Mtv = M.T @ v 71 | z = scipy.sparse.linalg.spsolve(MtM, Mtv) 72 | 73 | std_z = np.std(z, ddof=1) 74 | mean_z = np.mean(z) 75 | z_zscore = (z - mean_z) / std_z 76 | outlier_ind = np.abs(z_zscore) > 10 77 | z_min = np.min(z[~outlier_ind]) 78 | z_max = np.max(z[~outlier_ind]) 79 | 80 | Z = mask.astype('float') 81 | for idx in range(no_pix): 82 | # obtain the position in 2D picture 83 | h = obj_h[idx] 84 | w = obj_w[idx] 85 | Z[h, w] = (z[idx] - z_min) / (z_max - z_min) * 255 86 | 87 | depth = Z 88 | return depth 89 | 90 | def save_depthmap(depth,filename=None): 91 | """save the depth map in npy format""" 92 | if filename is None: 93 | raise ValueError("filename is None") 94 | np.save(filename, depth) 95 | 96 | def disp_depthmap(depth=None, delay=0, name=None): 97 | """display the depth map""" 98 | depth = np.uint8(depth) 99 | if name is None: 100 | name = 'depth map' 101 | cv2.imshow(name, depth) 102 | cv2.waitKey() 103 | cv2.destroyAllWindows() 104 | --------------------------------------------------------------------------------