NAME
pad_matrix_by_extending - Pads a matrix by extending the value at the edges of the matrix
SYNOPSIS
#include "m/m_mat_basic.h"
Example compile flags (system dependent):
-DLINUX_X86_64 -DLINUX_X86_64_OPTERON -DGNU_COMPILER
-I/home/kobus/include
-L/home/kobus/misc/load/linux_x86_64_opteron -L/usr/lib/x86_64-linux-gnu
-lKJB -lfftw3 -lgsl -lgslcblas -ljpeg -lSVM -lstdc++ -lpthread -lSLATEC -lg2c -lacml -lacml_mv -lblas -lg2c -lncursesw
int pad_matrix_by_extending
(
Matrix **target_mpp,
const Matrix *src_mp,
int left,
int right,
int top,
int bottom
);
PARAMETERS
-
Matrix **target_mpp
-
Padded output matrix
-
const Matrix *src_mp
-
Input matrix
-
int left
-
Number of columns to add to left of matrix
-
int right
-
Number of columns to add to right of matrix
-
int top
-
Number of columns to add to top of matrix
-
int bottom
-
Number of columns to add to bottom of matrix
DESCRIPTION
Instead of padding a matrix with zeros, it's often desirable for the padded
region to have the same value as the adjacent matrix elements. For example,
consider the input matrx M:
M = [1 2]
[3 4]
Calling pad_matrix_by_extending(&M_padded, M, 2, 2, 2, 2) would result in:
[ 1 1 1 2 2 2 ]
[ 1 1 1 2 2 2 ]
M_padded = [ 1 1 1 2 2 2 ]
[ 3 3 3 4 4 4 ]
[ 3 3 3 4 4 4 ]
[ 3 3 3 4 4 4 ]
This is useful in edge-detection, so edges aren't detected at the edges
of an image.
RETURNS
If the routine fails, then ERROR is returned with and error message being
set. Otherwise NO_ERROR is returned.
DISCLAIMER
This software is not adequatedly tested. It is recomended that
results are checked independantly where appropriate.
AUTHOR
Kyle Simek
DOCUMENTER
Kobus Barnard
SEE ALSO
random_split_matrix_by_rows
,
split_matrix_by_rows
,
get_matrix_transpose
,
create_matrix_copy
,
copy_matrix
,
select_matrix_cols
,
copy_matrix_block
,
ow_copy_matrix_block
,
copy_matrix_block_2
,
ow_copy_matrix_block_2
,
ow_copy_matrix
,
ow_copy_matrix_with_col_selection
,
copy_int_matrix_to_matrix
,
copy_matrix_to_int_matrix
,
get_random_matrix_row
,
get_matrix_row
,
ow_get_matrix_row
,
remove_matrix_row
,
put_matrix_row
,
copy_matrix_row
,
get_random_matrix_col
,
get_matrix_col
,
remove_matrix_col
,
put_matrix_col
,
copy_matrix_col
,
insert_zero_row_in_matrix
,
insert_zero_col_in_matrix
,
vector_is_matrix_row
,
stack_matrix_rows
,
unstack_matrix_rows
,
randomize_matrix_rows
,
get_matrix_trace
,
is_matrix_diagonal
,
nonnan_matrix