Follow this link to skip to the main content

Algorithms
[Vision Package]

Collaboration diagram for Algorithms:


Classes

class  claraty::Transform_Op< T >
class  claraty::Resample_Op

Detailed Description

Image operations

While specific operations are implemented, they do not use the Image_Op interface, which provides a purely virtual filter() function. This will (eventually) allow all classes that inherit from Image_Op to be used interchangably (to do the filter operation). For instance, a generic algorithm could take any Image_Op:

template<class T>
void my_algorithm(Image_Op<T>& my_op, Image<double> input_image) {

  Image<double> output_image;
  my_op.filter(input_image, output_image)
}

The Image_Ops that are implemented all support the filter function, but do not inherit from the Image_Op class (yet). All Image_Ops are templatized by the type that they used for internal storage (and so the type used for doing operations); for most operations this will be double or float, but char operations can be forced by using the char type (NOTE: the templatization of Image_IO classes my be removed if it seems unnecessary).

A simple example for using the Convolve_Op:

Image<char> input_image, output_image;
... // load/capture an input image

double kernel_values[] = {-1.0, -0.5, 0.0, 0.0, 0.5, 1.0}; // random kernel values
Matrix_NxM<double,2,3> kernel(kernel_values); // create a kernel
Convolve_Op<double> conv_op(kernel); // create the operation

conv_op.set_conv_shape(Convolve_Op<double>::CONV_VALID); // set the shape

conv_op.filter(input_image, output_image); // filter the input image and put in the output image
...