Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
monticore
EmbeddedMontiArc
generators
EMAM2Cpp
Commits
4d31cd96
Commit
4d31cd96
authored
Jan 05, 2020
by
Ahmed
Browse files
add findContours command
parent
779f4aa1
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/main/java/de/monticore/lang/monticar/generator/cpp/LanguageUnitCPP.java
View file @
4d31cd96
...
...
@@ -125,7 +125,11 @@ public class LanguageUnitCPP extends LanguageUnit {
resultString
+=
"#include \""
+
string
+
".h\"\n"
;
for
(
String
string:
bluePrint
.
getCVIncludeStrings
())
resultString
+=
"#include \""
+
string
+
".hpp\"\n"
;
if
(
string
.
contains
(
"vector"
)){
resultString
+=
"#include <"
+
string
+
">\n"
;
}
else
{
resultString
+=
"#include \""
+
string
+
".hpp\"\n"
;
}
if
(
generatorCPP
.
isExecutionLoggingActive
)
resultString
+=
"#include <fstream>\n"
;
...
...
src/main/java/de/monticore/lang/monticar/generator/cpp/commands/FindContoursCommand.java
View file @
4d31cd96
...
...
@@ -19,7 +19,7 @@ import java.util.List;
* @author Ahmed Diab
*/
public
class
FindContoursCommand
extends
MathCommand
{
public
class
FindContoursCommand
extends
ArgumentReturn
MathCommand
{
public
FindContoursCommand
()
{
setMathCommandName
(
"findContours"
);
}
...
...
@@ -52,6 +52,7 @@ public class FindContoursCommand extends MathCommand{
mathMatrixNameExpressionSymbol
.
getMathMatrixAccessOperatorSymbol
().
setMathMatrixAccessSymbols
(
newMatrixAccessSymbols
);
((
BluePrintCPP
)
bluePrint
).
addCVIncludeString
(
"opencv2/imgproc"
);
((
BluePrintCPP
)
bluePrint
).
addCVIncludeString
(
"vector"
);
}
}
src/test/resources/results/armadillo/testMath/l0/test_math_findContoursCommandTest.h
View file @
4d31cd96
...
...
@@ -5,17 +5,26 @@
#endif
#include
"armadillo"
#include
"opencv2/imgproc.hpp"
#include
<vector>
using
namespace
arma
;
using
namespace
cv
;
class
test_math_findContoursCommandTest
{
public:
mat
image
;
int
mode
;
int
method
;
mat
hierarchy
;
mat
contours
;
void
init
()
{
image
=
mat
(
n
,
m
);
hierarchy
=
mat
(
x
,
y
);
contours
=
mat
(
w
,
z
);
}
void
execute
()
{
double
a
=
(
findContours
(
0
,
0
,
0
,
0
,
0
)
);
findContours
(
image
,
contours
,
hierarchy
,
mode
,
method
);
}
};
#endif
#endif
\ No newline at end of file
src/test/resources/test/math/FindContoursCommandTest.emam
View file @
4d31cd96
...
...
@@ -2,7 +2,14 @@
package
test
.
math
;
component
FindContoursCommandTest
{
implementation
Math
{
Q
a
=
findContours
(
0
,
0
,
0
,
0
,
0
);
port
in
Q
^{
n
,
m
}
image
,
in
Z
mode
,
in
Z
method
,
out
Q
^{
x
,
y
}
hierarchy
,
out
Q
^{
w
,
z
}
contours
;
implementation
Math
{
contours
=
findContours
(
image
,
hierarchy
,
mode
,
method
);
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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