On 25 Dez., 03:15, Yuval Levy <[email protected]> wrote:
> Probably Kay will find plenty of ways to improve on this.
I adressed the second issue as well. I made the script to produce
dummy images in the current working directory, prefixing the original
image names with 'dummy_', and I also made it output a modified pto
file using these names. Here's the modified routine:
def imgfile_to_i_lines ( scan ) :
scan.make_member_access() # makes accessing the data more
comfortable ;-)
for line in scan.i : # look at all i-lines
width = line.w.value # extract the desired values
height = line.h.value
# take the path away from the filename
# and prefix the name with 'dummy_'
name = 'dummy_' + os.path.basename ( line.n.value )
line.n.value = name # we modify the data in the scan
# generate random RGB values for the placeholder image
r = random.randint(0, 255)
g = random.randint(0, 255)
b = random.randint(0, 255)
# comopose the ImageMagick convert command
cmd = 'convert -size %dx%d xc:"rgb(%d,%d,%d)" %s' % (width,
height, r, g , b, name)
# tell me you're doing something
print cmd
# execute it
os.system(cmd)
# now we output a modified pto using filenames without a path
dummified_pto = "dummified_" + scan.filename # that's what we call
it
outfile = open ( dummified_pto , 'w' ) # open the file for
writing
scan.pto ( outfile ) # and write the
modified pto
Kay
--
You received this message because you are subscribed to the Google Groups
"Hugin and other free panoramic software" group.
A list of frequently asked questions is available at:
http://wiki.panotools.org/Hugin_FAQ
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at http://groups.google.com/group/hugin-ptx