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

Prewitt 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). It's almost the same as the sobel operator, but with a different mask. More...

Functions

std::vector< std::vector< int32_t > > square (const std::vector< std::vector< int32_t > > &G)
 square function
 
std::vector< std::vector< int32_t > > Prewitt (const std::vector< std::vector< int32_t > > &image)
 Prewitt apply function.
 

Detailed Description

Prewitt 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). It's almost the same as the sobel operator, but with a different mask.

Function Documentation

◆ Prewitt()

std::vector< std::vector< int32_t > > prewitt::Prewitt ( const std::vector< std::vector< int32_t > > & image)
inline

Prewitt apply function.

Parameters
imagethe input image
Returns
std::vector<std::vector<int32_t> > the resulted image after applying the prewitt mask

◆ square()

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

square function

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