Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
monticore
EmbeddedMontiArc
generators
EMAM2Cpp
Commits
6a065901
Commit
6a065901
authored
Apr 07, 2020
by
Ahmed
Browse files
some fixes
parent
8f53e604
Changes
6
Hide whitespace changes
Inline
Side-by-side
src/main/java/de/monticore/lang/monticar/generator/MathCommand.java
View file @
6a065901
...
...
@@ -106,7 +106,7 @@ public abstract class MathCommand {
if
(
code
.
contains
(
"mat("
)){
code
=
code
.
replace
(
"mat("
,
"Mat<unsigned char>("
);
}
else
if
(
code
.
contains
(
"cube("
)){
code
=
code
.
replace
(
"
mat
("
,
"Cube<unsigned char>("
);
code
=
code
.
replace
(
"
cube
("
,
"Cube<unsigned char>("
);
}
((
TargetCodeInstruction
)
instruct
).
setInstruction
(
code
);
}
...
...
src/main/java/de/monticore/lang/monticar/generator/cpp/commands/RectangleCommand.java
View file @
6a065901
...
...
@@ -55,7 +55,7 @@ public class RectangleCommand extends MathCommand{
MathFunctionFixer
.
fixMathFunctions
(
accessSymbol
,
bluePrintCPP
);
String
nameOfSecondParameter
=
mathMatrixNameExpressionSymbol
.
getMathMatrixAccessOperatorSymbol
().
getMathMatrixAccessSymbols
().
get
(
1
).
getTextualRepresentation
();
ComponentConverter
.
fixVariableType
(
nameOfSecondParameter
,
bluePrintCPP
,
"Q"
,
"Rect"
,
""
);
ComponentConverter
.
fixVariableType
(
nameOfSecondParameter
,
bluePrintCPP
,
"Q"
,
"
cv::
Rect"
,
""
);
Method
rectangleHelperMethod
=
getRectangleHelperMethod
(
mathMatrixNameExpressionSymbol
,
bluePrintCPP
,
properties
);
valueListString
+=
ExecuteMethodGenerator
.
generateExecuteCode
(
mathExpressionSymbol
,
new
ArrayList
<
String
>());
...
...
src/test/resources/results/armadillo/testMath/l0/test_math_erodeAndGaussianBlurCommandTest.h
View file @
6a065901
...
...
@@ -21,10 +21,10 @@ Cube<unsigned char> outMatrix;
arma
::
Mat
<
unsigned
char
>
out2Matrix
;
void
init
()
{
src
=
c
ube
(
n
,
m
,
3
);
src
=
C
ube
<
unsigned
char
>
(
n
,
m
,
3
);
sizeY
=
colvec
(
3
);
two
=
colvec
(
2
);
outMatrix
=
c
ube
(
3
,
n
,
m
);
outMatrix
=
C
ube
<
unsigned
char
>
(
3
,
n
,
m
);
out2Matrix
=
Mat
<
unsigned
char
>
(
2
,
m
);
}
void
erodeHelper
(
const
Cube
<
unsigned
char
>&
src
,
cv
::
Mat
&
dst
,
int
erosion_elem
,
int
iterations
)
...
...
@@ -66,4 +66,3 @@ findContoursHelper(dst3, contours);
};
#endif
src/test/resources/results/armadillo/testMath/l0/test_math_gaussianBlurCommandTest.h
View file @
6a065901
...
...
@@ -18,8 +18,8 @@ double sigmaY;
Cube
<
unsigned
char
>
dst
;
void
init
()
{
src
=
c
ube
(
n
,
m
,
3
);
dst
=
c
ube
(
n
,
m
,
3
);
src
=
C
ube
<
unsigned
char
>
(
n
,
m
,
3
);
dst
=
C
ube
<
unsigned
char
>
(
n
,
m
,
3
);
}
void
gaussianBlurHelper
(
const
Cube
<
unsigned
char
>&
src
,
Cube
<
unsigned
char
>&
dst
,
int
sizeX
,
int
sizeY
,
double
sigmaX
,
double
sigmaY
)
{
...
...
@@ -36,4 +36,4 @@ gaussianBlurHelper(src, dst, sizeX, sizeY, sigmaX, sigmaY);
}
};
#endif
#endif
\ No newline at end of file
src/test/resources/results/armadillo/testMath/l0/test_math_rectangleCommandTest.h
View file @
6a065901
...
...
@@ -11,16 +11,16 @@ using namespace std;
class
test_math_rectangleCommandTest
{
public:
Cube
<
unsigned
char
>
src
;
Rect
rect
;
cv
::
Rect
rect
;
colvec
color
;
int
thickness
;
int
lineType
;
Cube
<
unsigned
char
>
outputImg
;
void
init
()
{
src
=
c
ube
(
3
,
n
,
m
);
src
=
C
ube
<
unsigned
char
>
(
3
,
n
,
m
);
color
=
colvec
(
3
);
outputImg
=
c
ube
(
3
,
n
,
m
);
outputImg
=
C
ube
<
unsigned
char
>
(
3
,
n
,
m
);
}
Cube
<
unsigned
char
>
rectangleHelper
(
const
Cube
<
unsigned
char
>&
src
,
cv
::
Rect
&
rect
,
colvec
color
,
int
thickness
,
int
lineType
)
{
...
...
src/test/resources/test/math/ErodeAndGaussianBlurCommandTest.emam
View file @
6a065901
...
...
@@ -12,11 +12,14 @@ component ErodeAndGaussianBlurCommandTest{
out
Q
^{
3
,
n
,
m
}
outMatrix
,
out
Q
^{
2
,
m
}
out2Matrix
;
implementation
Math
{
instance
GaussianBlurCommandTest
gaussBlur
;
instance
CvtColorCommandTest
cvtColor
;
dst
=
erode
(
src
,
erosion_elem
,
iterations
);
dst3
=
dilate
(
dst
,
dilation_elem
,
iterations
);
contours
=
findContours
(
dst3
);
//
implementation
Math
{
}
//
dst
=
erode
(
src
,
erosion_elem
,
iterations
);
//
dst3
=
dilate
(
dst
,
dilation_elem
,
iterations
);
//
contours
=
findContours
(
dst3
);
//}
}
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