Commit 90aece38 authored by Ahmed's avatar Ahmed

Auto stash before rebase of "adi-dev"

parent b30c09e9
......@@ -281,7 +281,12 @@ public class ArmadilloFunctionTest extends AbstractSymtabTest {
}
@Test
public void testRectangleCommand() throws IOException{
public void testRectangleCommand() throws IOException {
testMathCommand("rectangle");
}
@Test
public void testErodeAndGaussianBlur() throws IOException{
testMathCommand("erodeAndGaussianBlur");
}
}
#ifndef TEST_MATH_ERODEANDGAUSSIANBLURCOMMANDTEST
#define TEST_MATH_ERODEANDGAUSSIANBLURCOMMANDTEST
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
#include "armadillo"
#include "opencv2/imgproc.hpp"
#include "opencv2/imgproc.hpp"
using namespace arma;
using namespace cv;
class test_math_erodeAndGaussianBlurCommandTest{
public:
mat src;
int erosion_elem;
int iterations;
int sizeX;
int sizeY;
double sigmaX;
double sigmaY;
mat dstB;
void init()
{
src=mat(n,m);
dstB=mat(n,m);
}
void erodeHelper(mat src, mat dst, int erosion_elem, int iterations)
{
int erosion_type = 0;
if( erosion_elem == 0 ){ erosion_type = MORPH_RECT; }
else if( erosion_elem == 1 ){ erosion_type = MORPH_CROSS; }
else if( erosion_elem == 2) { erosion_type = MORPH_ELLIPSE; }
erosion_size = erosion_elem;
mat element = getStructuringElement( erosion_type,
Size( 2*erosion_size + 1, 2*erosion_size+1 ),
Point( -1, -1 ) );
erode( src, dst, element, Point(-1,-1), iterations );
}
void gaussianBlurHelper(mat src, mat dst, int sizeX, int sizeY, double sigmaX, double sigmaY)
{
gaussianBlur(src, dst, Size(sizeX, sizeY), sigmaX, sigmaY);
}
void execute()
{
mat dst=mat(n,m);
erodeHelper(src, dst, erosion_elem, iterations);
mat deterMat = (det(dst));
mat dstB;
gaussianBlurHelper(dst, dstB, sizeX, sizeY, sigmaX, sigmaY);
}
};
#endif
/* (c) https://github.com/MontiCore/monticore */
package test.math;
component ErodeAndGaussianBlurCommandTest{
port
in Q^{n,m} src,
in Z erosion_elemIn,
in Z iterationsIn1,
in Z sizeX,
in Z sizeY,
in Q sigmaX,
in Q sigmaY,
out Q^{n,m} dstB;
instance ErodeCommandTest erode;
connect erosion_elemIn -> erode.erosion_elem;
connect iterationsIn1 -> erode.iterations;
//connect erode.dst -> dilate.dst;
//implementation Math{
//Q^{n,m} dst;
//dst = erode(src, erosion_elem, iterations);
//Q^{2,3} deterMat = det(dst);
//Q^{n,m} dstB = gaussianBlur(dst, sizeX, sizeY, sigmaX, sigmaY);
//}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment