当前位置: 首页>>代码示例>>C#>>正文


C# ITracker.InitializeNewTracking方法代码示例

本文整理汇总了C#中ITracker.InitializeNewTracking方法的典型用法代码示例。如果您正苦于以下问题:C# ITracker.InitializeNewTracking方法的具体用法?C# ITracker.InitializeNewTracking怎么用?C# ITracker.InitializeNewTracking使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ITracker的用法示例。


在下文中一共展示了ITracker.InitializeNewTracking方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: BeginMeasurements

        public void BeginMeasurements()
        {
            bool isColourBitmap = false;
            AstroImage currentImage = m_VideoController.GetCurrentAstroImage(false);
            //using (Bitmap nonIntegratedBmp = m_Host.FramePlayer.GetFrame(m_CurrFrameNo, true))
            //{
            //    isColourBitmap = BitmapFilter.IsColourBitmap(nonIntegratedBmp);
            //}

            LightCurveReductionContext.Instance.IsColourVideo = isColourBitmap;

            if (isColourBitmap &&
                TangraConfig.Settings.Photometry.ColourChannel != TangraConfig.ColourChannel.GrayScale)
            {
                string channel = TangraConfig.Settings.Photometry.ColourChannel.ToString();
                DialogResult dlgRes = m_VideoController.ShowMessageBox(
                    "Would you like to use the GrayScale band for this measurement only?\r\n\r\n" +
                    "This appears to be a colour video but the current band to measure is not set to GrayScale. It is recommended to use the GrayScale band for colour videos. \r\n\r\n" +
                    "To use the GrayScale band for this reduction only - press 'Yes', to use the currently set [" + channel + "] " +
                    "band press 'No'. To manually set a different band for this and other reductions press 'Cancel' and configure the band from the Tangra settings form before you continue.",
                    "Warning",
                    MessageBoxButtons.YesNoCancel,
                    MessageBoxIcon.Warning);

                if (dlgRes == DialogResult.Cancel)
                    return;

                if (dlgRes == DialogResult.Yes)
                    LightCurveReductionContext.Instance.ColourChannel = TangraConfig.ColourChannel.GrayScale;
                else
                    LightCurveReductionContext.Instance.ColourChannel = TangraConfig.Settings.Photometry.ColourChannel;
            }

            LightCurveReductionContext.Instance.ColourChannel = TangraConfig.Settings.Photometry.ColourChannel;

            //LightCurveReductionContext.Instance.OSDFrame =
            //    RegistryConfig.Instance.OSDSizes.GetOSDRectangleForFrameSize(
            //        VideoContext.Current.VideoStream.Width, VideoContext.Current.VideoStream.Height);

            m_BackedUpSelectMeasuringStarsState = m_StateMachine.m_CurrentStateObject;
            m_Measuring = false;
            m_Refining = true;
            m_ViewingLightCurve = false;
            m_Configuring = false;
            m_Correcting = false;

            if (m_StackedAstroImage == null)
            {
                EnsureStackedAstroImage();
                m_AveragedFrame = new AveragedFrame(m_StackedAstroImage);
            }

            string usedTrackerType;
            m_Tracker = TrackerFactory.CreateTracker(
                m_StackedAstroImage.Width,
                m_StackedAstroImage.Height,
                LightCurveReductionContext.Instance.LightCurveReductionType,
                m_VideoController.GetVideoFileFormat(),
                m_StateMachine.MeasuringStars,
                out usedTrackerType);

            LightCurveReductionContext.Instance.UsedTracker = usedTrackerType;
            TangraContext.Current.CrashReportInfo.Tracker = usedTrackerType;

            if (!m_Tracker.InitializeNewTracking(m_VideoController.GetCurrentAstroImage(false)))
                return;

            for (int i = 0; i < 4; i++)
            {
                m_ManualTrackingDeltaX[i] = 0;
                m_ManualTrackingDeltaY[i] = 0;
            }

            m_VideoController.InitializeTimestampOCR();

            if (m_VideoController.HasTimestampOCR() || m_VideoController.HasEmbeddedTimeStamps())
                LightCurveReductionContext.Instance.HasEmbeddedTimeStamps = true;
            else
                LightCurveReductionContext.Instance.HasEmbeddedTimeStamps = false;

            m_VideoController.StatusChanged("Refining");

            m_StateMachine.ChangeState(LightCurvesState.Running);

            MeasuringStarted();

            m_CameraName = m_VideoController.IsAstroDigitalVideo || m_VideoController.IsAstroAnalogueVideo ? m_VideoController.AstroVideoCameraModel : string.Empty;
            m_AavFrameIntegration = m_VideoController.IsAstroAnalogueVideo ? m_VideoController.AstroAnalogueVideoIntegratedAAVFrames : -1;
            m_AavNativeVideoFormat = m_VideoController.IsAstroAnalogueVideo ? m_VideoController.AstroVideoNativeVideoStandard : string.Empty;
            m_AavStackedFrameRate = m_VideoController.IsAstroAnalogueVideo ? m_VideoController.AstroAnalogueVideoStackedFrameRate : 0;

            if (LightCurveReductionContext.Instance.DebugTracking)
            {
                TangraContext.Current.CanPlayVideo = true;
                m_VideoController.UpdateViews();
            }
            else
                m_VideoController.PlayVideo(m_CurrFrameNo > -1 ? (int?)m_CurrFrameNo : null, 1);
        }
开发者ID:hpavlov,项目名称:tangra3,代码行数:99,代码来源:ReduceLightCurveOperation.cs


注:本文中的ITracker.InitializeNewTracking方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。