|
|
|
|
[Home][21 Video Input][21.4 AVI Selection]
|
|
21.4 AVI Video SelectionThe basic Video Match operation is: (1) Specify a Video File; (2) Convert Video to Images; (3) Treat the Converted Images as Directory Input covered earlier. The only video format supported in this version is *.avi. If you need a different video format supported, customization will solve this problem. After starting the chapter projects software, selecting an *.avi file in Figure 19.1, the ImageFinder will convert the avi video file to a set of images. After that, video recognition is converted into image recognition. Example. Converting AVI Video:
Figure 21.1 Converting AVI Video File to Images, Step 1.
Figure 21.2 Converting AVI Video File to Images, Step 2. The �Source� button selects an *.avi file, which in turn, calls the following functions: int videoFilePointer = 0; private bool searachSource6 () { try { if ( f.openFileDialog1.ShowDialog () != DialogResult.OK ) return true;
bool b = f.openFileDialog1.FileName.EndsWith (".avi") || f.openFileDialog1.FileName.EndsWith (".AVI") || f.openFileDialog1.FileName.EndsWith (".Avi"); if (!b) { f.richTextBox1.Text = "Not *.avi file\n"; return false; } script.aviVideo70.setVideoFile ( f.openFileDialog1.FileName ); if ( ! script.aviVideo70.getVideoFileStatus() ) { f.richTextBox1.Text = "Video Selection Fail!\n" + script.aviVideo70.getMessage (); return false; } f.textBox2.Text = script.aviVideo70.getVideoFile () ;
script.aviVideo70.setVideoToImagesDir (this.videoLiveParameters .imageOutputFolder); f.richTextBox1.AppendText ( "Video To Image Directory: \n" + script.aviVideo70.getVideoToImagesDir () +"\n"); videoFilePointer = 0; f.pictureBox2.Image = script.aviVideo70.getBitmap (videoFilePointer); } catch (Exception ee ) { f.richTextBox1.AppendText ( ee.ToString () +"\n"); return false; } return true; } This code will:
We will now explain this code. The first statement, if ( openFileDialog1.ShowDialog () != DialogResult.OK ) return; opens a file dialog box and selects an *.avi file. The next statement, script.aviVideo70.setVideoFile ( f.openFileDialog1.FileName ); assigns the selected *.avi file to the script.aviVideo70 object. The next two statements, script.aviVideo70.setVideoToImagesDir (this.videoLiveParameters .imageOutputFolder); f.richTextBox1.AppendText ( "Video To Image Directory: \n" + script.aviVideo70.getVideoToImagesD creates the �Video To Image� directory, and prints a message to the text Box. The last statement, f.pictureBox2.Image = script.aviVideo70.getBitmap (videoFilePointer); prints the first image in the video.
[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. |