MultipleTemplateMatching::MultipleTemplateMatching() { setName("MultipleTemplateMatching"); setDesc(QObject::tr("Match a template on an image and output the all found positions, the matching scores and the result image")); setGroup("image/object detection"); mImageIn.setName("image"); addInputPort(mImageIn); mTemplateIn.setName("template"); addInputPort(mTemplateIn); mMethodIn.setName("method"); mMethodIn.addChoice(CV_TM_CCORR_NORMED,tr("normalized cross correlation")); mMethodIn.addChoice(CV_TM_CCOEFF_NORMED, tr("fast normalized cross correlation")); mMethodIn.addChoice(CV_TM_SQDIFF_NORMED, tr("normalized squared differences")); mMethodIn.setDefault(CV_TM_CCOEFF_NORMED); mMethodIn.setVisibility(AdvancedPortVisibility); addInputPort(mMethodIn); mMinScoreIn.setName("min score"); mMinScoreIn.setRange(0.0,1.0); mMinScoreIn.setDefault(0.0); addInputPort(mMinScoreIn); mOffsetIn.setName("offset"); mOffsetIn.setDesc(QObject::tr("Offset that will be added to all calculated positions")); mOffsetIn.setDefault(QPointF(0.0, 0.0)); addInputPort(mOffsetIn); mOffsetIn.setVisibility(AdvancedPortVisibility); mScoreOuts.setName("scores"); mScoreOuts.setDesc(QObject::tr("The matching score of the found position")); addOutputListPort(mScoreOuts); mPositionOuts.setName("positions"); addOutputListPort(mPositionOuts); mNeedNewImage.setName("fresh image only"); mNeedNewImage.setDesc(QObject::tr("Only execute if the main input has a new image")); mNeedNewImage.setDefault(true); mNeedNewImage.setVisibility(AdvancedPortVisibility); addInputPort(mNeedNewImage); mSendResultImage.setName("send result image"); mSendResultImage.setDesc(QObject::tr("Set this to true if the result image of the template matching should be send on the port <result>")); mSendResultImage.setDefault(false); mSendResultImage.setVisibility(ExpertPortVisibility); addInputPort(mSendResultImage); mResultOut.setName("result"); mResultOut.setDesc(QObject::tr("The result image from the template matching operation. Only sent if the port <send result image> is set to true")); mResultOut.setVisibility(ExpertPortVisibility); addOutputPort(mResultOut); }
MomentFilter::MomentFilter() { setName("Moments"); setDesc(QObject::tr("Calculates the moments of a contour.")); setGroup("image/contour"); mIn.setName("input"); mNumPixelsOut.setName("numPixels"); mNumPixelsOut.setDesc(QObject::tr("The number of pixels inside a contour(m00)")); mCogOut.setName("cog"); mCogOut.setDesc(QObject::tr("The center of gravity (based on m01, m10 and m00")); addInputListPort(mIn); addOutputListPort(mNumPixelsOut); addOutputListPort(mCogOut); }
ConvexHullFilter::ConvexHullFilter() { setName("ConvexHullFilter"); setDesc("Calculates the convex hull of contour"); setGroup("user"); mIn.setName("input"); mIn.setDesc("A list of outer contours or a single one"); addInputListPort(mIn); mOut.setName("convexHull"); mOut.setDesc("The convex hulls in the same order as the inputs"); addOutputListPort(mOut); }
ConvexHull::ConvexHull() { setName("ConvexHull"); setDesc(QObject::tr("Calculates the convex hull of contour")); setGroup("image/contour"); mIn.setName("imageIn"); mIn.setDesc(QObject::tr("Image input")); addInputListPort(mIn); mOut.setName("convexHull"); mOut.setDesc(QObject::tr("Convex hull of input image")); addOutputListPort(mOut); }
FindContours::FindContours() { setName("FindContours"); setDesc(QObject::tr("Extracts contours from an image")); setGroup("image/contour"); mIn.setName("imageIn"); mIn.setDesc(QObject::tr("Image input")); addInputPort(mIn); mOffsetIn.setName("offset"); mOffsetIn.setDesc(QObject::tr("Offset that will be added to all calculated positions")); mOffsetIn.setDefault(QPointF(0.0, 0.0)); addInputPort(mOffsetIn); mContourOut.setName("contour"); addOutputListPort(mContourOut); }
ContoursFilter::ContoursFilter() { setName("ContoursFilter"); setDesc("Extracts contours from an image. The image should be thresholded"); setGroup("user"); mIn.setName("input"); mIn.setDesc("Thresholded input image"); addInputPort(mIn); mOffsetIn.setName("offset"); mOffsetIn.setDesc("Offset that will be added to all calculated positions"); mOffsetIn.setDefault(QPointF(0.0, 0.0)); addInputPort(mOffsetIn); mContourOut.setName("contour"); mContourOut.setDesc("A list of the calculated outer contours"); addOutputListPort(mContourOut); }