mirror of https://github.com/davisking/dlib.git
Made the object_detector's interface a little more complete and flexible.
This commit is contained in:
parent
806c637259
commit
1bb12d6a08
|
@ -34,6 +34,15 @@ namespace dlib
|
|||
const matrix<double,0,1>& w_
|
||||
);
|
||||
|
||||
const matrix<double,0,1>& get_w (
|
||||
) const;
|
||||
|
||||
const overlap_tester_type& get_overlap_tester (
|
||||
) const;
|
||||
|
||||
const image_scanner_type& get_scanner (
|
||||
) const;
|
||||
|
||||
object_detector& operator= (
|
||||
const object_detector& item
|
||||
);
|
||||
|
@ -277,6 +286,45 @@ namespace dlib
|
|||
}
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------------------
|
||||
|
||||
template <
|
||||
typename image_scanner_type,
|
||||
typename overlap_tester_type
|
||||
>
|
||||
const matrix<double,0,1>& object_detector<image_scanner_type,overlap_tester_type>::
|
||||
get_w (
|
||||
) const
|
||||
{
|
||||
return w;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------------------
|
||||
|
||||
template <
|
||||
typename image_scanner_type,
|
||||
typename overlap_tester_type
|
||||
>
|
||||
const overlap_tester_type& object_detector<image_scanner_type,overlap_tester_type>::
|
||||
get_overlap_tester (
|
||||
) const
|
||||
{
|
||||
return boxes_overlap;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------------------
|
||||
|
||||
template <
|
||||
typename image_scanner_type,
|
||||
typename overlap_tester_type
|
||||
>
|
||||
const image_scanner_type& object_detector<image_scanner_type,overlap_tester_type>::
|
||||
get_scanner (
|
||||
) const
|
||||
{
|
||||
return scanner;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------------------
|
||||
|
||||
}
|
||||
|
|
|
@ -71,6 +71,30 @@ namespace dlib
|
|||
with respect to overlap_tester. That is, for all
|
||||
pairs of returned detections A and B, we will always
|
||||
have: overlap_tester(A,B) == false
|
||||
- #get_w() == w
|
||||
- #get_overlap_tester() == overlap_tester
|
||||
- #get_scanner() == scanner
|
||||
!*/
|
||||
|
||||
const matrix<double,0,1>& get_w (
|
||||
) const;
|
||||
/*!
|
||||
ensures
|
||||
- returns the weight vector used by this object
|
||||
!*/
|
||||
|
||||
const overlap_tester_type& get_overlap_tester (
|
||||
) const;
|
||||
/*!
|
||||
ensures
|
||||
- returns the overlap tester used by this object
|
||||
!*/
|
||||
|
||||
const image_scanner_type& get_scanner (
|
||||
) const;
|
||||
/*!
|
||||
ensures
|
||||
- returns the image scanner used by this object.
|
||||
!*/
|
||||
|
||||
object_detector& operator= (
|
||||
|
@ -97,6 +121,9 @@ namespace dlib
|
|||
- The returned vector will be sorted in the sense that the highest
|
||||
confidence detections come first. E.g. element 0 is the best detection,
|
||||
element 1 the next best, and so on.
|
||||
- #get_scanner() will have been loaded with img. Therefore, you can call
|
||||
#get_scanner().get_feature_vector() to obtain the feature vectors for
|
||||
the resulting object detection boxes.
|
||||
!*/
|
||||
|
||||
template <
|
||||
|
@ -120,6 +147,9 @@ namespace dlib
|
|||
detection. This is the detection value output by the scanner
|
||||
minus the threshold, therefore this is a value > 0.
|
||||
- #dets[i].second == the bounding box for the i-th detection.
|
||||
- #get_scanner() will have been loaded with img. Therefore, you can call
|
||||
#get_scanner().get_feature_vector() to obtain the feature vectors for
|
||||
the resulting object detection boxes.
|
||||
!*/
|
||||
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue