Commit 6a065901 authored by Ahmed's avatar Ahmed

some fixes

parent 8f53e604
......@@ -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);
}
......
......@@ -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>());
......
......@@ -21,10 +21,10 @@ Cube<unsigned char> outMatrix;
arma::Mat<unsigned char> out2Matrix;
void init()
{
src = cube(n, m, 3);
src = Cube<unsigned char>(n, m, 3);
sizeY=colvec(3);
two=colvec(2);
outMatrix = cube(3, n, m);
outMatrix = Cube<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
......@@ -18,8 +18,8 @@ double sigmaY;
Cube<unsigned char> dst;
void init()
{
src = cube(n, m, 3);
dst = cube(n, m, 3);
src = Cube<unsigned char>(n, m, 3);
dst = Cube<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
......@@ -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 = cube(3, n, m);
src = Cube<unsigned char>(3, n, m);
color=colvec(3);
outputImg = cube(3, n, m);
outputImg = Cube<unsigned char>(3, n, m);
}
Cube<unsigned char> rectangleHelper(const Cube<unsigned char>& src, cv::Rect& rect, colvec color, int thickness, int lineType)
{
......
......@@ -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);
//}
}
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