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...
|
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 More...
|
|
std::vector< std::vector< int32_t > > | Sobel (const std::vector< std::vector< int32_t > > &image) |
| Sobel apply function. More...
|
|
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)
◆ 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
-
image | the 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
-
- Returns
- vector<vector<int32_t> > the squared root 2d array