face detection problem (was: f-spot-list Digest, Vol 76, Issue 4)



Hello Philip,

> Thanks for the example script.
> I checked it, but unfortunately, it does not work with my photos I tested.
> 
> I added a bit of debugging and attached a patch file for this file.
> Maybe you can check, what's wrong with it?
> 
> Error message is
> > terminate called after throwing an instance of 'int'
> > Abgebrochen
> 
> and occurs in the line after "Problem starts here" is printed.

You can't find a file.  If you didn't get more information, then the
file finding was wrapped in a try/except.  Print the Exception in the
except part to see where the problem occurs.

> 25a26
> >   print("Problems start here")
> 27a29
> >   print("Problem solved")
> 75,77c77,87
> <   img_name = sys.argv[1]
> <   output = sys.argv[2]
> <   image = cvLoadImage(sys.argv[1]);
> ---
> >   try:
> >     img_name = sys.argv[1]
> >   except:
> >     pass
> >   try:
> >     output = sys.argv[2]
> >   except:
> >     pass
> >   print("Starting cvLoadImage...")
> >   image = cvLoadImage(sys.argv[1])
> >   print("Image loaded, starting detection...")
> 78a89
> >   print("Detection done...")

That doesn't make much sense, does it?  The very least you could do is
to tell people to provide an argument and/or set a standard argument
if you find out that sys.argv[1] and sys.argv[2] do not exist (never
mind that there are better ways to handle that than with a try/except).

The OpenCV documentation comes with facedetect.py, you could give that
a try.

Or  
<plug> 
you could download my face-detection and classification suite from

http://svenutcke.de/sw/Face/

And see how you like this
</plug>

Sven
-- 
  .xxxx.       FACE-Tools                                      |||||
 |(o)(o)|      http://www.svenutcke.de/sw/Face/              {. @ @ .}
(  (__)  )                                                    |  o  |
  | __ |       Face detection and recognition                  \_U_/
   \__/        for photo-managers like F-Spot


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]