First:  I updated the ptoimggen.py script to deal with Windows paths.  I love 
Python.  Attached (for Kay).

Now to Emaad:

On January 1, 2011 02:09:25 am Emad ud din Btt wrote:
> Hi Yuv,
> 
> CPfind has added cps to images now. It took 5997.08 seconds = 1.67 hours
> from command line. I am sending pto files with this email. Please! Check.

I started checking.  Then I realized that this is a waste of time.

How can you expect such a messy input to result in anything else but garbage?

You need to clean up your files; be more precise in your statements; and learn 
to quote properly; before you can expect any help.

FILES:

There are 173 images in the projects you attached.  These images belong to at 
least two categories, if not three:
* 76 are JPG images that seem to be out of camera JPGs
* 97 are TIFF images that from their file names seem to be the result of some 
enfusion
* of the 97 TIFF, some seem to be duplicate (e.g. PC180070_enfused_1.tif and
PC180070_enfused) and some seems to be enfused multiple times (e.g. 
PC180139_enfused_enfused.tif)

clean up!  either load only one set of enfused images; or one set of JPG 
images.  If the input is incomplete or garbage, you can't expect anything but 
garbage in return.  Don't blame it on Hugin, on cpfind, on autopano-SIFT-C, or 
on anything that is not between the back of your chair and your keyboard.


CPFIND:

cpfind has "successfully" connected the 173 images with 26007 points.  I don't 
have the actual images and can't judge the quality of those points, but there 
are definitely too many.  It is garbage-in garbage out.  Before doing anything 
you need to clean up the input images mess.


STATEMENTS:

You stated in [0] that "It also keeps iterating even if you leave it for 24 
hours.".  You stated this in relationship with CPfind and with Autopano-SIFT-
C.

You need to understand that once the CPs are generated, it is no longer CPfind 
or Autopano-SIFT-C.  It is the Optimizer.  And given the garbage fed into it, 
I don't blame the Optimizer for not coming up with anything meaningful.

Even if those were 26K real CPs, you would be competing for the largest 
gigapixel pano ever (assuming a recent full frame camera and 20% image 
overlap).  No wonder your computer churns for hours and hours.

This is not the first time that you are looking for help on this mailing list 
and make unclear statements about what went wrong [1].  This is not helpful, 
nor is it respectful of the time of those trying to help.

Moreover, your quoting is poor and makes it difficult to follow/understand a 
thread with you.  Please next time quote properly.

I have now wasted about half hour of my time to try to understand you.

If you want a reply from me in the future, you need to improve massively on 
your end.  You need to clean up your files; be more precise in your 
statements; and learn to quote properly; before you can expect any help.

Until then, I will ignore you / your posts.
Yuv


[0] http://groups.google.com/group/hugin-ptx/msg/9fc8f88d2ab211f7
[1] http://groups.google.com/group/hugin-ptx/t/c1f8d1d51e9f455a
#!/usr/bin/python
# -*- coding: utf-8 -*-

gpl = r"""
    ptoimggen.py - scan a pto file and generate placeholder images
                   and project file to use when debugging
                
    Copyright (C) 2010  Kay F. Jahnke
    Copyright (C) 2010  Yuval Levy

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
"""

import sys
import argparse
import parse_pto
import random
import os

# I needed a routine to scan i-lines in pto files and make sure Hugin does
# not complain about missing images or other things.

def imgfile_to_i_lines ( scan ) :


    scan.make_member_access() # makes accessing the data more comfortable ;-)

    # parse all the i lines
    for line in scan.i :

        # get the width, height, and image file name from the i line
        width = line.w.value        # extract the desired values
        height = line.h.value

        # remove the path from the filename
        # postfix the name with '_dummy.jpg' to avoid overwriting
        # existing files and to save space by using the jpg format
        name = os.path.basename ( line.n.value.replace ('\\', '/') ) + '_dummy.jpg'
        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)" -quality 1 %s' % (width, height, r, g , b, name)
        # tell me you're doing something
        print cmd
        # execute it
        os.system(cmd)
            
    # 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 )

def main() :
    
    # we create an argument parser
    
    parser = argparse.ArgumentParser (
        formatter_class=argparse.RawDescriptionHelpFormatter ,
        description = gpl + '''
    We ask users to post pto files that cause errors
    with their bug reports, but not the actual images to
    avoid straining bandwidth and online storage.

    The first thing a bug hunter does to analyze the pto
    file is to fix the images. This script does it by
    creating placeholder images and a dummy project file
    to play with.

    ''' )
    
    parser.add_argument('-p', '--pto',
                        metavar='<pto file>',
                        type=str,
                        help='pto file to be processed')

    if len ( sys.argv ) < 2 :
        parser.print_help()
        return

    args = parser.parse_args( sys.argv[1:] )

    scan = parse_pto.pto_scan ( args.pto )
    imgfile_to_i_lines ( scan )

# are we main? if so, do the main thing...

if __name__ == "__main__":
    main()

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to