Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
E
EMAM2Cpp
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
13
Issues
13
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
1
Merge Requests
1
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Test Cases
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
monticore
EmbeddedMontiArc
generators
EMAM2Cpp
Commits
2123b848
Commit
2123b848
authored
Feb 12, 2020
by
Ahmed
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
define types
parent
640ba3f0
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
103 additions
and
67 deletions
+103
-67
src/main/java/de/monticore/lang/monticar/generator/BluePrint.java
.../java/de/monticore/lang/monticar/generator/BluePrint.java
+4
-0
src/main/java/de/monticore/lang/monticar/generator/cpp/commands/BoundingRectCommand.java
.../monticar/generator/cpp/commands/BoundingRectCommand.java
+8
-1
src/main/java/de/monticore/lang/monticar/generator/cpp/commands/LargestContourCommand.java
...onticar/generator/cpp/commands/LargestContourCommand.java
+5
-2
src/main/java/de/monticore/lang/monticar/generator/cpp/commands/RectangleCommand.java
...ang/monticar/generator/cpp/commands/RectangleCommand.java
+6
-1
src/main/java/de/monticore/lang/monticar/generator/cpp/converter/ComponentConverter.java
.../monticar/generator/cpp/converter/ComponentConverter.java
+34
-7
src/main/java/de/monticore/lang/monticar/generator/cpp/converter/ComponentConverterMethodGeneration.java
...tor/cpp/converter/ComponentConverterMethodGeneration.java
+12
-6
src/test/java/de/monticore/lang/monticar/generator/cpp/armadillo/ArmadilloFunctionTest.java
...nticar/generator/cpp/armadillo/ArmadilloFunctionTest.java
+2
-2
src/test/resources/results/armadillo/testMath/l0/test_math_boundingRectCommandTest.h
...armadillo/testMath/l0/test_math_boundingRectCommandTest.h
+1
-1
src/test/resources/results/armadillo/testMath/l0/test_math_erodeAndGaussianBlurCommandTest.h
...o/testMath/l0/test_math_erodeAndGaussianBlurCommandTest.h
+14
-19
src/test/resources/results/armadillo/testMath/l0/test_math_findContoursCommandTest.h
...armadillo/testMath/l0/test_math_findContoursCommandTest.h
+2
-5
src/test/resources/results/armadillo/testMath/l0/test_math_largestContourCommandTest.h
...madillo/testMath/l0/test_math_largestContourCommandTest.h
+2
-2
src/test/resources/results/armadillo/testMath/l0/test_math_rectangleCommandTest.h
...ts/armadillo/testMath/l0/test_math_rectangleCommandTest.h
+1
-1
src/test/resources/test/math/ErodeAndGaussianBlurCommandTest.emam
.../resources/test/math/ErodeAndGaussianBlurCommandTest.emam
+10
-17
src/test/resources/test/math/FindContoursCommandTest.emam
src/test/resources/test/math/FindContoursCommandTest.emam
+2
-3
No files found.
src/main/java/de/monticore/lang/monticar/generator/BluePrint.java
View file @
2123b848
...
...
@@ -5,6 +5,7 @@ import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.instance
import
de.monticore.lang.monticar.generator.optimization.MathInformationRegister
;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.Optional
;
...
...
@@ -67,6 +68,9 @@ public class BluePrint {
variables
.
remove
(
v
);
}
public
void
replaceVariable
(
Variable
varOld
,
Variable
varNew
){
Collections
.
replaceAll
(
variables
,
varOld
,
varNew
);
}
public
void
addMethod
(
Method
method
)
{
methods
.
add
(
method
);
}
...
...
src/main/java/de/monticore/lang/monticar/generator/cpp/commands/BoundingRectCommand.java
View file @
2123b848
...
...
@@ -7,6 +7,7 @@ import de.monticore.lang.monticar.generator.BluePrint;
import
de.monticore.lang.monticar.generator.MathCommand
;
import
de.monticore.lang.monticar.generator.cpp.BluePrintCPP
;
import
de.monticore.lang.monticar.generator.cpp.MathFunctionFixer
;
import
de.monticore.lang.monticar.generator.cpp.converter.ComponentConverter
;
import
de.monticore.lang.monticar.generator.cpp.converter.ExecuteMethodGenerator
;
import
de.monticore.lang.monticar.generator.cpp.converter.MathConverter
;
import
de.monticore.lang.monticar.generator.cpp.symbols.MathStringExpression
;
...
...
@@ -46,10 +47,16 @@ public class BoundingRectCommand extends MathCommand{
public
void
convertUsingArmadilloBackend
(
MathExpressionSymbol
mathExpressionSymbol
,
BluePrint
bluePrint
)
{
MathMatrixNameExpressionSymbol
mathMatrixNameExpressionSymbol
=
(
MathMatrixNameExpressionSymbol
)
mathExpressionSymbol
;
mathMatrixNameExpressionSymbol
.
setNameToAccess
(
""
);
BluePrintCPP
bluePrintCPP
=
(
BluePrintCPP
)
bluePrint
;
String
valueListString
=
""
;
for
(
MathMatrixAccessSymbol
accessSymbol
:
mathMatrixNameExpressionSymbol
.
getMathMatrixAccessOperatorSymbol
().
getMathMatrixAccessSymbols
())
MathFunctionFixer
.
fixMathFunctions
(
accessSymbol
,
(
BluePrintCPP
)
bluePrint
);
MathFunctionFixer
.
fixMathFunctions
(
accessSymbol
,
bluePrintCPP
);
String
nameOfFirstParameter
=
mathMatrixNameExpressionSymbol
.
getMathMatrixAccessOperatorSymbol
().
getMathMatrixAccessSymbols
().
get
(
0
).
getTextualRepresentation
();
ComponentConverter
.
fixVariableType
(
nameOfFirstParameter
,
bluePrintCPP
,
"Q"
,
"vector<cv::Point>"
,
""
);
valueListString
+=
ExecuteMethodGenerator
.
generateExecuteCode
(
mathExpressionSymbol
,
new
ArrayList
<
String
>());
List
<
MathMatrixAccessSymbol
>
newMatrixAccessSymbols
=
new
ArrayList
<>();
MathStringExpression
stringExpression
=
new
MathStringExpression
(
"boundingRect"
+
valueListString
,
mathMatrixNameExpressionSymbol
.
getMathMatrixAccessOperatorSymbol
().
getMathMatrixAccessSymbols
());
...
...
src/main/java/de/monticore/lang/monticar/generator/cpp/commands/LargestContourCommand.java
View file @
2123b848
...
...
@@ -10,6 +10,7 @@ import de.monticore.lang.monticar.generator.cpp.converter.ExecuteMethodGenerator
import
de.monticore.lang.monticar.generator.cpp.converter.MathConverter
;
import
de.monticore.lang.monticar.generator.cpp.symbols.MathStringExpression
;
import
de.se_rwth.commons.logging.Log
;
import
de.monticore.lang.monticar.generator.cpp.converter.ComponentConverter
;
import
java.util.ArrayList
;
import
java.util.List
;
...
...
@@ -45,11 +46,13 @@ public class LargestContourCommand extends MathCommand {
public
void
convertUsingArmadilloBackend
(
MathExpressionSymbol
mathExpressionSymbol
,
BluePrint
bluePrint
)
{
MathMatrixNameExpressionSymbol
mathMatrixNameExpressionSymbol
=
(
MathMatrixNameExpressionSymbol
)
mathExpressionSymbol
;
mathMatrixNameExpressionSymbol
.
setNameToAccess
(
""
);
BluePrintCPP
bluePrintCPP
=
(
BluePrintCPP
)
bluePrint
;
String
valueListString
=
""
;
for
(
MathMatrixAccessSymbol
accessSymbol
:
mathMatrixNameExpressionSymbol
.
getMathMatrixAccessOperatorSymbol
().
getMathMatrixAccessSymbols
())
MathFunctionFixer
.
fixMathFunctions
(
accessSymbol
,
(
BluePrintCPP
)
bluePrint
);
MathFunctionFixer
.
fixMathFunctions
(
accessSymbol
,
bluePrintCPP
);
String
nameOfFirstParameter
=
mathMatrixNameExpressionSymbol
.
getMathMatrixAccessOperatorSymbol
().
getMathMatrixAccessSymbols
().
get
(
0
).
getTextualRepresentation
();
ComponentConverter
.
fixVariableType
(
nameOfFirstParameter
,
bluePrintCPP
,
"Q"
,
"vector<vector<cv::Point>>"
,
""
);
Method
largestContourMethod
=
getLargestContourMethod
();
valueListString
+=
ExecuteMethodGenerator
.
generateExecuteCode
(
mathExpressionSymbol
,
new
ArrayList
<
String
>());
List
<
MathMatrixAccessSymbol
>
newMatrixAccessSymbols
=
new
ArrayList
<>();
...
...
src/main/java/de/monticore/lang/monticar/generator/cpp/commands/RectangleCommand.java
View file @
2123b848
...
...
@@ -6,6 +6,7 @@ import de.monticore.lang.math._symboltable.matrix.MathMatrixNameExpressionSymbol
import
de.monticore.lang.monticar.generator.*
;
import
de.monticore.lang.monticar.generator.cpp.BluePrintCPP
;
import
de.monticore.lang.monticar.generator.cpp.MathFunctionFixer
;
import
de.monticore.lang.monticar.generator.cpp.converter.ComponentConverter
;
import
de.monticore.lang.monticar.generator.cpp.converter.ExecuteMethodGenerator
;
import
de.monticore.lang.monticar.generator.cpp.converter.MathConverter
;
import
de.monticore.lang.monticar.generator.cpp.symbols.MathStringExpression
;
...
...
@@ -45,10 +46,14 @@ public class RectangleCommand extends MathCommand{
public
void
convertUsingArmadilloBackend
(
MathExpressionSymbol
mathExpressionSymbol
,
BluePrint
bluePrint
)
{
MathMatrixNameExpressionSymbol
mathMatrixNameExpressionSymbol
=
(
MathMatrixNameExpressionSymbol
)
mathExpressionSymbol
;
mathMatrixNameExpressionSymbol
.
setNameToAccess
(
""
);
BluePrintCPP
bluePrintCPP
=
(
BluePrintCPP
)
bluePrint
;
String
valueListString
=
""
;
for
(
MathMatrixAccessSymbol
accessSymbol
:
mathMatrixNameExpressionSymbol
.
getMathMatrixAccessOperatorSymbol
().
getMathMatrixAccessSymbols
())
MathFunctionFixer
.
fixMathFunctions
(
accessSymbol
,
(
BluePrintCPP
)
bluePrint
);
MathFunctionFixer
.
fixMathFunctions
(
accessSymbol
,
bluePrintCPP
);
String
nameOfSecondParameter
=
mathMatrixNameExpressionSymbol
.
getMathMatrixAccessOperatorSymbol
().
getMathMatrixAccessSymbols
().
get
(
1
).
getTextualRepresentation
();
ComponentConverter
.
fixVariableType
(
nameOfSecondParameter
,
bluePrintCPP
,
"Q"
,
"Rect"
,
""
);
Method
rectangleHelperMethod
=
getRectangleHelperMethod
();
valueListString
+=
ExecuteMethodGenerator
.
generateExecuteCode
(
mathExpressionSymbol
,
new
ArrayList
<
String
>());
...
...
src/main/java/de/monticore/lang/monticar/generator/cpp/converter/ComponentConverter.java
View file @
2123b848
...
...
@@ -69,17 +69,17 @@ public class ComponentConverter {
if
(
mathStatementsSymbol
!=
null
)
{
List
<
MathExpressionSymbol
>
mathExpressionSymbols
=
mathStatementsSymbol
.
getMathExpressionSymbols
();
for
(
MathExpressionSymbol
mathExpressionSymbol
:
mathExpressionSymbols
){
namesOfFunctions
.
add
(
getNameOfMathCommand
(
mathExpressionSymbol
));
String
nameOfFunction
=
getNameOfMathCommand
(
mathExpressionSymbol
);
namesOfFunctions
.
add
(
nameOfFunction
);
fixFunctionTypes
(
nameOfFunction
,
mathExpressionSymbol
,
bluePrint
);
}
}
if
(
namesOfFunctions
!=
null
)
{
for
(
String
nameOfFunction
:
namesOfFunctions
){
usedMathCommand
.
add
(
bluePrint
.
getMathCommandRegister
().
getMathCommand
(
nameOfFunction
));
}
}
if
(
mathStatementsSymbol
!=
null
){
//handleDependenceOfCVCommands(mathStatementsSymbol, BluePrintCPP bluePrint);
}
...
...
@@ -314,7 +314,7 @@ public class ComponentConverter {
initLine
.
ifPresent
(
s
->
method
.
addInstruction
(
new
TargetCodeInstruction
(
s
)));
}
}
//TODO: Try to modify this Method
public
static
void
handleDependenceOfCVCommands
(
MathStatementsSymbol
mathStatementsSymbol
,
BluePrintCPP
bluePrint
)
{
List
<
MathExpressionSymbol
>
mathExpressionSymbols
=
mathStatementsSymbol
.
getMathExpressionSymbols
();
int
mathExpressionSymbolsSize
=
mathExpressionSymbols
.
size
();
...
...
@@ -332,9 +332,6 @@ public class ComponentConverter {
}
}
}
}
}
}
...
...
@@ -395,4 +392,34 @@ public class ComponentConverter {
public
static
void
fixMathFunctions
(
MathExpressionSymbol
mathExpressionSymbol
,
BluePrintCPP
bluePrintCPP
)
{
MathFunctionFixer
.
fixMathFunctions
(
mathExpressionSymbol
,
bluePrintCPP
);
}
private
static
void
fixFunctionTypes
(
String
nameOfFunction
,
MathExpressionSymbol
mathExpressionSymbol
,
BluePrintCPP
bluePrintCPP
)
{
String
outputName
=
getNameOfOutput
(
mathExpressionSymbol
);
switch
(
nameOfFunction
)
{
case
"findContours"
:
fixVariableType
(
outputName
,
bluePrintCPP
,
"Q"
,
"vector<vector<cv::Point>>"
,
""
);
break
;
case
"largestContour"
:
fixVariableType
(
outputName
,
bluePrintCPP
,
"Q"
,
"vector<cv::Point>"
,
""
);
break
;
case
"boundingRect"
:
fixVariableType
(
outputName
,
bluePrintCPP
,
"Q"
,
"Rect"
,
""
);
break
;
}
}
public
static
void
fixVariableType
(
String
variableName
,
BluePrintCPP
bluePrint
,
String
typeNameMontiCar
,
String
typeNameTargetLanguage
,
String
includeName
){
List
<
Variable
>
variables
=
bluePrint
.
getVariables
();
for
(
Variable
var
:
variables
){
if
(
var
.
getName
().
equals
(
variableName
)){
fixType
(
var
,
typeNameMontiCar
,
typeNameTargetLanguage
,
includeName
);
}
}
}
private
static
void
fixType
(
Variable
variable
,
String
typeNameMontiCar
,
String
typeNameTargetLanguage
,
String
includeName
){
VariableType
varTypeNew
=
new
VariableType
(
typeNameMontiCar
,
typeNameTargetLanguage
,
includeName
);
variable
.
setVariableType
(
varTypeNew
);
}
}
src/main/java/de/monticore/lang/monticar/generator/cpp/converter/ComponentConverterMethodGeneration.java
View file @
2123b848
...
...
@@ -23,6 +23,7 @@ import java.util.Collection;
import
java.util.List
;
import
static
de
.
monticore
.
lang
.
monticar
.
generator
.
cpp
.
converter
.
ComponentConverter
.
getNameOfOutput
;
import
static
de
.
monticore
.
lang
.
monticar
.
generator
.
cpp
.
converter
.
ComponentConverter
.
getNameOfMathCommand
;
/**
*/
...
...
@@ -195,13 +196,16 @@ public class ComponentConverterMethodGeneration {
MathFunctionFixer
.
fixMathFunctions
(
mathExpressionSymbol
,
bluePrint
);
String
result
=
ExecuteMethodGenerator
.
generateExecuteCode
(
mathExpressionSymbol
,
includeStrings
);
String
outputName
=
""
;
for
(
MathCommand
mathCommand
:
ComponentConverter
.
usedMathCommand
)
if
(
mathCommand
!=
null
)
{
String
argumentNoReturnFunctionName
=
mathCommand
.
getMathCommandName
();
if
(
mathCommand
.
isArgumentNoReturnMathCommand
()
&&
result
.
contains
(
argumentNoReturnFunctionName
))
{
outputName
=
getNameOfOutput
(
mathExpressionSymbol
);
result
=
fixArgumentNoReturnInstruction
(
result
,
outputName
);
for
(
MathCommand
mathCommand
:
ComponentConverter
.
usedMathCommand
)
{
if
(
mathCommand
!=
null
)
{
String
argumentNoReturnFunctionName
=
mathCommand
.
getMathCommandName
();
if
(
mathCommand
.
isArgumentNoReturnMathCommand
()
&&
result
.
contains
(
argumentNoReturnFunctionName
))
{
outputName
=
getNameOfOutput
(
mathExpressionSymbol
);
result
=
fixArgumentNoReturnInstruction
(
result
,
outputName
);
//TODO Add fixType Here ---> think about put the function here or down
}
}
//fixVariableTypes(mathCommand, result,mathExpressionSymbol, bluePrint);
}
TargetCodeMathInstruction
instruction
=
new
TargetCodeMathInstruction
(
result
,
mathExpressionSymbol
);
Log
.
info
(
mathExpressionSymbol
.
getClass
().
getName
()
+
" "
+
mathExpressionSymbol
.
getTextualRepresentation
(),
"GenerateSymbol:"
);
...
...
@@ -378,4 +382,6 @@ public class ComponentConverterMethodGeneration {
}
}
src/test/java/de/monticore/lang/monticar/generator/cpp/armadillo/ArmadilloFunctionTest.java
View file @
2123b848
...
...
@@ -284,9 +284,9 @@ public class ArmadilloFunctionTest extends AbstractSymtabTest {
public
void
testRectangleCommand
()
throws
IOException
{
testMathCommand
(
"rectangle"
);
}
/*
@Test
//only for testing
public
void
testErodeAndGaussianBlur
()
throws
IOException
{
testMathCommand
(
"erodeAndGaussianBlur"
);
}
*/
}
}
src/test/resources/results/armadillo/testMath/l0/test_math_boundingRectCommandTest.h
View file @
2123b848
...
...
@@ -9,7 +9,7 @@ using namespace arma;
using
namespace
cv
;
class
test_math_boundingRectCommandTest
{
public:
double
contour
;
vector
<
cv
::
Point
>
contour
;
double
rect
;
void
init
()
{
...
...
src/test/resources/results/armadillo/testMath/l0/test_math_erodeAndGaussianBlurCommandTest.h
View file @
2123b848
...
...
@@ -5,25 +5,27 @@
#endif
#include "armadillo"
#include "opencv2/imgproc.hpp"
#include <vector>
#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
;
cube
src
;
int
erosion_elemIn
;
colvec
sizeY
;
colvec
two
;
cube
outMatrix
;
mat
out2Matrix
;
void
init
()
{
src
=
mat
(
n
,
m
);
dstB
=
mat
(
n
,
m
);
src
=
cube
(
3
,
n
,
m
);
sizeY
=
colvec
(
3
);
two
=
colvec
(
2
);
outMatrix
=
cube
(
3
,
n
,
m
);
out2Matrix
=
mat
(
2
,
m
);
}
void
erodeHelper
(
mat
src
,
mat
dst
,
int
erosion_elem
,
int
iterations
)
void
erodeHelper
(
cube
src
,
cube
dst
,
int
erosion_elem
,
int
iterations
)
{
int
erosion_type
=
0
;
if
(
erosion_elem
==
0
){
erosion_type
=
MORPH_RECT
;
}
...
...
@@ -35,17 +37,10 @@ void erodeHelper(mat src, mat dst, int erosion_elem, int iterations)
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
);
findContours
(
image
,
contours
,
mode
,
method
);
erodeHelper
(
src
,
dst
,
erosion_elem
,
iterations
);
mat
deterMat
=
(
det
(
dst
));
mat
dstB
;
gaussianBlurHelper
(
dst
,
dstB
,
sizeX
,
sizeY
,
sigmaX
,
sigmaY
);
}
};
...
...
src/test/resources/results/armadillo/testMath/l0/test_math_findContoursCommandTest.h
View file @
2123b848
...
...
@@ -13,17 +13,14 @@ public:
mat
image
;
int
mode
;
int
method
;
mat
hierarchy
;
mat
contours
;
vector
<
vector
<
cv
::
Point
>>
contours
;
void
init
()
{
image
=
mat
(
n
,
m
);
hierarchy
=
mat
(
x
,
y
);
contours
=
mat
(
w
,
z
);
}
void
execute
()
{
findContours
(
image
,
contours
,
hierarchy
,
mode
,
method
);
findContours
(
image
,
contours
,
mode
,
method
);
}
};
...
...
src/test/resources/results/armadillo/testMath/l0/test_math_largestContourCommandTest.h
View file @
2123b848
...
...
@@ -9,8 +9,8 @@ using namespace arma;
using
namespace
cv
;
class
test_math_largestContourCommandTest
{
public:
double
contours
;
double
lContour
;
vector
<
vector
<
cv
::
Point
>>
contours
;
vector
<
cv
::
Point
>
lContour
;
void
init
()
{
}
...
...
src/test/resources/results/armadillo/testMath/l0/test_math_rectangleCommandTest.h
View file @
2123b848
...
...
@@ -10,7 +10,7 @@ using namespace cv;
class
test_math_rectangleCommandTest
{
public:
cube
src
;
double
rect
;
Rect
rect
;
colvec
color
;
int
thickness
;
int
lineType
;
...
...
src/test/resources/test/math/ErodeAndGaussianBlurCommandTest.emam
View file @
2123b848
...
...
@@ -3,23 +3,16 @@ package test.math;
component
ErodeAndGaussianBlurCommandTest
{
port
in
Q
^{
n
,
m
}
src
,
in
Q
^{
3
,
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
;
in
Q
^{
3
}
sizeY
,
in
Q
^{
2
}
two
,
out
Q
^{
3
,
n
,
m
}
outMatrix
,
out
Q
^{
2
,
m
}
out2Matrix
;
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
);
//}
implementation
Math
{
contours
=
findContours
(
image
,
mode
,
method
);
dst
=
erode
(
src
,
erosion_elem
,
iterations
);
}
}
src/test/resources/test/math/FindContoursCommandTest.emam
View file @
2123b848
...
...
@@ -6,10 +6,9 @@ component FindContoursCommandTest{
in
Q
^{
n
,
m
}
image
,
in
Z
mode
,
in
Z
method
,
out
Q
^{
x
,
y
}
hierarchy
,
out
Q
^{
w
,
z
}
contours
;
out
Q
contours
;
implementation
Math
{
contours
=
findContours
(
image
,
hierarchy
,
mode
,
method
);
contours
=
findContours
(
image
,
mode
,
method
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment