Package pycv :: Package cs :: Package cv :: Module detect :: Class ObjectDetectionInfo
[hide private]
[frames] | no frames]

Class ObjectDetectionInfo

source code

Instance Methods [hide private]
 
save_to_file(self, filepath) source code
 
load_from_file(self, filepath) source code
 
load_from_classifier(classifier, patch_len) source code
 
copy_from(self, ivecs, dvecs, patch_len) source code
 
_convert_Haar(self, lc, patch_len, c, is_improver, to_reset, reset_value=0)
Convert from THaarClassifier to a new classifier with scale s so that I can detect from image with different scales.
source code
 
_convert_Haars(self, cc, patch_len)
Convert from composite to a new classifier with scale s so that I can detect from image with different scales.
source code
Class Variables [hide private]
  ivecs = None
  dvecs = None
  patch_len = None
Method Details [hide private]

_convert_Haar(self, lc, patch_len, c, is_improver, to_reset, reset_value=0)

source code 

Convert from THaarClassifier to a new classifier with scale s so that I can detect from image with different scales.

Input:
lc: a THaarClassifier patch_len: the length of the patch to be used by lc c: the voting weight (double) is_improver: (boolean) an improver or a filter? to_reset: (boolean) to reset previous sum? reset_value: (double) value to be reset to
Output:

all the parameters of the haar classifier will be stored in an int array and a double array

New reference:

ivec: 64 items, format as follows
  • ivec[0]: the number of indices

  • ivec[1]: flag, in which:
    • bit 0: set if it is an improver, otherwise it is a filter
    • bit 1: set if the previous sum is to be reset
  • starting from ivec[4]: tuples of 3 integers:
    • x position w.r.t. the top-left corner
    • y position w.r.t. the top-left corner
    • coefficient/weight
dvec: 4 items, format as follows
  • dvec[0]: threshold b
  • dvec[1]: voting weight c
  • dvec[2]: reset value -- only meaningful if bit 1 of ivec[1] is set

Old reference:

ivec: format as follows
  • first 32 ints: (vectorized) indices w.r.t. the location

    of the top-left corner

  • ivec[32]: the number of indices

  • ivec[33]: flag, in which:
    • bit 0: set if it is an improver, otherwise it is a filter
    • bit 1: set if the previous sum is to be reset
dvec: format as follows
  • first 32 doubles: weights
  • dvec[32]: threshold b
  • dvec[33]: voting weight c
  • dvec[34]: reset value -- only meaningful if bit 1 of ivec[33] is set

_convert_Haars(self, cc, patch_len)

source code 

Convert from composite to a new classifier with scale s so that I can detect from image with different scales.

Input:
cc: a composite classifier, which can be:
  • A THaarClassifier
  • A SimpleCascade of composite classifiers
  • A GeneralizedCascade of composite classifiers
  • A DiscreteBoostedClassifier of composite classifiers

patch_len: the length of the patch to be used by lc

Output:
ivecs: a 2D int array representing the 'int' parameters of the composite classifier dvecs: a 2D double array representing the 'double' parameters of the composite classifier