├── .gitignore ├── J3DEngine ├── BlocksExchangeInterface.hpp ├── ExportSparseCloud.hpp ├── Global.cpp ├── Global.h ├── J3DEngine.cpp ├── J3DEngine.ico ├── J3DEngine.rc ├── J3DEngine.vcxproj ├── J3DEngine.vcxproj.filters ├── MatchImages.hpp ├── OriginPoints.hpp ├── PresetConfigureImages.hpp ├── StructureFromMotion.hpp ├── StructureFromPoses.hpp └── resource.h ├── J3DGUI ├── Dialog_MatchFeature.cpp ├── Dialog_MatchFeature.ui ├── Dialog_ReconstructMesh.cpp ├── Dialog_ReconstructMesh.h ├── Global.cpp ├── Global.h ├── ImageView.cpp ├── ImageView.h ├── J3DGUI.rc ├── J3D_GUI.ico ├── Jutil.cpp ├── Jutil.h ├── QT3DReconstruction.cpp ├── QT3DReconstruction.h ├── QT3DReconstruction.pri ├── QT3DReconstruction.pro ├── QT3DReconstruction.pro.user.8d0f0ea ├── QT3DReconstruction.qrc ├── QT3DReconstruction.ui ├── QT3DReconstruction.vcxproj ├── QT3DReconstruction.vcxproj.filters ├── TiffData.hpp ├── dialog_addsensorwidth.cpp ├── dialog_addsensorwidth.h ├── dialog_addsensorwidth.ui ├── dialog_coorintersector.cpp ├── dialog_coorintersector.h ├── dialog_coorintersector.ui ├── dialog_densifypointcloud.cpp ├── dialog_densifypointcloud.h ├── dialog_densifypointcloud.ui ├── dialog_fullauto.cpp ├── dialog_fullauto.h ├── dialog_fullauto.ui ├── dialog_matchfeature.h ├── dialog_pointinfo.cpp ├── dialog_pointinfo.h ├── dialog_pointinfo.ui ├── dialog_reconstructmesh.ui ├── dialog_sfm.cpp ├── dialog_sfm.h ├── dialog_sfm.ui ├── dialog_texturemesh.cpp ├── dialog_texturemesh.h ├── dialog_texturemesh.ui ├── dxflib │ ├── dl_attributes.h │ ├── dl_codes.h │ ├── dl_creationadapter.h │ ├── dl_creationinterface.h │ ├── dl_dxf.cpp │ ├── dl_dxf.h │ ├── dl_entities.h │ ├── dl_exception.h │ ├── dl_extrusion.h │ ├── dl_global.h │ ├── dl_writer.h │ ├── dl_writer_ascii.cpp │ └── dl_writer_ascii.h ├── main.cpp ├── mvsviewer.cpp ├── mvsviewer.h └── resource.h ├── J3DReconstruction.sln ├── J3DViewRender ├── Camera.cpp ├── Common.cpp ├── Image.cpp ├── J3DViewRender.cpp ├── J3DViewRender.rc ├── J3DViewRender.vcxproj ├── J3DViewRender.vcxproj.filters ├── Scene.cpp ├── Viewer.hpp ├── Window.cpp ├── framework.h ├── include │ ├── Camera.h │ ├── Common.h │ ├── Image.h │ ├── Scene.h │ └── Window.h └── resource.h ├── MVSEngine ├── DensifyPointCloud.cpp ├── J3DMVSEngine.rc ├── MVSEngine.h ├── MVSEngine.vcxproj ├── MVSEngine.vcxproj.filters ├── ReconstructMesh.cpp ├── RefineMesh.cpp ├── TextureMesh.cpp └── resource.h ├── README.md ├── Viewer ├── Viewer.cpp ├── Viewer.rc ├── Viewer.vcxproj ├── Viewer.vcxproj.filters └── resource.h ├── images ├── engine.png ├── gui.png ├── intersector.jpg ├── paras.png └── senwidinfo.png ├── resource ├── J3D_GUI.ico ├── SenWidDB.txt └── default.ply └── test ├── DSC_0333.JPG ├── DSC_0334.JPG ├── DSC_0335.JPG ├── DSC_0336.JPG ├── DSC_0337.JPG ├── DSC_0338.JPG ├── DSC_0339.JPG ├── DSC_0340.JPG ├── DSC_0341.JPG ├── DSC_0342.JPG ├── DSC_0343.JPG ├── DSC_0344.JPG ├── DSC_0345.JPG ├── DSC_0346.JPG ├── DSC_0347.JPG ├── DSC_0348.JPG ├── DSC_0349.JPG └── DSC_0350.JPG /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.userosscache 8 | *.sln.docstates 9 | 10 | # User-specific files (MonoDevelop/Xamarin Studio) 11 | *.userprefs 12 | 13 | # Build results 14 | [Dd]ebug/ 15 | [Dd]ebugPublic/ 16 | [Rr]elease/ 17 | [Rr]eleases/ 18 | x64/ 19 | x86/ 20 | bld/ 21 | [Bb]in/ 22 | [Oo]bj/ 23 | [Ll]og/ 24 | MVSEngine/x64/ 25 | J3DGUI/Release/ 26 | J3DEngine/x64/ 27 | MVSEngine/x64/ 28 | J3DViewRender/x64/ 29 | 30 | 31 | 32 | # Visual Studio 2015 cache/options directory 33 | .vs/ 34 | # Uncomment if you have tasks that create the project's static files in wwwroot 35 | #wwwroot/ 36 | 37 | # MSTest test Results 38 | [Tt]est[Rr]esult*/ 39 | [Bb]uild[Ll]og.* 40 | 41 | # NUNIT 42 | *.VisualState.xml 43 | TestResult.xml 44 | 45 | # Build Results of an ATL Project 46 | [Dd]ebugPS/ 47 | [Rr]eleasePS/ 48 | dlldata.c 49 | 50 | # DNX 51 | project.lock.json 52 | project.fragment.lock.json 53 | artifacts/ 54 | 55 | *_i.c 56 | *_p.c 57 | *_i.h 58 | *.ilk 59 | *.meta 60 | *.obj 61 | *.pch 62 | *.pdb 63 | *.pgc 64 | *.pgd 65 | *.rsp 66 | *.sbr 67 | *.tlb 68 | *.tli 69 | *.tlh 70 | *.tmp 71 | *.tmp_proj 72 | *.log 73 | *.vspscc 74 | *.vssscc 75 | .builds 76 | *.pidb 77 | *.svclog 78 | *.scc 79 | 80 | # Chutzpah Test files 81 | _Chutzpah* 82 | 83 | # Visual C++ cache files 84 | ipch/ 85 | *.aps 86 | *.ncb 87 | *.opendb 88 | *.opensdf 89 | *.sdf 90 | *.cachefile 91 | *.VC.db 92 | *.VC.VC.opendb 93 | 94 | # Visual Studio profiler 95 | *.psess 96 | *.vsp 97 | *.vspx 98 | *.sap 99 | 100 | # TFS 2012 Local Workspace 101 | $tf/ 102 | 103 | # Guidance Automation Toolkit 104 | *.gpState 105 | 106 | # ReSharper is a .NET coding add-in 107 | _ReSharper*/ 108 | *.[Rr]e[Ss]harper 109 | *.DotSettings.user 110 | 111 | # JustCode is a .NET coding add-in 112 | .JustCode 113 | 114 | # TeamCity is a build add-in 115 | _TeamCity* 116 | 117 | # DotCover is a Code Coverage Tool 118 | *.dotCover 119 | 120 | # NCrunch 121 | _NCrunch_* 122 | .*crunch*.local.xml 123 | nCrunchTemp_* 124 | 125 | # MightyMoose 126 | *.mm.* 127 | AutoTest.Net/ 128 | 129 | # Web workbench (sass) 130 | .sass-cache/ 131 | 132 | # Installshield output folder 133 | [Ee]xpress/ 134 | 135 | # DocProject is a documentation generator add-in 136 | DocProject/buildhelp/ 137 | DocProject/Help/*.HxT 138 | DocProject/Help/*.HxC 139 | DocProject/Help/*.hhc 140 | DocProject/Help/*.hhk 141 | DocProject/Help/*.hhp 142 | DocProject/Help/Html2 143 | DocProject/Help/html 144 | 145 | # Click-Once directory 146 | publish/ 147 | 148 | # Publish Web Output 149 | *.[Pp]ublish.xml 150 | *.azurePubxml 151 | # TODO: Comment the next line if you want to checkin your web deploy settings 152 | # but database connection strings (with potential passwords) will be unencrypted 153 | #*.pubxml 154 | *.publishproj 155 | 156 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 157 | # checkin your Azure Web App publish settings, but sensitive information contained 158 | # in these scripts will be unencrypted 159 | PublishScripts/ 160 | 161 | # NuGet Packages 162 | *.nupkg 163 | # The packages folder can be ignored because of Package Restore 164 | **/packages/* 165 | # except build/, which is used as an MSBuild target. 166 | !**/packages/build/ 167 | # Uncomment if necessary however generally it will be regenerated when needed 168 | #!**/packages/repositories.config 169 | # NuGet v3's project.json files produces more ignoreable files 170 | *.nuget.props 171 | *.nuget.targets 172 | 173 | # Microsoft Azure Build Output 174 | csx/ 175 | *.build.csdef 176 | 177 | # Microsoft Azure Emulator 178 | ecf/ 179 | rcf/ 180 | 181 | # Windows Store app package directories and files 182 | AppPackages/ 183 | BundleArtifacts/ 184 | Package.StoreAssociation.xml 185 | _pkginfo.txt 186 | 187 | # Visual Studio cache files 188 | # files ending in .cache can be ignored 189 | *.[Cc]ache 190 | # but keep track of directories ending in .cache 191 | !*.[Cc]ache/ 192 | 193 | # Others 194 | ClientBin/ 195 | ~$* 196 | *~ 197 | *.dbmdl 198 | *.dbproj.schemaview 199 | *.jfm 200 | *.pfx 201 | *.publishsettings 202 | node_modules/ 203 | orleans.codegen.cs 204 | 205 | # Since there are multiple workflows, uncomment next line to ignore bower_components 206 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 207 | #bower_components/ 208 | 209 | # RIA/Silverlight projects 210 | Generated_Code/ 211 | 212 | # Backup & report files from converting an old project file 213 | # to a newer Visual Studio version. Backup files are not needed, 214 | # because we have git ;-) 215 | _UpgradeReport_Files/ 216 | Backup*/ 217 | UpgradeLog*.XML 218 | UpgradeLog*.htm 219 | 220 | # SQL Server files 221 | *.mdf 222 | *.ldf 223 | 224 | # Business Intelligence projects 225 | *.rdl.data 226 | *.bim.layout 227 | *.bim_*.settings 228 | 229 | # Microsoft Fakes 230 | FakesAssemblies/ 231 | 232 | # GhostDoc plugin setting file 233 | *.GhostDoc.xml 234 | 235 | # Node.js Tools for Visual Studio 236 | .ntvs_analysis.dat 237 | 238 | # Visual Studio 6 build log 239 | *.plg 240 | 241 | # Visual Studio 6 workspace options file 242 | *.opt 243 | 244 | # Visual Studio LightSwitch build output 245 | **/*.HTMLClient/GeneratedArtifacts 246 | **/*.DesktopClient/GeneratedArtifacts 247 | **/*.DesktopClient/ModelManifest.xml 248 | **/*.Server/GeneratedArtifacts 249 | **/*.Server/ModelManifest.xml 250 | _Pvt_Extensions 251 | 252 | # Paket dependency manager 253 | .paket/paket.exe 254 | paket-files/ 255 | 256 | # FAKE - F# Make 257 | .fake/ 258 | 259 | # JetBrains Rider 260 | .idea/ 261 | *.sln.iml 262 | 263 | # CodeRush 264 | .cr/ 265 | 266 | # Python Tools for Visual Studio (PTVS) 267 | __pycache__/ 268 | *.pyc 269 | 270 | #dynamic link lib 271 | *.dll -------------------------------------------------------------------------------- /J3DEngine/BlocksExchangeInterface.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoulBasic/J3DReconstruction/dd519e8652aa9399b1a0965dfc60e395ab99c533/J3DEngine/BlocksExchangeInterface.hpp -------------------------------------------------------------------------------- /J3DEngine/ExportSparseCloud.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoulBasic/J3DReconstruction/dd519e8652aa9399b1a0965dfc60e395ab99c533/J3DEngine/ExportSparseCloud.hpp -------------------------------------------------------------------------------- /J3DEngine/Global.cpp: -------------------------------------------------------------------------------- 1 | #include "Global.h" 2 | 3 | 4 | int Global::processProject = 0; 5 | int Global::processState = 0; 6 | int Global::process = PROCESSWORKING; 7 | 8 | bool Global::saveProcess() 9 | { 10 | 11 | ofstream file; 12 | locale loc = locale::global(locale("")); 13 | file.open("C:\\ProgramData\\J3DEngine\\ProcessCache.tmp", ios::out | ios::trunc); 14 | locale::global(loc); 15 | if (!file.is_open()) 16 | return false; 17 | std::string project = std::to_string(Global::processProject); 18 | std::string state = std::to_string(Global::processState); 19 | std::string process = std::to_string(Global::process); 20 | file << process << endl; 21 | file << project << endl; 22 | file << state; 23 | file.close(); 24 | return true; 25 | } 26 | 27 | 28 | int Global::getFiles(const char* path, std::vector& arr) 29 | { 30 | int num_of_img = 0; 31 | intptr_t hFile = 0; 32 | struct _finddata_t fileinfo; 33 | char p[700] = { 0 }; 34 | strcpy(p, path); 35 | strcat(p, "\\*"); 36 | char buf[256]; 37 | if ((hFile = _findfirst(p, &fileinfo)) != -1) 38 | { 39 | do 40 | { 41 | if ((fileinfo.attrib & _A_SUBDIR)) 42 | { 43 | if (strcmp(fileinfo.name, ".") != 0 && strcmp(fileinfo.name, "..") != 0) 44 | continue; 45 | } 46 | else 47 | { 48 | 49 | strcpy(buf, path); 50 | strcat(buf, "\\"); 51 | strcat(buf, fileinfo.name); 52 | struct stat st1; 53 | stat(buf, &st1); 54 | arr.push_back(buf); 55 | } 56 | } while (_findnext(hFile, &fileinfo) == 0); 57 | _findclose(hFile); 58 | } 59 | return num_of_img; 60 | } -------------------------------------------------------------------------------- /J3DEngine/Global.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | using namespace std; 10 | 11 | #define CMD_FULLAUTO 100 12 | #define CMD_MATCHFEATURES 101 13 | #define CMD_SFMANDSFP 102 14 | #define CMD_EXPORTSPARSECLOUD 103 15 | #define CMD_EXPORTDENSECLOUD 104 16 | #define CMD_RECONSTRUCTMESH 105 17 | #define CMD_TEXTUREMESH 106 18 | #define CMD_IMPORTFROMBE 107 19 | #define LISTIMAGES 1 20 | #define COMPUTEFEATURES 2 21 | #define MATCHFEATURES 3 22 | #define SFM 4 23 | #define SFP 5 24 | #define COLORED 6 25 | #define SPARSE 7 26 | #define DENSE 8 27 | #define DENSEFUSE 12 28 | #define REMESH 9 29 | #define REFINE 10 30 | #define TEXTURE 11 31 | #define FULLAUTO 13 32 | #define PROCESSWORKING 0 33 | #define PROCESSCLOSE 1 34 | #define PROCESSERROR 2 35 | #define EXIT_SUCCESS 0 36 | #define EXIT_FAILURE 1 37 | 38 | class Global 39 | { 40 | public: 41 | static int process; 42 | static int processProject; 43 | static int processState; 44 | static bool saveProcess(); 45 | static int getFiles(const char* path, std::vector& arr); 46 | }; 47 | 48 | -------------------------------------------------------------------------------- /J3DEngine/J3DEngine.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoulBasic/J3DReconstruction/dd519e8652aa9399b1a0965dfc60e395ab99c533/J3DEngine/J3DEngine.cpp -------------------------------------------------------------------------------- /J3DEngine/J3DEngine.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoulBasic/J3DReconstruction/dd519e8652aa9399b1a0965dfc60e395ab99c533/J3DEngine/J3DEngine.ico -------------------------------------------------------------------------------- /J3DEngine/J3DEngine.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoulBasic/J3DReconstruction/dd519e8652aa9399b1a0965dfc60e395ab99c533/J3DEngine/J3DEngine.rc -------------------------------------------------------------------------------- /J3DEngine/J3DEngine.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;ipp;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | 源文件 20 | 21 | 22 | 源文件 23 | 24 | 25 | 26 | 27 | 头文件 28 | 29 | 30 | 头文件 31 | 32 | 33 | 头文件 34 | 35 | 36 | 头文件 37 | 38 | 39 | 头文件 40 | 41 | 42 | 头文件 43 | 44 | 45 | 头文件 46 | 47 | 48 | 头文件 49 | 50 | 51 | 52 | 53 | 资源文件 54 | 55 | 56 | 57 | 58 | 资源文件 59 | 60 | 61 | 62 | 63 | 头文件 64 | 65 | 66 | -------------------------------------------------------------------------------- /J3DEngine/MatchImages.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoulBasic/J3DReconstruction/dd519e8652aa9399b1a0965dfc60e395ab99c533/J3DEngine/MatchImages.hpp -------------------------------------------------------------------------------- /J3DEngine/OriginPoints.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoulBasic/J3DReconstruction/dd519e8652aa9399b1a0965dfc60e395ab99c533/J3DEngine/OriginPoints.hpp -------------------------------------------------------------------------------- /J3DEngine/PresetConfigureImages.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoulBasic/J3DReconstruction/dd519e8652aa9399b1a0965dfc60e395ab99c533/J3DEngine/PresetConfigureImages.hpp -------------------------------------------------------------------------------- /J3DEngine/StructureFromMotion.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoulBasic/J3DReconstruction/dd519e8652aa9399b1a0965dfc60e395ab99c533/J3DEngine/StructureFromMotion.hpp -------------------------------------------------------------------------------- /J3DEngine/StructureFromPoses.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoulBasic/J3DReconstruction/dd519e8652aa9399b1a0965dfc60e395ab99c533/J3DEngine/StructureFromPoses.hpp -------------------------------------------------------------------------------- /J3DEngine/resource.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoulBasic/J3DReconstruction/dd519e8652aa9399b1a0965dfc60e395ab99c533/J3DEngine/resource.h -------------------------------------------------------------------------------- /J3DGUI/Dialog_MatchFeature.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoulBasic/J3DReconstruction/dd519e8652aa9399b1a0965dfc60e395ab99c533/J3DGUI/Dialog_MatchFeature.cpp -------------------------------------------------------------------------------- /J3DGUI/Dialog_ReconstructMesh.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoulBasic/J3DReconstruction/dd519e8652aa9399b1a0965dfc60e395ab99c533/J3DGUI/Dialog_ReconstructMesh.cpp -------------------------------------------------------------------------------- /J3DGUI/Dialog_ReconstructMesh.h: -------------------------------------------------------------------------------- 1 | #ifndef DIALOG_RECONSTRUCTMESH_H 2 | #define DIALOG_RECONSTRUCTMESH_H 3 | 4 | #include 5 | #include "Global.h" 6 | #include 7 | #include 8 | #include 9 | 10 | namespace Ui { 11 | class Dialog_ReconstructMesh; 12 | } 13 | 14 | class Dialog_ReconstructMesh : public QDialog 15 | { 16 | Q_OBJECT 17 | 18 | public: 19 | explicit Dialog_ReconstructMesh(QWidget *parent = nullptr); 20 | ~Dialog_ReconstructMesh(); 21 | 22 | private slots: 23 | void on_btn_OK_clicked(); 24 | 25 | void on_btn_CANCEL_clicked(); 26 | 27 | void on_pushButton_browseInputDir_clicked(); 28 | 29 | void on_pushButton_browseOutputDir_clicked(); 30 | 31 | private: 32 | Ui::Dialog_ReconstructMesh *ui; 33 | }; 34 | 35 | #endif // DIALOG_RECONSTRUCTMESH_H 36 | -------------------------------------------------------------------------------- /J3DGUI/Global.cpp: -------------------------------------------------------------------------------- 1 | #include "Global.h" 2 | 3 | int Global::engineTid = 0; 4 | QString Global::imagesDir = ""; 5 | QString Global::imagesInfoFile = ""; 6 | QString Global::matchesOutputDir = ""; 7 | QString Global::matchesDir = ""; 8 | QString Global::sfmOutputDir = ""; 9 | QString Global::densifyInputDir = ""; 10 | QString Global::densifyOutputDir = ""; 11 | QString Global::densifyWorkingDir = ""; 12 | QString Global::reconstructMeshInputDir = ""; 13 | QString Global::reconstructMeshOutputDir = ""; 14 | QString Global::reconstructMeshWorkingDir = ""; 15 | QString Global::textureMeshInputDir = ""; 16 | QString Global::textureMeshOutputDir = ""; 17 | QString Global::textureMeshWorkingDir = ""; 18 | QString Global::fullauto_InPutDir = ""; 19 | QString Global::fullauto_OutputDir = ""; 20 | QString Global::importWorkingDir = ""; 21 | QString Global::processETA = ""; 22 | bool Global::tasking = false; 23 | bool Global::autoTasking = false; 24 | bool Global::intersecting = false; 25 | int Global::process = PROCESSWORKING; 26 | int Global::processProject = 0; 27 | int Global::processState = 0; 28 | 29 | void Global::connectEngine() 30 | { 31 | QFile file("C:\\ProgramData\\J3DEngine\\ProgramCache.tmp"); 32 | if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) 33 | { 34 | return; 35 | } 36 | QString tid = QString(file.readAll()); 37 | file.close(); 38 | Global::engineTid = tid.toInt(); 39 | if (tid == 0) 40 | { 41 | return; 42 | } 43 | return; 44 | } 45 | 46 | DWORD Global::GetProcessidFromName(const char* name) 47 | { 48 | PROCESSENTRY32 pe; 49 | DWORD id = 0; 50 | HANDLE hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0); 51 | pe.dwSize = sizeof(PROCESSENTRY32); 52 | if (!Process32First(hSnapshot, &pe)) 53 | return 0; 54 | while (1) 55 | { 56 | pe.dwSize = sizeof(PROCESSENTRY32); 57 | if (Process32Next(hSnapshot, &pe) == FALSE) 58 | break; 59 | if (strcmp(pe.szExeFile, name) == 0) 60 | { 61 | id = pe.th32ProcessID; 62 | break; 63 | } 64 | } 65 | CloseHandle(hSnapshot); 66 | return id; 67 | } 68 | 69 | 70 | bool Global::getProcessMsg() 71 | { 72 | QFile Processcache("C:\\ProgramData\\J3DEngine\\ProcessCache.tmp"); 73 | if (Processcache.open(QIODevice::ReadOnly | QIODevice::Text)) 74 | { 75 | 76 | QByteArray buf = Processcache.readLine(); 77 | QString str(buf); 78 | Global::process = str.toInt(); 79 | buf = Processcache.readLine(); 80 | str = buf; 81 | if (buf.size() == 21 && str.mid(0, 2) == "Es") { 82 | Global::processProject = DENSE; 83 | } 84 | else if (buf.size() == 21 && str.mid(0, 2) == "Pr") { 85 | Global::processProject = REFINE; 86 | } 87 | else if (buf.size() == 17) { 88 | Global::processProject = DENSEFUSE; 89 | } 90 | else if (buf.size() == 16) { 91 | Global::processProject = REMESH; 92 | } 93 | else if (buf.size() == 18) { 94 | Global::processProject = TEXTURE; 95 | } 96 | str = Processcache.readLine(); 97 | Global::processState = str.toInt(); 98 | str = Processcache.readLine(); 99 | Global::processETA = str; 100 | Processcache.close(); 101 | return true; 102 | } 103 | else 104 | return false; 105 | } 106 | 107 | 108 | int Global::getFiles(const char* path, std::vector& arr, bool fullName) 109 | { 110 | arr.clear(); 111 | intptr_t hFile = 0; 112 | struct _finddata_t fileinfo; 113 | char p[700] = { 0 }; 114 | strcpy(p, path); 115 | strcat(p, "\\*"); 116 | char buf[256]; 117 | if ((hFile = _findfirst(p, &fileinfo)) != -1) 118 | { 119 | do 120 | { 121 | if ((fileinfo.attrib & _A_SUBDIR)) 122 | { 123 | if (strcmp(fileinfo.name, ".") != 0 && strcmp(fileinfo.name, "..") != 0) 124 | continue; 125 | } 126 | else 127 | { 128 | strcpy(buf, path); 129 | strcat(buf, "\\"); 130 | strcat(buf, fileinfo.name); 131 | struct stat st1; 132 | stat(buf, &st1); 133 | arr.push_back(fullName ? buf : fileinfo.name); 134 | } 135 | } while (_findnext(hFile, &fileinfo) == 0); 136 | _findclose(hFile); 137 | } 138 | return arr.size(); 139 | } -------------------------------------------------------------------------------- /J3DGUI/Global.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoulBasic/J3DReconstruction/dd519e8652aa9399b1a0965dfc60e395ab99c533/J3DGUI/Global.h -------------------------------------------------------------------------------- /J3DGUI/ImageView.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoulBasic/J3DReconstruction/dd519e8652aa9399b1a0965dfc60e395ab99c533/J3DGUI/ImageView.cpp -------------------------------------------------------------------------------- /J3DGUI/ImageView.h: -------------------------------------------------------------------------------- 1 | #ifndef IMAGE_VIEW_H 2 | #define IMAGE_VIEW_H 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include "dialog_coorintersector.h" 12 | 13 | class ImageView : public QWidget 14 | { 15 | Q_OBJECT 16 | public: 17 | ImageView(QWidget* parent); 18 | ~ImageView(); 19 | void loadImage(QString fileName, int index); 20 | protected: 21 | void contextMenuEvent(QContextMenuEvent *event) override; 22 | void paintEvent(QPaintEvent *event) override; 23 | void wheelEvent(QWheelEvent *event) override; 24 | void mousePressEvent(QMouseEvent *event) override; 25 | void mouseMoveEvent(QMouseEvent *event) override; 26 | void mouseReleaseEvent(QMouseEvent *event) override; 27 | 28 | private: 29 | QImage m_Image; 30 | qreal m_ZoomValue = 1.0; 31 | int m_XPtInterval = 0; 32 | int m_YPtInterval = 0; 33 | QPoint m_OldPos; 34 | QPoint now_pos; 35 | QPoint now_image_pos; 36 | bool m_Pressed = false; 37 | Dialog_CoorIntersector* _parent; 38 | SEACAVE::Point3d intersectResult; 39 | int image_index; 40 | QMenu* right_button_menu; 41 | private slots: 42 | void onZoomInImage(void); 43 | void onZoomOutImage(void); 44 | void intersectPoint(); 45 | 46 | }; 47 | #endif 48 | 49 | -------------------------------------------------------------------------------- /J3DGUI/J3DGUI.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoulBasic/J3DReconstruction/dd519e8652aa9399b1a0965dfc60e395ab99c533/J3DGUI/J3DGUI.rc -------------------------------------------------------------------------------- /J3DGUI/J3D_GUI.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoulBasic/J3DReconstruction/dd519e8652aa9399b1a0965dfc60e395ab99c533/J3DGUI/J3D_GUI.ico -------------------------------------------------------------------------------- /J3DGUI/Jutil.cpp: -------------------------------------------------------------------------------- 1 | // Jutil.cpp : 定义静态库的函数。 2 | // 3 | #include "Jutil.h" 4 | 5 | namespace Jutil 6 | { 7 | SparseFileName::SparseFileName(const std::string& fullFileName) 8 | { 9 | this->extName = fullFileName.substr(fullFileName.find_last_of('.') + 1); 10 | 11 | int i = 0; 12 | for (i = fullFileName.length() - 1; i >= 0; i--) 13 | { 14 | if ('/' == fullFileName[i] || '\\' == fullFileName[i]) 15 | { 16 | break; 17 | } 18 | } 19 | this->dir = fullFileName.substr(0, i); 20 | 21 | this->frontName = fullFileName.substr(i + 1, fullFileName.find_last_of('.') - i - 1); 22 | 23 | } 24 | 25 | SparseFileName::SparseFileName() 26 | { 27 | dir = ""; 28 | extName = ""; 29 | frontName = ""; 30 | } 31 | 32 | 33 | 34 | BinaryPrintFile::BinaryPrintFile(std::string fileName) 35 | { 36 | this->is = new std::ifstream(); 37 | this->fileName = fileName; 38 | } 39 | 40 | bool BinaryPrintFile::init() 41 | { 42 | is->open(fileName, std::ios::in | std::ios::binary); 43 | if (!is->is_open()) 44 | { 45 | return false; 46 | } 47 | return true; 48 | } 49 | 50 | void BinaryPrintFile::sparseByte(int buf) 51 | { 52 | if (buf) sparseByte(buf / 2); 53 | else return; 54 | buffer += std::to_string(buf % 2); 55 | } 56 | 57 | std::string BinaryPrintFile::getByte() 58 | { 59 | int buf = 0; 60 | is->read(reinterpret_cast(&buf), 1); 61 | buffer.clear(); 62 | sparseByte(buf); 63 | if (buffer.length() < 8) 64 | { 65 | while (8 != buffer.length()) 66 | { 67 | buffer.insert(buffer.begin(), '0'); 68 | } 69 | } 70 | return buffer; 71 | } 72 | 73 | std::vector BinaryPrintFile::getBytes(int num) 74 | { 75 | std::vector temp; 76 | for (int i = 0; i < num; i++) 77 | { 78 | temp.push_back(getByte()); 79 | } 80 | return temp; 81 | } 82 | 83 | Clock::Clock() { reset(); } 84 | 85 | void Clock::reset() { _timePoint = std::chrono::high_resolution_clock::now(); } 86 | 87 | double Clock::getElapsedTimeInSec() 88 | { 89 | return this->getElapsedTimeInMircoSec() * 0.000001; 90 | } 91 | 92 | double Clock::getElapsedTimeInMilliSec() 93 | { 94 | return this->getElapsedTimeInMircoSec() * 0.001; 95 | } 96 | 97 | long long Clock::getElapsedTimeInMircoSec() 98 | { 99 | return std::chrono::duration_cast(std::chrono::high_resolution_clock::now() - _timePoint).count(); 100 | } 101 | 102 | void binaryPrint(int x) 103 | { 104 | std::bitset<32> bs(x); 105 | std::cout << bs << std::endl; 106 | } 107 | void binaryPrint(unsigned int x) 108 | { 109 | std::bitset<32> bs(x); 110 | std::cout << bs << std::endl; 111 | } 112 | void binaryPrint(char x) 113 | { 114 | std::bitset<8> bs(x); 115 | std::cout << bs << std::endl; 116 | } 117 | void binaryPrint(unsigned char x) 118 | { 119 | std::bitset<8> bs(x); 120 | std::cout << bs << std::endl; 121 | } 122 | void binaryPrint(float x) 123 | { 124 | int t = x; 125 | std::bitset<32> bs(t); 126 | std::cout << bs << std::endl; 127 | } 128 | void binaryPrint(double x) 129 | { 130 | std::bitset<64> bs(x); 131 | std::cout << bs << std::endl; 132 | } 133 | void binaryPrint(std::string str) 134 | { 135 | int len = str.length(); 136 | auto cstr = str.c_str(); 137 | for (int i = 0; i <= len; i++, cstr++) 138 | { 139 | std::cout << std::bitset<8>(*cstr) << " "; 140 | } 141 | std::cout << std::endl; 142 | } 143 | 144 | std::vector split(std::string str, std::string pattern) 145 | { 146 | std::string::size_type pos; 147 | std::vector result; 148 | str += pattern;//扩展字符串以方便操作 149 | int size = str.size(); 150 | for (int i = 0; i < size; i++) 151 | { 152 | pos = str.find(pattern, i); 153 | if (pos < size) 154 | { 155 | std::string s = str.substr(i, pos - i); 156 | result.push_back(s); 157 | i = pos + pattern.size() - 1; 158 | } 159 | } 160 | return result; 161 | } 162 | 163 | std::string getExtentionName(const std::string& str) 164 | { 165 | return str.substr(str.find_last_of('.') + 1); 166 | } 167 | 168 | std::string getFrontName(const std::string& str) 169 | { 170 | return str.substr(0, str.find_last_of('.')); 171 | } 172 | 173 | std::string getMiddleText(const std::string& str, const std::string& front, const std::string& behind) 174 | { 175 | auto lft = str.find(front); 176 | auto rht = str.find(behind); 177 | if (-1 == lft || -1 == rht) return ""; 178 | return str.substr(lft + front.length(), rht - lft - front.length()); 179 | 180 | } 181 | 182 | #ifdef _WIN32 183 | wchar_t * charTowchar(const char* cchar) 184 | { 185 | wchar_t *m_wchar; 186 | int len = MultiByteToWideChar(CP_ACP, 0, cchar, strlen(cchar), NULL, 0); 187 | m_wchar = new wchar_t[len + 1]; 188 | MultiByteToWideChar(CP_ACP, 0, cchar, strlen(cchar), m_wchar, len); 189 | m_wchar[len] = '\0'; 190 | return m_wchar; 191 | } 192 | 193 | char * wcharTochar(const wchar_t* wchar) 194 | { 195 | char * m_char; 196 | int len = WideCharToMultiByte(CP_ACP, 0, wchar, wcslen(wchar), NULL, 0, NULL, NULL); 197 | m_char = new char[len + 1]; 198 | WideCharToMultiByte(CP_ACP, 0, wchar, wcslen(wchar), m_char, len, NULL, NULL); 199 | m_char[len] = '\0'; 200 | return m_char; 201 | } 202 | #endif // _WIN32 203 | 204 | 205 | 206 | std::string getFileDir(const std::string& fileName) 207 | { 208 | if (fileName.length() <= 1)return ""; 209 | int i = 0; 210 | for (i = fileName.length() - 1; i >= 0; i--) 211 | { 212 | if ('/' == fileName[i] || '\\' == fileName[i]) 213 | { 214 | break; 215 | } 216 | } 217 | return fileName.substr(0, i); 218 | } 219 | 220 | std::string getFileName(const std::string& fullName) 221 | { 222 | if (fullName.length() <= 1)return ""; 223 | int i = 0; 224 | for (i = fullName.length() - 1; i >= 0; i--) 225 | { 226 | if ('/' == fullName[i] || '\\' == fullName[i]) 227 | { 228 | break; 229 | } 230 | } 231 | return fullName.substr(i + 1, fullName.length()); 232 | } 233 | } 234 | 235 | 236 | -------------------------------------------------------------------------------- /J3DGUI/Jutil.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoulBasic/J3DReconstruction/dd519e8652aa9399b1a0965dfc60e395ab99c533/J3DGUI/Jutil.h -------------------------------------------------------------------------------- /J3DGUI/QT3DReconstruction.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoulBasic/J3DReconstruction/dd519e8652aa9399b1a0965dfc60e395ab99c533/J3DGUI/QT3DReconstruction.cpp -------------------------------------------------------------------------------- /J3DGUI/QT3DReconstruction.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include "ui_QT3DReconstruction.h" 4 | #include 5 | #include "dialog_matchfeature.h" 6 | #include "dialog_sfm.h" 7 | #include "dialog_densifypointcloud.h" 8 | #include "Dialog_ReconstructMesh.h" 9 | #include "dialog_texturemesh.h" 10 | #include "dialog_addsensorwidth.h" 11 | #include "dialog_fullauto.h" 12 | #include "dialog_coorintersector.h" 13 | #include 14 | #include "qfiledialog.h" 15 | #include "qmessagebox.h" 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include "Global.h" 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include "mvsviewer.h" 27 | #include "qevent.h" 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include "Jutil.h" 34 | #include "Common.h" 35 | #include "Scene.h" 36 | 37 | class QT3DReconstruction : public QMainWindow 38 | { 39 | Q_OBJECT 40 | 41 | public: 42 | QT3DReconstruction(QWidget *parent = Q_NULLPTR); 43 | ~QT3DReconstruction(); 44 | 45 | bool openView(QString fileName); 46 | static bool openViewCompatibility(QString fileName); 47 | bool converseType(QString fileNameSrc, QString fileNameDes); 48 | private slots: 49 | 50 | void on_actionMatchFeature_triggered(); 51 | void on_actionSFM_triggered(); 52 | void on_action_addSensorWidth_triggered(); 53 | void on_actionDenseCloud_triggered(); 54 | void timerSlot(); 55 | void on_action_reconstrctMesh_triggered(); 56 | void on_action_triggered(); 57 | void on_actionopen_mvs_file_triggered(); 58 | void on_action_fullauto_triggered(); 59 | void on_action_2_triggered(); 60 | void on_pushButton_camera_clicked(); 61 | void on_pushButton_pointcloud_clicked(); 62 | void on_pushButton_mesh_clicked(); 63 | void on_pushButton_texture_clicked(); 64 | void on_pushButton_pointplus_clicked(); 65 | void on_pushButton_pointsub_clicked(); 66 | void on_pushButton_pointnumplus_clicked(); 67 | void on_pushButton_pointnumsub_clicked(); 68 | void on_pushButton_viewportplus_clicked(); 69 | void on_pushButton_viewportsub_clicked(); 70 | void on_pushButton_export_clicked(); 71 | void on_action_coor_triggered(); 72 | void on_action_import_BlocksExchange_triggered(); 73 | 74 | private: 75 | 76 | Ui::QT3DReconstructionClass ui; 77 | Dialog_MatchFeature dlgmf; 78 | Dialog_SFM dlgsfm; 79 | Dialog_DensifyPointCloud dlgdense; 80 | Dialog_ReconstructMesh dlgrm; 81 | Dialog_TextureMesh dlgtm; 82 | Dialog_addsensorwidth dlgasw; 83 | Dialog_FullAuto dlgfa; 84 | Dialog_CoorIntersector dlgci; 85 | QTimer* timer; 86 | VIEWER::Scene* J3DViewer; 87 | bool J3DViewerAva; 88 | Jutil::SparseFileName J3DFile; 89 | void closeEvent(QCloseEvent *event); 90 | void init_thread() 91 | { 92 | emit(this->ui.actionopen_mvs_file->triggered()); 93 | } 94 | protected: 95 | 96 | }; 97 | -------------------------------------------------------------------------------- /J3DGUI/QT3DReconstruction.pri: -------------------------------------------------------------------------------- 1 | # ---------------------------------------------------- 2 | # This file is generated by the Qt Visual Studio Tools. 3 | # ------------------------------------------------------ 4 | 5 | # This is a reminder that you are using a generated .pro file. 6 | # Remove it when you are finished editing this file. 7 | message("You are running qmake on a generated .pro file. This may not work!") 8 | 9 | 10 | HEADERS += ./Global.h \ 11 | $$PWD/Dialog_ReconstructMesh.h \ 12 | $$PWD/dialog_addsensorwidth.h \ 13 | $$PWD/dialog_coor.h \ 14 | $$PWD/dialog_coorintersector.h \ 15 | $$PWD/dialog_fullauto.h \ 16 | $$PWD/dialog_pointinfo.h \ 17 | $$PWD/dialog_texturemesh.h \ 18 | $$PWD/j3dviewer.h \ 19 | $$PWD/mvsviewer.h \ 20 | ./QT3DReconstruction.h \ 21 | ./dialog_densifypointcloud.h \ 22 | ./dialog_matchfeature.h \ 23 | ./dialog_sfm.h 24 | SOURCES += ./dialog_densifypointcloud.cpp \ 25 | $$PWD/Dialog_ReconstructMesh.cpp \ 26 | $$PWD/dialog_addsensorwidth.cpp \ 27 | $$PWD/dialog_coor.cpp \ 28 | $$PWD/dialog_coorintersector.cpp \ 29 | $$PWD/dialog_fullauto.cpp \ 30 | $$PWD/dialog_pointinfo.cpp \ 31 | $$PWD/dialog_texturemesh.cpp \ 32 | $$PWD/j3dviewer.cpp \ 33 | $$PWD/mvsviewer.cpp \ 34 | ./Dialog_MatchFeature.cpp \ 35 | ./dialog_sfm.cpp \ 36 | ./Global.cpp \ 37 | ./QT3DReconstruction.cpp \ 38 | ./main.cpp 39 | FORMS += ./dialog_densifypointcloud.ui \ 40 | $$PWD/dialog_addsensorwidth.ui \ 41 | $$PWD/dialog_coor.ui \ 42 | $$PWD/dialog_coorintersector.ui \ 43 | $$PWD/dialog_fullauto.ui \ 44 | $$PWD/dialog_pointinfo.ui \ 45 | $$PWD/dialog_reconstructmesh.ui \ 46 | $$PWD/dialog_texturemesh.ui \ 47 | ./Dialog_MatchFeature.ui \ 48 | ./dialog_sfm.ui \ 49 | ./QT3DReconstruction.ui 50 | RESOURCES += QT3DReconstruction.qrc 51 | -------------------------------------------------------------------------------- /J3DGUI/QT3DReconstruction.pro: -------------------------------------------------------------------------------- 1 | # ---------------------------------------------------- 2 | # This file is generated by the Qt Visual Studio Tools. 3 | # ------------------------------------------------------ 4 | 5 | TEMPLATE = app 6 | TARGET = QT3DReconstruction 7 | DESTDIR = ../Release 8 | CONFIG += release 9 | DEFINES += _UNICODE _ENABLE_EXTENDED_ALIGNED_STORAGE WIN64 10 | LIBS += -L"." 11 | DEPENDPATH += . 12 | MOC_DIR += . 13 | OBJECTS_DIR += release 14 | UI_DIR += . 15 | RCC_DIR += . 16 | include(QT3DReconstruction.pri) 17 | 18 | HEADERS += 19 | 20 | SOURCES += 21 | 22 | FORMS += 23 | -------------------------------------------------------------------------------- /J3DGUI/QT3DReconstruction.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /J3DGUI/QT3DReconstruction.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | QT3DReconstructionClass 4 | 5 | 6 | 7 | 0 8 | 0 9 | 1366 10 | 818 11 | 12 | 13 | 14 | 15 | 0 16 | 0 17 | 18 | 19 | 20 | J3D可视化平台 21 | 22 | 23 | 24 | J3D_GUI.icoJ3D_GUI.ico 25 | 26 | 27 | 28 | 29 | 30 | 1100 31 | 0 32 | 271 33 | 31 34 | 35 | 36 | 37 | 38 | 微软雅黑 39 | 12 40 | 41 | 42 | 43 | Qt::LeftToRight 44 | 45 | 46 | Engine 47 | 48 | 49 | Qt::AlignCenter 50 | 51 | 52 | 53 | 54 | 55 | 10 56 | 730 57 | 161 58 | 21 59 | 60 | 61 | 62 | 当前程序运行状况: 63 | 64 | 65 | 66 | 67 | 68 | 220 69 | 730 70 | 391 71 | 31 72 | 73 | 74 | 75 | 76 | 微软雅黑 77 | 12 78 | 79 | 80 | 81 | 等待任务 82 | 83 | 84 | Qt::AlignCenter 85 | 86 | 87 | 88 | 89 | 90 | 640 91 | 740 92 | 671 93 | 23 94 | 95 | 96 | 97 | 0 98 | 99 | 100 | 101 | 102 | 103 | 10 104 | 70 105 | 1341 106 | 621 107 | 108 | 109 | 110 | 111 | 112 | 113 | 0 114 | 0 115 | 91 116 | 31 117 | 118 | 119 | 120 | 渲染相机位置 121 | 122 | 123 | 124 | 125 | 126 | 110 127 | 0 128 | 91 129 | 31 130 | 131 | 132 | 133 | 渲染点云 134 | 135 | 136 | 137 | 138 | 139 | 220 140 | 0 141 | 91 142 | 31 143 | 144 | 145 | 146 | 渲染网格 147 | 148 | 149 | 150 | 151 | 152 | 330 153 | 0 154 | 91 155 | 31 156 | 157 | 158 | 159 | 渲染纹理 160 | 161 | 162 | 163 | 164 | 165 | 440 166 | 0 167 | 51 168 | 31 169 | 170 | 171 | 172 | 点大小+ 173 | 174 | 175 | 176 | 177 | 178 | 490 179 | 0 180 | 51 181 | 31 182 | 183 | 184 | 185 | 点大小- 186 | 187 | 188 | 189 | 190 | 191 | 570 192 | 0 193 | 81 194 | 31 195 | 196 | 197 | 198 | 渲染点数量+ 199 | 200 | 201 | 202 | 203 | 204 | 650 205 | 0 206 | 81 207 | 31 208 | 209 | 210 | 211 | 渲染点数量- 212 | 213 | 214 | 215 | 216 | 217 | 920 218 | 0 219 | 101 220 | 31 221 | 222 | 223 | 224 | 输出为其他格式 225 | 226 | 227 | 228 | 229 | 230 | 760 231 | 0 232 | 71 233 | 31 234 | 235 | 236 | 237 | 相机视角+ 238 | 239 | 240 | 241 | 242 | 243 | 830 244 | 0 245 | 71 246 | 31 247 | 248 | 249 | 250 | 相机视角- 251 | 252 | 253 | 254 | 255 | 256 | 1030 257 | 0 258 | 61 259 | 31 260 | 261 | 262 | 263 | 264 | ply 265 | 266 | 267 | 268 | 269 | obj 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 0 279 | 0 280 | 1366 281 | 23 282 | 283 | 284 | 285 | 286 | 分步三维重建 287 | 288 | 289 | 290 | SFM引擎 291 | 292 | 293 | 294 | 295 | 296 | 297 | MVS引擎 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 可视化模块 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 全自动三维重建 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 特征匹配 330 | 331 | 332 | 333 | 334 | SFM及稀疏点云生成 335 | 336 | 337 | 338 | 339 | 密集点云生成 340 | 341 | 342 | 343 | 344 | 添加相机传感器参数 345 | 346 | 347 | 348 | 349 | 三角网模型重建 350 | 351 | 352 | 353 | 354 | 模型纹理映射 355 | 356 | 357 | 358 | 359 | 打开模型 360 | 361 | 362 | 363 | 364 | 全自动工程配置 365 | 366 | 367 | 368 | 369 | 打开模型(兼容模式) 370 | 371 | 372 | 373 | 374 | 坐标映射 375 | 376 | 377 | 378 | 379 | 导入其他SFM数据 380 | 381 | 382 | 383 | 384 | 385 | 386 | mvsviewer 387 | QWidget 388 |
mvsviewer.h
389 | 1 390 |
391 |
392 | 393 | 394 | 395 | btn_onclick() 396 | 397 |
398 | -------------------------------------------------------------------------------- /J3DGUI/QT3DReconstruction.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 6 | h;hh;hpp;hxx;hm;inl;inc;xsd 7 | 8 | 9 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 10 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 11 | 12 | 13 | {99349809-55BA-4b9d-BF79-8FDBB0286EB3} 14 | ui 15 | 16 | 17 | {D9D6E242-F8AF-46E4-B9FD-80ECBC20BA3E} 18 | qrc;* 19 | false 20 | 21 | 22 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 23 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 24 | 25 | 26 | {4a6fbe7b-c248-4a7a-922f-4b3480482f08} 27 | 28 | 29 | {6425b121-f300-4b68-a66a-a90bc8db646d} 30 | 31 | 32 | 33 | 34 | Form Files 35 | 36 | 37 | Form Files 38 | 39 | 40 | Form Files 41 | 42 | 43 | Header Files 44 | 45 | 46 | Header Files 47 | 48 | 49 | Header Files 50 | 51 | 52 | Header Files 53 | 54 | 55 | Header Files 56 | 57 | 58 | Form Files 59 | 60 | 61 | Form Files 62 | 63 | 64 | 65 | 66 | Source Files 67 | 68 | 69 | Source Files 70 | 71 | 72 | Source Files 73 | 74 | 75 | Source Files 76 | 77 | 78 | Source Files 79 | 80 | 81 | Source Files 82 | 83 | 84 | Source Files 85 | 86 | 87 | Source Files 88 | 89 | 90 | Source Files 91 | 92 | 93 | Source Files 94 | 95 | 96 | Source Files 97 | 98 | 99 | Source Files 100 | 101 | 102 | Source Files 103 | 104 | 105 | Source Files 106 | 107 | 108 | dxflib 109 | 110 | 111 | dxflib 112 | 113 | 114 | Source Files 115 | 116 | 117 | 118 | 119 | Header Files 120 | 121 | 122 | Header Files 123 | 124 | 125 | Header Files 126 | 127 | 128 | Header Files 129 | 130 | 131 | Header Files 132 | 133 | 134 | Header Files 135 | 136 | 137 | Header Files 138 | 139 | 140 | 141 | 142 | Header Files 143 | 144 | 145 | Header Files 146 | 147 | 148 | Header Files 149 | 150 | 151 | dxflib 152 | 153 | 154 | dxflib 155 | 156 | 157 | dxflib 158 | 159 | 160 | dxflib 161 | 162 | 163 | dxflib 164 | 165 | 166 | dxflib 167 | 168 | 169 | dxflib 170 | 171 | 172 | dxflib 173 | 174 | 175 | dxflib 176 | 177 | 178 | dxflib 179 | 180 | 181 | dxflib 182 | 183 | 184 | Header Files 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | Form Files 193 | 194 | 195 | Form Files 196 | 197 | 198 | Form Files 199 | 200 | 201 | Form Files 202 | 203 | 204 | Form Files 205 | 206 | 207 | 208 | 209 | Resource Files 210 | 211 | 212 | 213 | 214 | Resource Files 215 | 216 | 217 | 218 | 219 | Cmake Rules 220 | 221 | 222 | -------------------------------------------------------------------------------- /J3DGUI/TiffData.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoulBasic/J3DReconstruction/dd519e8652aa9399b1a0965dfc60e395ab99c533/J3DGUI/TiffData.hpp -------------------------------------------------------------------------------- /J3DGUI/dialog_addsensorwidth.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoulBasic/J3DReconstruction/dd519e8652aa9399b1a0965dfc60e395ab99c533/J3DGUI/dialog_addsensorwidth.cpp -------------------------------------------------------------------------------- /J3DGUI/dialog_addsensorwidth.h: -------------------------------------------------------------------------------- 1 | #ifndef DIALOG_ADDSENSORWIDTH_H 2 | #define DIALOG_ADDSENSORWIDTH_H 3 | 4 | #include 5 | #include "Global.h" 6 | #include 7 | #include 8 | #include 9 | 10 | namespace Ui { 11 | class Dialog_addsensorwidth; 12 | } 13 | 14 | class Dialog_addsensorwidth : public QDialog 15 | { 16 | Q_OBJECT 17 | 18 | public: 19 | explicit Dialog_addsensorwidth(QWidget *parent = nullptr); 20 | ~Dialog_addsensorwidth(); 21 | 22 | private slots: 23 | void on_btn_OK_clicked(); 24 | 25 | void on_btn_CANCEL_clicked(); 26 | 27 | private: 28 | Ui::Dialog_addsensorwidth *ui; 29 | }; 30 | 31 | #endif // DIALOG_ADDSENSORWIDTH_H 32 | -------------------------------------------------------------------------------- /J3DGUI/dialog_addsensorwidth.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | Dialog_addsensorwidth 4 | 5 | 6 | 7 | 0 8 | 0 9 | 229 10 | 188 11 | 12 | 13 | 14 | 添加相机参数 15 | 16 | 17 | 18 | 19 | 100 20 | 50 21 | 81 22 | 20 23 | 24 | 25 | 26 | 27 | 28 | 29 | 20 30 | 80 31 | 61 32 | 21 33 | 34 | 35 | 36 | 相机焦距: 37 | 38 | 39 | 40 | 41 | 42 | 20 43 | 50 44 | 71 45 | 21 46 | 47 | 48 | 49 | 相机型号: 50 | 51 | 52 | 53 | 54 | 55 | 120 56 | 140 57 | 81 58 | 31 59 | 60 | 61 | 62 | 取消 63 | 64 | 65 | 66 | 67 | 68 | 20 69 | 140 70 | 81 71 | 31 72 | 73 | 74 | 75 | 确定 76 | 77 | 78 | 79 | 80 | 81 | 100 82 | 80 83 | 81 84 | 20 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 20 95 | 20 96 | 171 97 | 16 98 | 99 | 100 | 101 | 添加相机参数: 102 | 103 | 104 | 105 | 106 | 107 | 20 108 | 110 109 | 111 110 | 21 111 | 112 | 113 | 114 | 相机视场角(FOV): 115 | 116 | 117 | 118 | 119 | 120 | 130 121 | 110 122 | 41 123 | 20 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 190 134 | 80 135 | 31 136 | 21 137 | 138 | 139 | 140 | mm 141 | 142 | 143 | 144 | 145 | 146 | 180 147 | 110 148 | 31 149 | 21 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | -------------------------------------------------------------------------------- /J3DGUI/dialog_coorintersector.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoulBasic/J3DReconstruction/dd519e8652aa9399b1a0965dfc60e395ab99c533/J3DGUI/dialog_coorintersector.cpp -------------------------------------------------------------------------------- /J3DGUI/dialog_coorintersector.h: -------------------------------------------------------------------------------- 1 | #ifndef DIALOG_COORINTERSECTOR_H 2 | #define DIALOG_COORINTERSECTOR_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include "Global.h" 13 | #include 14 | #include "libs/MVS/Common.h" 15 | #include "libs/MVS/Scene.h" 16 | #include "TiffData.hpp" 17 | #include 18 | #include 19 | #include "dialog_pointinfo.h" 20 | #include "dxflib/dl_dxf.h" 21 | #include 22 | #include 23 | #include 24 | struct JPoint3d 25 | { 26 | QString note; 27 | double x; 28 | double y; 29 | double z; 30 | JPoint3d(const QString& n, double a, double b, double c):note(n),x(a),y(b),z(c){} 31 | JPoint3d():note(""), x(0), y(0), z(0) {} 32 | }; 33 | 34 | 35 | namespace Ui { 36 | class Dialog_CoorIntersector; 37 | } 38 | 39 | class Dialog_CoorIntersector : public QDialog 40 | { 41 | Q_OBJECT 42 | 43 | public: 44 | explicit Dialog_CoorIntersector(QWidget *parent = nullptr); 45 | ~Dialog_CoorIntersector(); 46 | void printMsg(const QString& msg); 47 | void intersectPoint(int x, int y, int image_index); 48 | void onIntersection(int x, int y, int image_index, QPoint& now_pos); 49 | void addPoint(double x, double y, double z, const QString& note); 50 | protected: 51 | void resizeEvent(QResizeEvent *event); 52 | private slots: 53 | void on_toolButton_imageDir_clicked(); 54 | void on_toolButton_dsmDir_clicked(); 55 | void on_listView_images_clicked(QModelIndex index); 56 | void show_picked_points_menu(const QPoint& pos); 57 | void on_pushButton_outputDXF_clicked(); 58 | void on_delete_point_clicked(); 59 | private: 60 | void read_dsm_file(QString fileName); 61 | void clear_sfm_file(); 62 | bool write_to_dxf(const std::string& fileName); 63 | 64 | QStringListModel* images_model; 65 | QStringListModel* picked_points_model; 66 | QString workDir; 67 | TiffData* tiffData; 68 | MVS::Scene* scene; 69 | Ui::Dialog_CoorIntersector *ui; 70 | std::vector picked_points; 71 | Dialog_PointInfo dlg_point_info; 72 | bool have_DSM_data; 73 | QMenu* picked_points_menu; 74 | }; 75 | 76 | #endif // DIALOG_COORINTERSECTOR_H 77 | -------------------------------------------------------------------------------- /J3DGUI/dialog_coorintersector.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | Dialog_CoorIntersector 4 | 5 | 6 | 7 | 0 8 | 0 9 | 1600 10 | 900 11 | 12 | 13 | 14 | 坐标映射 15 | 16 | 17 | 18 | J3D_GUI.icoJ3D_GUI.ico 19 | 20 | 21 | 22 | 23 | 10 24 | 90 25 | 340 26 | 300 27 | 28 | 29 | 30 | 31 | 32 | 33 | 358 34 | 90 35 | 1240 36 | 800 37 | 38 | 39 | 40 | 41 | 42 | 43 | 100 44 | 10 45 | 171 46 | 21 47 | 48 | 49 | 50 | true 51 | 52 | 53 | 54 | 55 | 56 | 280 57 | 10 58 | 31 59 | 21 60 | 61 | 62 | 63 | ... 64 | 65 | 66 | 67 | 68 | 69 | 10 70 | 420 71 | 340 72 | 470 73 | 74 | 75 | 76 | 77 | 78 | 79 | 20 80 | 10 81 | 81 82 | 21 83 | 84 | 85 | 86 | SFM重建目录 87 | 88 | 89 | 90 | 91 | 92 | 10 93 | 70 94 | 71 95 | 21 96 | 97 | 98 | 99 | 影像数据 100 | 101 | 102 | 103 | 104 | 105 | 10 106 | 390 107 | 81 108 | 31 109 | 110 | 111 | 112 | 已选中的点集 113 | 114 | 115 | 116 | 117 | 118 | 580 119 | 10 120 | 31 121 | 21 122 | 123 | 124 | 125 | ... 126 | 127 | 128 | 129 | 130 | 131 | 400 132 | 10 133 | 171 134 | 21 135 | 136 | 137 | 138 | true 139 | 140 | 141 | 142 | 143 | 144 | 320 145 | 10 146 | 81 147 | 21 148 | 149 | 150 | 151 | DSM文件路径 152 | 153 | 154 | 155 | 156 | 157 | 640 158 | 10 159 | 931 160 | 41 161 | 162 | 163 | 164 | 165 | 黑体 166 | 14 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 20 177 | 40 178 | 281 179 | 21 180 | 181 | 182 | 183 | 184 | 黑体 185 | 12 186 | 187 | 188 | 189 | 无SFM重建数据,请先选择目录 190 | 191 | 192 | 193 | 194 | 195 | 320 196 | 40 197 | 291 198 | 21 199 | 200 | 201 | 202 | 203 | 黑体 204 | 12 205 | 206 | 207 | 208 | 无DSM数据,请先选择文件 209 | 210 | 211 | 212 | 213 | 214 | 90 215 | 390 216 | 111 217 | 31 218 | 219 | 220 | 221 | 输出到dxf 222 | 223 | 224 | 225 | 226 | 227 | ImageView 228 | QWidget 229 |
ImageView.h
230 | 1 231 |
232 |
233 | 234 | 235 |
236 | -------------------------------------------------------------------------------- /J3DGUI/dialog_densifypointcloud.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoulBasic/J3DReconstruction/dd519e8652aa9399b1a0965dfc60e395ab99c533/J3DGUI/dialog_densifypointcloud.cpp -------------------------------------------------------------------------------- /J3DGUI/dialog_densifypointcloud.h: -------------------------------------------------------------------------------- 1 | #ifndef DIALOG_DENSIFYPOINTCLOUD_H 2 | #define DIALOG_DENSIFYPOINTCLOUD_H 3 | 4 | #include 5 | #include 6 | #include "Global.h" 7 | #include 8 | #include 9 | 10 | namespace Ui { 11 | class Dialog_DensifyPointCloud; 12 | } 13 | 14 | class Dialog_DensifyPointCloud : public QDialog 15 | { 16 | Q_OBJECT 17 | 18 | public: 19 | explicit Dialog_DensifyPointCloud(QWidget *parent = nullptr); 20 | ~Dialog_DensifyPointCloud(); 21 | 22 | private slots: 23 | void on_pushButton_browseInputDir_clicked(); 24 | 25 | void on_pushButton_browseOutputDir_clicked(); 26 | 27 | void on_btn_OK_clicked(); 28 | 29 | void on_btn_CANCEL_clicked(); 30 | 31 | private: 32 | Ui::Dialog_DensifyPointCloud *ui; 33 | }; 34 | 35 | #endif // DIALOG_DENSIFYPOINTCLOUD_H 36 | -------------------------------------------------------------------------------- /J3DGUI/dialog_densifypointcloud.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | Dialog_DensifyPointCloud 4 | 5 | 6 | 7 | 0 8 | 0 9 | 502 10 | 189 11 | 12 | 13 | 14 | 密集点云生成 15 | 16 | 17 | 18 | 19 | 130 20 | 40 21 | 301 22 | 20 23 | 24 | 25 | 26 | 27 | 28 | 29 | 440 30 | 40 31 | 51 32 | 23 33 | 34 | 35 | 36 | 浏览 37 | 38 | 39 | 40 | 41 | 42 | 10 43 | 10 44 | 171 45 | 16 46 | 47 | 48 | 49 | 生成密集点云参数设置: 50 | 51 | 52 | 53 | 54 | 55 | 10 56 | 40 57 | 121 58 | 21 59 | 60 | 61 | 62 | 三维重建结果目录: 63 | 64 | 65 | 66 | 67 | 68 | 440 69 | 80 70 | 51 71 | 23 72 | 73 | 74 | 75 | 浏览 76 | 77 | 78 | 79 | 80 | 81 | 130 82 | 80 83 | 301 84 | 20 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 10 95 | 80 96 | 121 97 | 21 98 | 99 | 100 | 101 | 密集点云输出目录: 102 | 103 | 104 | 105 | 106 | 107 | 140 108 | 130 109 | 81 110 | 31 111 | 112 | 113 | 114 | 确定 115 | 116 | 117 | 118 | 119 | 120 | 270 121 | 130 122 | 81 123 | 31 124 | 125 | 126 | 127 | 取消 128 | 129 | 130 | 131 | 132 | 133 | 134 | -------------------------------------------------------------------------------- /J3DGUI/dialog_fullauto.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoulBasic/J3DReconstruction/dd519e8652aa9399b1a0965dfc60e395ab99c533/J3DGUI/dialog_fullauto.cpp -------------------------------------------------------------------------------- /J3DGUI/dialog_fullauto.h: -------------------------------------------------------------------------------- 1 | #ifndef DIALOG_FULLAUTO_H 2 | #define DIALOG_FULLAUTO_H 3 | 4 | #include 5 | #include "Global.h" 6 | #include 7 | #include 8 | #include 9 | 10 | namespace Ui { 11 | class Dialog_FullAuto; 12 | } 13 | 14 | class Dialog_FullAuto : public QDialog 15 | { 16 | Q_OBJECT 17 | 18 | public: 19 | explicit Dialog_FullAuto(QWidget *parent = nullptr); 20 | ~Dialog_FullAuto(); 21 | 22 | private slots: 23 | void on_pushButton_browseInputDir_clicked(); 24 | 25 | void on_pushButton_browseOutputDir_clicked(); 26 | 27 | void on_btn_OK_clicked(); 28 | 29 | void on_btn_CANCEL_clicked(); 30 | 31 | private: 32 | Ui::Dialog_FullAuto *ui; 33 | }; 34 | 35 | #endif // DIALOG_FULLAUTO_H 36 | -------------------------------------------------------------------------------- /J3DGUI/dialog_matchfeature.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef DIALOG_MATCHFEATURE_H 3 | #define DIALOG_MATCHFEATURE_H 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include "Global.h" 10 | #include 11 | #include 12 | #include 13 | 14 | namespace Ui { 15 | class Dialog_MatchFeature; 16 | } 17 | 18 | class Dialog_MatchFeature : public QDialog 19 | { 20 | Q_OBJECT 21 | 22 | public: 23 | explicit Dialog_MatchFeature(QWidget *parent = nullptr); 24 | ~Dialog_MatchFeature(); 25 | 26 | private slots: 27 | 28 | 29 | void on_btn_CANCEL_clicked(); 30 | 31 | void on_btn_OK_clicked(); 32 | 33 | void pushButton_browseInputDir_clicked(); 34 | 35 | void pushButton_browseOutputDir_clicked(); 36 | 37 | private: 38 | Ui::Dialog_MatchFeature *ui; 39 | 40 | }; 41 | 42 | #endif // DIALOG_MATCHFEATURE_H 43 | -------------------------------------------------------------------------------- /J3DGUI/dialog_pointinfo.cpp: -------------------------------------------------------------------------------- 1 | #include "dialog_pointinfo.h" 2 | #include "ui_dialog_pointinfo.h" 3 | #include "dialog_coorintersector.h" 4 | Dialog_PointInfo::Dialog_PointInfo(QWidget *parent) : 5 | QDialog(parent), 6 | ui(new Ui::Dialog_PointInfo) 7 | { 8 | setWindowFlags(Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint); 9 | ui->setupUi(this); 10 | } 11 | 12 | Dialog_PointInfo::~Dialog_PointInfo() 13 | { 14 | delete ui; 15 | } 16 | 17 | 18 | void Dialog_PointInfo::on_pushButton_cancel_clicked() 19 | { 20 | this->close(); 21 | } 22 | 23 | void Dialog_PointInfo::on_pushButton_OK_clicked() 24 | { 25 | Dialog_CoorIntersector* _parent = (Dialog_CoorIntersector*)_p; 26 | auto note = ui->lineEdit_note->text(); 27 | if (note.isEmpty())note = "unknown"; 28 | _parent->addPoint(ui->lineEdit_xi->text().toDouble(), ui->lineEdit_yi->text().toDouble(), ui->lineEdit_zi->text().toDouble(), ui->lineEdit_note->text()); 29 | this->close(); 30 | } 31 | 32 | void Dialog_PointInfo::setNote(const QString & str) { ui->lineEdit_note->setText(str); } 33 | void Dialog_PointInfo::setXi(double x) { ui->lineEdit_xi->setText(QString::number(x, 'g', 10)); } 34 | void Dialog_PointInfo::setYi(double y) { ui->lineEdit_yi->setText(QString::number(y, 'g', 10)); } 35 | void Dialog_PointInfo::setZi(double z) { ui->lineEdit_zi->setText(QString::number(z, 'g', 10)); } 36 | 37 | void Dialog_PointInfo::clearXYZi() 38 | { 39 | ui->lineEdit_xi->setText(""); 40 | ui->lineEdit_yi->setText(""); 41 | ui->lineEdit_zi->setText(""); 42 | } 43 | 44 | -------------------------------------------------------------------------------- /J3DGUI/dialog_pointinfo.h: -------------------------------------------------------------------------------- 1 | #ifndef DIALOG_POINTINFO_H 2 | #define DIALOG_POINTINFO_H 3 | #include 4 | #include 5 | namespace Ui { 6 | class Dialog_PointInfo; 7 | } 8 | 9 | class Dialog_PointInfo : public QDialog 10 | { 11 | Q_OBJECT 12 | 13 | public: 14 | explicit Dialog_PointInfo(QWidget *parent = nullptr); 15 | ~Dialog_PointInfo(); 16 | void setNote(const QString& str); 17 | void setXi(double x); 18 | void setYi(double y); 19 | void setZi(double z); 20 | void clearXYZi(); 21 | void setP(void* p) { _p = p; } 22 | private slots: 23 | void on_pushButton_OK_clicked(); 24 | void on_pushButton_cancel_clicked(); 25 | private: 26 | Ui::Dialog_PointInfo *ui; 27 | void* _p; 28 | }; 29 | 30 | #endif // DIALOG_POINTINFO_H 31 | -------------------------------------------------------------------------------- /J3DGUI/dialog_pointinfo.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | Dialog_PointInfo 4 | 5 | 6 | 7 | 0 8 | 0 9 | 177 10 | 226 11 | 12 | 13 | 14 | 映射点信息 15 | 16 | 17 | 18 | 19 | 50 20 | 110 21 | 113 22 | 20 23 | 24 | 25 | 26 | 27 | 28 | 29 | 50 30 | 130 31 | 113 32 | 20 33 | 34 | 35 | 36 | 37 | 38 | 39 | 50 40 | 150 41 | 113 42 | 20 43 | 44 | 45 | 46 | 47 | 48 | 49 | 20 50 | 110 51 | 20 52 | 20 53 | 54 | 55 | 56 | X: 57 | 58 | 59 | 60 | 61 | 62 | 20 63 | 130 64 | 21 65 | 20 66 | 67 | 68 | 69 | Y: 70 | 71 | 72 | 73 | 74 | 75 | 20 76 | 150 77 | 20 78 | 20 79 | 80 | 81 | 82 | Z: 83 | 84 | 85 | 86 | 87 | 88 | 50 89 | 0 90 | 111 91 | 31 92 | 93 | 94 | 95 | 当前映射点信息 96 | 97 | 98 | 99 | 100 | 101 | 50 102 | 60 103 | 111 104 | 20 105 | 106 | 107 | 108 | false 109 | 110 | 111 | 112 | 113 | 114 | 10 115 | 30 116 | 81 117 | 31 118 | 119 | 120 | 121 | 映射点名称: 122 | 123 | 124 | 125 | 126 | 127 | 10 128 | 80 129 | 81 130 | 31 131 | 132 | 133 | 134 | 映射点坐标: 135 | 136 | 137 | 138 | 139 | 140 | 30 141 | 180 142 | 51 143 | 31 144 | 145 | 146 | 147 | 确认 148 | 149 | 150 | 151 | 152 | 153 | 100 154 | 180 155 | 51 156 | 31 157 | 158 | 159 | 160 | 放弃 161 | 162 | 163 | 164 | 165 | 166 | 167 | -------------------------------------------------------------------------------- /J3DGUI/dialog_reconstructmesh.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | Dialog_ReconstructMesh 4 | 5 | 6 | 7 | 0 8 | 0 9 | 495 10 | 195 11 | 12 | 13 | 14 | 三角网模型重建 15 | 16 | 17 | 18 | 19 | 10 20 | 20 21 | 171 22 | 16 23 | 24 | 25 | 26 | 三角网重建参数设置: 27 | 28 | 29 | 30 | 31 | 32 | 140 33 | 140 34 | 81 35 | 31 36 | 37 | 38 | 39 | 确定 40 | 41 | 42 | 43 | 44 | 45 | 270 46 | 140 47 | 81 48 | 31 49 | 50 | 51 | 52 | 取消 53 | 54 | 55 | 56 | 57 | 58 | 10 59 | 90 60 | 121 61 | 21 62 | 63 | 64 | 65 | 三角网模型输出目录: 66 | 67 | 68 | 69 | 70 | 71 | 430 72 | 90 73 | 41 74 | 23 75 | 76 | 77 | 78 | 浏览 79 | 80 | 81 | 82 | 83 | 84 | 430 85 | 50 86 | 41 87 | 23 88 | 89 | 90 | 91 | 浏览 92 | 93 | 94 | 95 | 96 | 97 | 130 98 | 90 99 | 291 100 | 20 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 10 111 | 50 112 | 121 113 | 21 114 | 115 | 116 | 117 | 密集点云文件目录: 118 | 119 | 120 | 121 | 122 | 123 | 130 124 | 50 125 | 291 126 | 20 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | -------------------------------------------------------------------------------- /J3DGUI/dialog_sfm.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoulBasic/J3DReconstruction/dd519e8652aa9399b1a0965dfc60e395ab99c533/J3DGUI/dialog_sfm.cpp -------------------------------------------------------------------------------- /J3DGUI/dialog_sfm.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #ifndef DIALOG_SFM_H 3 | #define DIALOG_SFM_H 4 | 5 | #include 6 | #include "Global.h" 7 | #include 8 | #include 9 | #include 10 | 11 | namespace Ui { 12 | class Dialog_SFM; 13 | } 14 | 15 | class Dialog_SFM : public QDialog 16 | { 17 | Q_OBJECT 18 | 19 | public: 20 | explicit Dialog_SFM(QWidget *parent = nullptr); 21 | ~Dialog_SFM(); 22 | 23 | private slots: 24 | 25 | void on_btn_OK_clicked(); 26 | 27 | void on_btn_CANCEL_clicked(); 28 | 29 | void on_pushButton_browseInputDir_clicked(); 30 | 31 | void on_pushButton_browseOutputDir_clicked(); 32 | 33 | private: 34 | Ui::Dialog_SFM *ui; 35 | }; 36 | 37 | #endif // DIALOG_SFM_H 38 | -------------------------------------------------------------------------------- /J3DGUI/dialog_sfm.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | Dialog_SFM 4 | 5 | 6 | 7 | 0 8 | 0 9 | 491 10 | 257 11 | 12 | 13 | 14 | 三维重建配置 15 | 16 | 17 | 18 | J3D_GUI.icoJ3D_GUI.ico 19 | 20 | 21 | 22 | 23 | 430 24 | 50 25 | 41 26 | 23 27 | 28 | 29 | 30 | 浏览 31 | 32 | 33 | 34 | 35 | 36 | 10 37 | 20 38 | 171 39 | 16 40 | 41 | 42 | 43 | 三维重建参数设置: 44 | 45 | 46 | 47 | 48 | 49 | 90 50 | 50 51 | 331 52 | 20 53 | 54 | 55 | 56 | 57 | 58 | 59 | 10 60 | 50 61 | 81 62 | 21 63 | 64 | 65 | 66 | 匹配数据路径: 67 | 68 | 69 | 70 | 71 | 72 | 10 73 | 80 74 | 81 75 | 21 76 | 77 | 78 | 79 | 结果输出路径: 80 | 81 | 82 | 83 | 84 | 85 | 90 86 | 80 87 | 331 88 | 20 89 | 90 | 91 | 92 | 93 | 94 | 95 | 430 96 | 80 97 | 41 98 | 23 99 | 100 | 101 | 102 | 浏览 103 | 104 | 105 | 106 | 107 | 108 | 10 109 | 110 110 | 111 111 | 21 112 | 113 | 114 | 115 | 空中三角测量方法: 116 | 117 | 118 | 119 | 120 | 121 | 120 122 | 110 123 | 231 124 | 21 125 | 126 | 127 | 128 | 3 129 | 130 | 131 | 132 | DIRECT_LINEAR_TRANSFORM 133 | 134 | 135 | 136 | 137 | L1_ANGULAR 138 | 139 | 140 | 141 | 142 | LINFINITY_ANGULAR 143 | 144 | 145 | 146 | 147 | INVERSE_DEPTH_WEIGHTED_MIDPOINT 148 | 149 | 150 | 151 | 152 | 153 | 154 | 120 155 | 140 156 | 231 157 | 21 158 | 159 | 160 | 161 | 3 162 | 163 | 164 | 165 | DLT_6POINTS 166 | 167 | 168 | 169 | 170 | P3P_KE_CVPR17 171 | 172 | 173 | 174 | 175 | P3P_KNEIP_CVPR11 176 | 177 | 178 | 179 | 180 | P3P_NORDBERG_ECCV18 181 | 182 | 183 | 184 | 185 | UP2P_KUKELOVA_ACCV10 186 | 187 | 188 | 189 | 190 | 191 | 192 | 10 193 | 140 194 | 111 195 | 21 196 | 197 | 198 | 199 | 计算后方交会方法: 200 | 201 | 202 | 203 | 204 | 205 | 130 206 | 200 207 | 81 208 | 31 209 | 210 | 211 | 212 | 确定 213 | 214 | 215 | 216 | 217 | 218 | 260 219 | 200 220 | 81 221 | 31 222 | 223 | 224 | 225 | 取消 226 | 227 | 228 | 229 | 230 | 231 | 232 | -------------------------------------------------------------------------------- /J3DGUI/dialog_texturemesh.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoulBasic/J3DReconstruction/dd519e8652aa9399b1a0965dfc60e395ab99c533/J3DGUI/dialog_texturemesh.cpp -------------------------------------------------------------------------------- /J3DGUI/dialog_texturemesh.h: -------------------------------------------------------------------------------- 1 | #ifndef DIALOG_TEXTUREMESH_H 2 | #define DIALOG_TEXTUREMESH_H 3 | 4 | #include 5 | #include "Global.h" 6 | #include 7 | #include 8 | #include 9 | namespace Ui { 10 | class Dialog_TextureMesh; 11 | } 12 | 13 | class Dialog_TextureMesh : public QDialog 14 | { 15 | Q_OBJECT 16 | 17 | public: 18 | explicit Dialog_TextureMesh(QWidget *parent = nullptr); 19 | ~Dialog_TextureMesh(); 20 | 21 | private slots: 22 | void on_btn_OK_clicked(); 23 | 24 | void on_btn_CANCEL_clicked(); 25 | 26 | void on_pushButton_browseInputDir_clicked(); 27 | 28 | void on_pushButton_browseOutputDir_clicked(); 29 | 30 | private: 31 | Ui::Dialog_TextureMesh *ui; 32 | }; 33 | 34 | #endif // DIALOG_TEXTUREMESH_H 35 | -------------------------------------------------------------------------------- /J3DGUI/dialog_texturemesh.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | Dialog_TextureMesh 4 | 5 | 6 | 7 | 0 8 | 0 9 | 494 10 | 226 11 | 12 | 13 | 14 | 纹理映射 15 | 16 | 17 | 18 | 19 | 120 20 | 170 21 | 81 22 | 31 23 | 24 | 25 | 26 | 确定 27 | 28 | 29 | 30 | 31 | 32 | 430 33 | 50 34 | 41 35 | 23 36 | 37 | 38 | 39 | 浏览 40 | 41 | 42 | 43 | 44 | 45 | 10 46 | 90 47 | 121 48 | 21 49 | 50 | 51 | 52 | 纹理模型输出目录: 53 | 54 | 55 | 56 | 57 | 58 | 10 59 | 50 60 | 121 61 | 21 62 | 63 | 64 | 65 | 三角网模型文件路径: 66 | 67 | 68 | 69 | 70 | 71 | 290 72 | 170 73 | 81 74 | 31 75 | 76 | 77 | 78 | 取消 79 | 80 | 81 | 82 | 83 | 84 | 430 85 | 90 86 | 41 87 | 23 88 | 89 | 90 | 91 | 浏览 92 | 93 | 94 | 95 | 96 | 97 | 130 98 | 90 99 | 291 100 | 20 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 10 111 | 20 112 | 171 113 | 16 114 | 115 | 116 | 117 | 纹理参数设置: 118 | 119 | 120 | 121 | 122 | 123 | 130 124 | 50 125 | 291 126 | 20 127 | 128 | 129 | 130 | 131 | 132 | 133 | 10 134 | 130 135 | 121 136 | 21 137 | 138 | 139 | 140 | 纹理模型输出格式: 141 | 142 | 143 | 144 | 145 | 146 | 130 147 | 130 148 | 81 149 | 22 150 | 151 | 152 | 153 | 154 | ply 155 | 156 | 157 | 158 | 159 | obj 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | -------------------------------------------------------------------------------- /J3DGUI/dxflib/dl_attributes.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Copyright (C) 2001-2013 RibbonSoft, GmbH. All rights reserved. 3 | ** 4 | ** This file is part of the dxflib project. 5 | ** 6 | ** This file is free software; you can redistribute it and/or modify 7 | ** it under the terms of the GNU General Public License as published by 8 | ** the Free Software Foundation; either version 2 of the License, or 9 | ** (at your option) any later version. 10 | ** 11 | ** Licensees holding valid dxflib Professional Edition licenses may use 12 | ** this file in accordance with the dxflib Commercial License 13 | ** Agreement provided with the Software. 14 | ** 15 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 16 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 17 | ** 18 | ** See http://www.ribbonsoft.com for further details. 19 | ** 20 | ** Contact info@ribbonsoft.com if any conditions of this licensing are 21 | ** not clear to you. 22 | ** 23 | **********************************************************************/ 24 | 25 | #ifndef DL_ATTRIBUTES_H 26 | #define DL_ATTRIBUTES_H 27 | 28 | #include "dl_global.h" 29 | 30 | #include 31 | #include 32 | 33 | #include "dl_codes.h" 34 | 35 | /** 36 | * Storing and passing around attributes. Attributes 37 | * are the layer name, color, width and line type. 38 | * 39 | * @author Andrew Mustun 40 | */ 41 | class DXFLIB_EXPORT DL_Attributes { 42 | 43 | public: 44 | 45 | /** 46 | * Default constructor. 47 | */ 48 | DL_Attributes() : 49 | layer(""), 50 | color(0), 51 | color24(-1), 52 | width(0), 53 | linetype("BYLAYER"), 54 | linetypeScale(1.0), 55 | handle(-1), 56 | inPaperSpace(false) { 57 | } 58 | 59 | /** 60 | * Constructor for DXF attributes. 61 | * 62 | * @param layer Layer name for this entity or NULL for no layer 63 | * (every entity should be on a named layer!). 64 | * @param color Color number (0..256). 0 = BYBLOCK, 256 = BYLAYER. 65 | * @param width Line thickness. Defaults to zero. -1 = BYLAYER, 66 | * -2 = BYBLOCK, -3 = default width 67 | * @param linetype Line type name or "BYLAYER" or "BYBLOCK". Defaults 68 | * to "BYLAYER" 69 | */ 70 | DL_Attributes(const std::string& layer, 71 | int color, int width, 72 | const std::string& linetype, 73 | double linetypeScale) : 74 | layer(layer), 75 | color(color), 76 | color24(-1), 77 | width(width), 78 | linetype(linetype), 79 | linetypeScale(linetypeScale), 80 | handle(-1), 81 | inPaperSpace(false) { 82 | 83 | } 84 | 85 | /** 86 | * Constructor for DXF attributes. 87 | * 88 | * @param layer Layer name for this entity or NULL for no layer 89 | * (every entity should be on a named layer!). 90 | * @param color Color number (0..256). 0 = BYBLOCK, 256 = BYLAYER. 91 | * @param color24 24 bit color (0x00RRGGBB, see DXF reference). 92 | * @param width Line thickness. Defaults to zero. -1 = BYLAYER, 93 | * -2 = BYBLOCK, -3 = default width 94 | * @param linetype Line type name or "BYLAYER" or "BYBLOCK". Defaults 95 | * to "BYLAYER" 96 | */ 97 | DL_Attributes(const std::string& layer, 98 | int color, int color24, int width, 99 | const std::string& linetype, 100 | int handle=-1) : 101 | layer(layer), 102 | color(color), 103 | color24(color24), 104 | width(width), 105 | linetype(linetype), 106 | linetypeScale(1.0), 107 | handle(handle), 108 | inPaperSpace(false) { 109 | } 110 | 111 | /** 112 | * Sets the layer. If the given pointer points to NULL, the 113 | * new layer name will be an empty but valid string. 114 | */ 115 | void setLayer(const std::string& layer) { 116 | this->layer = layer; 117 | } 118 | 119 | /** 120 | * @return Layer name. 121 | */ 122 | std::string getLayer() const { 123 | return layer; 124 | } 125 | 126 | /** 127 | * Sets the color. 128 | * 129 | * @see DL_Codes, dxfColors 130 | */ 131 | void setColor(int color) { 132 | this->color = color; 133 | } 134 | 135 | /** 136 | * Sets the 24bit color. 137 | * 138 | * @see DL_Codes, dxfColors 139 | */ 140 | void setColor24(int color) { 141 | this->color24 = color; 142 | } 143 | 144 | /** 145 | * @return Color. 146 | * 147 | * @see DL_Codes, dxfColors 148 | */ 149 | int getColor() const { 150 | return color; 151 | } 152 | 153 | /** 154 | * @return 24 bit color or -1 if no 24bit color is defined. 155 | * 156 | * @see DL_Codes, dxfColors 157 | */ 158 | int getColor24() const { 159 | return color24; 160 | } 161 | 162 | /** 163 | * Sets the width. 164 | */ 165 | void setWidth(int width) { 166 | this->width = width; 167 | } 168 | 169 | /** 170 | * @return Width. 171 | */ 172 | int getWidth() const { 173 | return width; 174 | } 175 | 176 | /** 177 | * Sets the line type. This can be any string and is not 178 | * checked to be a valid line type. 179 | */ 180 | void setLinetype(const std::string& linetype) { 181 | this->linetype = linetype; 182 | } 183 | 184 | /** 185 | * Sets the entity specific line type scale. 186 | */ 187 | void setLinetypeScale(double linetypeScale) { 188 | this->linetypeScale = linetypeScale; 189 | } 190 | 191 | double getLinetypeScale() const { 192 | return linetypeScale; 193 | } 194 | 195 | /** 196 | * @return Line type. 197 | */ 198 | std::string getLinetype() const { 199 | if (linetype.length()==0) { 200 | return "BYLAYER"; 201 | } else { 202 | return linetype; 203 | } 204 | } 205 | 206 | void setHandle(int h) { 207 | handle = h; 208 | } 209 | 210 | int getHandle() const { 211 | return handle; 212 | } 213 | 214 | void setInPaperSpace(bool on) { 215 | inPaperSpace = on; 216 | } 217 | 218 | bool isInPaperSpace() const { 219 | return inPaperSpace; 220 | } 221 | 222 | private: 223 | std::string layer; 224 | int color; 225 | int color24; 226 | int width; 227 | std::string linetype; 228 | double linetypeScale; 229 | int handle; 230 | 231 | // DXF code 67 (true: entity in paper space, false: entity in model space (default): 232 | bool inPaperSpace; 233 | }; 234 | 235 | #endif 236 | 237 | // EOF 238 | -------------------------------------------------------------------------------- /J3DGUI/dxflib/dl_creationadapter.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Copyright (C) 2001-2013 RibbonSoft, GmbH. All rights reserved. 3 | ** 4 | ** This file is part of the dxflib project. 5 | ** 6 | ** This file is free software; you can redistribute it and/or modify 7 | ** it under the terms of the GNU General Public License as published by 8 | ** the Free Software Foundation; either version 2 of the License, or 9 | ** (at your option) any later version. 10 | ** 11 | ** Licensees holding valid dxflib Professional Edition licenses may use 12 | ** this file in accordance with the dxflib Commercial License 13 | ** Agreement provided with the Software. 14 | ** 15 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 16 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 17 | ** 18 | ** See http://www.ribbonsoft.com for further details. 19 | ** 20 | ** Contact info@ribbonsoft.com if any conditions of this licensing are 21 | ** not clear to you. 22 | ** 23 | **********************************************************************/ 24 | 25 | #ifndef DL_CREATIONADAPTER_H 26 | #define DL_CREATIONADAPTER_H 27 | 28 | #include "dl_global.h" 29 | 30 | #include "dl_creationinterface.h" 31 | 32 | /** 33 | * An abstract adapter class for receiving DXF events when a DXF file is being read. 34 | * The methods in this class are empty. This class exists as convenience for creating 35 | * listener objects. 36 | * 37 | * @author Andrew Mustun 38 | */ 39 | class DXFLIB_EXPORT DL_CreationAdapter : public DL_CreationInterface { 40 | public: 41 | DL_CreationAdapter() {} 42 | virtual ~DL_CreationAdapter() {} 43 | virtual void processCodeValuePair(unsigned int, const std::string&) {} 44 | virtual void endSection() {} 45 | virtual void addLayer(const DL_LayerData&) {} 46 | virtual void addLinetype(const DL_LinetypeData&) {} 47 | virtual void addLinetypeDash(double) {} 48 | virtual void addBlock(const DL_BlockData&) {} 49 | virtual void endBlock() {} 50 | virtual void addTextStyle(const DL_StyleData&) {} 51 | virtual void addPoint(const DL_PointData&) {} 52 | virtual void addLine(const DL_LineData&) {} 53 | virtual void addXLine(const DL_XLineData&) {} 54 | virtual void addRay(const DL_RayData&) {} 55 | 56 | virtual void addArc(const DL_ArcData&) {} 57 | virtual void addCircle(const DL_CircleData&) {} 58 | virtual void addEllipse(const DL_EllipseData&) {} 59 | 60 | virtual void addPolyline(const DL_PolylineData&) {} 61 | virtual void addVertex(const DL_VertexData&) {} 62 | 63 | virtual void addSpline(const DL_SplineData&) {} 64 | virtual void addControlPoint(const DL_ControlPointData&) {} 65 | virtual void addFitPoint(const DL_FitPointData&) {} 66 | virtual void addKnot(const DL_KnotData&) {} 67 | 68 | virtual void addInsert(const DL_InsertData&) {} 69 | 70 | virtual void addMText(const DL_MTextData&) {} 71 | virtual void addMTextChunk(const std::string&) {} 72 | virtual void addText(const DL_TextData&) {} 73 | virtual void addArcAlignedText(const DL_ArcAlignedTextData&) {} 74 | virtual void addAttribute(const DL_AttributeData&) {} 75 | 76 | virtual void addDimAlign(const DL_DimensionData&, 77 | const DL_DimAlignedData&) {} 78 | virtual void addDimLinear(const DL_DimensionData&, 79 | const DL_DimLinearData&) {} 80 | virtual void addDimRadial(const DL_DimensionData&, 81 | const DL_DimRadialData&) {} 82 | virtual void addDimDiametric(const DL_DimensionData&, 83 | const DL_DimDiametricData&) {} 84 | virtual void addDimAngular(const DL_DimensionData&, 85 | const DL_DimAngularData&) {} 86 | virtual void addDimAngular3P(const DL_DimensionData&, 87 | const DL_DimAngular3PData&) {} 88 | virtual void addDimOrdinate(const DL_DimensionData&, 89 | const DL_DimOrdinateData&) {} 90 | virtual void addLeader(const DL_LeaderData&) {} 91 | virtual void addLeaderVertex(const DL_LeaderVertexData&) {} 92 | 93 | virtual void addHatch(const DL_HatchData&) {} 94 | 95 | virtual void addTrace(const DL_TraceData&) {} 96 | virtual void add3dFace(const DL_3dFaceData&) {} 97 | virtual void addSolid(const DL_SolidData&) {} 98 | 99 | virtual void addImage(const DL_ImageData&) {} 100 | virtual void linkImage(const DL_ImageDefData&) {} 101 | virtual void addHatchLoop(const DL_HatchLoopData&) {} 102 | virtual void addHatchEdge(const DL_HatchEdgeData&) {} 103 | 104 | virtual void addXRecord(const std::string&) {} 105 | virtual void addXRecordString(int, const std::string&) {} 106 | virtual void addXRecordReal(int, double) {} 107 | virtual void addXRecordInt(int, int) {} 108 | virtual void addXRecordBool(int, bool) {} 109 | 110 | virtual void addXDataApp(const std::string&) {} 111 | virtual void addXDataString(int, const std::string&) {} 112 | virtual void addXDataReal(int, double) {} 113 | virtual void addXDataInt(int, int) {} 114 | 115 | virtual void addDictionary(const DL_DictionaryData&) {} 116 | virtual void addDictionaryEntry(const DL_DictionaryEntryData&) {} 117 | 118 | virtual void endEntity() {} 119 | 120 | virtual void addComment(const std::string&) {} 121 | 122 | virtual void setVariableVector(const std::string&, double, double, double, int) {} 123 | virtual void setVariableString(const std::string&, const std::string&, int) {} 124 | virtual void setVariableInt(const std::string&, int, int) {} 125 | virtual void setVariableDouble(const std::string&, double, int) {} 126 | #ifdef DL_COMPAT 127 | virtual void setVariableVector(const char*, double, double, double, int) {} 128 | virtual void setVariableString(const char*, const char*, int) {} 129 | virtual void setVariableInt(const char*, int, int) {} 130 | virtual void setVariableDouble(const char*, double, int) {} 131 | virtual void processCodeValuePair(unsigned int, char*) {} 132 | virtual void addComment(const char*) {} 133 | virtual void addMTextChunk(const char*) {} 134 | #endif 135 | virtual void endSequence() {} 136 | }; 137 | 138 | #endif 139 | -------------------------------------------------------------------------------- /J3DGUI/dxflib/dl_exception.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Copyright (C) 2001-2013 RibbonSoft, GmbH. All rights reserved. 3 | ** Copyright (C) 2001 Robert J. Campbell Jr. 4 | ** 5 | ** This file is part of the dxflib project. 6 | ** 7 | ** This file is free software; you can redistribute it and/or modify 8 | ** it under the terms of the GNU General Public License as published by 9 | ** the Free Software Foundation; either version 2 of the License, or 10 | ** (at your option) any later version. 11 | ** 12 | ** Licensees holding valid dxflib Professional Edition licenses may use 13 | ** this file in accordance with the dxflib Commercial License 14 | ** Agreement provided with the Software. 15 | ** 16 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 17 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 18 | ** 19 | ** See http://www.ribbonsoft.com for further details. 20 | ** 21 | ** Contact info@ribbonsoft.com if any conditions of this licensing are 22 | ** not clear to you. 23 | ** 24 | **********************************************************************/ 25 | 26 | #ifndef DL_EXCEPTION_H 27 | #define DL_EXCEPTION_H 28 | 29 | #include "dl_global.h" 30 | 31 | #if _MSC_VER > 1000 32 | #pragma once 33 | #endif // _MSC_VER > 1000 34 | 35 | /** 36 | * Used for exception handling. 37 | */ 38 | class DXFLIB_EXPORT DL_Exception {} 39 | ; 40 | 41 | /** 42 | * Used for exception handling. 43 | */ 44 | class DXFLIB_EXPORT DL_NullStrExc : public DL_Exception {} 45 | ; 46 | 47 | /** 48 | * Used for exception handling. 49 | */ 50 | class DXFLIB_EXPORT DL_GroupCodeExc : public DL_Exception { 51 | DL_GroupCodeExc(int gc=0) : groupCode(gc) {} 52 | int groupCode; 53 | }; 54 | #endif 55 | 56 | -------------------------------------------------------------------------------- /J3DGUI/dxflib/dl_extrusion.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Copyright (C) 2001-2013 RibbonSoft, GmbH. All rights reserved. 3 | ** 4 | ** This file is part of the dxflib project. 5 | ** 6 | ** This file is free software; you can redistribute it and/or modify 7 | ** it under the terms of the GNU General Public License as published by 8 | ** the Free Software Foundation; either version 2 of the License, or 9 | ** (at your option) any later version. 10 | ** 11 | ** Licensees holding valid dxflib Professional Edition licenses may use 12 | ** this file in accordance with the dxflib Commercial License 13 | ** Agreement provided with the Software. 14 | ** 15 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 16 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 17 | ** 18 | ** See http://www.ribbonsoft.com for further details. 19 | ** 20 | ** Contact info@ribbonsoft.com if any conditions of this licensing are 21 | ** not clear to you. 22 | ** 23 | **********************************************************************/ 24 | 25 | #ifndef DL_EXTRUSION_H 26 | #define DL_EXTRUSION_H 27 | 28 | #include "dl_global.h" 29 | 30 | #include 31 | 32 | 33 | /** 34 | * Extrusion direction. 35 | * 36 | * @author Andrew Mustun 37 | */ 38 | class DXFLIB_EXPORT DL_Extrusion { 39 | 40 | public: 41 | 42 | /** 43 | * Default constructor. 44 | */ 45 | DL_Extrusion() { 46 | direction = new double[3]; 47 | setDirection(0.0, 0.0, 1.0); 48 | setElevation(0.0); 49 | } 50 | 51 | 52 | /** 53 | * Destructor. 54 | */ 55 | ~DL_Extrusion() { 56 | delete[] direction ; 57 | } 58 | 59 | 60 | /** 61 | * Constructor for DXF extrusion. 62 | * 63 | * @param direction Vector of axis along which the entity shall be extruded 64 | * this is also the Z axis of the Entity coordinate system 65 | * @param elevation Distance of the entities XY plane from the origin of the 66 | * world coordinate system 67 | */ 68 | DL_Extrusion(double dx, double dy, double dz, double elevation) { 69 | direction = new double[3]; 70 | setDirection(dx, dy, dz); 71 | setElevation(elevation); 72 | } 73 | 74 | 75 | 76 | /** 77 | * Sets the direction vector. 78 | */ 79 | void setDirection(double dx, double dy, double dz) { 80 | direction[0]=dx; 81 | direction[1]=dy; 82 | direction[2]=dz; 83 | } 84 | 85 | 86 | 87 | /** 88 | * @return direction vector. 89 | */ 90 | double* getDirection() const { 91 | return direction; 92 | } 93 | 94 | 95 | 96 | /** 97 | * @return direction vector. 98 | */ 99 | void getDirection(double dir[]) const { 100 | dir[0]=direction[0]; 101 | dir[1]=direction[1]; 102 | dir[2]=direction[2]; 103 | } 104 | 105 | 106 | 107 | /** 108 | * Sets the elevation. 109 | */ 110 | void setElevation(double elevation) { 111 | this->elevation = elevation; 112 | } 113 | 114 | 115 | 116 | /** 117 | * @return Elevation. 118 | */ 119 | double getElevation() const { 120 | return elevation; 121 | } 122 | 123 | 124 | 125 | /** 126 | * Copies extrusion (deep copies) from another extrusion object. 127 | */ 128 | DL_Extrusion operator = (const DL_Extrusion& extru) { 129 | setDirection(extru.direction[0], extru.direction[1], extru.direction[2]); 130 | setElevation(extru.elevation); 131 | 132 | return *this; 133 | } 134 | 135 | 136 | 137 | private: 138 | double *direction; 139 | double elevation; 140 | }; 141 | 142 | #endif 143 | 144 | -------------------------------------------------------------------------------- /J3DGUI/dxflib/dl_global.h: -------------------------------------------------------------------------------- 1 | #if defined(DXFLIB_DLL) 2 | # ifdef _WIN32 3 | # if defined(DXFLIB_LIBRARY) 4 | # define DXFLIB_EXPORT __declspec(dllexport) 5 | # else 6 | # define DXFLIB_EXPORT __declspec(dllimport) 7 | # endif 8 | # else 9 | # define DXFLIB_EXPORT 10 | # endif 11 | #else 12 | # define DXFLIB_EXPORT 13 | #endif 14 | -------------------------------------------------------------------------------- /J3DGUI/dxflib/dl_writer_ascii.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Copyright (C) 2001-2013 RibbonSoft, GmbH. All rights reserved. 3 | ** Copyright (C) 2001 Robert J. Campbell Jr. 4 | ** 5 | ** This file is part of the dxflib project. 6 | ** 7 | ** This file is free software; you can redistribute it and/or modify 8 | ** it under the terms of the GNU General Public License as published by 9 | ** the Free Software Foundation; either version 2 of the License, or 10 | ** (at your option) any later version. 11 | ** 12 | ** Licensees holding valid dxflib Professional Edition licenses may use 13 | ** this file in accordance with the dxflib Commercial License 14 | ** Agreement provided with the Software. 15 | ** 16 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 17 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 18 | ** 19 | ** See http://www.ribbonsoft.com for further details. 20 | ** 21 | ** Contact info@ribbonsoft.com if any conditions of this licensing are 22 | ** not clear to you. 23 | ** 24 | **********************************************************************/ 25 | 26 | #if _MSC_VER > 1000 27 | #pragma once 28 | #endif // _MSC_VER > 1000 29 | 30 | #include 31 | #include 32 | 33 | #include "dl_writer_ascii.h" 34 | #include "dl_exception.h" 35 | 36 | 37 | /** 38 | * Closes the output file. 39 | */ 40 | void DL_WriterA::close() const { 41 | m_ofile.close(); 42 | } 43 | 44 | 45 | /** 46 | * @retval true Opening file has failed. 47 | * @retval false Otherwise. 48 | */ 49 | bool DL_WriterA::openFailed() const { 50 | return m_ofile.fail(); 51 | } 52 | 53 | 54 | 55 | /** 56 | * Writes a real (double) variable to the DXF file. 57 | * 58 | * @param gc Group code. 59 | * @param value Double value 60 | */ 61 | void DL_WriterA::dxfReal(int gc, double value) const { 62 | char str[256]; 63 | if (version==DL_Codes::AC1009_MIN) { 64 | sprintf(str, "%.6lf", value); 65 | } 66 | else { 67 | sprintf(str, "%.16lf", value); 68 | } 69 | 70 | // fix for german locale: 71 | strReplace(str, ',', '.'); 72 | 73 | // Cut away those zeros at the end: 74 | bool dot = false; 75 | int end = -1; 76 | for (unsigned int i=0; i0 && end<(int)strlen(str)) { 86 | str[end] = '\0'; 87 | } 88 | 89 | dxfString(gc, str); 90 | m_ofile.flush(); 91 | } 92 | 93 | 94 | 95 | /** 96 | * Writes an int variable to the DXF file. 97 | * 98 | * @param gc Group code. 99 | * @param value Int value 100 | */ 101 | void DL_WriterA::dxfInt(int gc, int value) const { 102 | m_ofile << (gc<10 ? " " : (gc<100 ? " " : "")) << gc << "\n" << value << "\n"; 103 | } 104 | 105 | 106 | 107 | /** 108 | * Writes a hex int variable to the DXF file. 109 | * 110 | * @param gc Group code. 111 | * @param value Int value 112 | */ 113 | void DL_WriterA::dxfHex(int gc, int value) const { 114 | char str[12]; 115 | sprintf(str, "%0X", value); 116 | dxfString(gc, str); 117 | } 118 | 119 | 120 | 121 | /** 122 | * Writes a string variable to the DXF file. 123 | * 124 | * @param gc Group code. 125 | * @param value String 126 | */ 127 | void DL_WriterA::dxfString(int gc, const char* value) const { 128 | if (value==NULL) { 129 | #ifndef __GCC2x__ 130 | //throw DL_NullStrExc(); 131 | #endif 132 | } 133 | m_ofile << (gc<10 ? " " : (gc<100 ? " " : "")) << gc << "\n" 134 | << value << "\n"; 135 | } 136 | 137 | 138 | 139 | void DL_WriterA::dxfString(int gc, const std::string& value) const { 140 | m_ofile << (gc<10 ? " " : (gc<100 ? " " : "")) << gc << "\n" 141 | << value << "\n"; 142 | } 143 | 144 | 145 | /** 146 | * Replaces every occurence of src with dest in the null terminated str. 147 | */ 148 | void DL_WriterA::strReplace(char* str, char src, char dest) { 149 | size_t i; 150 | for (i=0; i 1000 32 | #pragma once 33 | #endif // _MSC_VER > 1000 34 | 35 | #include "dl_writer.h" 36 | #include 37 | #include 38 | 39 | /** 40 | * Implements functions defined in DL_Writer for writing low 41 | * level DXF constructs to an ASCII format DXF file. 42 | * 43 | * @para fname File name of the file to be created. 44 | * @para version DXF version. Defaults to DL_VERSION_2002. 45 | * 46 | * @todo What if \c fname is NULL? Or \c fname can't be opened for 47 | * another reason? 48 | */ 49 | class DXFLIB_EXPORT DL_WriterA : public DL_Writer { 50 | public: 51 | DL_WriterA(const char* fname, DL_Codes::version version=DL_VERSION_2000) 52 | : DL_Writer(version), m_ofile(fname) {} 53 | virtual ~DL_WriterA() {} 54 | 55 | bool openFailed() const; 56 | void close() const; 57 | void dxfReal(int gc, double value) const; 58 | void dxfInt(int gc, int value) const; 59 | void dxfHex(int gc, int value) const; 60 | void dxfString(int gc, const char* value) const; 61 | void dxfString(int gc, const std::string& value) const; 62 | 63 | static void strReplace(char* str, char src, char dest); 64 | 65 | private: 66 | /** 67 | * DXF file to be created. 68 | */ 69 | mutable std::ofstream m_ofile; 70 | 71 | }; 72 | 73 | #endif 74 | 75 | -------------------------------------------------------------------------------- /J3DGUI/main.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "QT3DReconstruction.h" 3 | #include 4 | #include 5 | #include "ImageView.h" 6 | int main(int argc, char *argv[]) 7 | { 8 | QApplication a(argc, argv); 9 | QT3DReconstruction w; 10 | 11 | w.show(); 12 | 13 | return a.exec(); 14 | } 15 | -------------------------------------------------------------------------------- /J3DGUI/mvsviewer.cpp: -------------------------------------------------------------------------------- 1 | #include "mvsviewer.h" 2 | #include 3 | #include "Windows.h" 4 | #include "qwindow.h" 5 | mvsviewer::mvsviewer(QWidget *parent) 6 | : QWidget(parent) 7 | { 8 | } 9 | 10 | mvsviewer::mvsviewer(int i, QWidget *parent) 11 | : QWidget(parent) 12 | { 13 | i++; 14 | WId wid = (WId)FindWindowA("GLFW30", "J3D Viewer"); 15 | QWindow*m_window; 16 | m_window = QWindow::fromWinId(wid); 17 | m_window->setFlags(m_window->flags() | Qt::CustomizeWindowHint | Qt::WindowTitleHint); 18 | QWidget *m_widget; 19 | m_widget = QWidget::createWindowContainer(m_window, this); 20 | m_widget->setMinimumSize(1361, 661); 21 | } 22 | mvsviewer::~mvsviewer() { 23 | 24 | } 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /J3DGUI/mvsviewer.h: -------------------------------------------------------------------------------- 1 | #ifndef MVSVIEWER_H 2 | #define MVSVIEWER_H 3 | #include 4 | 5 | 6 | class mvsviewer :public QWidget 7 | { 8 | Q_OBJECT 9 | public: 10 | mvsviewer(QWidget *parent = nullptr); 11 | mvsviewer(int i, QWidget *parent = nullptr); 12 | ~mvsviewer(); 13 | private: 14 | 15 | 16 | }; 17 | 18 | #endif // MVSVIEWER_H 19 | -------------------------------------------------------------------------------- /J3DGUI/resource.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoulBasic/J3DReconstruction/dd519e8652aa9399b1a0965dfc60e395ab99c533/J3DGUI/resource.h -------------------------------------------------------------------------------- /J3DReconstruction.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.28307.1145 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "J3DEngine", "J3DEngine\J3DEngine.vcxproj", "{876553CC-6603-4752-B10D-EDEE46B76701}" 7 | ProjectSection(ProjectDependencies) = postProject 8 | {B2482291-0BAD-4B20-857A-D3E886D30880} = {B2482291-0BAD-4B20-857A-D3E886D30880} 9 | EndProjectSection 10 | EndProject 11 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Software", "Software", "{0855FEDF-51BA-4BEE-8BE8-CBA92BE481F9}" 12 | EndProject 13 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "J3DGUI", "J3DGUI\QT3DReconstruction.vcxproj", "{34E1DCE3-43FC-45FE-89AB-BE84E115FCEC}" 14 | ProjectSection(ProjectDependencies) = postProject 15 | {47DDE12E-E262-4317-9F05-679422DE938D} = {47DDE12E-E262-4317-9F05-679422DE938D} 16 | EndProjectSection 17 | EndProject 18 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "J3DViewer", "Viewer\Viewer.vcxproj", "{84686931-3F00-3FD3-BD52-233F97739FF2}" 19 | ProjectSection(ProjectDependencies) = postProject 20 | {47DDE12E-E262-4317-9F05-679422DE938D} = {47DDE12E-E262-4317-9F05-679422DE938D} 21 | EndProjectSection 22 | EndProject 23 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "J3DMVSEngine", "MVSEngine\MVSEngine.vcxproj", "{B2482291-0BAD-4B20-857A-D3E886D30880}" 24 | EndProject 25 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "J3DViewRender", "J3DViewRender\J3DViewRender.vcxproj", "{47DDE12E-E262-4317-9F05-679422DE938D}" 26 | EndProject 27 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Lib", "Lib", "{39B15343-9876-4C11-9B58-CF7BE139056F}" 28 | EndProject 29 | Global 30 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 31 | Debug|x64 = Debug|x64 32 | Debug|x86 = Debug|x86 33 | Release|x64 = Release|x64 34 | Release|x86 = Release|x86 35 | EndGlobalSection 36 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 37 | {876553CC-6603-4752-B10D-EDEE46B76701}.Debug|x64.ActiveCfg = Debug|x64 38 | {876553CC-6603-4752-B10D-EDEE46B76701}.Debug|x64.Build.0 = Debug|x64 39 | {876553CC-6603-4752-B10D-EDEE46B76701}.Debug|x86.ActiveCfg = Debug|Win32 40 | {876553CC-6603-4752-B10D-EDEE46B76701}.Debug|x86.Build.0 = Debug|Win32 41 | {876553CC-6603-4752-B10D-EDEE46B76701}.Release|x64.ActiveCfg = Release|x64 42 | {876553CC-6603-4752-B10D-EDEE46B76701}.Release|x64.Build.0 = Release|x64 43 | {876553CC-6603-4752-B10D-EDEE46B76701}.Release|x86.ActiveCfg = Release|Win32 44 | {876553CC-6603-4752-B10D-EDEE46B76701}.Release|x86.Build.0 = Release|Win32 45 | {34E1DCE3-43FC-45FE-89AB-BE84E115FCEC}.Debug|x64.ActiveCfg = Debug|x64 46 | {34E1DCE3-43FC-45FE-89AB-BE84E115FCEC}.Debug|x64.Build.0 = Debug|x64 47 | {34E1DCE3-43FC-45FE-89AB-BE84E115FCEC}.Debug|x86.ActiveCfg = Debug|Win32 48 | {34E1DCE3-43FC-45FE-89AB-BE84E115FCEC}.Debug|x86.Build.0 = Debug|Win32 49 | {34E1DCE3-43FC-45FE-89AB-BE84E115FCEC}.Release|x64.ActiveCfg = Release|x64 50 | {34E1DCE3-43FC-45FE-89AB-BE84E115FCEC}.Release|x64.Build.0 = Release|x64 51 | {34E1DCE3-43FC-45FE-89AB-BE84E115FCEC}.Release|x86.ActiveCfg = Release|Win32 52 | {34E1DCE3-43FC-45FE-89AB-BE84E115FCEC}.Release|x86.Build.0 = Release|Win32 53 | {84686931-3F00-3FD3-BD52-233F97739FF2}.Debug|x64.ActiveCfg = Debug|x64 54 | {84686931-3F00-3FD3-BD52-233F97739FF2}.Debug|x64.Build.0 = Debug|x64 55 | {84686931-3F00-3FD3-BD52-233F97739FF2}.Debug|x86.ActiveCfg = Debug|x64 56 | {84686931-3F00-3FD3-BD52-233F97739FF2}.Release|x64.ActiveCfg = Release|x64 57 | {84686931-3F00-3FD3-BD52-233F97739FF2}.Release|x64.Build.0 = Release|x64 58 | {84686931-3F00-3FD3-BD52-233F97739FF2}.Release|x86.ActiveCfg = Release|x64 59 | {B2482291-0BAD-4B20-857A-D3E886D30880}.Debug|x64.ActiveCfg = Debug|x64 60 | {B2482291-0BAD-4B20-857A-D3E886D30880}.Debug|x64.Build.0 = Debug|x64 61 | {B2482291-0BAD-4B20-857A-D3E886D30880}.Debug|x86.ActiveCfg = Debug|Win32 62 | {B2482291-0BAD-4B20-857A-D3E886D30880}.Debug|x86.Build.0 = Debug|Win32 63 | {B2482291-0BAD-4B20-857A-D3E886D30880}.Release|x64.ActiveCfg = Release|x64 64 | {B2482291-0BAD-4B20-857A-D3E886D30880}.Release|x64.Build.0 = Release|x64 65 | {B2482291-0BAD-4B20-857A-D3E886D30880}.Release|x86.ActiveCfg = Release|Win32 66 | {B2482291-0BAD-4B20-857A-D3E886D30880}.Release|x86.Build.0 = Release|Win32 67 | {47DDE12E-E262-4317-9F05-679422DE938D}.Debug|x64.ActiveCfg = Debug|x64 68 | {47DDE12E-E262-4317-9F05-679422DE938D}.Debug|x64.Build.0 = Debug|x64 69 | {47DDE12E-E262-4317-9F05-679422DE938D}.Debug|x86.ActiveCfg = Debug|Win32 70 | {47DDE12E-E262-4317-9F05-679422DE938D}.Debug|x86.Build.0 = Debug|Win32 71 | {47DDE12E-E262-4317-9F05-679422DE938D}.Release|x64.ActiveCfg = Release|x64 72 | {47DDE12E-E262-4317-9F05-679422DE938D}.Release|x64.Build.0 = Release|x64 73 | {47DDE12E-E262-4317-9F05-679422DE938D}.Release|x86.ActiveCfg = Release|Win32 74 | {47DDE12E-E262-4317-9F05-679422DE938D}.Release|x86.Build.0 = Release|Win32 75 | EndGlobalSection 76 | GlobalSection(SolutionProperties) = preSolution 77 | HideSolutionNode = FALSE 78 | EndGlobalSection 79 | GlobalSection(NestedProjects) = preSolution 80 | {876553CC-6603-4752-B10D-EDEE46B76701} = {0855FEDF-51BA-4BEE-8BE8-CBA92BE481F9} 81 | {34E1DCE3-43FC-45FE-89AB-BE84E115FCEC} = {0855FEDF-51BA-4BEE-8BE8-CBA92BE481F9} 82 | {84686931-3F00-3FD3-BD52-233F97739FF2} = {0855FEDF-51BA-4BEE-8BE8-CBA92BE481F9} 83 | {B2482291-0BAD-4B20-857A-D3E886D30880} = {39B15343-9876-4C11-9B58-CF7BE139056F} 84 | {47DDE12E-E262-4317-9F05-679422DE938D} = {39B15343-9876-4C11-9B58-CF7BE139056F} 85 | EndGlobalSection 86 | GlobalSection(ExtensibilityGlobals) = postSolution 87 | SolutionGuid = {AB89B0A3-73DD-4371-B6B4-EE9C3D69856F} 88 | EndGlobalSection 89 | EndGlobal 90 | -------------------------------------------------------------------------------- /J3DViewRender/Camera.cpp: -------------------------------------------------------------------------------- 1 | #include "include/Common.h" 2 | #include "include/Camera.h" 3 | 4 | using namespace VIEWER; 5 | 6 | Camera::Camera(const AABB3d& _box, double _fov) 7 | : 8 | box(_box), 9 | width(0), height(0), 10 | rotation(Eigen::Quaterniond::Identity()), 11 | center(Eigen::Vector3d::Zero()), 12 | dist(0), radius(100), fov(_fov), 13 | scaleF(1.f), 14 | prevCamID(NO_ID), currentCamID(NO_ID), maxCamID(0) 15 | { 16 | Reset(); 17 | } 18 | 19 | void Camera::CopyOf(const Camera& rhs) 20 | { 21 | rotation = rhs.rotation; 22 | center = rhs.center; 23 | dist = rhs.dist; 24 | radius = rhs.radius; 25 | fov = rhs.fov; 26 | } 27 | 28 | 29 | void Camera::Init(const AABB3d& _box) 30 | { 31 | box = _box; 32 | Reset(); 33 | } 34 | 35 | void Camera::Reset() 36 | { 37 | center = box.GetCenter(); 38 | radius = box.GetSize().norm()*0.5; 39 | rotation = Eigen::Quaterniond::Identity(); 40 | scaleF = 1.f; 41 | prevCamID = currentCamID = NO_ID; 42 | fov = 40; 43 | dist = radius * 0.5 / SIN(D2R(fov)); 44 | Resize(width, height); 45 | } 46 | 47 | void Camera::Resize(int _width, int _height) 48 | { 49 | glMatrixMode(GL_PROJECTION); 50 | glLoadIdentity(); 51 | const GLfloat zNear = 1e-2f; 52 | const GLfloat zFar = 1e5f; 53 | width = _width; height = _height; 54 | GLfloat aspect = float(width) / float(height); 55 | GLfloat fH = TAN(FD2R((float)fov)) * zNear; 56 | GLfloat fW = fH * aspect; 57 | glFrustum(-fW, fW, -fH, fH, zNear, zFar); 58 | } 59 | 60 | void Camera::SetFOV(double _fov) 61 | { 62 | fov = _fov; 63 | Resize(width, height); 64 | } 65 | 66 | 67 | Eigen::Vector3d Camera::GetPosition() const 68 | { 69 | const Eigen::Matrix3d R(rotation.toRotationMatrix()); 70 | const Eigen::Vector3d eye(0, 0, dist); 71 | return R * eye + center; 72 | } 73 | 74 | Eigen::Matrix4d Camera::GetLookAt() const 75 | { 76 | const Eigen::Matrix3d R(rotation.toRotationMatrix()); 77 | const Eigen::Vector3d eye(R.col(2) * dist + center); 78 | const Eigen::Vector3d up(R.col(1)); 79 | 80 | const Eigen::Vector3d n((center - eye).normalized()); 81 | const Eigen::Vector3d s(n.cross(up)); 82 | const Eigen::Vector3d v(s.cross(n)); 83 | 84 | Eigen::Matrix4d m; 85 | m << 86 | s(0), s(1), s(2), -eye.dot(s), 87 | v(0), v(1), v(2), -eye.dot(v), 88 | -n(0), -n(1), -n(2), eye.dot(n), 89 | 0.0, 0.0, 0.0, 1.0; 90 | return m; 91 | } 92 | void Camera::GetLookAt(Eigen::Vector3d& _eye, Eigen::Vector3d& _center, Eigen::Vector3d& _up) const 93 | { 94 | const Eigen::Matrix3d R(rotation.toRotationMatrix()); 95 | const Eigen::Vector3d eye(0, 0, dist); 96 | const Eigen::Vector3d up(0, 1, 0); 97 | 98 | _eye = R * eye + center; 99 | _center = center; 100 | _up = R * up; 101 | } 102 | 103 | void Camera::Rotate(const Eigen::Vector2d& pos, const Eigen::Vector2d& prevPos) 104 | { 105 | if (pos.isApprox(prevPos, ZERO_TOLERANCE)) 106 | return; 107 | 108 | Eigen::Vector3d oldp(prevPos.x(), prevPos.y(), 0); 109 | Eigen::Vector3d newp(pos.x(), pos.y(), 0); 110 | const double radius_virtual_sphere(0.9); 111 | Project2Sphere(radius_virtual_sphere, oldp); 112 | Project2Sphere(radius_virtual_sphere, newp); 113 | Eigen::Quaterniond dr; 114 | dr.setFromTwoVectors(newp, oldp); 115 | rotation *= dr; 116 | 117 | // disable camera view mode 118 | prevCamID = currentCamID; 119 | } 120 | 121 | void Camera::Project2Sphere(double radius, Eigen::Vector3d& p) const 122 | { 123 | p.z() = 0; 124 | const double d = p.x()* p.x() + p.y() * p.y(); 125 | const double r = radius * radius; 126 | if (d < r) p.z() = SQRT(r - d); 127 | else p *= radius / p.norm(); 128 | } 129 | /*----------------------------------------------------------------*/ 130 | -------------------------------------------------------------------------------- /J3DViewRender/Common.cpp: -------------------------------------------------------------------------------- 1 | #include "include/Common.h" 2 | -------------------------------------------------------------------------------- /J3DViewRender/Image.cpp: -------------------------------------------------------------------------------- 1 | 2 | 3 | #include "include/Common.h" 4 | #include "include/Image.h" 5 | 6 | using namespace VIEWER; 7 | 8 | Image::Image(MVS::IIndex _idx) 9 | : 10 | idx(_idx), 11 | texture(0) 12 | { 13 | } 14 | Image::~Image() 15 | { 16 | Release(); 17 | } 18 | 19 | void Image::Release() 20 | { 21 | if (IsValid()) { 22 | glDeleteTextures(1, &texture); 23 | texture = 0; 24 | } 25 | ReleaseImage(); 26 | } 27 | void Image::ReleaseImage() 28 | { 29 | if (IsImageValid()) { 30 | cv::Mat* const p(pImage); 31 | Thread::safeExchange(pImage.ptr, (int_t)IMG_NULL); 32 | delete p; 33 | } 34 | } 35 | 36 | void Image::SetImageLoading() 37 | { 38 | ASSERT(IsImageEmpty()); 39 | Thread::safeExchange(pImage.ptr, (int_t)IMG_LOADING); 40 | } 41 | void Image::AssignImage(cv::InputArray img) 42 | { 43 | ASSERT(IsImageLoading()); 44 | ImagePtrInt pImg(new cv::Mat(img.getMat())); 45 | if (pImg.pImage->cols % 4 != 0) { 46 | // make sure the width is multiple of 4 (seems to be an OpenGL limitation) 47 | cv::resize(*pImg.pImage, *pImg.pImage, cv::Size((pImg.pImage->cols / 4) * 4, pImg.pImage->rows), 0, 0, cv::INTER_AREA); 48 | } 49 | Thread::safeExchange(pImage.ptr, pImg.ptr); 50 | } 51 | bool Image::TransferImage() 52 | { 53 | if (!IsImageValid()) 54 | return false; 55 | SetImage(*pImage); 56 | glfwPostEmptyEvent(); 57 | ReleaseImage(); 58 | return true; 59 | } 60 | 61 | void Image::SetImage(cv::InputArray img) 62 | { 63 | cv::Mat image(img.getMat()); 64 | glEnable(GL_TEXTURE_2D); 65 | // create texture 66 | glGenTextures(1, &texture); 67 | // select our current texture 68 | glBindTexture(GL_TEXTURE_2D, texture); 69 | // load texture 70 | width = image.cols; 71 | height = image.rows; 72 | ASSERT(image.channels() == 1 || image.channels() == 3); 73 | ASSERT(image.isContinuous()); 74 | glTexImage2D(GL_TEXTURE_2D, 75 | 0, image.channels(), 76 | width, height, 77 | 0, (image.channels() == 1) ? GL_LUMINANCE : GL_BGR, 78 | GL_UNSIGNED_BYTE, image.ptr()); 79 | glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); 80 | glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); 81 | } 82 | void Image::GenerateMipmap() const { 83 | glBindTexture(GL_TEXTURE_2D, texture); 84 | glGenerateMipmap(GL_TEXTURE_2D); 85 | } 86 | void Image::Bind() const { 87 | glBindTexture(GL_TEXTURE_2D, texture); 88 | } 89 | /*----------------------------------------------------------------*/ 90 | -------------------------------------------------------------------------------- /J3DViewRender/J3DViewRender.cpp: -------------------------------------------------------------------------------- 1 | // J3DViewRender.cpp : 定义静态库的函数。 2 | // 3 | 4 | #include "framework.h" 5 | 6 | // TODO: 这是一个库函数示例 7 | void fnJ3DViewRender() 8 | { 9 | } 10 | -------------------------------------------------------------------------------- /J3DViewRender/J3DViewRender.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoulBasic/J3DReconstruction/dd519e8652aa9399b1a0965dfc60e395ab99c533/J3DViewRender/J3DViewRender.rc -------------------------------------------------------------------------------- /J3DViewRender/J3DViewRender.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | Debug 14 | x64 15 | 16 | 17 | Release 18 | x64 19 | 20 | 21 | 22 | 15.0 23 | {47DDE12E-E262-4317-9F05-679422DE938D} 24 | Win32Proj 25 | J3DViewRender 26 | 10.0.17763.0 27 | 28 | 29 | 30 | StaticLibrary 31 | true 32 | v141 33 | Unicode 34 | 35 | 36 | StaticLibrary 37 | false 38 | v141 39 | true 40 | Unicode 41 | 42 | 43 | DynamicLibrary 44 | true 45 | v141 46 | MultiByte 47 | 48 | 49 | DynamicLibrary 50 | false 51 | v141 52 | true 53 | MultiByte 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | false 75 | 76 | 77 | true 78 | 79 | 80 | true 81 | 82 | 83 | false 84 | 85 | 86 | 87 | NotUsing 88 | Level3 89 | MaxSpeed 90 | true 91 | true 92 | false 93 | NDEBUG;_LIB;WIN32;_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_SCL_SECURE_NO_WARNINGS;_WIN32;_HAS_EXCEPTIONS=1;_USE_OPENMP;_USE_OPENGL;_USE_BOOST;_USE_EIGEN;_USE_NONFREE;_USE_FAST_FLOAT2INT;_USE_FAST_CBRT;_USE_SSE;CMAKE_INTDIR="Release";%(PreprocessorDefinitions) 94 | false 95 | pch.h 96 | C:\openMVS\src;C:\openMVS\Boost\boost_1_67_0;C:\openMVS\build\openCV\install\include;C:\openMVS\Eigen;C:\openMVS\glfw3\GLFW\include;C:\openMVS\glew-2.1.0\include;%(AdditionalIncludeDirectories) 97 | %(AdditionalOptions) /bigobj /Zm170 /bigobj /Zm170 98 | None 99 | 100 | 101 | Windows 102 | true 103 | true 104 | true 105 | C:/openMVS/Boost/boost_1_67_0/lib64-msvc-14.1;C:\openMVS\build\openMVS\lib\vc15\x64\Release;C:\openMVS\build\openCV\install\x64\vc15\lib;C:\openMVS\jpeg-9d;C:\openMVS\glew-2.1.0\lib\Release\x64;C:\openMVS\glfw3\GLFW\lib;%(AdditionalLibraryDirectories) 106 | MVS.lib;Math.lib;IO.lib;Common.lib;glew32.lib;glfw3.lib;opencv_world341.lib;opencv_img_hash341.lib;libjpeg.lib;opengl32.lib;glu32.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;comdlg32.lib;advapi32.lib 107 | %(AdditionalOptions) /machine:x64 /FORCE:MULTIPLE 108 | 109 | 110 | 111 | 112 | Use 113 | Level3 114 | Disabled 115 | true 116 | WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) 117 | true 118 | pch.h 119 | 120 | 121 | Windows 122 | true 123 | 124 | 125 | 126 | 127 | NotUsing 128 | Level3 129 | Disabled 130 | false 131 | _LIB;WIN32;_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_SCL_SECURE_NO_WARNINGS;_WIN32;_HAS_EXCEPTIONS=1;_USE_OPENMP;_USE_OPENGL;_USE_BOOST;_USE_EIGEN;_USE_NONFREE;_USE_FAST_FLOAT2INT;_USE_FAST_CBRT;_USE_SSE;CMAKE_INTDIR="Debug";%(PreprocessorDefinitions) 132 | false 133 | pch.h 134 | C:\openMVS\src;C:\openMVS\Boost\boost_1_67_0;C:\openMVS\build\openCV\install\include;C:\openMVS\Eigen;C:\openMVS\glfw3\GLFW\include;C:\openMVS\glew-2.1.0\include;%(AdditionalIncludeDirectories) 135 | 136 | 137 | Windows 138 | true 139 | C:/openMVS/Boost/boost_1_67_0/lib64-msvc-14.1;C:\openMVS\build\openMVS\lib\vc15\x64\Debug;C:\openMVS\build\openCV\install\x64\vc15\lib;C:\openMVS\jpeg-9d;C:\openMVS\glew-2.1.0\lib\Release\x64;C:\openMVS\glfw3\GLFW\lib;%(AdditionalLibraryDirectories) 140 | MVS.lib;Math.lib;IO.lib;Common.lib;glew32.lib;glfw3.lib;opencv_world341d.lib;opencv_img_hash341d.lib;libjpeg.lib;opengl32.lib;glu32.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;comdlg32.lib;advapi32.lib 141 | 142 | 143 | 144 | 145 | Use 146 | Level3 147 | MaxSpeed 148 | true 149 | true 150 | true 151 | WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) 152 | true 153 | pch.h 154 | 155 | 156 | Windows 157 | true 158 | true 159 | true 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | -------------------------------------------------------------------------------- /J3DViewRender/J3DViewRender.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;ipp;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | 头文件 20 | 21 | 22 | 头文件 23 | 24 | 25 | 头文件 26 | 27 | 28 | 头文件 29 | 30 | 31 | 头文件 32 | 33 | 34 | 头文件 35 | 36 | 37 | 头文件 38 | 39 | 40 | 41 | 42 | 源文件 43 | 44 | 45 | 源文件 46 | 47 | 48 | 源文件 49 | 50 | 51 | 源文件 52 | 53 | 54 | 源文件 55 | 56 | 57 | 源文件 58 | 59 | 60 | 61 | 62 | 资源文件 63 | 64 | 65 | -------------------------------------------------------------------------------- /J3DViewRender/Viewer.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoulBasic/J3DReconstruction/dd519e8652aa9399b1a0965dfc60e395ab99c533/J3DViewRender/Viewer.hpp -------------------------------------------------------------------------------- /J3DViewRender/Window.cpp: -------------------------------------------------------------------------------- 1 | 2 | 3 | #include "include/Common.h" 4 | #include "include/Window.h" 5 | 6 | using namespace VIEWER; 7 | 8 | Window::WindowsMap Window::g_mapWindows; 9 | 10 | Window::Window() 11 | : 12 | window(NULL), 13 | pos(Eigen::Vector2d::Zero()), 14 | prevPos(Eigen::Vector2d::Zero()) 15 | { 16 | } 17 | Window::~Window() 18 | { 19 | Release(); 20 | } 21 | 22 | void Window::Release() 23 | { 24 | if (IsValid()) { 25 | glfwDestroyWindow(window); 26 | window = NULL; 27 | } 28 | clbkOpenScene.reset(); 29 | clbkExportScene.reset(); 30 | clbkRayScene.reset(); 31 | clbkCompilePointCloud.reset(); 32 | clbkCompileMesh.reset(); 33 | } 34 | 35 | bool Window::Init(int width, int height, LPCTSTR name) 36 | { 37 | glfwDefaultWindowHints(); 38 | glfwWindowHint(GLFW_VISIBLE, 0); 39 | window = glfwCreateWindow(width, height, name, NULL, NULL); 40 | if (!window) 41 | return false; 42 | glfwMakeContextCurrent(window); 43 | glfwSetFramebufferSizeCallback(window, Window::Resize); 44 | glfwSetKeyCallback(window, Window::Key); 45 | glfwSetCursorPosCallback(window, Window::CursorPos); 46 | glfwSetMouseButtonCallback(window, Window::MouseButton); 47 | glfwSetScrollCallback(window, Window::Scroll); 48 | glfwSetDropCallback(window, Window::Drop); 49 | g_mapWindows[window] = this; 50 | Reset(); 51 | return true; 52 | } 53 | void Window::SetCamera(CameraPtr cam) 54 | { 55 | camera = cam; 56 | int width, height; 57 | glfwGetWindowSize(window, &width, &height); 58 | Resize(width, height); 59 | } 60 | void Window::SetName(LPCTSTR name) 61 | { 62 | glfwSetWindowTitle(window, name); 63 | } 64 | void Window::SetVisible(bool v) 65 | { 66 | if (v) 67 | glfwShowWindow(window); 68 | else 69 | glfwHideWindow(window); 70 | } 71 | void Window::Reset(uint32_t _minViews) 72 | { 73 | if (camera) 74 | camera->Reset(); 75 | sparseType = SPR_ALL; 76 | minViews = _minViews; 77 | pointSize = 2.f; 78 | cameraBlend = 0.5f; 79 | bRenderCameras = false; 80 | bRenderSolid = true; 81 | bRenderTexture = true; 82 | selectionType = SEL_NA; 83 | if (clbkCompilePointCloud != NULL) 84 | clbkCompilePointCloud(); 85 | if (clbkCompileMesh != NULL) 86 | clbkCompileMesh(); 87 | glfwPostEmptyEvent(); 88 | } 89 | 90 | void Window::UpdateView(const ImageArr& images, const MVS::ImageArr& sceneImages) 91 | { 92 | glMatrixMode(GL_MODELVIEW); 93 | if (camera->prevCamID != camera->currentCamID && camera->currentCamID != NO_ID) { 94 | // enable camera view mode 95 | // apply current camera transform 96 | const Image& image = images[camera->currentCamID]; 97 | const MVS::Image& imageData = sceneImages[image.idx]; 98 | const MVS::Camera& camera = imageData.camera; 99 | const Eigen::Matrix4d trans(TransW2L((const Matrix3x3::EMat)camera.R, camera.GetT())); 100 | glLoadMatrixf((GLfloat*)gs_convert); 101 | glMultMatrixd((GLdouble*)trans.data()); 102 | } 103 | else { 104 | // apply view point transform 105 | const Eigen::Matrix4d trans(camera->GetLookAt()); 106 | glLoadMatrixd((GLdouble*)trans.data()); 107 | } 108 | } 109 | 110 | void Window::UpdateMousePosition() 111 | { 112 | prevPos = pos; 113 | // get current position 114 | glfwGetCursorPos(window, &pos.x(), &pos.y()); 115 | // normalize position to [-1:1] range 116 | const int w(camera->width); 117 | const int h(camera->height); 118 | pos.x() = (2.0 * pos.x() - w) / w; 119 | pos.y() = (h - 2.0 * pos.y()) / h; 120 | } 121 | 122 | void Window::Resize(int width, int height) 123 | { 124 | glfwMakeContextCurrent(window); 125 | glViewport(0, 0, (GLint)width, (GLint)height); 126 | camera->Resize(width, height); 127 | } 128 | void Window::Resize(GLFWwindow* window, int width, int height) 129 | { 130 | g_mapWindows[window]->Resize(width, height); 131 | } 132 | 133 | void Window::Key(int k, int /*scancode*/, int action, int mod) 134 | { 135 | switch (k) { 136 | case GLFW_KEY_ESCAPE: 137 | if (action == GLFW_RELEASE) 138 | glfwSetWindowShouldClose(window, 1); 139 | break; 140 | case GLFW_KEY_DOWN: 141 | if (action == GLFW_RELEASE) { 142 | if (mod & GLFW_MOD_SHIFT) { 143 | if (minViews > 2) { 144 | minViews--; 145 | if (clbkCompilePointCloud != NULL) 146 | clbkCompilePointCloud(); 147 | } 148 | } 149 | else { 150 | pointSize = MAXF(pointSize - 0.5f, 0.5f); 151 | } 152 | } 153 | break; 154 | case GLFW_KEY_UP: 155 | if (action == GLFW_RELEASE) { 156 | if (mod & GLFW_MOD_SHIFT) { 157 | minViews++; 158 | if (clbkCompilePointCloud != NULL) 159 | clbkCompilePointCloud(); 160 | } 161 | else { 162 | pointSize += 0.5f; 163 | } 164 | } 165 | break; 166 | case GLFW_KEY_LEFT: 167 | if (action == GLFW_RELEASE) { 168 | camera->prevCamID = camera->currentCamID; 169 | camera->currentCamID--; 170 | if (camera->currentCamID < NO_ID && camera->currentCamID >= camera->maxCamID) 171 | camera->currentCamID = camera->maxCamID-1; 172 | } 173 | break; 174 | case GLFW_KEY_RIGHT: 175 | if (action == GLFW_RELEASE) { 176 | camera->prevCamID = camera->currentCamID; 177 | camera->currentCamID++; 178 | if (camera->currentCamID >= camera->maxCamID) 179 | camera->currentCamID = NO_ID; 180 | } 181 | break; 182 | //case GLFW_KEY_E: 183 | // if (action == GLFW_RELEASE && clbkExportScene != NULL) 184 | // clbkExportScene(NULL, NULL, false); 185 | // break; 186 | //case GLFW_KEY_R: 187 | // if (action == GLFW_RELEASE) 188 | // Reset(); 189 | // break; 190 | case GLFW_KEY_C: 191 | if (action == GLFW_RELEASE) 192 | bRenderCameras = !bRenderCameras; 193 | break; 194 | case GLFW_KEY_M: 195 | if (action == GLFW_RELEASE) { 196 | if (bRenderSolid) { 197 | bRenderSolid = false; 198 | glPolygonMode(GL_FRONT, GL_LINE); 199 | } 200 | else { 201 | bRenderSolid = true; 202 | glPolygonMode(GL_FRONT, GL_FILL); 203 | } 204 | } 205 | break; 206 | case GLFW_KEY_T: 207 | if (action == GLFW_RELEASE) { 208 | bRenderTexture = !bRenderTexture; 209 | if (clbkCompileMesh != NULL) 210 | clbkCompileMesh(); 211 | } 212 | break; 213 | case GLFW_KEY_P: 214 | switch (sparseType) { 215 | case SPR_POINTS: sparseType = SPR_LINES; break; 216 | case SPR_LINES: sparseType = SPR_ALL; break; 217 | case SPR_ALL: sparseType = SPR_POINTS; break; 218 | } 219 | if (clbkCompilePointCloud != NULL) 220 | clbkCompilePointCloud(); 221 | break; 222 | case GLFW_KEY_KP_SUBTRACT: 223 | if (action == GLFW_RELEASE) { 224 | if (mod & GLFW_MOD_CONTROL) 225 | camera->SetFOV(MAXF(camera->fov-5, 5.0)); 226 | else if (mod & GLFW_MOD_SHIFT) 227 | camera->scaleF *= 0.9f; 228 | else 229 | cameraBlend = MAXF(cameraBlend-0.1f, 0.f); 230 | } 231 | break; 232 | case GLFW_KEY_KP_ADD: 233 | if (action == GLFW_RELEASE) { 234 | if (mod & GLFW_MOD_CONTROL) 235 | camera->SetFOV(camera->fov+5); 236 | else if (mod & GLFW_MOD_SHIFT) 237 | camera->scaleF *= 1.11f; 238 | else 239 | cameraBlend = MINF(cameraBlend+0.1f, 1.f); 240 | } 241 | break; 242 | } 243 | } 244 | void Window::Key(GLFWwindow* window, int k, int scancode, int action, int mod) 245 | { 246 | g_mapWindows[window]->Key(k, scancode, action, mod); 247 | } 248 | 249 | void Window::MouseButton(int button, int action, int /*mods*/) 250 | { 251 | if (clbkRayScene != NULL && button == GLFW_MOUSE_BUTTON_LEFT) { 252 | typedef Eigen::Matrix Mat4; 253 | Mat4 P, V; 254 | glGetDoublev(GL_MODELVIEW_MATRIX, V.data()); 255 | glGetDoublev(GL_PROJECTION_MATRIX, P.data()); 256 | // 4d Homogeneous Clip Coordinates 257 | const Eigen::Vector4d ray_clip(pos.x(), pos.y(), -1.0, 1.0); 258 | // 4d Eye (Camera) Coordinates 259 | Eigen::Vector4d ray_eye(P.inverse()*ray_clip); 260 | ray_eye.z() = -1.0; 261 | ray_eye.w() = 0.0; 262 | // 4d World Coordinates 263 | const Mat4 invV(V.inverse()); 264 | ASSERT(ISEQUAL(invV(3, 3), 1.0)); 265 | const Eigen::Vector3d start(invV.topRightCorner<3, 1>()); 266 | const Eigen::Vector4d ray_wor(invV*ray_eye); 267 | const Eigen::Vector3d dir(ray_wor.topRows<3>().normalized()); 268 | clbkRayScene(Ray3d(start, dir), action); 269 | } 270 | } 271 | void Window::MouseButton(GLFWwindow* window, int button, int action, int mods) 272 | { 273 | g_mapWindows[window]->MouseButton(button, action, mods); 274 | } 275 | 276 | void Window::Scroll(double /*xoffset*/, double yoffset) 277 | { 278 | camera->dist *= (yoffset <= 0 ? POW(1.11, -yoffset) : POW(0.9, yoffset)); 279 | } 280 | void Window::Scroll(GLFWwindow* window, double xoffset, double yoffset) 281 | { 282 | g_mapWindows[window]->Scroll(xoffset, yoffset); 283 | } 284 | 285 | void Window::Drop(int count, const char** paths) 286 | { 287 | if (clbkOpenScene && count > 0) 288 | { 289 | SetVisible(false); 290 | String fileName(paths[0]); 291 | Util::ensureUnifySlash(fileName); 292 | if (count > 1) { 293 | String meshFileName(paths[1]); 294 | Util::ensureUnifySlash(meshFileName); 295 | clbkOpenScene(fileName, meshFileName); 296 | } 297 | else { 298 | clbkOpenScene(fileName, NULL); 299 | } 300 | SetVisible(true); 301 | } 302 | } 303 | 304 | void Window::NewModel(const std::string& fn) 305 | { 306 | if (clbkOpenScene) 307 | { 308 | SetVisible(false); 309 | String fileName(fn); 310 | Util::ensureUnifySlash(fileName); 311 | clbkOpenScene(fileName, NULL); 312 | SetVisible(true); 313 | } 314 | } 315 | 316 | void Window::Drop(GLFWwindow* window, int count, const char** paths) 317 | { 318 | g_mapWindows[window]->Drop(count, paths); 319 | } 320 | 321 | void Window::CursorPos(GLFWwindow* window, double x, double y) 322 | { 323 | g_mapWindows[window]->cursorXPos = x; 324 | g_mapWindows[window]->cursorYPos = y; 325 | } 326 | 327 | bool Window::IsShiftKeyPressed() const 328 | { 329 | return 330 | glfwGetKey(window, GLFW_KEY_LEFT_SHIFT) == GLFW_PRESS || 331 | glfwGetKey(window, GLFW_KEY_RIGHT_SHIFT) == GLFW_PRESS; 332 | } 333 | bool Window::IsCtrlKeyPressed() const 334 | { 335 | return 336 | glfwGetKey(window, GLFW_KEY_LEFT_CONTROL) == GLFW_PRESS || 337 | glfwGetKey(window, GLFW_KEY_RIGHT_CONTROL) == GLFW_PRESS; 338 | } 339 | bool Window::IsAltKeyPressed() const 340 | { 341 | return 342 | glfwGetKey(window, GLFW_KEY_LEFT_ALT) == GLFW_PRESS || 343 | glfwGetKey(window, GLFW_KEY_RIGHT_ALT) == GLFW_PRESS; 344 | } 345 | /*----------------------------------------------------------------*/ 346 | -------------------------------------------------------------------------------- /J3DViewRender/framework.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define WIN32_LEAN_AND_MEAN // 从 Windows 头文件中排除极少使用的内容 4 | -------------------------------------------------------------------------------- /J3DViewRender/include/Camera.h: -------------------------------------------------------------------------------- 1 | #ifndef _VIEWER_CAMERA_H_ 2 | #define _VIEWER_CAMERA_H_ 3 | 4 | namespace VIEWER { 5 | 6 | class Camera 7 | { 8 | public: 9 | EIGEN_MAKE_ALIGNED_OPERATOR_NEW 10 | 11 | AABB3d box; 12 | int width, height; 13 | Eigen::Quaterniond rotation; 14 | Eigen::Vector3d center; 15 | double dist; 16 | double radius; 17 | double fov; 18 | float scaleF; 19 | MVS::IIndex prevCamID, currentCamID, maxCamID; 20 | 21 | public: 22 | explicit Camera(const AABB3d& _box = AABB3d(true), double _fov = 40); 23 | void CopyOf(const Camera&); 24 | 25 | void Init(const AABB3d&); 26 | void Reset(); 27 | void Resize(int _width, int _height); 28 | void SetFOV(double _fov); 29 | 30 | Eigen::Vector3d GetPosition() const; 31 | Eigen::Matrix4d GetLookAt() const; 32 | void GetLookAt(Eigen::Vector3d& eye, Eigen::Vector3d& center, Eigen::Vector3d& up) const; 33 | void Rotate(const Eigen::Vector2d& pos, const Eigen::Vector2d& prevPos); 34 | 35 | protected: 36 | void Project2Sphere(double radius, Eigen::Vector3d& p) const; 37 | }; 38 | typedef CSharedPtr CameraPtr; 39 | /*----------------------------------------------------------------*/ 40 | 41 | } // namespace VIEWER 42 | 43 | #endif // _VIEWER_CAMERA_H_ 44 | -------------------------------------------------------------------------------- /J3DViewRender/include/Common.h: -------------------------------------------------------------------------------- 1 | #ifndef _VIEWER_COMMON_H_ 2 | #define _VIEWER_COMMON_H_ 3 | 4 | #include 5 | #include "libs/MVS/Common.h" 6 | #include "libs/MVS/Scene.h" 7 | 8 | #if defined(_MSC_VER) 9 | #include 10 | #elif defined(__APPLE__) 11 | #include 12 | #else 13 | #include 14 | #endif 15 | #include 16 | 17 | using namespace SEACAVE; 18 | 19 | namespace VIEWER { 20 | 21 | // the conversion matrix from OpenGL default coordinate system 22 | // to the camera coordinate system: 23 | // [ 1 0 0 0] * [ x ] = [ x ] 24 | // 0 -1 0 0 y -y 25 | // 0 0 -1 0 z -z 26 | // 0 0 0 1 1 1 27 | static const GLfloat gs_convert[4][4] = { 28 | {1.f, 0.f, 0.f, 0.f}, 29 | {0.f, -1.f, 0.f, 0.f}, 30 | {0.f, 0.f, -1.f, 0.f}, 31 | {0.f, 0.f, 0.f, 1.f} }; 32 | 33 | /// given rotation matrix R and translation vector t, 34 | /// column-major matrix m is equal to: 35 | /// [ R11 R12 R13 t.x ] 36 | /// | R21 R22 R23 t.y | 37 | /// | R31 R32 R33 t.z | 38 | /// [ 0.0 0.0 0.0 1.0 ] 39 | // 40 | // World to Local 41 | inline Eigen::Matrix4d TransW2L(const Eigen::Matrix3d& R, const Eigen::Vector3d& t) 42 | { 43 | Eigen::Matrix4d m(Eigen::Matrix4d::Identity()); 44 | m.block(0, 0, 3, 3) = R; 45 | m.block(0, 3, 3, 1) = t; 46 | return m; 47 | } 48 | // Local to World 49 | // same as above, but with the inverse of the two 50 | inline Eigen::Matrix4d TransL2W(const Eigen::Matrix3d& R, const Eigen::Vector3d& t) 51 | { 52 | Eigen::Matrix4d m(Eigen::Matrix4d::Identity()); 53 | m.block(0, 0, 3, 3) = R.transpose(); 54 | m.block(0, 3, 3, 1) = -t; 55 | return m; 56 | } 57 | /*----------------------------------------------------------------*/ 58 | 59 | } // namespace MVS 60 | 61 | #endif // _VIEWER_COMMON_H_ 62 | -------------------------------------------------------------------------------- /J3DViewRender/include/Image.h: -------------------------------------------------------------------------------- 1 | #ifndef _VIEWER_IMAGE_H_ 2 | #define _VIEWER_IMAGE_H_ 3 | 4 | namespace VIEWER { 5 | 6 | class Image 7 | { 8 | public: 9 | typedef CLISTDEFIDX(Image, uint32_t) ImageArr; 10 | enum { 11 | IMG_NULL = 0, 12 | IMG_LOADING, 13 | IMG_VALID 14 | }; 15 | union ImagePtrInt { 16 | cv::Mat* pImage; 17 | int_t ptr; 18 | inline ImagePtrInt() : ptr(IMG_NULL) {} 19 | inline ImagePtrInt(cv::Mat* p) : pImage(p) {} 20 | inline operator cv::Mat* () const { return pImage; } 21 | inline operator cv::Mat*& () { return pImage; } 22 | }; 23 | 24 | public: 25 | MVS::IIndex idx; // image index in the current scene 26 | int width, height; 27 | GLuint texture; 28 | double opacity; 29 | ImagePtrInt pImage; 30 | 31 | public: 32 | Image(MVS::IIndex = NO_ID); 33 | ~Image(); 34 | 35 | void Release(); 36 | void ReleaseImage(); 37 | inline bool IsValid() const { return texture > 0; } 38 | inline bool IsImageEmpty() const { return pImage.ptr == IMG_NULL; } 39 | inline bool IsImageLoading() const { return pImage.ptr == IMG_LOADING; } 40 | inline bool IsImageValid() const { return pImage.ptr >= IMG_VALID; } 41 | 42 | void SetImageLoading(); 43 | void AssignImage(cv::InputArray); 44 | bool TransferImage(); 45 | 46 | void SetImage(cv::InputArray); 47 | void GenerateMipmap() const; 48 | void Bind() const; 49 | 50 | protected: 51 | }; 52 | typedef Image::ImageArr ImageArr; 53 | /*----------------------------------------------------------------*/ 54 | 55 | } // namespace VIEWER 56 | 57 | #endif // _VIEWER_IMAGE_H_ 58 | -------------------------------------------------------------------------------- /J3DViewRender/include/Scene.h: -------------------------------------------------------------------------------- 1 | #ifndef _VIEWER_SCENE_H_ 2 | #define _VIEWER_SCENE_H_ 3 | 4 | #include "Window.h" 5 | 6 | namespace VIEWER { 7 | 8 | class Scene 9 | { 10 | public: 11 | typedef TOctree OctreePoints; 12 | typedef TOctree OctreeMesh; 13 | 14 | public: 15 | String name; 16 | String sceneName; 17 | MVS::Scene scene; 18 | Window window; 19 | ImageArr images; // scene photos 20 | ImageArr textures; // mesh textures 21 | 22 | OctreePoints octPoints; 23 | OctreeMesh octMesh; 24 | 25 | GLuint listPointCloud; 26 | GLuint listMesh; 27 | // multi-threading 28 | static SEACAVE::EventQueue events; // internal events queue (processed by the working threads) 29 | static SEACAVE::Thread thread; // worker thread 30 | 31 | public: 32 | __declspec(dllexport) Scene(); 33 | __declspec(dllexport) ~Scene(); 34 | 35 | void Empty(); 36 | void Release(); 37 | void ReleasePointCloud(); 38 | void ReleaseMesh(); 39 | inline bool IsValid() const { return window.IsValid(); } 40 | inline bool IsOpen() const { return IsValid() && !scene.IsEmpty(); } 41 | inline bool IsOctreeValid() const { return !octPoints.IsEmpty() || !octMesh.IsEmpty(); } 42 | 43 | __declspec(dllexport) bool Init(int width, int height, LPCTSTR windowName, LPCTSTR fileName = NULL, LPCTSTR meshFileName = NULL); 44 | bool Open(LPCTSTR fileName, LPCTSTR meshFileName = NULL); 45 | __declspec(dllexport) bool Export(LPCTSTR fileName, LPCTSTR exportType = NULL, bool losslessTexture = false) const; 46 | __declspec(dllexport) bool Export(LPCTSTR _fileName, LPCTSTR exportType, bool losslessTexture, bool b) const; 47 | void CompilePointCloud(); 48 | void CompileMesh(); 49 | 50 | void Draw(); 51 | void ProcessEvents(); 52 | __declspec(dllexport) void Loop(); 53 | 54 | void CastRay(const Ray3&, int); 55 | 56 | protected: 57 | static void* ThreadWorker(void*); 58 | }; 59 | /*----------------------------------------------------------------*/ 60 | 61 | } // namespace VIEWER 62 | 63 | #endif // _VIEWER_SCENE_H_ 64 | -------------------------------------------------------------------------------- /J3DViewRender/include/Window.h: -------------------------------------------------------------------------------- 1 | #ifndef _VIEWER_WINDOW_H_ 2 | #define _VIEWER_WINDOW_H_ 3 | #include "Camera.h" 4 | #include "Image.h" 5 | 6 | namespace VIEWER { 7 | 8 | class Window 9 | { 10 | public: 11 | GLFWwindow* window; // window handle 12 | CameraPtr camera; // current camera (always valid) 13 | Eigen::Vector2d pos, prevPos; // current and previous mouse position (normalized) 14 | 15 | enum SPARSE { 16 | SPR_POINTS = (1 << 0), 17 | SPR_LINES = (1 << 1), 18 | SPR_ALL = SPR_POINTS | SPR_LINES 19 | }; 20 | SPARSE sparseType; 21 | unsigned minViews; 22 | float pointSize; 23 | float cameraBlend; 24 | bool bRenderCameras; 25 | bool bRenderSolid; 26 | bool bRenderTexture; 27 | 28 | enum SELECTION { 29 | SEL_NA = 0, 30 | SEL_POINT, 31 | SEL_TRIANGLE 32 | }; 33 | SELECTION selectionType; 34 | Point3f selectionPoints[4]; 35 | double selectionTimeClick, selectionTime; 36 | double cursorXPos, cursorYPos; 37 | typedef DELEGATE ClbkOpenScene; 38 | ClbkOpenScene clbkOpenScene; 39 | typedef DELEGATE ClbkExportScene; 40 | ClbkExportScene clbkExportScene; 41 | typedef DELEGATE ClbkRayScene; 42 | ClbkRayScene clbkRayScene; 43 | typedef DELEGATE ClbkCompilePointCloud; 44 | ClbkCompilePointCloud clbkCompilePointCloud; 45 | typedef DELEGATE ClbkCompileMesh; 46 | ClbkCompileMesh clbkCompileMesh; 47 | 48 | typedef std::unordered_map WindowsMap; 49 | static WindowsMap g_mapWindows; 50 | 51 | public: 52 | Window(); 53 | ~Window(); 54 | 55 | void Release(); 56 | inline bool IsValid() const { return window != NULL; } 57 | 58 | bool Init(int width, int height, LPCTSTR name); 59 | void SetCamera(CameraPtr); 60 | void SetName(LPCTSTR); 61 | __declspec(dllexport) void SetVisible(bool); 62 | void Reset(uint32_t minViews = 2); 63 | 64 | inline GLFWwindow* GetWindow() { return window; } 65 | 66 | void UpdateView(const ImageArr&, const MVS::ImageArr&); 67 | void UpdateMousePosition(); 68 | 69 | void Resize(int width, int height); 70 | static void Resize(GLFWwindow* window, int width, int height); 71 | __declspec(dllexport) void Key(int k, int scancode, int action, int mod); 72 | static void Key(GLFWwindow* window, int k, int scancode, int action, int mod); 73 | void MouseButton(int button, int action, int mods); 74 | static void MouseButton(GLFWwindow* window, int button, int action, int mods); 75 | void Scroll(double xoffset, double yoffset); 76 | static void Scroll(GLFWwindow* window, double xoffset, double yoffset); 77 | __declspec(dllexport) void Drop(int count, const char** paths); 78 | __declspec(dllexport) void NewModel(const std::string& fn); 79 | static void Drop(GLFWwindow* window, int count, const char** paths); 80 | 81 | static void CursorPos(GLFWwindow* window, double x, double y); 82 | 83 | protected: 84 | bool IsShiftKeyPressed() const; 85 | bool IsCtrlKeyPressed() const; 86 | bool IsAltKeyPressed() const; 87 | }; 88 | /*----------------------------------------------------------------*/ 89 | 90 | } // namespace VIEWER 91 | 92 | #endif // _VIEWER_WINDOW_H_ 93 | -------------------------------------------------------------------------------- /J3DViewRender/resource.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoulBasic/J3DReconstruction/dd519e8652aa9399b1a0965dfc60e395ab99c533/J3DViewRender/resource.h -------------------------------------------------------------------------------- /MVSEngine/J3DMVSEngine.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoulBasic/J3DReconstruction/dd519e8652aa9399b1a0965dfc60e395ab99c533/MVSEngine/J3DMVSEngine.rc -------------------------------------------------------------------------------- /MVSEngine/MVSEngine.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | namespace MVSEngine 5 | { 6 | bool Initialize_Dense(size_t argc, LPCTSTR* argv); 7 | void Finalize_Dense(); 8 | __declspec(dllexport) int DensifyPointCloud(int num, char* cmd[]); 9 | 10 | bool Initialize_ReconstructMesh(size_t argc, LPCTSTR* argv); 11 | void Finalize_ReconstructMesh(); 12 | __declspec(dllexport) int ReconstructMesh(int num, char* cmd[]); 13 | 14 | bool Initialize_RefineMesh(size_t argc, LPCTSTR* argv); 15 | void Finalize_RefineMesh(); 16 | __declspec(dllexport) int RefineMesh(int num, char* cmd[]); 17 | 18 | bool Initialize_TextureMesh(size_t argc, LPCTSTR* argv); 19 | void Finalize_TextureMesh(); 20 | __declspec(dllexport) int TextureMesh(int num, char* cmd[]); 21 | 22 | 23 | } 24 | -------------------------------------------------------------------------------- /MVSEngine/MVSEngine.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;ipp;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | 源文件 20 | 21 | 22 | 源文件 23 | 24 | 25 | 源文件 26 | 27 | 28 | 源文件 29 | 30 | 31 | 32 | 33 | 头文件 34 | 35 | 36 | 头文件 37 | 38 | 39 | 40 | 41 | 资源文件 42 | 43 | 44 | -------------------------------------------------------------------------------- /MVSEngine/ReconstructMesh.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoulBasic/J3DReconstruction/dd519e8652aa9399b1a0965dfc60e395ab99c533/MVSEngine/ReconstructMesh.cpp -------------------------------------------------------------------------------- /MVSEngine/RefineMesh.cpp: -------------------------------------------------------------------------------- 1 | #include "libs/MVS/Common.h" 2 | #include "libs/MVS/Scene.h" 3 | #include 4 | #include "MVSEngine.h" 5 | using namespace MVS; 6 | #define APPNAME _T("RefineMesh") 7 | 8 | namespace OPT_RefineMesh { 9 | String strInputFileName; 10 | String strOutputFileName; 11 | String strMeshFileName; 12 | unsigned nResolutionLevel; 13 | unsigned nMinResolution; 14 | unsigned nMaxViews; 15 | float fDecimateMesh; 16 | unsigned nCloseHoles; 17 | unsigned nEnsureEdgeSize; 18 | unsigned nScales; 19 | float fScaleStep; 20 | unsigned nReduceMemory; 21 | unsigned nAlternatePair; 22 | float fRegularityWeight; 23 | float fRatioRigidityElasticity; 24 | unsigned nMaxFaceArea; 25 | float fPlanarVertexRatio; 26 | float fGradientStep; 27 | #ifdef _USE_CUDA 28 | bool bUseCUDA; 29 | #endif 30 | unsigned nArchiveType; 31 | int nProcessPriority; 32 | unsigned nMaxThreads; 33 | String strExportType; 34 | String strConfigFileName; 35 | boost::program_options::variables_map vm; 36 | } // namespace OPT_RefineMesh 37 | 38 | 39 | bool MVSEngine::Initialize_RefineMesh(size_t argc, LPCTSTR* argv) 40 | { 41 | // Initialize_Dense log and console 42 | CLOSE_LOGFILE(); 43 | CLOSE_LOGCONSOLE(); 44 | CLOSE_LOG(); 45 | OPEN_LOG(); 46 | OPEN_LOGCONSOLE(); 47 | 48 | boost::program_options::options_description generic("Generic options"); 49 | generic.add_options() 50 | ("help,h", "produce this help message") 51 | ("working-folder,w", boost::program_options::value(&WORKING_FOLDER), "working directory (default current directory)") 52 | ("config-file,c", boost::program_options::value(&OPT_RefineMesh::strConfigFileName)->default_value(APPNAME _T(".cfg")), "file name containing program options") 53 | ("export-type", boost::program_options::value(&OPT_RefineMesh::strExportType)->default_value(_T("ply")), "file type used to export the 3D scene (ply or obj)") 54 | ("archive-type", boost::program_options::value(&OPT_RefineMesh::nArchiveType)->default_value(2), "project archive type: 0-text, 1-binary, 2-compressed binary") 55 | ("process-priority", boost::program_options::value(&OPT_RefineMesh::nProcessPriority)->default_value(-1), "process priority (below normal by default)") 56 | ("max-threads", boost::program_options::value(&OPT_RefineMesh::nMaxThreads)->default_value(0), "maximum number of threads (0 for using all available cores)") 57 | #if TD_VERBOSE != TD_VERBOSE_OFF 58 | ("verbosity,v", boost::program_options::value(&g_nVerbosityLevel)->default_value( 59 | #if TD_VERBOSE == TD_VERBOSE_DEBUG 60 | 3 61 | #else 62 | 2 63 | #endif 64 | ), "verbosity level") 65 | #endif 66 | ; 67 | 68 | boost::program_options::options_description config("Refine options"); 69 | config.add_options() 70 | ("input-file,i", boost::program_options::value(&OPT_RefineMesh::strInputFileName), "input filename containing camera poses and image list") 71 | ("output-file,o", boost::program_options::value(&OPT_RefineMesh::strOutputFileName), "output filename for storing the mesh") 72 | ("resolution-level", boost::program_options::value(&OPT_RefineMesh::nResolutionLevel)->default_value(0), "how many times to scale down the images before mesh refinement") 73 | ("min-resolution", boost::program_options::value(&OPT_RefineMesh::nMinResolution)->default_value(640), "do not scale images lower than this resolution") 74 | ("max-views", boost::program_options::value(&OPT_RefineMesh::nMaxViews)->default_value(8), "maximum number of neighbor images used to refine the mesh") 75 | ("decimate", boost::program_options::value(&OPT_RefineMesh::fDecimateMesh)->default_value(0.f), "decimation factor in range [0..1] to be applied to the input surface before refinement (0 - auto, 1 - disabled)") 76 | ("close-holes", boost::program_options::value(&OPT_RefineMesh::nCloseHoles)->default_value(30), "try to close small holes in the input surface (0 - disabled)") 77 | ("ensure-edge-size", boost::program_options::value(&OPT_RefineMesh::nEnsureEdgeSize)->default_value(1), "ensure edge size and improve vertex valence of the input surface (0 - disabled, 1 - auto, 2 - force)") 78 | ("max-face-area", boost::program_options::value(&OPT_RefineMesh::nMaxFaceArea)->default_value(64), "maximum face area projected in any pair of images that is not subdivided (0 - disabled)") 79 | ("scales", boost::program_options::value(&OPT_RefineMesh::nScales)->default_value(3), "how many iterations to run mesh optimization on multi-scale images") 80 | ("scale-step", boost::program_options::value(&OPT_RefineMesh::fScaleStep)->default_value(0.5f), "image scale factor used at each mesh optimization step") 81 | ("reduce-memory", boost::program_options::value(&OPT_RefineMesh::nReduceMemory)->default_value(1), "recompute some data in order to reduce memory requirements") 82 | ("alternate-pair", boost::program_options::value(&OPT_RefineMesh::nAlternatePair)->default_value(0), "refine mesh using an image pair alternatively as reference (0 - both, 1 - alternate, 2 - only left, 3 - only right)") 83 | ("regularity-weight", boost::program_options::value(&OPT_RefineMesh::fRegularityWeight)->default_value(0.2f), "scalar regularity weight to balance between photo-consistency and regularization terms during mesh optimization") 84 | ("rigidity-elasticity-ratio", boost::program_options::value(&OPT_RefineMesh::fRatioRigidityElasticity)->default_value(0.9f), "scalar ratio used to compute the regularity gradient as a combination of rigidity and elasticity") 85 | ("gradient-step", boost::program_options::value(&OPT_RefineMesh::fGradientStep)->default_value(45.05f), "gradient step to be used instead (0 - auto)") 86 | ("planar-vertex-ratio", boost::program_options::value(&OPT_RefineMesh::fPlanarVertexRatio)->default_value(0.f), "threshold used to remove vertices on planar patches (0 - disabled)") 87 | #ifdef _USE_CUDA 88 | ("use-cuda", boost::program_options::value(&OPT_RefineMesh::bUseCUDA)->default_value(true), "refine mesh using CUDA") 89 | #endif 90 | ; 91 | 92 | boost::program_options::options_description hidden("Hidden options"); 93 | hidden.add_options() 94 | ("mesh-file", boost::program_options::value(&OPT_RefineMesh::strMeshFileName), "mesh file name to refine (overwrite the existing mesh)") 95 | ; 96 | 97 | boost::program_options::options_description cmdline_options; 98 | cmdline_options.add(generic).add(config).add(hidden); 99 | 100 | boost::program_options::options_description config_file_options; 101 | config_file_options.add(config).add(hidden); 102 | 103 | boost::program_options::positional_options_description p; 104 | p.add("input-file", -1); 105 | 106 | try { 107 | // parse command line options 108 | boost::program_options::store(boost::program_options::command_line_parser((int)argc, argv).options(cmdline_options).positional(p).run(), OPT_RefineMesh::vm); 109 | boost::program_options::notify(OPT_RefineMesh::vm); 110 | INIT_WORKING_FOLDER; 111 | // parse configuration file 112 | std::ifstream ifs(MAKE_PATH_SAFE(OPT_RefineMesh::strConfigFileName)); 113 | if (ifs) { 114 | boost::program_options::store(parse_config_file(ifs, config_file_options), OPT_RefineMesh::vm); 115 | boost::program_options::notify(OPT_RefineMesh::vm); 116 | } 117 | } 118 | catch (const std::exception& e) { 119 | LOG(e.what()); 120 | return false; 121 | } 122 | 123 | 124 | OPEN_LOGFILE(MAKE_PATH(APPNAME _T("-") + Util::getUniqueName(0) + _T(".log")).c_str()); 125 | 126 | //Util::LogBuild(); 127 | //LOG(_T("Command line:%s"), Util::CommandLineToString(argc, argv).c_str()); 128 | 129 | 130 | Util::ensureValidPath(OPT_RefineMesh::strInputFileName); 131 | Util::ensureUnifySlash(OPT_RefineMesh::strInputFileName); 132 | if (OPT_RefineMesh::vm.count("help") || OPT_RefineMesh::strInputFileName.IsEmpty()) { 133 | boost::program_options::options_description visible("Available options"); 134 | visible.add(generic).add(config); 135 | GET_LOG() << visible; 136 | } 137 | if (OPT_RefineMesh::strInputFileName.IsEmpty()) 138 | return false; 139 | OPT_RefineMesh::strExportType = OPT_RefineMesh::strExportType.ToLower() == _T("obj") ? _T(".obj") : _T(".ply"); 140 | 141 | Util::ensureValidPath(OPT_RefineMesh::strOutputFileName); 142 | Util::ensureUnifySlash(OPT_RefineMesh::strOutputFileName); 143 | if (OPT_RefineMesh::strOutputFileName.IsEmpty()) 144 | OPT_RefineMesh::strOutputFileName = Util::getFileFullName(OPT_RefineMesh::strInputFileName) + _T("_refine.J3D"); 145 | 146 | Process::setCurrentProcessPriority((Process::Priority)OPT_RefineMesh::nProcessPriority); 147 | #ifdef _USE_OPENMP 148 | if (OPT_RefineMesh::nMaxThreads != 0) 149 | omp_set_num_threads(OPT_RefineMesh::nMaxThreads); 150 | #endif 151 | 152 | #ifdef _USE_BREAKPAD 153 | // start memory dumper 154 | MiniDumper::Create(APPNAME, WORKING_FOLDER); 155 | #endif 156 | 157 | Util::Init(); 158 | return true; 159 | } 160 | 161 | // Finalize_RefineMesh application instance 162 | void MVSEngine::Finalize_RefineMesh() 163 | { 164 | #if TD_VERBOSE != TD_VERBOSE_OFF 165 | // print memory statistics 166 | Util::LogMemoryInfo(); 167 | #endif 168 | 169 | } 170 | 171 | int MVSEngine::RefineMesh(int num, char* cmd[]) 172 | { 173 | #ifdef _DEBUGINFO 174 | // set _crtBreakAlloc index to stop in at allocation 175 | _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);// | _CRTDBG_CHECK_ALWAYS_DF); 176 | #endif 177 | int argc = num; 178 | LPCTSTR* argv = (LPCTSTR*)cmd; 179 | 180 | if (!Initialize_RefineMesh(argc, argv)) 181 | return EXIT_FAILURE; 182 | 183 | Scene scene(OPT_RefineMesh::nMaxThreads); 184 | // load and refine the coarse mesh 185 | if (!scene.Load(MAKE_PATH_SAFE(OPT_RefineMesh::strInputFileName))) 186 | return EXIT_FAILURE; 187 | if (!OPT_RefineMesh::strMeshFileName.IsEmpty()) { 188 | // load given coarse mesh 189 | scene.mesh.Load(MAKE_PATH_SAFE(OPT_RefineMesh::strMeshFileName)); 190 | } 191 | if (scene.mesh.IsEmpty()) { 192 | VERBOSE("error: empty initial mesh"); 193 | return EXIT_FAILURE; 194 | } 195 | TD_TIMER_START(); 196 | #ifdef _USE_CUDA 197 | if (!OPT_RefineMesh::bUseCUDA || 198 | !scene.RefineMeshCUDA(OPT_RefineMesh::nResolutionLevel, OPT_RefineMesh::nMinResolution, OPT_RefineMesh::nMaxViews, 199 | OPT_RefineMesh::fDecimateMesh, OPT_RefineMesh::nCloseHoles, OPT_RefineMesh::nEnsureEdgeSize, 200 | OPT_RefineMesh::nMaxFaceArea, 201 | OPT_RefineMesh::nScales, OPT_RefineMesh::fScaleStep, 202 | OPT_RefineMesh::nAlternatePair > 10 ? OPT_RefineMesh::nAlternatePair % 10 : 0, 203 | OPT_RefineMesh::fRegularityWeight, 204 | OPT_RefineMesh::fRatioRigidityElasticity, 205 | OPT_RefineMesh::fGradientStep)) 206 | #endif 207 | if (!scene.RefineMesh(OPT_RefineMesh::nResolutionLevel, OPT_RefineMesh::nMinResolution, OPT_RefineMesh::nMaxViews, 208 | OPT_RefineMesh::fDecimateMesh, OPT_RefineMesh::nCloseHoles, OPT_RefineMesh::nEnsureEdgeSize, 209 | OPT_RefineMesh::nMaxFaceArea, 210 | OPT_RefineMesh::nScales, OPT_RefineMesh::fScaleStep, 211 | OPT_RefineMesh::nReduceMemory, OPT_RefineMesh::nAlternatePair, 212 | OPT_RefineMesh::fRegularityWeight, 213 | OPT_RefineMesh::fRatioRigidityElasticity, 214 | OPT_RefineMesh::fPlanarVertexRatio, 215 | OPT_RefineMesh::fGradientStep)) 216 | return EXIT_FAILURE; 217 | VERBOSE("Mesh refinement completed: %u vertices, %u faces (%s)", scene.mesh.vertices.GetSize(), scene.mesh.faces.GetSize(), TD_TIMER_GET_FMT().c_str()); 218 | 219 | // save the final mesh 220 | const String baseFileName(MAKE_PATH_SAFE(Util::getFileFullName(OPT_RefineMesh::strOutputFileName))); 221 | scene.Save(baseFileName + _T(".J3D"), (ARCHIVE_TYPE)OPT_RefineMesh::nArchiveType); 222 | scene.mesh.Save(baseFileName + OPT_RefineMesh::strExportType); 223 | #if TD_VERBOSE != TD_VERBOSE_OFF 224 | if (VERBOSITY_LEVEL > 2) 225 | scene.ExportCamerasMLP(baseFileName + _T(".mlp"), baseFileName + OPT_RefineMesh::strExportType); 226 | #endif 227 | 228 | Finalize_RefineMesh(); 229 | return EXIT_SUCCESS; 230 | } 231 | /*----------------------------------------------------------------*/ 232 | -------------------------------------------------------------------------------- /MVSEngine/TextureMesh.cpp: -------------------------------------------------------------------------------- 1 | #include "libs/MVS/Common.h" 2 | #include "libs/MVS/Scene.h" 3 | #include 4 | #include "MVSEngine.h" 5 | using namespace MVS; 6 | #define APPNAME _T("TextureMesh") 7 | namespace OPT_TextureMesh { 8 | String strInputFileName; 9 | String strOutputFileName; 10 | String strMeshFileName; 11 | float fDecimateMesh; 12 | unsigned nCloseHoles; 13 | unsigned nResolutionLevel; 14 | unsigned nMinResolution; 15 | float fOutlierThreshold; 16 | float fRatioDataSmoothness; 17 | bool bGlobalSeamLeveling; 18 | bool bLocalSeamLeveling; 19 | unsigned nTextureSizeMultiple; 20 | unsigned nRectPackingHeuristic; 21 | uint32_t nColEmpty; 22 | unsigned nOrthoMapResolution; 23 | unsigned nArchiveType; 24 | int nProcessPriority; 25 | unsigned nMaxThreads; 26 | String strExportType; 27 | String strConfigFileName; 28 | boost::program_options::variables_map vm; 29 | } // namespace OPT_TextureMesh 30 | 31 | // Initialize_TextureMesh and parse the command line parameters 32 | bool MVSEngine::Initialize_TextureMesh(size_t argc, LPCTSTR* argv) 33 | { 34 | // Initialize_Dense log and console 35 | CLOSE_LOGFILE(); 36 | CLOSE_LOGCONSOLE(); 37 | CLOSE_LOG(); 38 | OPEN_LOG(); 39 | OPEN_LOGCONSOLE(); 40 | 41 | // group of options allowed only on command line 42 | boost::program_options::options_description generic("Generic options"); 43 | generic.add_options() 44 | ("help,h", "produce this help message") 45 | ("working-folder,w", boost::program_options::value(&WORKING_FOLDER), "working directory (default current directory)") 46 | ("config-file,c", boost::program_options::value(&OPT_TextureMesh::strConfigFileName)->default_value(APPNAME _T(".cfg")), "file name containing program options") 47 | ("export-type", boost::program_options::value(&OPT_TextureMesh::strExportType)->default_value(_T("ply")), "file type used to export the 3D scene (ply or obj)") 48 | ("archive-type", boost::program_options::value(&OPT_TextureMesh::nArchiveType)->default_value(2), "project archive type: 0-text, 1-binary, 2-compressed binary") 49 | ("process-priority", boost::program_options::value(&OPT_TextureMesh::nProcessPriority)->default_value(-1), "process priority (below normal by default)") 50 | ("max-threads", boost::program_options::value(&OPT_TextureMesh::nMaxThreads)->default_value(0), "maximum number of threads (0 for using all available cores)") 51 | #if TD_VERBOSE != TD_VERBOSE_OFF 52 | ("verbosity,v", boost::program_options::value(&g_nVerbosityLevel)->default_value( 53 | #if TD_VERBOSE == TD_VERBOSE_DEBUG 54 | 3 55 | #else 56 | 2 57 | #endif 58 | ), "verbosity level") 59 | #endif 60 | ; 61 | 62 | // group of options allowed both on command line and in config file 63 | boost::program_options::options_description config("Texture options"); 64 | config.add_options() 65 | ("input-file,i", boost::program_options::value(&OPT_TextureMesh::strInputFileName), "input filename containing camera poses and image list") 66 | ("output-file,o", boost::program_options::value(&OPT_TextureMesh::strOutputFileName), "output filename for storing the mesh") 67 | ("decimate", boost::program_options::value(&OPT_TextureMesh::fDecimateMesh)->default_value(1.f), "decimation factor in range [0..1] to be applied to the input surface before refinement (0 - auto, 1 - disabled)") 68 | ("close-holes", boost::program_options::value(&OPT_TextureMesh::nCloseHoles)->default_value(30), "try to close small holes in the input surface (0 - disabled)") 69 | ("resolution-level", boost::program_options::value(&OPT_TextureMesh::nResolutionLevel)->default_value(0), "how many times to scale down the images before mesh refinement") 70 | ("min-resolution", boost::program_options::value(&OPT_TextureMesh::nMinResolution)->default_value(640), "do not scale images lower than this resolution") 71 | ("outlier-threshold", boost::program_options::value(&OPT_TextureMesh::fOutlierThreshold)->default_value(6e-2f), "threshold used to find and remove outlier face textures (0 - disabled)") 72 | ("cost-smoothness-ratio", boost::program_options::value(&OPT_TextureMesh::fRatioDataSmoothness)->default_value(0.1f), "ratio used to adjust the preference for more compact patches (1 - best quality/worst compactness, ~0 - worst quality/best compactness)") 73 | ("global-seam-leveling", boost::program_options::value(&OPT_TextureMesh::bGlobalSeamLeveling)->default_value(true), "generate uniform texture patches using global seam leveling") 74 | ("local-seam-leveling", boost::program_options::value(&OPT_TextureMesh::bLocalSeamLeveling)->default_value(true), "generate uniform texture patch borders using local seam leveling") 75 | ("texture-size-multiple", boost::program_options::value(&OPT_TextureMesh::nTextureSizeMultiple)->default_value(0), "texture size should be a multiple of this value (0 - power of two)") 76 | ("patch-packing-heuristic", boost::program_options::value(&OPT_TextureMesh::nRectPackingHeuristic)->default_value(3), "specify the heuristic used when deciding where to place a new patch (0 - best fit, 3 - good speed, 100 - best speed)") 77 | ("empty-color", boost::program_options::value(&OPT_TextureMesh::nColEmpty)->default_value(0x00696969), "color used for faces not covered by any image") 78 | ("orthographic-image-resolution", boost::program_options::value(&OPT_TextureMesh::nOrthoMapResolution)->default_value(0), "orthographic image resolution to be generated from the textured mesh - the mesh is expected to be already geo-referenced or at least properly oriented (0 - disabled)") 79 | ; 80 | 81 | // hidden options, allowed both on command line and 82 | // in config file, but will not be shown to the user 83 | boost::program_options::options_description hidden("Hidden options"); 84 | hidden.add_options() 85 | ("mesh-file", boost::program_options::value(&OPT_TextureMesh::strMeshFileName), "mesh file name to texture (overwrite the existing mesh)") 86 | ; 87 | 88 | boost::program_options::options_description cmdline_options; 89 | cmdline_options.add(generic).add(config).add(hidden); 90 | 91 | boost::program_options::options_description config_file_options; 92 | config_file_options.add(config).add(hidden); 93 | 94 | boost::program_options::positional_options_description p; 95 | p.add("input-file", -1); 96 | 97 | try { 98 | 99 | boost::program_options::store(boost::program_options::command_line_parser((int)argc, argv).options(cmdline_options).positional(p).run(), OPT_TextureMesh::vm); 100 | boost::program_options::notify(OPT_TextureMesh::vm); 101 | INIT_WORKING_FOLDER; 102 | // parse configuration file 103 | std::ifstream ifs(MAKE_PATH_SAFE(OPT_TextureMesh::strConfigFileName)); 104 | if (ifs) { 105 | boost::program_options::store(parse_config_file(ifs, config_file_options), OPT_TextureMesh::vm); 106 | boost::program_options::notify(OPT_TextureMesh::vm); 107 | } 108 | } 109 | catch (const std::exception& e) { 110 | LOG(e.what()); 111 | return false; 112 | } 113 | 114 | 115 | OPEN_LOGFILE(MAKE_PATH(APPNAME _T("-") + Util::getUniqueName(0) + _T(".log")).c_str()); 116 | 117 | 118 | // validate input 119 | Util::ensureValidPath(OPT_TextureMesh::strInputFileName); 120 | Util::ensureUnifySlash(OPT_TextureMesh::strInputFileName); 121 | if (OPT_TextureMesh::vm.count("help") || OPT_TextureMesh::strInputFileName.IsEmpty()) { 122 | boost::program_options::options_description visible("Available options"); 123 | visible.add(generic).add(config); 124 | GET_LOG() << visible; 125 | } 126 | if (OPT_TextureMesh::strInputFileName.IsEmpty()) 127 | return false; 128 | OPT_TextureMesh::strExportType = OPT_TextureMesh::strExportType.ToLower() == _T("obj") ? _T(".obj") : _T(".ply"); 129 | 130 | 131 | Util::ensureValidPath(OPT_TextureMesh::strOutputFileName); 132 | Util::ensureUnifySlash(OPT_TextureMesh::strOutputFileName); 133 | if (OPT_TextureMesh::strOutputFileName.IsEmpty()) 134 | OPT_TextureMesh::strOutputFileName = Util::getFileFullName(OPT_TextureMesh::strInputFileName) + _T("_texture.J3D"); 135 | 136 | Process::setCurrentProcessPriority((Process::Priority)OPT_TextureMesh::nProcessPriority); 137 | #ifdef _USE_OPENMP 138 | if (OPT_TextureMesh::nMaxThreads != 0) 139 | omp_set_num_threads(OPT_TextureMesh::nMaxThreads); 140 | #endif 141 | 142 | #ifdef _USE_BREAKPAD 143 | // start memory dumper 144 | MiniDumper::Create(APPNAME, WORKING_FOLDER); 145 | #endif 146 | 147 | Util::Init(); 148 | return true; 149 | } 150 | 151 | void MVSEngine::Finalize_TextureMesh() 152 | { 153 | #if TD_VERBOSE != TD_VERBOSE_OFF 154 | // print memory statistics 155 | Util::LogMemoryInfo(); 156 | #endif 157 | 158 | } 159 | 160 | int MVSEngine::TextureMesh(int num, char* cmd[]) 161 | { 162 | #ifdef _DEBUGINFO 163 | _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);// | _CRTDBG_CHECK_ALWAYS_DF); 164 | #endif 165 | int argc = num; 166 | LPCTSTR* argv = (LPCTSTR*)cmd; 167 | if (!Initialize_TextureMesh(argc, argv)) 168 | return EXIT_FAILURE; 169 | 170 | Scene scene(OPT_TextureMesh::nMaxThreads); 171 | // load and texture the mesh 172 | if (!scene.Load(MAKE_PATH_SAFE(OPT_TextureMesh::strInputFileName))) 173 | return EXIT_FAILURE; 174 | if (!OPT_TextureMesh::strMeshFileName.IsEmpty()) { 175 | // load given mesh 176 | scene.mesh.Load(MAKE_PATH_SAFE(OPT_TextureMesh::strMeshFileName)); 177 | } 178 | if (scene.mesh.IsEmpty()) { 179 | VERBOSE("error: empty initial mesh"); 180 | return EXIT_FAILURE; 181 | } 182 | const String baseFileName(MAKE_PATH_SAFE(Util::getFileFullName(OPT_TextureMesh::strOutputFileName))); 183 | if (OPT_TextureMesh::nOrthoMapResolution && !scene.mesh.textureDiffuse.empty()) { 184 | goto ProjectOrtho; 185 | } 186 | 187 | { 188 | 189 | if (OPT_TextureMesh::fDecimateMesh < 1.f) { 190 | ASSERT(OPT_TextureMesh::fDecimateMesh > 0.f); 191 | scene.mesh.Clean(OPT_TextureMesh::fDecimateMesh, 0.f, false, OPT_TextureMesh::nCloseHoles, 0u, false); 192 | scene.mesh.Clean(1.f, 0.f, false, 0, 0u, true); // extra cleaning to remove non-manifold problems created by closing holes 193 | #if TD_VERBOSE != TD_VERBOSE_OFF 194 | if (VERBOSITY_LEVEL > 3) 195 | scene.mesh.Save(baseFileName + _T("_decim") + OPT_TextureMesh::strExportType); 196 | #endif 197 | } 198 | 199 | 200 | TD_TIMER_START(); 201 | if (!scene.TextureMesh(OPT_TextureMesh::nResolutionLevel, OPT_TextureMesh::nMinResolution, OPT_TextureMesh::fOutlierThreshold, OPT_TextureMesh::fRatioDataSmoothness, OPT_TextureMesh::bGlobalSeamLeveling, OPT_TextureMesh::bLocalSeamLeveling, OPT_TextureMesh::nTextureSizeMultiple, OPT_TextureMesh::nRectPackingHeuristic, Pixel8U(OPT_TextureMesh::nColEmpty))) 202 | return EXIT_FAILURE; 203 | VERBOSE("Mesh texturing completed: %u vertices, %u faces (%s)", scene.mesh.vertices.GetSize(), scene.mesh.faces.GetSize(), TD_TIMER_GET_FMT().c_str()); 204 | 205 | scene.Save(baseFileName + _T(".J3D"), (ARCHIVE_TYPE)OPT_TextureMesh::nArchiveType); 206 | scene.mesh.Save(baseFileName + OPT_TextureMesh::strExportType); 207 | #if TD_VERBOSE != TD_VERBOSE_OFF 208 | if (VERBOSITY_LEVEL > 2) 209 | scene.ExportCamerasMLP(baseFileName + _T(".mlp"), baseFileName + OPT_TextureMesh::strExportType); 210 | #endif 211 | } 212 | 213 | if (OPT_TextureMesh::nOrthoMapResolution) { 214 | ProjectOrtho: 215 | Image8U3 imageRGB; 216 | Image8U imageRGBA[4]; 217 | Point3 center; 218 | scene.mesh.ProjectOrthoTopDown(OPT_TextureMesh::nOrthoMapResolution, imageRGB, imageRGBA[3], center); 219 | Image8U4 image; 220 | cv::split(imageRGB, imageRGBA); 221 | cv::merge(imageRGBA, 4, image); 222 | image.Save(baseFileName + _T("_orthomap.png")); 223 | SML sml(_T("OrthoMap")); 224 | sml[_T("Center")].val = String::FormatString(_T("%g %g %g"), center.x, center.y, center.z); 225 | sml.Save(baseFileName + _T("_orthomap.txt")); 226 | } 227 | 228 | Finalize_TextureMesh(); 229 | return EXIT_SUCCESS; 230 | } 231 | -------------------------------------------------------------------------------- /MVSEngine/resource.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoulBasic/J3DReconstruction/dd519e8652aa9399b1a0965dfc60e395ab99c533/MVSEngine/resource.h -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # J3D模型重建系统 2 | #### **J3DReconstruction** 3 | 4 | #### 本应用是Windows下基于openMVG+openMVS的三维重建解决方案以及基于Qt的可视化桌面平台 5 | 6 | 程序为摄影测量影像的三维重建提供解决方案,可将摄影测量的原始影像进行特征匹配重建为三维点云,重建深度图为点云加密,三角网重建,纹理映射,生成纹理模型。 7 | 8 | 若有幸您能喜欢的话,请为我点上一颗star,谢谢啦。 9 | 10 | 11 | 12 | ### 简介 13 | 14 | 本项目主要是前段时间因学业及项目需要,去鼓捣了一下多目三维重建这个东西,然后其实发现国外开源的框架和库不少,我索性就照着openMVG和openMVS两个开源库做了一个二次开发,把开源库大体上的功能封装起来,用qt做了一个windows桌面程序,也免得大家去linux下面编译各种库,在脚本里面跑程序了。本来许多人也并不是为了鼓捣这源码的,只是想看看这些开源库的效果而已嘛。 15 | 16 | 如果有想在windows下配置环境编译的同学可以fork下来研究研究,由于是个人项目,若是有什么bug或者其他问题可以私信联系我。或者不愿意麻烦的,可以直接下载编译后的二进制程序直接Windows下运行就行,希望给同是研究三维重建这一块儿的同学们帮上一些小忙。 17 | 18 | 由于windows下配置相关三方库的操作步骤较为繁琐,如果同学恰巧和我一样也是用的msvc2017_64的编译器(**vs2017**或者是带有**v141平台工具集的vs2019**),那么可以使用我上传的二进制依赖库,来快速进行环境的配置,我也简单做了一个小视频,来帮助大家快速地部署生成项目 19 | 20 | 视频地址:[https://www.bilibili.com/video/BV1p5411g7Ht/](https://www.bilibili.com/video/BV1p5411g7Ht/) 21 | 22 | 二进制依赖库包地址链接:[https://pan.baidu.com/s/1ZEh6Ts7V4JAAb15y5r89RQ](https://pan.baidu.com/s/1ZEh6Ts7V4JAAb15y5r89RQ) 提取码:40zz 23 | (2022.03.24)因msvc2017编译器升级,使隐式转换的条件更苛刻,会导致使用二进制依赖库的小伙伴编译不过,提示无法将参数 1 从“SEACAVE::String”转换为“SEACAVE::String &,解决方案可以参考https://github.com/SoulBasic/J3DReconstruction/issues/2 24 | 25 | 26 | ### 功能 27 | 28 | #### Function 29 | 30 | 本应用实现了如下功能: 31 | 32 | openMVG库中基于SIFT及其他几种特征子算法的特征提取、特征匹配的封装 33 | 34 | openMVG库中提供的全局及增量sfm、sfp、空中三角测量、生成稀疏点云和相机姿态信息的封装 35 | 36 | openMVS库中提供的密集点云生成管道封装 37 | 38 | openMVS库中提供的三角网模型重建及精炼管道封装 39 | 40 | openMVS库中提供的纹理映射管道封装 41 | 42 | openMVS库中提供的基于GLFW库的可视化模型预览封装 43 | 44 | OSG库中提供的基于openGL库的可视化模型预览及格式转换封装(转换到osgb格式可以在smart3D打开、若本机安装obj2gltf插件可转换到gltf供Cesium加载) 45 | 46 | 基于空间前方交会的图像像点坐标到实景三维坐标的映射可视化组件 47 | 48 | 49 | 50 | ### 构建 51 | 52 | #### Build 53 | 54 | 本项目在开发时的环境如下: 55 | 56 | Windows 10 + VisualStudio 2017 57 | 58 | openMVG 59 | 60 | openMVS 61 | 62 | (本项目所用的openMVG、openMVS在原项目的基础上有做细微更改,实际构建使用的代码也在我的仓库中,有需要的同学可以一起使用,若使用原版库,则J3DGUI中预览模型只能使用兼容模式) 63 | 64 | openCV(openCV 3.4.1 & openCV 3.4.1_contrib) 65 | 66 | VCG:(VCG 1.0.0) 67 | 68 | CGAL(CGAL 5.0.2 x64) 69 | 70 | Boost(boost_1_67_0-msvc-14.1-64 ) 71 | 72 | QT (qt-opensource-windows-x86-5.14.2) 73 | 74 | LibQGLViewer(libQGLViewer-2.6.4) 75 | 76 | Ceres(ceres-solver-1.14.0) 77 | 78 | Eigen (eigen-3.3.7) 79 | 80 | GoogleFlags (gflags 2.2.2) 81 | 82 | GoogleLog (glog 0.3.3) 83 | 84 | CXSParse(CXSParse 3.1.1) 85 | 86 | LIBJPEG(jpeg-9d) 87 | 88 | GLFW(glfw-3.3.2) 89 | 90 | LIBPNG(libpng 1.6.37) 91 | 92 | GLEW(glew-2.1.0) 93 | 94 | GDAL(gdal-2.0.3) 95 | 96 | 97 | 98 | ##### Windows下构建过程: 99 | 100 | 1.请将上述库和环境一一构建(该项目基于x64,建议构建x64的库),其中三方库需要在每个vs工程中INSTALL二进制库(INSTALL后库目录会在C盘的Program Files中,不INSTALL也可以,只要能找到具体include目录和lib目录及文件即可) 101 | 102 | 2.fork并pull本项目到本地,然后在vs中打开本项目代码,(由于需要用到qt,请在vs中下载qt拓展,并配置好相关编译器(我用的是msvc2017_64)) 103 | 104 | 3.检查所有项目(J3DMVSEngine、J3DViewRender、J3DEngine、J3DGUI、J3DViewer)的项目属性,并检查各个三方库的include目录(C++-常规-附加包含目录)、lib目录(链接器-常规-附加库目录)(链接器-输入-附加依赖项)是否正确(我的三方库统一安装在C:\openMVS下,如果不是安装于此,需要进行相关的修改) 105 | 106 | 107 | 108 | ### 示例 109 | 110 | #### Example 111 | 112 | ​ 构建并编译J3DReconstruction,执行J3DEngine以及J3DGUI应用程序,可实现在J3DGUI程序中可视化调用openMVG及openMVS的构建管道 113 | 114 | ​ 管道中算法实现及介绍可参考openMVG及openMVS的Wiki页面: 115 | 116 | ​ [https://github.com/cdcseacave/openMVS/wiki]() 117 | 118 | ​ [https://github.com/openMVG/openMVG/wiki]() 119 | 120 | 121 | 122 | ##### SFM及MVS重建模块: 123 | 124 | 这里使用一组照片作为例子 125 | (照片来源:[https://www1.maths.lth.se/matematiklth/personal/calle/dataset/dataset.html](https://www1.maths.lth.se/matematiklth/personal/calle/dataset/dataset.html)) 126 | 127 | 将源图片放在一个文件夹里 128 | 若是相机型号比较冷门,需要在文件-添加相机参数中添加相机的几项参数(这个参数可以参考下图去图片元数据中获取,若没有元数据或不齐全,可以去google一下对应相机的具体参数,程序是通过以下公式进行粗略计算的) 129 | $$ 130 | sensorWidth = 2 * ( focal * std::tan( (0.5 * FOV)/57.296) ); 131 | $$ 132 | 若是利用焦距/FOV等参数计算不够精确,也可自行获取相机型号及传感器宽度值手动导入SenWidDB.txt 133 | 134 | **(※※※注:若SFM步骤时提示There is no defined intrinsic data in order to compute an essential matrix for the initial pair,则说明缺失源图片的相机传感器参数,需要根据以下图片中的情况进行手动添加,否则会SFM重建失败※※※)** 135 | 136 | ![senwidinfo](images/senwidinfo.png) 137 | 138 | 添加之后在SenWidDB.txt中理应也会出现对应的 相机型号;传感器宽度值 139 | 140 | 若SenWidDB.txt中无源图片对应的相机型号,会出现SFM重建失败等错误。 141 | 142 | 当然其实大多数的相机都有预设值,源于官方数据,不需要手动添加的的,具体可以在程序路径中的SenWidDB.txt查询。 143 | 144 | 我也提供了一组测试图片,在项目的test文件夹中,可自行下载并添加NIKON D60的传感器参数(23.6mm) 145 | 146 | 147 | 148 | 然后在程序中中选择全自动三维重建选项,(若提示无缓存访问权限,请用管理员身份运行)填写源图片路径、输出重建结果路径以及其他参数,确认后即可跟随管道完成重建任务,最终可在J3DGUI程序中可视化查看结果 149 | 150 | **(若是全自动出现程序未响应或者其他错误,可以尝试分步进行,目前发现偶尔在win7遇到这样的问题)** 151 | 152 | 153 | 154 | ![engine](images/engine.png) 155 | 156 | 157 | 158 | ![参数设置](images/paras.png) 159 | 160 | 程序运行结束后,在输出路径中会有对应的重建文件,用J3DGUI或用其他第三方模型预览器打开都可。 161 | 162 | ![预览模型](images/gui.png) 163 | 164 | 可视化预览也支持以下键盘操作 165 | 166 | 调整视角:鼠标左键按住拖动 167 | 调整大小:鼠标滚轮调整 168 | 调整视点:鼠标双击模型某 点/面 将其居中 169 | 显示相机位置:C键 170 | 渲染点云:P键 171 | 调整点云中的点大小:A/S键 A键放大 S键缩小 172 | 渲染网格:M键 173 | 渲染纹理:T键 174 | 175 | 如果需要预览或查看osg或osgb格式模型,则需要在软件路径下含有OSG库中的osgviewer.exe和osgconv.exe 176 | 177 | ##### 坐标映射模块: 178 | 179 | ​ 从J3DGUI的**文件-坐标映射**打开,选择完整运行SFM引擎中的步骤后的目录(即含有SparseCloud.J3D文件的重建结果目录),以及目标地形DSM数据(需使用三方软件生成,如CC或photoscan等)。 180 | 181 | 注意:需要SFM重建数据和DSM数据的地理参考相同(J3D的SFM引擎默认使用ECEF坐标系),则需三方软件生成ECEF坐标系下的DSM文件,如果无法获取ECEF坐标系下的DSM数据,则建议使用J3DGUI中 **分步三维重建-导入其他SFM数据**中的功能,导入其他软件生成的Blocks Exchange XML格式的SFM数据,只需保证生成XML数据时使用的地理参考和DSM数据相同即可(建议使用cgcs2000高斯投影坐标等米制XYZ数据,可以获得较好映射效果) 182 | 183 | 导入后可以选择可用的影像,在影像上右键选择像点,即可映射对应点的地理坐标,并保存到点集,可将点集输出为dxf格式在Auto CAD等软件中预览。 184 | 185 | ![坐标映射功能](images/intersector.jpg) 186 | 187 | 188 | 189 | 190 | 191 | ### 版权及证书 192 | 193 | #### J3DReconstruction License (include OpenMVG and OpenMVS License) 194 | 195 | ##### Included third parties license details 196 | 197 | Copyright (c) 2020 Michael Jiao. 198 | 199 | J3DReconstruction is licensed under an MIT/X style license. And this program includes works distributed under the terms of another license(s) and other copyright notice(s). 200 | 201 | * __SeaCave__
202 | Copyright (c) 2007 SEACAVE SRL. 203 | Licensed under a [Boost license](http://www.boost.org/users/license.html). 204 | * __easyexif__
205 | [https://github.com/mayanklahiri/easyexif](https://github.com/mayanklahiri/easyexif) 206 | Copyright (c) 2010 Mayank Lahiri. 207 | Distributed under the [New BSD License](http://opensource.org/licenses/BSD-3-Clause). 208 | * __histogram__
209 | Copyright (c) Jansson Consulting & Pierre Moulon. 210 | Licensed under the [MPL2 license](http://opensource.org/licenses/MPL-2.0). 211 | * __htmlDoc__
212 | Copyright (c) Pierre Moulon. 213 | Licensed under the [MPL2 license](http://opensource.org/licenses/MPL-2.0). 214 | * __ACRANSAC__
215 | Copyright (c) Pierre Moulon. 216 | Licensed under the [MPL2 license](http://opensource.org/licenses/MPL-2.0). 217 | * __stlplus3__
218 | [http://stlplus.sourceforge.net](http://stlplus.sourceforge.net) 219 | Copyright (c) 1999-2004 Southampton University, 2004 onwards Andy Rushton. All rights reserved. 220 | Licensed under the [BSD license](http://opensource.org/licenses/bsd-license.php). 221 | * __rectangle-bin-packing__
222 | [http://clb.demon.fi/projects/rectangle-bin-packing](http://clb.demon.fi/projects/rectangle-bin-packing) 223 | Copyright (c) Jukka Jylänki. 224 | Released to Public Domain, do whatever you want with it. 225 | * __ceres-solver__
226 | [http://ceres-solver.org](http://ceres-solver.org) 227 | Copyright 2015 Google Inc. All rights reserved. 228 | Licensed under the [New BSD license](http://ceres-solver.org/license.html). 229 | * __lmfit__
230 | [http://apps.jcns.fz-juelich.de/doku/sc/lmfit](http://apps.jcns.fz-juelich.de/doku/sc/lmfit) 231 | Copyright (c) Joachim Wuttke. 232 | Licensed under the [FreeBSD license](http://opensource.org/licenses/BSD-2-Clause). 233 | * __TRWS__
234 | [http://pub.ist.ac.at/~vnk/software.html](http://pub.ist.ac.at/~vnk/software.html) 235 | Copyright (c) Vladimir Kolmogorov. 236 | Licensed under the [MSR-SSLA license](http://research.microsoft.com/en-us/um/people/antr/vrr/vrr/license.htm). 237 | * __ibfs__
238 | [http://www.cs.tau.ac.il/~sagihed/ibfs](http://www.cs.tau.ac.il/~sagihed/ibfs) 239 | Copyright (c) Haim Kaplan and Sagi Hed. 240 | This software can be used for research purposes only. 241 | * __loopy-belief-propagation__
242 | [https://github.com/nmoehrle/mvs-texturing](https://github.com/nmoehrle/mvs-texturing) 243 | Copyright (c) Michael Waechter. 244 | Licensed under the [BSD 3-Clause license](http://opensource.org/licenses/BSD-3-Clause). 245 | * __eigen__
246 | [http://eigen.tuxfamily.org](http://eigen.tuxfamily.org) 247 | Copyright (c) Eigen authors. 248 | Distributed under the [MPL2 license](http://opensource.org/licenses/MPL-2.0). 249 | Compiled with EIGEN_MPL2_ONLY to ensure MPL2 compatible code. 250 | * __OpenCV__
251 | [http://opencv.org](http://opencv.org) 252 | Copyright (c) 2015, Itseez. 253 | Licensed under the [BSD license](http://opensource.org/licenses/bsd-license.php). 254 | * __Boost__
255 | [http://www.boost.org](http://www.boost.org) 256 | Copyright Beman Dawes, David Abrahams, 1998-2005. 257 | Copyright Rene Rivera 2004-2007. 258 | Licensed under a [Boost license](http://www.boost.org/users/license.html). 259 | * __CGAL__
260 | [http://www.cgal.org](http://www.cgal.org) 261 | Copyright (c) 1995-2015 The CGAL Project. All rights reserved. 262 | Licensed under the [GPL](http://www.gnu.org/copyleft/gpl.html)/[LGPL license](http://www.gnu.org/copyleft/lesser.html). 263 | * **cmdLine** 264 | Copyright (c) Pascal Monasse. Licensed under the [MPL2 license](http://opensource.org/licenses/MPL-2.0). 265 | * **CppUnitLite** (optional) 266 | Public domain. 267 | * **cxsparse** (optional) 268 | Copyright (c) 2006-2012, Timothy A. Davis. Distributed under the [GNU LGPL license](http://opensource.org/licenses/lgpl-license). 269 | * **easyexif** 270 | Copyright (c) 2010 Mayank Lahiri. Distributed under the [New BSD License](http://opensource.org/licenses/BSD-3-Clause). 271 | * **fast** 272 | Copyright (c) 2006, 2008 Edward Rosten Distributed under the [New BSD License](https://opensource.org/licenses/BSD-3-Clause). 273 | * **flann** 274 | Copyright (c) 2008-2011 Marius Muja ([mariusm@cs.ubc.ca](mailto:mariusm@cs.ubc.ca)). All rights reserved. Copyright (c) 2008-2011 David G. Lowe ([lowe@cs.ubc.ca](mailto:lowe@cs.ubc.ca)). All rights reserved. Distributed under the [BSD License](http://www.opensource.org/licenses/bsd-license.php). 275 | * **histogram** 276 | Copyright (c) Jansson Consulting & Pierre Moulon. Licensed under the [MPL2 license](http://opensource.org/licenses/MPL-2.0). 277 | * **hnswlib** 278 | Copyright (c) hnswlib authors. Licensed under the [Apache-2.0 license](https://opensource.org/licenses/Apache-2.0). 279 | * **htmlDoc** 280 | Copyright (c) Pierre Moulon. Licensed under the [MPL2 license](http://opensource.org/licenses/MPL-2.0). 281 | * **jpeg** 282 | Copyright (c) Independent JPEG Group License. Licensed under the [Independent JPEG Group License](https://spdx.org/licenses/IJG). 283 | * **lemon** 284 | Copyright (c) Lemon authors. Licensed under the [Boost License 1.0](http://www.boost.org/LICENSE_1_0.txt). 285 | * **png** (optional) 286 | Copyright (c) 2004, 2006-2015 Glenn Randers-Pehrson Licensed under the [lib png license](http://www.libpng.org/pub/png/src/libpng-LICENSE.txt). 287 | * **progress** 288 | Copyright (c) Pierre MOULON Licensed under the [MPL2 license](http://opensource.org/licenses/MPL-2.0). 289 | * **stlplus3** 290 | Copyright (c) 1999-2004 Southampton University, 2004 onwards Andy Rushton. All rights reserved. Licensed under the [BSD license](http://opensource.org/licenses/bsd-license.php). 291 | * **GDAL** 292 | All Copyright Licensed under the [GDAL license](https://github.com/openscenegraph/OpenSceneGraph/blob/master/LICENSE.txt). 293 | * **tiff** (optional) 294 | Copyright (c) 1988-1997 Sam Leffler Copyright (c) 1991-1997 Silicon Graphics, Inc. Licensed under a BSD-like license. 295 | * **vectorGraphics** 296 | Copyright (c) Pierre Moulon Licensed under the [MPL2 license](http://opensource.org/licenses/MPL-2.0). 297 | * **zlib** (optional) 298 | Copyright (C) 1995-2005 Jean-loup Gailly Licensed under the [zlib license](http://opensource.org/licenses/Zlib). 299 | * 300 | -------------------------------------------------------------------------------- /Viewer/Viewer.cpp: -------------------------------------------------------------------------------- 1 | #pragma comment( linker, "/subsystem:\"windows\" /entry:\"mainCRTStartup\"" ) 2 | #include "Common.h" 3 | #include "Scene.h" 4 | using namespace VIEWER; 5 | int main(int argc, char* argv[]) 6 | { 7 | auto J3DViewer = new VIEWER::Scene(); 8 | 9 | if (!J3DViewer->Init(1361, 661, "J3D Viewer", argv[1])) 10 | return -1; 11 | J3DViewer->window.SetVisible(true); 12 | J3DViewer->Loop(); 13 | return 0; 14 | } 15 | -------------------------------------------------------------------------------- /Viewer/Viewer.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoulBasic/J3DReconstruction/dd519e8652aa9399b1a0965dfc60e395ab99c533/Viewer/Viewer.rc -------------------------------------------------------------------------------- /Viewer/Viewer.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {539D4A12-E76D-39BA-85A0-A66AD93ED390} 6 | 7 | 8 | {8D0CFA22-7291-36EA-9FFA-4E2B2583E8AC} 9 | 10 | 11 | {6c900fe2-d320-4ff9-96bf-ddd04e9e9f04} 12 | 13 | 14 | 15 | 16 | Source Files 17 | 18 | 19 | 20 | 21 | Resource Files 22 | 23 | 24 | -------------------------------------------------------------------------------- /Viewer/resource.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoulBasic/J3DReconstruction/dd519e8652aa9399b1a0965dfc60e395ab99c533/Viewer/resource.h -------------------------------------------------------------------------------- /images/engine.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoulBasic/J3DReconstruction/dd519e8652aa9399b1a0965dfc60e395ab99c533/images/engine.png -------------------------------------------------------------------------------- /images/gui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoulBasic/J3DReconstruction/dd519e8652aa9399b1a0965dfc60e395ab99c533/images/gui.png -------------------------------------------------------------------------------- /images/intersector.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoulBasic/J3DReconstruction/dd519e8652aa9399b1a0965dfc60e395ab99c533/images/intersector.jpg -------------------------------------------------------------------------------- /images/paras.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoulBasic/J3DReconstruction/dd519e8652aa9399b1a0965dfc60e395ab99c533/images/paras.png -------------------------------------------------------------------------------- /images/senwidinfo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoulBasic/J3DReconstruction/dd519e8652aa9399b1a0965dfc60e395ab99c533/images/senwidinfo.png -------------------------------------------------------------------------------- /resource/J3D_GUI.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoulBasic/J3DReconstruction/dd519e8652aa9399b1a0965dfc60e395ab99c533/resource/J3D_GUI.ico -------------------------------------------------------------------------------- /resource/default.ply: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoulBasic/J3DReconstruction/dd519e8652aa9399b1a0965dfc60e395ab99c533/resource/default.ply -------------------------------------------------------------------------------- /test/DSC_0333.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoulBasic/J3DReconstruction/dd519e8652aa9399b1a0965dfc60e395ab99c533/test/DSC_0333.JPG -------------------------------------------------------------------------------- /test/DSC_0334.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoulBasic/J3DReconstruction/dd519e8652aa9399b1a0965dfc60e395ab99c533/test/DSC_0334.JPG -------------------------------------------------------------------------------- /test/DSC_0335.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoulBasic/J3DReconstruction/dd519e8652aa9399b1a0965dfc60e395ab99c533/test/DSC_0335.JPG -------------------------------------------------------------------------------- /test/DSC_0336.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoulBasic/J3DReconstruction/dd519e8652aa9399b1a0965dfc60e395ab99c533/test/DSC_0336.JPG -------------------------------------------------------------------------------- /test/DSC_0337.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoulBasic/J3DReconstruction/dd519e8652aa9399b1a0965dfc60e395ab99c533/test/DSC_0337.JPG -------------------------------------------------------------------------------- /test/DSC_0338.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoulBasic/J3DReconstruction/dd519e8652aa9399b1a0965dfc60e395ab99c533/test/DSC_0338.JPG -------------------------------------------------------------------------------- /test/DSC_0339.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoulBasic/J3DReconstruction/dd519e8652aa9399b1a0965dfc60e395ab99c533/test/DSC_0339.JPG -------------------------------------------------------------------------------- /test/DSC_0340.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoulBasic/J3DReconstruction/dd519e8652aa9399b1a0965dfc60e395ab99c533/test/DSC_0340.JPG -------------------------------------------------------------------------------- /test/DSC_0341.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoulBasic/J3DReconstruction/dd519e8652aa9399b1a0965dfc60e395ab99c533/test/DSC_0341.JPG -------------------------------------------------------------------------------- /test/DSC_0342.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoulBasic/J3DReconstruction/dd519e8652aa9399b1a0965dfc60e395ab99c533/test/DSC_0342.JPG -------------------------------------------------------------------------------- /test/DSC_0343.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoulBasic/J3DReconstruction/dd519e8652aa9399b1a0965dfc60e395ab99c533/test/DSC_0343.JPG -------------------------------------------------------------------------------- /test/DSC_0344.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoulBasic/J3DReconstruction/dd519e8652aa9399b1a0965dfc60e395ab99c533/test/DSC_0344.JPG -------------------------------------------------------------------------------- /test/DSC_0345.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoulBasic/J3DReconstruction/dd519e8652aa9399b1a0965dfc60e395ab99c533/test/DSC_0345.JPG -------------------------------------------------------------------------------- /test/DSC_0346.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoulBasic/J3DReconstruction/dd519e8652aa9399b1a0965dfc60e395ab99c533/test/DSC_0346.JPG -------------------------------------------------------------------------------- /test/DSC_0347.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoulBasic/J3DReconstruction/dd519e8652aa9399b1a0965dfc60e395ab99c533/test/DSC_0347.JPG -------------------------------------------------------------------------------- /test/DSC_0348.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoulBasic/J3DReconstruction/dd519e8652aa9399b1a0965dfc60e395ab99c533/test/DSC_0348.JPG -------------------------------------------------------------------------------- /test/DSC_0349.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoulBasic/J3DReconstruction/dd519e8652aa9399b1a0965dfc60e395ab99c533/test/DSC_0349.JPG -------------------------------------------------------------------------------- /test/DSC_0350.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoulBasic/J3DReconstruction/dd519e8652aa9399b1a0965dfc60e395ab99c533/test/DSC_0350.JPG --------------------------------------------------------------------------------