Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

126 image cap #30

Open
tonisvain opened this issue Jan 18, 2018 · 4 comments
Open

126 image cap #30

tonisvain opened this issue Jan 18, 2018 · 4 comments

Comments

@tonisvain
Copy link

tonisvain commented Jan 18, 2018

Hi.

I don't know if this is the correct place for issue but it came up using this library.
I have searched for fixes but have not found any.
Found only one good topic but it seems this has already been fixed.
link: libjpeg causes weird crash

I have looked over the files. All have permissions and are there.
If there are less than 126 images, then it runs fine but maxes out at 126 for no apparent reason.

MacBook-Air:~ user$ cmvs /Users/user/Desktop/scan/dense.nvm.cmvs/00/ 100 4
Reading bundle...513 cameras -- 274217 points in bundle file
***********
513 cameras -- 274217 points
Reading images: ******************************************************************************************************************************
Couldn't read image /Users/user/Desktop/scan/dense.nvm.cmvs/00/visualize/00000126.jpg
Unsupported iamge format found. Stop allocation: /Users/user/Desktop/scan/dense.nvm.cmvs/00/visualize/00000126.jpg
*Unrecognizable txt format

i tried to find what might cause the exception but could not really get that far.
also the camera file raised an exception. first thing i checked was if the .txt files have the correct data in them and they all do. so i have no idea why i got that error.

error: Couldn't read image /Users/user/Desktop/scan/dense.nvm.cmvs/00/visualize/00000126.jpg
program/base/image/camera.cc line 38:

void Ccamera::init(const std::string cname, const int maxLevel) {
  ...
  string header;
  ifstr >> header;
  if (header == "CONTOUR")
    m_txtType = 0;
  else if (header == "CONTOUR2")
    m_txtType = 2;
  else if (header == "CONTOUR3")
    m_txtType = 3;
  else {
    cerr << "Unrecognizable txt format" << endl;
    exit (1);
  }
  ...
  updateCamera();
}

This is where the actual error is from i think. and looks like it traces back to Cimg.h as it did in the other case that i linked to. but where exactly i have no idea.

error: Unsupported iamge format found. Stop allocation: /Users/user/Desktop/scan/dense.nvm.cmvs/00/visualize/00000126.jpg
program/base/image/image.cc line 124:

if (readAnyImage(m_name, m_images[0], m_widths[0], m_heights[0], fast) == 0) {
    cerr << "Unsupported iamge format found. Stop allocation: "
	 << m_name << endl;
    return;
  }

error: Unrecognizable txt format
program/base/image/image.cc line 532:

int Cimage::readAnyImage(const std::string file, std::vector<unsigned char>& image, int& width, int& height, const int fast)
{
  // Use CImg for image loading
  cimg_library::CImg<unsigned char> cimage;
  try
  {
     ...
  }
  catch(cimg_library::CImgException &e)
  {
    std::cerr << "Couldn't read image " << file.c_str() << std::endl;
    return 0;
  }
  return 1;
}

for reference, some of the library versions:

  • cairo 1.14.12
  • cgal 4.7
  • cmake 3.10.1
  • [email protected] 4.9.4
  • gdal 1.11.5_3
  • glew 2.1.0
  • graphicsmagick 1.3.27
  • gtk+ 2.24.28
  • imagemagick 7.0.7-21
  • jpeg 9b
  • lzlib 1.
  • sfcgal 1.2.2

any type of fix will be welcomed!

@pmoulon
Copy link
Owner

pmoulon commented Jan 18, 2018

The strange thing is that the progress bar is not at zero. So it seems that some image are correctly loaded. Seems like the first 125 images are correctly loaded.

I would advice this:

  1. Check that the image (126) is existing on your disk
  2. Check if the ram is not used (perhaps the image is not loaded due to a memory overflow)

You can try to use various value for downsampling the image to see if it's a memory issue or not

@tonisvain
Copy link
Author

tonisvain commented Jan 19, 2018

  1. I have checked, all the files are there and are correct.
  2. looking at the activity monitor, it does not show a substantial increase in memory usage, but that might not give a full picture. also tied to run other applications that use a lot of RAM at the same time so 7GB was in use and it still failed at the same point.

How much RAM does it typically need? i have 8GB of ram and there should be some extra using VM.
the pictures are actually quite small to begin with. 1086X724 and 300 - 500 KB per pic
How do i select the downsampling?

@pmoulon
Copy link
Owner

pmoulon commented Jan 22, 2018

Subsampling can be changed by changing the variable level in the pmvs file: https://www.di.ens.fr/pmvs/documentation.html

The other possibility is that your image folder contains many ..
You can try to rename your folder hierarchy to do not contains any ..

@pmoulon
Copy link
Owner

pmoulon commented Feb 6, 2018

I was able to reproduce the issue. For me it happens in image 510 out of a dataset of 800.
I would advise you to look to https://github.com/alexlocher/hpmvs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants