AlgoPlus v0.1.0
Loading...
Searching...
No Matches
sobel Namespace Reference

Sobel operator is used for edge detection. It creates 2 3x3 arrays G_x and G_y and apply them to an image A(G_x * A, G_y * A). After that, the resulting image with edge detection is G = sqrt(G_x^2 + G_y^2) More...

Functions

std::pair< std::vector< std::vector< int32_t > >, std::vector< std::vector< int32_t > > > kernel ()
 
std::vector< std::vector< int32_t > > square (const std::vector< std::vector< int32_t > > &G)
 square function
 
std::vector< std::vector< int32_t > > Sobel (const std::vector< std::vector< int32_t > > &image)
 Sobel apply function.
 

Detailed Description

Sobel operator is used for edge detection. It creates 2 3x3 arrays G_x and G_y and apply them to an image A(G_x * A, G_y * A). After that, the resulting image with edge detection is G = sqrt(G_x^2 + G_y^2)

Function Documentation

◆ kernel()

std::pair< std::vector< std::vector< int32_t > >, std::vector< std::vector< int32_t > > > sobel::kernel ( )

@ brief kernel function. Of course you can change the kernel values depending on your needs

Returns
pair<vector<int32_t>, vector<int32_t>> the G_x and G_y 3x3 kernels

◆ Sobel()

std::vector< std::vector< int32_t > > sobel::Sobel ( const std::vector< std::vector< int32_t > > & image)

Sobel apply function.

Parameters
imagethe 2d array of the input image
Returns
vector<vector<in t32_t> > the resulting image

◆ square()

std::vector< std::vector< int32_t > > sobel::square ( const std::vector< std::vector< int32_t > > & G)

square function

Parameters
Gthe input 2d array
Returns
vector<vector<int32_t> > the squared root 2d array