21.5 Video to Images
About1 Introduction2 Image Recognition3 TransApplet4 API5 Interface6 Input7 Image Display8 Preprocessing9 Processing10 Normalization11 Parameter Class12 Image Signatures13 Unsupervised Filters14 BioFilters15 NeuralFilters16 Dynamic Library17 NeuralNet Filter18 Parameters19 Input Options20 Database Input21 Video Input22  Live Video Input23  Counting & Tracking24  Counting 25  Batch Job26 ImageFinder for DOS27 ImageHunt 28 Support Packages

21.1  Class Name 
21.2  Class Overview 
21.3  Link to Class 
21.4 AVI Selection 
21.5 Video to Images 
21.6 Testing 
[Home][21 Video Input][21.5 Video to Images]

 

21.5   Converting Video to Images

To convert the video to images, a new button is added, “Change” (Figure 21.1). Clicking the button will bring up the form on Figure 21.2, which has a button, “*.avi To Image”.  The roles of the three buttons are:

  •    The “Set Parameter” button will specify the:
    •    Video-To-Image Directory
    •    Starting Frame Number
    •    Ending Frame Number
    •    Skip Step
  •    The “*.Avi To Image” button will do the image conversion.
  •    The “OK” button will end the form.

Double clicking the “*.Avi To Image” button will convert the AVI video to images, which is implemented as follows:

            private void button2_Click_1(object sender, System.EventArgs e)

            {

                if ( ! f.gui.script.aviVideo70.getVideoFileStatus() )

                {

                richTextBox1.Text =

                    "Please select a video source first.\n"

                    + "Please click the Mode button, then click the source button.\n"

                    + "The Mode button can looks like Dir, File, Sub Dir, ...\n";

                return;

                }

                

                try{

                f.mainMenuToAPI.script.aviVideo70.

        setVideoToImagesDir (f.gui.videoLiveParameters .imageOutputFolder  );

                f.mainMenuToAPI.script.aviVideo70.setFrameNumberStart  

        (f.gui.videoLiveParameters .videoStart ) ;

                f.mainMenuToAPI.script.aviVideo70.setFrameNumberEnd

         ( f.gui.videoLiveParameters .videoEnd )  ;

                f.mainMenuToAPI.script.aviVideo70.setFrameNumberStep

        (f.gui.videoLiveParameters .videoStep  );

                }

                catch (Exception ee)

                {

                    richTextBox1.Text = ee.ToString () + "\n";

                    return;

                }

         

                if ( ! f.mainMenuToAPI.script.aviVideo70.videoToImages () )

                    richTextBox1.Text =  "Conversion fails!";

                else

                    richTextBox1.AppendText ( "Conversion completed!\n" );

            }

The last statement,

        f.mainMenuToAPI.script.aviVideo70.videoToImages ()

will convert the *.avi file into images.

 

 

[Home][About][1 Introduction][2 Image Recognition][3 TransApplet][4 API][5 Interface][6 Input][7 Image Display][8 Preprocessing][9 Processing][10 Normalization][11 Parameter Class][12 Image Signatures][13 Unsupervised Filters][14 BioFilters][15 NeuralFilters][16 Dynamic Library][17 NeuralNet Filter][18 Parameters][19 Input Options][20 Database Input][21 Video Input][22 Live Video Input][23 Counting & Tracking][24 Counting ][25 Batch Job][26 ImageFinder for DOS][27 ImageHunt ][28 Support Packages]

Copyright (c) 2006 - 2007 Attrasoft. All rights reserved.

gina@attrasoft.com