This repository contains the implementation of the paper: Giljoo Nam, Chenglei Wu, Min Kim, and Yaser Sheikh. Strand-accurate multi-view hair capture. pages 155–164, 06, 2019.
Note that the last part of the pipeline suggested in the paper - Hair Growing, is not implemented.
This implementation was based on the repositories:
The code in the folders /gipuma and /fuisible was modified to perform Line-based PatchMach Multi-view Stereo as proposed by the Strand-accurate multi-view hair capture paper.
- Ensure you have OpenCV installed on your system.
- Navigate to the Hair_Orient2D directory.
- Create a build directory and compile the program using CMake:
mkdir build
cd build
cmake ..
makeRun the program by providing the path to the input image folder:
./Orient2D <input_image_folder>Replace <input_image_folder> with the path to the folder containing the images you want to process.
gipuma/gipuma.cu: File containing cuda code for running LPMVS - Estimates 3D line map for one viewfuisible/fuisible.cu: File containing cuda code for merging all 3D line per-view maps into one.gipuma/scripts/97_frame_00005.sh: Shell script file for executing gipuma for each view and merge the results by running fuisible
Use cmake to compile fusible and gipuma projects:
cd fuisiblecmake . -D CMAKE_C_COMPILER=/usr/bin/gcc-7makecd ../gipumacmake . -D CMAKE_C_COMPILER=/usr/bin/gcc-7make
- Create a new folder
data/my_datasetinside thegipumafolder - Add a subfolder
imagescontaining the multiview images and the camera parameters following the KRT format - [Optional] Add another subfolder for
maskscontining the hair segmentation masks.masks/cam_img1.pngshould correspond toimages/cam_img1.png, ... - [Optional] Add another subfolder for
depthcontining the initial depth values.depth/cam_img1.datshould correspond toimages/cam_img1.png, ... - Add another subfolder for
orientation_fieldscontining the generated orientation fields.orientation_fields/cam_img_1_finalOrient.floshould correspond toimages/cam_img1.png, ... - Add another subfolder for
confidence_valuescontining the generated orientation fields.confidence_values/cam_img_1_finalVariance.floshould correspond toimages/cam_img1.png, ... - Add a script
my_dataset.shin the/scriptsfolder to run the Line-based PatchMatch MVS. For an example see:scrips/97_frame_00005.sh
The final file structure should look like:
├── gipuma
| ├── ...
| ├── data
| | ├── my_dataset
| | | ├── images
| | | | ├── cam_img_1.png
| | | | ├── cam_img_2.png
| | | | ├── ...
| | | | ├── cam_img_N.png
| | | | ├── cam_par.txt
| | | ├── depth # Optional folder
| | | | ├── cam_img_1.png
| | | | ├── cam_img_2.png
| | | | ├── ...
| | | | ├── cam_img_N.png
| | | ├── masks # Optional folder
| | | | ├── cam_img_1.png
| | | | ├── cam_img_2.png
| | | | ├── ...
| | | | ├── cam_img_N.png
| | | ├── orientation_fields
| | | | ├── cam_img_1_finalOrient.flo
| | | | ├── cam_img_2_finalOrient.flo
| | | | ├── ...
| | | | ├── cam_img_N_finalOrient.flo
| | | ├── confidence_values
| | | | ├── cam_img_1_finalVariance.flo
| | | | ├── cam_img_2_finalVariance.flo
| | | | ├── ...
| | | | ├── cam_img_N_finalVariance.flo
| ├── ...
| ├── scripts
| | ├── 97_frame_00005.sh
| | ├── my_dataset.sh
| | ├── ...
| ├── ...
├── ...
Finally, run the following command:
./my_dataset.sh
The final result will be stored in gipuma/results/{output_dir_basename}/consistencyCheck-.../line_cloud.dat
CMakeLists.txt: The CMake build configuration file for compiling the program.lib/LineFusion.hpp: Header file containing theLineFusionclass for performing line fusion on the noisy point cloud.pointclouds/: Directory containing example point cloud files.src/LineFusion.cpp: Source code file implementing theLineFusionclass.src/main.cpp: Main source code file implementing the program's main functionality.
-
Ensure that you have the Point Cloud Library (PCL) and Eigen3 libraries installed on your system.
-
Navigate to the repository's root directory.
-
Create a build directory and compile the program using CMake:
mkdir build cd build cmake .. make -
Run the program by providing the input and output filenames as command-line arguments:
./line_fusion <lpmvs_result> <output_pointcloud_file>
Replace
<lpmvs_result>with the path to the binary file containing the LPMVS data, and<output_pointcloud_file>with the desired path for the fused point cloud output.
Hair_Generation.cpp: Source code for the hair strands generation.all_output_strand.ply: The generation result.
-
Ensure that you have the Point Cloud Library (PCL), Eigen3 and OpenCV installed on your system.
-
Run the program in Visual Studio 2022