raboof / dualfisheye2equirectangular

Convert 'dual-fisheye' 360 image material to equirectangular mapping
MIT License
124 stars 37 forks source link

Segmentation fault #5

Open sabetAI opened 6 years ago

sabetAI commented 6 years ago

I'm trying to generate remapping for the Theta S with 1280x720 resolution images from dual fish eye cameras. I'm getting a segmentation fault when I run:

./projection -x xmap_thetaS.pgm -y ymap_thetaS.pgm -h 720 -w 1280 -r 640 -c 1280 -b 75 -m thetas

which is confusing. I thought projection was supposed to generate the .pgm files, not use pre-existing ones. What am I missing here?

raboof commented 6 years ago

You are correct projection should generated the .pgm files. Looks like a bug.

sabetAI commented 6 years ago

Any luck?

raboof commented 6 years ago

Sorry, I haven't had any free time to devote to this lately. Does running this command via gdb and looking at the backtrace reveal anything interesting?

josephduchesne commented 5 years ago

It's crashing on line 500 of the fork I've got:

image_x[(cfg.height - 1) - y][x + cfg.cols / 2] =(int)round(o.y) + cfg.crop + cfg.width / 2;

indices: 719, 640 x,y = 0,0 cfg.height = 720 cfg.cols = 1280

Works fine if you tweak the output size:

./projection -x xmap_thetaS.pgm -y ymap_thetaS.pgm -h 720 -w 1280 -r 720 -c 1440 -b 75 -m thetas
raboof commented 5 years ago

Would you be up for creating a PR to fix the issue?

josephduchesne commented 5 years ago

I'm afraid not at the moment, I was looking into this for work and changing the output parameters as a workaround was fine to let me proceed. I didn't get a chance to dig into how the function works enough to figure out why it's crashing (i.e.. what bounds checks are missing maybe).

raboof commented 5 years ago

Great that the workaround has unblocked you!

I was looking into this for work

Allocating some time to fix the bug would be a great way to give back!