BallTracking.emam 2.41 KB
Newer Older
Ahmed's avatar
Ahmed committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89
/* (c) https://github.com/MontiCore/monticore */
package de.rwth.ba;

component BallTracking{
    port
    in Q^{3,1280,720} 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
    out Q^{3,1280,720} modImageOut;

    instance CVGaussianBlur<1280,720> gaussBlur;
    instance CVCvtColor<1280,720> cvtColor;
	instance CVInRange<1280,720> inRange;
    instance CVErode<1280,720> erode;
    instance CVDilate<1280,720> dilate;
    instance CVFindContours<1280,720> findContours;
    instance CVLargestContour largestContour;
    instance CVBoundingRect boundingRect;
    instance CVRectangle<1280,720> rectAngle;

	//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;
	
	//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;

	//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;

}