Menu

Display utilities Named Window doesn't produce output

Q3Varnam
2014-07-18
2014-07-18
  • Q3Varnam

    Q3Varnam - 2014-07-18

    I am trying out FelzenszwalbHuttenlocherSegmenter.

    When I do this

                    display.addVideoListener(new VideoDisplayListener<MBFImage>() {
    
                        @Override
                        public void beforeUpdate(MBFImage frame)
                        {
                            DisplayUtilities.display(SegmentationUtilities.renderSegments(320, 240, seg.segment(frame)));
                        }
    

    This results in multiple windows opening for each frame of the segmented image. Hence I tried using the named window code below, so that I get a single segmented window

                    DisplayUtilities.createNamedWindow("Background");
                    VideoDisplay<MBFImage> display = 
                    VideoDisplay.createVideoDisplay(video);
                    display.addVideoListener(new VideoDisplayListener<MBFImage>() {
    
                        @Override
                        public void beforeUpdate(MBFImage frame)
                        {
    
                                                    DisplayUtilities.updateNamed("Background",SegmentationUtilities.renderSegments(320, 240, seg.segment(frame)),"Segmented");
    
    
                               }
    

    The named window code is producing only the video window, it doesn't produce the named window, is my usage correct?

    Secondly this code takes ages to process a single frame and render it, the CPU is not loaded most of the time, is there anything fundamentally incorrect in the way I am trying to run the segmenter?

     
  • Jonathon Hare

    Jonathon Hare - 2014-07-18

    Just do it like this:

    display.addVideoListener(new VideoDisplayListener<MBFImage>() {
        @Override
        public void beforeUpdate(MBFImage frame) {
            DisplayUtilities.displayName(SegmentationUtilities.renderSegments(320, 240, seg.segment(frame)), "Segmented");
        }
    
     
  • Q3Varnam

    Q3Varnam - 2014-07-18

    Thanks resolved.

     

Anonymous
Anonymous

Add attachments
Cancel