Пример #1
0
 public virtual void drawContours(Contour2DfArray contours, Image displayImage)
 {
     solar_api_displayPINVOKE.I2DOverlay_drawContours(swigCPtr, Contour2DfArray.getCPtr(contours), Image.getCPtr(displayImage));
     if (solar_api_displayPINVOKE.SWIGPendingException.Pending)
     {
         throw solar_api_displayPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Пример #2
0
        public virtual FrameworkReturnCode correct(Image inputImg, Contour2DfArray contours, ImageList patches)
        {
            FrameworkReturnCode ret = (FrameworkReturnCode)solar_api_imagePINVOKE.IPerspectiveController_correct__SWIG_0(swigCPtr, Image.getCPtr(inputImg), Contour2DfArray.getCPtr(contours), ImageList.getCPtr(patches));

            if (solar_api_imagePINVOKE.SWIGPendingException.Pending)
            {
                throw solar_api_imagePINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
Пример #3
0
        public virtual FrameworkReturnCode filter(Contour2DfArray inContours, Contour2DfArray outContours)
        {
            FrameworkReturnCode ret = (FrameworkReturnCode)solar_api_featuresPINVOKE.IContoursFilter_filter(swigCPtr, Contour2DfArray.getCPtr(inContours), Contour2DfArray.getCPtr(outContours));

            if (solar_api_featuresPINVOKE.SWIGPendingException.Pending)
            {
                throw solar_api_featuresPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
Пример #4
0
        public virtual FrameworkReturnCode extract(ImageList images, Contour2DfArray inContours, DescriptorBuffer descriptors, Contour2DfArray outContours)
        {
            FrameworkReturnCode ret = (FrameworkReturnCode)solar_api_featuresPINVOKE.IDescriptorsExtractorSBPattern_extract__SWIG_0(swigCPtr, ImageList.getCPtr(images), Contour2DfArray.getCPtr(inContours), DescriptorBuffer.getCPtr(descriptors), Contour2DfArray.getCPtr(outContours));

            if (solar_api_featuresPINVOKE.SWIGPendingException.Pending)
            {
                throw solar_api_featuresPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
Пример #5
0
        public virtual FrameworkReturnCode reindex(Contour2DfArray candidateContours, DescriptorMatchVector matches, Point2DfArray patternPoints, Point2DfArray imagePoints)
        {
            FrameworkReturnCode ret = (FrameworkReturnCode)solar_api_featuresPINVOKE.ISBPatternReIndexer_reindex(swigCPtr, Contour2DfArray.getCPtr(candidateContours), DescriptorMatchVector.getCPtr(matches), Point2DfArray.getCPtr(patternPoints), Point2DfArray.getCPtr(imagePoints));

            if (solar_api_featuresPINVOKE.SWIGPendingException.Pending)
            {
                throw solar_api_featuresPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
Пример #6
0
        public virtual FrameworkReturnCode extract(Image inputImg, Contour2DfArray contours)
        {
            FrameworkReturnCode ret = (FrameworkReturnCode)solar_api_featuresPINVOKE.IContoursExtractor_extract(swigCPtr, Image.getCPtr(inputImg), Contour2DfArray.getCPtr(contours));

            if (solar_api_featuresPINVOKE.SWIGPendingException.Pending)
            {
                throw solar_api_featuresPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
Пример #7
0
        public FiducialPipeline(IComponentManager xpcfComponentManager) : base(xpcfComponentManager)
        {
            binaryMarker = Create <IMarker2DSquaredBinary>("SolARMarker2DSquaredBinaryOpencv");

#if !NDEBUG
            imageViewer                 = Create <IImageViewer>("SolARImageViewerOpencv");
            imageViewerGrey             = Create <IImageViewer>("SolARImageViewerOpencv", "grey");
            imageViewerBinary           = Create <IImageViewer>("SolARImageViewerOpencv", "binary");
            imageViewerContours         = Create <IImageViewer>("SolARImageViewerOpencv", "contours");
            imageViewerFilteredContours = Create <IImageViewer>("SolARImageViewerOpencv", "filteredContours");
#endif
            overlay3DComponent = Create <I3DOverlay>("SolAR3DOverlayOpencv");

            imageFilterBinary          = Create <IImageFilter>("SolARImageFilterBinaryOpencv");
            imageConvertor             = Create <IImageConvertor>("SolARImageConvertorOpencv");
            contoursExtractor          = Create <IContoursExtractor>("SolARContoursExtractorOpencv");
            contoursFilter             = Create <IContoursFilter>("SolARContoursFilterBinaryMarkerOpencv");
            perspectiveController      = Create <IPerspectiveController>("SolARPerspectiveControllerOpencv");
            patternDescriptorExtractor = Create <IDescriptorsExtractorSBPattern>("SolARDescriptorsExtractorSBPatternOpencv");

            patternMatcher   = Create <IDescriptorMatcher>("SolARDescriptorMatcherRadiusOpencv");
            patternReIndexer = Create <ISBPatternReIndexer>("SolARSBPatternReIndexer");

            img2worldMapper = Create <IImage2WorldMapper>("SolARImage2WorldMapper4Marker2D");
            PnP             = Create <I3DTransformFinderFrom2D3D>("SolARPoseEstimationPnpOpencv");
#if !NDEBUG
            overlay2DContours = Create <I2DOverlay>("SolAR2DOverlayOpencv", "contours");
            overlay2DCircles  = Create <I2DOverlay>("SolAR2DOverlayOpencv", "circles");
#endif

            greyImage   = SharedPtr.Alloc <Image>().AddTo(subscriptions);
            binaryImage = SharedPtr.Alloc <Image>().AddTo(subscriptions);

            contours                      = new Contour2DfArray().AddTo(subscriptions);
            filtered_contours             = new Contour2DfArray().AddTo(subscriptions);
            patches                       = new ImageList().AddTo(subscriptions);
            recognizedContours            = new Contour2DfArray().AddTo(subscriptions);
            recognizedPatternsDescriptors = new DescriptorBuffer().AddTo(subscriptions);
            markerPatternDescriptor       = new DescriptorBuffer().AddTo(subscriptions);
            patternMatches                = new DescriptorMatchVector().AddTo(subscriptions);
            pattern2DPoints               = new Point2DfArray().AddTo(subscriptions);
            img2DPoints                   = new Point2DfArray().AddTo(subscriptions);
            pattern3DPoints               = new Point3DfArray().AddTo(subscriptions);
            //CamCalibration K;

            // components initialisation
            binaryMarker.loadMarker().Check();
            patternDescriptorExtractor.extract(binaryMarker.getPattern(), markerPatternDescriptor).Check();
            var binaryMarkerSize = binaryMarker.getSize();

            var patternSize = binaryMarker.getPattern().getSize();

            patternDescriptorExtractor.BindTo <IConfigurable>().getProperty("patternSize").setIntegerValue(patternSize);
            patternReIndexer.BindTo <IConfigurable>().getProperty("sbPatternSize").setIntegerValue(patternSize);

            // NOT WORKING ! initialize image mapper with the reference image size and marker size
            var img2worldMapperConf = img2worldMapper.BindTo <IConfigurable>();
            img2worldMapperConf.getProperty("digitalWidth").setIntegerValue(patternSize);
            img2worldMapperConf.getProperty("digitalHeight").setIntegerValue(patternSize);
            img2worldMapperConf.getProperty("worldWidth").setFloatingValue(binaryMarkerSize.width);
            img2worldMapperConf.getProperty("worldHeight").setFloatingValue(binaryMarkerSize.height);
        }