ppwwyyxx / OpenPano

Automatic Panorama Stitching From Scratch

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add command line parameter --output filename or similar syntax in order to control output path, filename on command line

pageauc opened this issue · comments

I compiled source on Raspberry Pi 3B and runs OK. Wrote a python program to take timelapse images simultaneously on multiple RPI's and transmit data back to a hub using ZMQ to stitch images. The problem I am having is I would like to control the path and name of the output file from the command line. Currently I copy out.jpg to a destination folder but this has issues. Can you add this feature or point me to code location where I can add this feature and recompile my own version and/or post pull request. Looked at source but not sure where or how to add new feature

I want to generate a panoramic timelapse video. Had to build adjustable RPI supports to fine tune pointing and alignment.
Little tricky to get camera aligned correctly but stitching works once positioned correctly Pano Quality could be better and some inconsistencies with cropping so I may have to use video motion stabilization. Otherwise basic prototype code is working.

Let me know.
Thanks Claude ....

I took a look at main.cc and added logic to read argv[1] as the output file name to pass an variable output file name. This works and input image file paths are read from argv[2] to argc. I am having a problem getting the void work() function
CROP line below to accept a variable.
write_rgb(IMGFILE(filename), res)

Tried replacing filename with a string variable, pointer etc but no luck. It just creates a file with whatever text is between the IMGFILE( ) braces
Is there a way to get
write_rgv(IMGFILE(out), res);

to read a variable in place of the out name..
Thanks Claude ...

Code below works fine since I pass a full output file path name including .jpg extension. I removed the IMGFILE function and replaced with the pano_out variable derived from argv[1]. I have added help in the main.cc main() function. Will add --h, --help, --v --version, command syntax, etc checking for argc < 3 to display command syntax. This will make life easier when spawning parallel processes so the output files do not clash since the output file paths can be unique since I include a unique sequence number for each group of image stitch job input files eg argv[2] ....... with the same seq number for the output stitch filepath image file per argv[1].
will probably add a bit of error checking. Eg make sure argv[1] has a file extension and valid path directory.

string pano_out = argv[1];
printf("Pano dest Output FilePath is %s\n", pano_out.c_str());
write_rgb(pano_out, res); 

Regards
Claude ....

Just for your information I have modified the project to make the first parameter the output file path. Also updated the command help to be more helpful. Was a good learning experience for me and updated some of my c++ skills. For code changes to main.cc see my github repo at https://github.com/pageauc/OpenPano

Let me know if you would like a push as I have found this change is more useful for my needs.
Thanks a Lot for your OpenPano project. I can do pano in python opencv but I prefer your approach.
Is there a way to control the cropping size and position to make timelapse video better. I can use motion stabilization or post processing but would be nice to have it automatically done.
Thanks Again
Claude ....