20 lines
366 B
C++
20 lines
366 B
C++
|
#include "edge_roberts.h"
|
||
|
|
||
|
EdgeRoberts::EdgeRoberts(PNM* img) :
|
||
|
EdgeGradient(img)
|
||
|
{
|
||
|
prepareMatrices();
|
||
|
}
|
||
|
|
||
|
EdgeRoberts::EdgeRoberts(PNM* img, ImageViewer* iv) :
|
||
|
EdgeGradient(img, iv)
|
||
|
{
|
||
|
prepareMatrices();
|
||
|
}
|
||
|
|
||
|
void EdgeRoberts::prepareMatrices()
|
||
|
{
|
||
|
g_x = math::matrix<float>(2, 2, {1, 0, 0, -1});
|
||
|
g_y = math::matrix<float>(2, 2, {0, 1, -1, 0});
|
||
|
}
|