Commit 06d618d1 authored by Ahmed's avatar Ahmed

update branch

parent ee05bd33
Pipeline #273487 failed with stage
in 36 seconds
rm -rf target
java -jar embedded-montiarc-math-generator-0.1.16-SNAPSHOT-jar-with-dependencies.jar -m src/main/emam/ -r ba.ballTracking -o target -flag-generate-cmake
cd target
sed -i 's/cube/Cube<unsigned char>/g' ba_ballTracking.h
cd ..
rm -rf build
mkdir build && cd build
......
......@@ -19,30 +19,10 @@ int main(int argc, const char** argv) {
ba_ballTracking ballT_Object;
ballT_Object.init();
//GaussianBlur
ballT_Object.sizeXIn = 11;
ballT_Object.sizeYIn = 11;
ballT_Object.sigmaXIn = 0;
ballT_Object.sigmaYIn = 0;
ballT_Object.multiplicator = 2;
//CvtColor
ballT_Object.colorConversionIn = 40;
//InRange
ballT_Object.lowerBoundaryIn = { 20, 100, 100 };
ballT_Object.upperBoundaryIn = { 30, 255, 255 };
//Erode
ballT_Object.erosion_elemIn = 0;
ballT_Object.iterationsIn1 = 2;
//Dilate
ballT_Object.dilation_elemIn = 0;
ballT_Object.iterationsIn2 = 2;
//FindContours
ballT_Object.modeIn = 0;
ballT_Object.methodIn = 2;
//rectangle
ballT_Object.colorIn = { 0,0,0 };
ballT_Object.thicknessIn = 4;
ballT_Object.lineTypeIn = 4;
cv::namedWindow("w", 1);
......@@ -54,8 +34,6 @@ int main(int argc, const char** argv) {
ballT_Object.execute();
cv::Mat output_frame = to_cvmat<unsigned char>(ballT_Object.modImageOut);
// cv::flip(output_frame, output_frame, 0);
//video.write(output_frame);
cv::imshow("w", output_frame);
cv::waitKey(30);
}
......
package ba;
component CVGaussianBlur<N n=960,N m=720> {
component ArmaMult<N n=960,N m=720> {
port
in Q^{n,m,3} src,
in Z sizeX,
in Z sizeY,
in Q sigmaX,
in Q sigmaY,
in Z multi,
out Q^{n,m,3} dst;
implementation Math {
dst = gaussianBlur(src, sizeX, sizeY, sigmaX, sigmaY);
dst = multi * src;
}
}
\ No newline at end of file
package ba;
component CVBoundingRect {
component ArmaSum<N n=960,N m=720> {
port
in Q contour,
out Q rect;
in Q^{n,m,3} src,
out Q^{n,m,3} dst;
implementation Math {
rect = boundingRect(contour);
dst = src + src;
}
}
\ No newline at end of file
......@@ -4,86 +4,23 @@ package ba;
component BallTracking{
port
in Q^{960,720,3} imageIn,
//GaussianBlur ports
in Z sizeXIn,
in Z sizeYIn,
in Q sigmaXIn,
in Q sigmaYIn,
//CvtColor ports
in Z colorConversionIn,
//InRange ports
in Q^{3} lowerBoundaryIn,
in Q^{3} upperBoundaryIn,
//Erode ports
in Z erosion_elemIn,
in Z iterationsIn1,
//Dilate ports
in Z dilation_elemIn,
in Z iterationsIn2,
//FindContours ports
in Z modeIn,
in Z methodIn,
//RectAngle ports
in Q^{3} colorIn,
in Z thicknessIn,
in Z lineTypeIn,
// i want to input the image again
in Z multiplicator,
in Z color,
out Q^{960,720,3} modImageOut;
instance CVGaussianBlur<960,720> gaussBlur;
instance ArmaMult<960,720> armaMult;
instance CVCvtColor<960,720> cvtColor;
instance CVInRange<960,720> inRange;
instance CVErode<960,720> erode;
instance CVDilate<960,720> dilate;
instance CVFindContours<960,720> findContours;
instance CVLargestContour largestContour;
instance CVBoundingRect boundingRect;
instance CVRectangle<960,720> rectAngle;
instance ArmaSum<960,720> armaSum;
//GaussianBlur
connect imageIn -> gaussBlur.src;
connect sizeXIn -> gaussBlur.sizeX;
connect sizeYIn -> gaussBlur.sizeY;
connect sigmaXIn -> gaussBlur.sigmaX;
connect sigmaYIn -> gaussBlur.sigmaY;
connect gaussBlur.dst -> cvtColor.src;
connect imageIn -> armaMult.src;
connect multiplicator -> armaMult.multi;
connect armaMult.dst -> cvtColor.src;
//CvtColor
connect colorConversionIn -> cvtColor.colorConversion;
connect cvtColor.dst -> inRange.src;
//InRange
connect lowerBoundaryIn -> inRange.lowerBoundary;
connect upperBoundaryIn -> inRange.upperBoundary;
connect inRange.dst -> erode.src;
//Erode
connect erosion_elemIn -> erode.erosion_elem;
connect iterationsIn1 -> erode.iterations;
connect erode.dst -> dilate.src;
//dilate
connect dilation_elemIn -> dilate.dilation_elem;
connect iterationsIn2 -> dilate.iterations;
connect dilate.dst -> findContours.image;
//FindContours
connect modeIn -> findContours.mode;
connect methodIn -> findContours.method;
connect findContours.contours -> largestContour.contours;
//LargestContour
connect largestContour.lContour -> boundingRect.contour;
connect color -> cvtColor.colorConversion;
connect cvtColor.dst -> armaSum.src;
//BoundingRect
connect boundingRect.rect -> rectAngle.rect;
//CVRectAngle
connect imageIn -> rectAngle.src;
connect colorIn -> rectAngle.color;
connect thicknessIn -> rectAngle.thickness;
connect lineTypeIn -> rectAngle.lineType;
//how to connect the src Image here as input
connect rectAngle.outputImg -> modImageOut;
connect armaSum.dst -> modImageOut;
}
\ No newline at end of file
package ba;
component CVDilate<N n=960,N m=720> {
port
in Q^{n,m} src,
in Z dilation_elem,
in Z iterations,
out Q^{n,m} dst;
implementation Math{
dst = dilate(src, dilation_elem, iterations);
}
}
\ No newline at end of file
package ba;
component CVErode<N n=960,N m=720> {
port
in Q^{n,m} src,
in Z erosion_elem,
in Z iterations,
out Q^{n,m} dst;
implementation Math{
dst = erode(src, erosion_elem, iterations);
}
}
\ No newline at end of file
package ba;
component CVFindContours<N n=960,N m=720> {
port
in Q^{n,m} image,
in Z mode,
in Z method,
out Q contours;
implementation Math {
contours = findContours(image, mode, method);
}
}
\ No newline at end of file
package ba;
component CVInRange<N n=960,N m=720> {
port
in Q^{n,m,3} src,
in Q^{3} lowerBoundary,
in Q^{3} upperBoundary,
out Q^{n,m} dst;
implementation Math{
dst = inRange(src, lowerBoundary, upperBoundary);
}
}
package ba;
component CVLargestContour{
port
in Q contours,
out Q lContour;
implementation Math{
lContour = largestContour(contours);
}
}
\ No newline at end of file
package ba;
component CVRectangle<N n=960,N m=720>{
port
in Q^{n,m,3} src,
in Q rect,
in Q^{3} color,
in Z thickness,
in Z lineType,
out Q^{n,m,3} outputImg;
implementation Math {
outputImg = rectangle(src, rect, color, thickness, lineType);
}
}
\ No newline at end of file
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