XCSF  1.4.7
XCSF learning classifier system
image.c File Reference

Image handling functions. More...

#include "image.h"
Include dependency graph for image.c:

Go to the source code of this file.

Functions

static void col2im_add_pixel (double *im, const int height, const int width, int row, int col, const int channel, const int pad, const double val)
 
static double im2col_get_pixel (const double *im, const int height, const int width, int row, int col, const int channel, const int pad)
 
void col2im (const double *data_col, const int channels, const int height, const int width, const int ksize, const int stride, const int pad, double *data_im)
 Transforms a column vector to an image vector. More...
 
void im2col (const double *data_im, const int channels, const int height, const int width, const int ksize, const int stride, const int pad, double *data_col)
 Transforms an image vector to a column vector. More...
 

Detailed Description

Image handling functions.

Author
Richard Preen rpree.nosp@m.n@gm.nosp@m.ail.c.nosp@m.om
Date
2020–2023.

Definition in file image.c.

Function Documentation

◆ col2im()

void col2im ( const double *  data_col,
const int  channels,
const int  height,
const int  width,
const int  ksize,
const int  stride,
const int  pad,
double *  data_im 
)

Transforms a column vector to an image vector.

Used for GEMM convolutional backward propagation.

Parameters
[in]data_colInput column vector.
[in]channelsNumber of image channels.
[in]heightImage height.
[in]widthImage width.
[in]ksizeKernel size.
[in]strideKernel stride.
[in]padKernel padding.
[out]data_imThe resulting image vector.

Definition at line 63 of file image.c.

References col2im_add_pixel().

Referenced by neural_layer_convolutional_backward().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ col2im_add_pixel()

static void col2im_add_pixel ( double *  im,
const int  height,
const int  width,
int  row,
int  col,
const int  channel,
const int  pad,
const double  val 
)
static

Definition at line 27 of file image.c.

Referenced by col2im().

Here is the caller graph for this function:

◆ im2col()

void im2col ( const double *  data_im,
const int  channels,
const int  height,
const int  width,
const int  ksize,
const int  stride,
const int  pad,
double *  data_col 
)

Transforms an image vector to a column vector.

Used for GEMM convolutional forward propagation.

Parameters
[in]data_imImage vector of dimension: height × width × channels.
[in]channelsNumber of image channels.
[in]heightImage height.
[in]widthImage width.
[in]ksizeKernel size.
[in]strideKernel stride.
[in]padKernel padding.
[out]data_colThe resulting column vector.

Definition at line 100 of file image.c.

References im2col_get_pixel().

Referenced by neural_layer_convolutional_backward(), and neural_layer_convolutional_forward().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ im2col_get_pixel()

static double im2col_get_pixel ( const double *  im,
const int  height,
const int  width,
int  row,
int  col,
const int  channel,
const int  pad 
)
static

Definition at line 39 of file image.c.

Referenced by im2col().

Here is the caller graph for this function: