Closed Reena24 closed 10 years ago
I suggest you try to use the newer version of the SfM library: https://github.com/royshil/SfM-Toy-Library It doesn't use PCL anymore and has a more streamlined build so it may be easier to use, but it has the same core SfM code.
Hi i did what u suggested of trying the new version of Sfm library : https://github.com/royshil/SfM-Toy-Library but i get compilation error when i try to build it 2>------ Build started: Project: SfMToyLibrary, Configuration: Release Win32 ------ 2>Build started 3/8/2014 7:50:20 PM. 2>InitializeBuildStatus: 2> Touching "SfMToyLibrary.dir\Release\SfMToyLibrary.unsuccessfulbuild". 2>CustomBuild: 2> All outputs are up-to-date. 2>cl : Command line error D8021: invalid numeric argument '/Wno-sign-compare' 2> 2>Build FAILED. 2> 2>Time Elapsed 00:00:00.11 3>------ Build started: Project: SfMToyUI, Configuration: Release Win32 ------ 3>Build started 3/8/2014 7:50:20 PM. 3>InitializeBuildStatus: 3> Touching "SfMToyUI.dir\Release\SfMToyUI.unsuccessfulbuild". 3>CustomBuild: 3> All outputs are up-to-date. 3>ClCompile: 3> ViewerInterface.cpp 3> sfmviewer.cpp 3> moc_ViewerInterface.cxx 3> moc_sfmviewer.cxx 3> main.cpp 3>C:\Users\Reeba\Desktop\SfM-Toy-Library-master\SfMToyLib\Distance.h(70): warning C4172: returning address of local variable or temporary 3> Generating Code... 3>LINK : fatal error LNK1181: cannot open input file 'SfMToyLib\Release\SfMToyLibrary.lib' 3> 3>Build FAILED. 3> 3>Time Elapsed 00:00:18.09 4>------ Skipped Build: Project: ALL_BUILD, Configuration: Release Win32 ------ 4>Project not selected to build for this solution configuration ========== Build: 1 succeeded, 2 failed, 0 up-to-date, 1 skipped ==========
Looks like the .lib file was not built, try to clean and re-build the project
I tried clean and rebuilt a lot of times but i still get the same error
It finally worked thankyou for your help
@Reena24 I just have the same error:LINK : fatal error LNK1181: cannot open input file 'SfMToyLib\Release\SfMToyLibrary.lib' How did you solve it?
Hello i have made the required changes in the code and now I am able to configure the code. I have few build error which i have no clue on how to solve as am a beginner
This post has NOT been accepted by the mailing list yet. This post was updated on Mar 04, 2014; 1:04pm. Hi I am trying to execute the code from https://github.com/MasteringOpenCV/code/tree/master/Chapter4_StructureFromMotion I have built it using cmake but i get these error
1>------ Build started: Project: ZERO_CHECK, Configuration: Debug Win32 ------ 1>Build started 3/4/2014 1:37:00 PM. 1>InitializeBuildStatus: 1> Creating "Win32\Debug\ZERO_CHECK\ZERO_CHECK.unsuccessfulbuild" because "AlwaysCreate" was specified. 1>FinalizeBuildStatus: 1> Deleting file "Win32\Debug\ZERO_CHECK\ZERO_CHECK.unsuccessfulbuild". 1> Touching "Win32\Debug\ZERO_CHECK\ZERO_CHECK.lastbuildstate". 1> 1>Build succeeded. 1> 1>Time Elapsed 00:00:00.07 2>------ Build started: Project: ExploringSfMExec, Configuration: Debug Win32 ------ 2>Build started 3/4/2014 1:37:00 PM. 2>InitializeBuildStatus: 2> Touching "ExploringSfMExec.dir\Debug\ExploringSfMExec.unsuccessfulbuild". 2>CustomBuild: 2> All outputs are up-to-date. 2>ClCompile: 2> All outputs are up-to-date. 2>ManifestResourceCompile: 2> All outputs are up-to-date. 2>LINK : fatal error LNK1104: cannot open file 'C:\Qt\4.8.0\lib\QtGuid4.lib' 2> 2>Build FAILED. 2> 2>Time Elapsed 00:00:00.18 3>------ Build started: Project: ALL_BUILD, Configuration: Debug Win32 ------ 3>Build started 3/4/2014 1:37:00 PM. 3>InitializeBuildStatus: 3> Creating "Win32\Debug\ALL_BUILD\ALL_BUILD.unsuccessfulbuild" because "AlwaysCreate" was specified. 3>CustomBuild: 3> Build all projects 3>FinalizeBuildStatus: 3> Deleting file "Win32\Debug\ALL_BUILD\ALL_BUILD.unsuccessfulbuild". 3> Touching "Win32\Debug\ALL_BUILD\ALL_BUILD.lastbuildstate". 3> 3>Build succeeded. 3> 3>Time Elapsed 00:00:00.07 ========== Build: 2 succeeded, 1 failed, 1 up-to-date, 0 skipped ==========
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// The code is /*****
include "Common.h"
include <opencv2/highgui/highgui.hpp>
include <opencv2/imgproc/imgproc.hpp>
include
ifdef WIN32
endif
include <gl/GL.h>//#include <GL/gl.h>
include <gl/GLU.h>// #include <GL/glu.h>
ifndef WIN32
include
endif
using namespace std; using namespace cv;
std::vectorcv::DMatch FlipMatches(const std::vectorcv::DMatch& matches) { std::vectorcv::DMatch flip; for(int i=0;i<matches.size();i++) { flip.push_back(matches[i]); swap(flip.back().queryIdx,flip.back().trainIdx); } return flip; }
std::vectorcv::Point3d CloudPointsToPoints(const std::vector cpts) {
std::vectorcv::Point3d out;
for (unsigned int i=0; i<cpts.size(); i++) {
out.push_back(cpts[i].pt);
}
return out;
}
void GetAlignedPointsFromMatch(const std::vectorcv::KeyPoint& imgpts1, const std::vectorcv::KeyPoint& imgpts2, const std::vectorcv::DMatch& matches, std::vectorcv::KeyPoint& pt_set1, std::vectorcv::KeyPoint& pt_set2) { for (unsigned int i=0; i<matches.size(); i++) { // cout << "matches[i].queryIdx " << matches[i].queryIdx << " matches[i].trainIdx " << matches[i].trainIdx << endl; assert(matches[i].queryIdx < imgpts1.size()); pt_set1.push_back(imgpts1[matches[i].queryIdx]); assert(matches[i].trainIdx < imgpts2.size()); pt_set2.push_back(imgpts2[matches[i].trainIdx]); }
}
void KeyPointsToPoints(const vector& kps, vector& ps) {
ps.clear();
for (unsigned int i=0; i<kps.size(); i++) ps.push_back(kps[i].pt);
}
void PointsToKeyPoints(const vector& ps, vector& kps) {
kps.clear();
for (unsigned int i=0; i<ps.size(); i++) kps.push_back(KeyPoint(ps[i],1.0f));
}
define intrpmnmx(val,min,max) (max==min ? 0.0 : ((val)-min)/(max-min))
void drawArrows(Mat& frame, const vector& prevPts, const vector& nextPts, const vector& status, const vector& verror, const Scalar& _line_color)
{
double minVal,maxVal; minMaxIdx(verror,&minVal,&maxVal,0,0,status);
int line_thickness = 1;
}
bool hasEnding (std::string const &fullString, std::string const &ending) { if (fullString.length() >= ending.length()) { return (0 == fullString.compare (fullString.length() - ending.length(), ending.length(), ending)); } else { return false; } }
bool hasEndingLower (string const &fullString_, string const &ending) { string fullstring = fullString, ending = ending; transform(fullString.begin(),fullString_.end(),fullstring.begin(),::tolower); // to lower return hasEnding(fullstring,ending); }
void imshow250x250(const string& name, const Mat& patch) { Mat bigpatch; cv::resize(patch,bigpatch,Size(250,250)); imshow(name_,bigpatch); }
void open_imgs_dir(char* dir_name, std::vectorcv::Mat& images, std::vectorstd::string& images_names, double downscale_factor) { if (dir_name == NULL) { return; }
ifndef WIN32
//open a directory the POSIX way
else
//open a directory the WIN32 way HANDLE hFind = INVALID_HANDLE_VALUE; WIN32_FIND_DATA fdata;
endif
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////Is some header file missing ????? Actually i dont have a file like C:\Qt\4.8.0\lib\QtGuid4.lib but i do have qt installed it is opensource it is installed in E:\OpenCV\dep\qt\qt-everywhere-opensource-src-4.8.4 and i have also installed PCL 1.6.0 All-In-One Installer but i checked it does not have Qt 4.8.0 in the 3rd party library. What should i do