peakvisor / panorama

photo panorama converter
https://peakvisor.com
MIT License
65 stars 16 forks source link

Failed to allocate memory #1

Closed arpu closed 5 years ago

arpu commented 7 years ago

PeakVisor panorama translator... convert equirectangular panorama: [samples/equirectangular_panorama.jpg] into cube faces: [cube_faces] of 4096 pixels in dimension

[CImg] CImgInstanceException [instance(0,0,0,0,(nil),non-shared)] CImg::CImg(): Failed to allocate memory (64.0 Mio) for image (4096,4096,1,4). terminate called after throwing an instance of 'cimg_library::CImgInstanceException' what(): [instance(0,0,0,0,(nil),non-shared)] CImg::CImg(): Failed to allocate memory (64.0 Mio) for image (4096,4096,1,4). [1] 5377 killed ./panorama -i samples/equirectangular_panorama.jpg -o cube_faces

fedora 25

dangerden commented 7 years ago

It looks like the machine is short of memory. Could the app prevent this shortage?

RichardMorris commented 7 years ago

There is a bug in the program. Line 105 of panorama.cpp reads

CImg* imgOut[4];

it should read

CImg* imgOut[6];

This cause some random data to be written somewhere and may well the cause of your problem.

It is also worth noting that the standard image is 16384 * 8192 in size, that is 134,217,728 so it will take a big chunk of memory to run. You might have better results using a smaller image and reduced value for the -r parameter.

dangerden commented 7 years ago

Yes, that's true. There are 4 faces looking forward, backward, left, and right. But also for the complete cube it needs top and bottom.

dangerden commented 5 years ago

This was fixed long ago...