vspline 1.1.0
Generic C++11 Code for Uniform B-Splines
Classes | Typedefs | Functions
gsm2.cc File Reference

calculating the gradient squared magnitude, derivatives More...

#include <iostream>
#include <vspline/vspline.h>
#include <vigra/stdimage.hxx>
#include <vigra/imageinfo.hxx>
#include <vigra/impex.hxx>

Go to the source code of this file.

Classes

struct  ev_gsm
 we build a vspline::unary_functor which calculates the sum of gradient squared magnitudes. Note how the 'compound evaluator' we construct follows a pattern of More...
 

Typedefs

typedef vigra::RGBValue< float, 0, 1, 2 > pixel_type
 
typedef vigra::TinyVector< float, 2 > coordinate_type
 
typedef vspline::bspline< pixel_type, 2 > spline_type
 
typedef vigra::MultiArray< 2, pixel_typetarget_type
 
typedef vspline::evaluator< coordinate_type, pixel_typeev_type
 

Functions

int main (int argc, char *argv[])
 

Detailed Description

calculating the gradient squared magnitude, derivatives

alternative implementation of gsm.cc, performing the calculation of the gradient squared magnitude with a functor and transform(), which is faster since the whole operation is multithreaded and potentially vectorized.

compile with: clang++ -std=c++11 -march=native -o gsm -O3 -pthread -DUSE_VC gsm.cc -lvigraimpex -lVc or clang++ -std=c++11 -march=native -o gsm -O3 -pthread gsm.cc -lvigraimpex (with Vc; use -DUSE_HWY and -lhwy for highway, or -std=c++17 and -DUSE_STDSIMD for the std::simd backend)

invoke passing an image file. the result will be written to 'gsm2.tif'

Definition in file gsm2.cc.

Typedef Documentation

◆ coordinate_type

typedef vigra::TinyVector< float , 2 > coordinate_type

Definition at line 60 of file gsm2.cc.

◆ ev_type

Definition at line 71 of file gsm2.cc.

◆ pixel_type

typedef vigra::RGBValue<float,0,1,2> pixel_type

Definition at line 57 of file gsm2.cc.

◆ spline_type

Definition at line 63 of file gsm2.cc.

◆ target_type

typedef vigra::MultiArray< 2 , pixel_type > target_type

Definition at line 66 of file gsm2.cc.

Function Documentation

◆ main()

int main ( int  argc,
char *  argv[] 
)

Definition at line 139 of file gsm2.cc.