contrib/mul/vil3d/algo/vil3d_corners.h
Go to the documentation of this file.
00001 // This is mul/vil3d/algo/vil3d_corners.h
00002 #ifndef vil3d_corners_h_
00003 #define vil3d_corners_h_
00004 //:
00005 // \file
00006 // \brief  Class containing functions to estimate corner-ness in various ways.
00007 // \author Tim Cootes
00008 
00009 #include <vil3d/vil3d_image_view.h>
00010 
00011 //: Class containing functions to estimate corner-ness in various ways.
00012 //  Implements 3D corner operators suggested by Karl Rohr
00013 template <class srcT, class destT>
00014 class vil3d_corners
00015 {
00016 private:
00017   //: Compute gradients, products and smoothed versions
00018   void compute_smooth_gradient_products(const vil3d_image_view<srcT>& src_im);
00019 public:
00020   //: Computes cornerness measure for every pixel
00021   //  At each pixel, computes det(N)/trace(N), where
00022   //  N is a matrix generated by smoothing over gradient
00023   //  product matrices M = (gi, gj, gk)' * (gi, gj, gk),
00024   //  where gi = i-gradient at a pixel etc.
00025   //
00026   //  This is the Op3 corner operator described by Rohr.
00027   void cornerness1(const vil3d_image_view<srcT>& src_im,
00028                    vil3d_image_view<destT>& cornerness);
00029 
00030   //: Workspace for gradient in i
00031   vil3d_image_view<destT> grad_i;
00032   //: Workspace for gradient in j
00033   vil3d_image_view<destT> grad_j;
00034   //: Workspace for gradient in k
00035   vil3d_image_view<destT> grad_k;
00036 
00037   //: Workspace for product images
00038   vil3d_image_view<destT> grad_product_;
00039   //: Workspace for smoothed product images
00040   vil3d_image_view<destT> smooth_grad_product_;
00041 
00042 };
00043 
00044 #endif // vil3d_corners_h_
00045