Esempio n. 1
0
        public int GetMaxQueueLength()
        {
            int maxQueueLen;

            QTrkDLL.QTrkGetQueueLength(inst, out maxQueueLen);
            return(maxQueueLen);
        }
Esempio n. 2
0
        public RMFrameCounters GetFrameCounters()
        {
            RMFrameCounters dst;

            QTrkDLL.RMGetFrameCounters(inst, out dst);
            return(dst);
        }
Esempio n. 3
0
        public LUTSize GetRadialZLUTSize()
        {
            LUTSize s;

            QTrkDLL.QTrkGetRadialZLUTSize(inst, out s.count, out s.planes, out s.radialsteps);
            return(s);
        }
Esempio n. 4
0
        public static QTrkComputedConfig FromConfig(QTrkConfig cfg)
        {
            QTrkComputedConfig cc;

            QTrkDLL.QTrkGetComputedConfig(ref cfg, out cc);
            return(cc);
        }
Esempio n. 5
0
        public LocalizationResult[] GetBeadResults(int start, int numFrames, int bead)
        {
            LocalizationResult[] results = new LocalizationResult[numFrames];
            int count = QTrkDLL.RMGetBeadResults(inst, start, numFrames, bead, out results);

            Array.Resize(ref results, count);
            return(results);
        }
Esempio n. 6
0
        public LocalizationResult[] GetResults(int startFrame, int numFrames)
        {
            LocalizationResult[] results = new LocalizationResult[numFrames * rmcfg.numBeads];
            int count = QTrkDLL.RMGetResults(inst, startFrame, numFrames, out results);

            Array.Resize(ref results, count * rmcfg.numBeads);
            return(results);
        }
Esempio n. 7
0
 public void Dispose()
 {
     if (inst != IntPtr.Zero)
     {
         QTrkDLL.RMDestroy(inst);
         inst = IntPtr.Zero;
     }
 }
Esempio n. 8
0
        public static void GenerateImageFromLUT(FloatImg image, FloatImg zlut, float minradius, float maxradius, Vector3 pos, bool useSplineInterp, int ovs)
        {
            ImageData imgData  = image.ImageData;
            ImageData zlutData = zlut.ImageData;

            QTrkDLL.GenerateImageFromLUT(ref imgData, ref zlutData, minradius, maxradius,
                                         pos, useSplineInterp, ovs);
        }
Esempio n. 9
0
        public void ScheduleLocalization(FloatImg img, uint frame, int zlut, uint timestamp)
        {
            ImageData       d   = img.ImageData;
            LocalizationJob job = new LocalizationJob()
            {
                frame = frame, timestamp = timestamp, zlutIndex = zlut
            };

            QTrkDLL.QTrkScheduleLocalization(inst, d.data, d.Pitch, QTRK_PixelDataType.Float, &job);
        }
Esempio n. 10
0
        public void Destroy()
        {
            if (inst != IntPtr.Zero)
            {
                Trace.WriteLine("Disposing QTrk instance...");

                QTrkDLL.QTrkFreeInstance(inst);
                inst = IntPtr.Zero;
            }
        }
Esempio n. 11
0
        public QTrkInstance(QTrkConfig config)
        {
            if (!IsDLLSelected)
            {
                throw new ApplicationException("Use QTrkInstance::SelectDLL before creating an instance");
            }

            inst = QTrkDLL.QTrkCreateInstance(ref config);
            QTrkDLL.QTrkGetComputedConfig(ref config, out cc);
        }
Esempio n. 12
0
        public void ScheduleFrameBitmap(Bitmap bmp, Int2[] positions, LocalizationJob[] jobInfo)
        {
//        public static extern int QTrkScheduleFrame(IntPtr qtrk, void* imgptr, int pitch, int width, int height, Int2* positions, int numROI, QTRK_PixelDataType pdt, LocalizationJob* jobInfo);
            BitmapData bmpData = bmp.LockBits(new Rectangle(0, 0, bmp.Width, bmp.Height), ImageLockMode.ReadOnly, PixelFormat.Format8bppIndexed);

            QTrkDLL.QTrkScheduleFrame(inst, bmpData.Scan0, bmpData.Stride, bmpData.Width, bmpData.Height, positions, positions.Length, QTRK_PixelDataType.U8, jobInfo);

            bmp.UnlockBits(bmpData);

//			QTrkDLL.QTrkScheduleFrame(inst,
        }
Esempio n. 13
0
        public FloatImg GetRadialZLUT()
        {
            int count, planes, radialsteps;

            QTrkDLL.QTrkGetRadialZLUTSize(inst, out count, out planes, out radialsteps);

            FloatImg lut = new FloatImg(radialsteps, planes * count);

            QTrkDLL.QTrkGetRadialZLUT(inst, lut.pixels);
            return(lut);
        }
Esempio n. 14
0
        public ResultManager(string file, string frameInfoFile, ResultManagerConfig rmcfg, string[] colnames)
        {
            string scsColNames = colnames != null?string.Join(";", colnames) : "";

            if (frameInfoFile == null)
            {
                frameInfoFile = "";
            }
            rmcfg.numFrameInfoColumns = colnames == null ? 0 : colnames.Length;
            inst       = QTrkDLL.RMCreate(file, frameInfoFile, ref rmcfg, scsColNames);
            this.rmcfg = rmcfg;
        }
Esempio n. 15
0
        public static Int2[] FindBeads(FloatImg img, Int2 sampleCornerPos, int roi, float imgRelDist, float acceptance)
        {
// public static extern IntPtr QTrkFindBeads(float* image, int w, int h, int smpCornerPosX, int smpCornerPosY, int roi, float imgRelDist, float acceptance);
            int       beadCount;
            ImageData sampleImg   = new ImageData();
            ImageData imgData     = img.ImageData;
            IntPtr    beadListPtr = QTrkDLL.QTrkFindBeads(ref imgData, sampleCornerPos.x, sampleCornerPos.y, roi, imgRelDist, acceptance, out beadCount, ref sampleImg);
            Int2 *    beadpos     = (Int2 *)beadListPtr.ToPointer();

            Int2[] r = new Int2[beadCount];
            for (int i = 0; i < beadCount; i++)
            {
                r[i] = beadpos[i];
            }

            QTrkDLL.QTrkFreeROIPositions(beadListPtr);
            return(r);
        }
Esempio n. 16
0
        public FloatImg[] GetRadialZLUTImages()
        {
            int count, planes, radialsteps;

            QTrkDLL.QTrkGetRadialZLUTSize(inst, out count, out planes, out radialsteps);

            IntPtr lutspace = Marshal.AllocHGlobal(sizeof(float) * count * planes * radialsteps);

            QTrkDLL.QTrkGetRadialZLUT(inst, lutspace);

            FloatImg[] luts = new FloatImg[count];
            float *    src  = (float *)lutspace.ToPointer();

            for (int i = 0; i < count; i++)
            {
                float *srcimg = &src[i * planes * radialsteps];
                luts[i] = new FloatImg(radialsteps, planes, srcimg);
            }

            Marshal.FreeHGlobal(lutspace);

            return(luts);
        }
Esempio n. 17
0
 public void SetTracker(QTrkInstance trkInst)
 {
     tracker = trkInst;
     QTrkDLL.RMSetTracker(inst, trkInst.InstancePtr);
 }
Esempio n. 18
0
        public static void ApplyPoissonNoise(FloatImg img, float poissonMax, float maxValue)
        {
            ImageData imgData = img.ImageData;

            QTrkDLL.ApplyPoissonNoise(ref imgData, poissonMax, maxValue);
        }
Esempio n. 19
0
 public static void SelectDLL(bool useDebug, bool useCUDA, string baseDir = "")
 {
     QTrkDLL.SelectNativeLibrary(baseDir == "" ? Directory.GetCurrentDirectory() : baseDir, useDebug, useCUDA, IntPtr.Size == 8);
     IsDLLSelected = true;
 }
Esempio n. 20
0
 public static void NormalizeRadialProfile(float[] prof)
 {
     QTrkDLL.NormalizeRadialProfile(prof, prof.Length);
 }
Esempio n. 21
0
 public void BeginLUT(bool normalize)
 {
     QTrkDLL.QTrkBeginLUT(inst, (uint)(normalize ? 4 : 0));
 }
Esempio n. 22
0
        public void Normalize()
        {
            ImageData r = ImageData;

            QTrkDLL.NormalizeImage(ref r);
        }
Esempio n. 23
0
        public static void ComputeRadialProfile(float[] dst, int angularSteps, float minradius, float maxradius, Vector2 center, FloatImg src, float mean, bool normalize)
        {
            ImageData d = src.ImageData;

            QTrkDLL.ComputeRadialProfile(dst, dst.Length, angularSteps, minradius, maxradius, center, &d, mean, normalize);
        }
Esempio n. 24
0
 public void RemoveBead(int bead)
 {
     QTrkDLL.RMRemoveBead(inst, bead);
 }
Esempio n. 25
0
        public void BuildLUT(FloatImg image, int plane)
        {
            ImageData data = image.ImageData;

            QTrkDLL.QTrkBuildLUT(inst, data.data, data.Pitch, QTRK_PixelDataType.Float, plane, null);
        }
Esempio n. 26
0
 public void SetLocalizationMode(LocalizeModeEnum locMode)
 {
     QTrkDLL.QTrkSetLocalizationMode(inst, (int)locMode);
 }
Esempio n. 27
0
 public void Flush()
 {
     QTrkDLL.RMFlush(inst);
 }
Esempio n. 28
0
 public void Flush()
 {
     QTrkDLL.QTrkFlush(inst);
 }
Esempio n. 29
0
 public void ScheduleLocalization(ref ImageData img, LocalizationJob *job)
 {
     QTrkDLL.QTrkScheduleLocalization(inst, img.data, img.Pitch, QTRK_PixelDataType.Float, job);
 }
Esempio n. 30
0
 public void StoreFrameInfo(int frame, double timestamp, float[] cols)
 {
     QTrkDLL.RMStoreFrameInfo(inst, frame, timestamp, cols);
 }