Go to the documentation of this file.00001
00002 #ifndef vil3d_grad_3x3x3_h_
00003 #define vil3d_grad_3x3x3_h_
00004
00005
00006
00007
00008
00009 #include <vil3d/algo/vil3d_grad_1x3.h>
00010 #include <vil3d/algo/vil3d_smooth_121.h>
00011
00012
00013
00014
00015
00016 template<class srcT, class destT>
00017 void vil3d_grad_3x3x3_i(const vil3d_image_view<srcT>& src_im,
00018 vil3d_image_view<destT>& grad_im)
00019 {
00020 vil3d_image_view<destT> tmp_im;
00021 vil3d_smooth_121_j(src_im,grad_im);
00022 vil3d_smooth_121_k(grad_im,tmp_im);
00023 vil3d_grad_1x3_i(tmp_im,grad_im);
00024 }
00025
00026
00027
00028
00029
00030 template<class srcT, class destT>
00031 void vil3d_grad_3x3x3_j(const vil3d_image_view<srcT>& src_im,
00032 vil3d_image_view<destT>& grad_im)
00033 {
00034 vil3d_image_view<destT> tmp_im;
00035 vil3d_smooth_121_i(src_im,grad_im);
00036 vil3d_smooth_121_k(grad_im,tmp_im);
00037 vil3d_grad_1x3_j(tmp_im,grad_im);
00038 }
00039
00040
00041
00042
00043
00044
00045 template<class srcT, class destT>
00046 void vil3d_grad_3x3x3_k(const vil3d_image_view<srcT>& src_im,
00047 vil3d_image_view<destT>& grad_im)
00048 {
00049 vil3d_image_view<destT> tmp_im;
00050 vil3d_smooth_121_i(src_im,grad_im);
00051 vil3d_smooth_121_j(grad_im,tmp_im);
00052 vil3d_grad_1x3_k(tmp_im,grad_im);
00053 }
00054
00055
00056
00057
00058
00059 template<class srcT, class destT>
00060 void vil3d_grad_3x3x3(const vil3d_image_view<srcT>& src_im,
00061 vil3d_image_view<destT>& grad_i,
00062 vil3d_image_view<destT>& grad_j,
00063 vil3d_image_view<destT>& grad_k)
00064 {
00065 vil3d_image_view<destT> smth_i,smth_ij,smth_ik;
00066 vil3d_smooth_121_i(src_im,smth_i);
00067 vil3d_smooth_121_j(smth_i,smth_ij);
00068 vil3d_smooth_121_k(smth_i,smth_ik);
00069 vil3d_grad_1x3_j(smth_ik,grad_j);
00070 vil3d_grad_1x3_k(smth_ij,grad_k);
00071
00072 vil3d_image_view<destT> smth_j,smth_jk;
00073 vil3d_smooth_121_j(src_im,smth_j);
00074 vil3d_smooth_121_k(smth_j,smth_jk);
00075 vil3d_grad_1x3_i(smth_jk,grad_i);
00076 }
00077
00078 #endif