Automated Approach of Cataloguing TeraScan Images Utilizing Active Server Pages - PowerPoint PPT Presentation

About This Presentation
Title:

Automated Approach of Cataloguing TeraScan Images Utilizing Active Server Pages

Description:

The Center of Excellence in Remote Sensing Education and Research (CERSER) on ... sensed Advanced Very High Resolution Radiometer (AVHRR) and Sea Wide Field-of ... – PowerPoint PPT presentation

Number of Views:73
Avg rating:3.0/5.0
Slides: 50
Provided by: jeffre105
Learn more at: http://cerser.ecsu.edu
Category:

less

Transcript and Presenter's Notes

Title: Automated Approach of Cataloguing TeraScan Images Utilizing Active Server Pages


1
Automated Approach of Cataloguing TeraScan Images
Utilizing Active Server Pages
  • 2005-2006 ONR Multimedia

2
Abstract
  • The Center of Excellence in Remote Sensing
    Education and Research (CERSER) on the campus of
    Elizabeth City State University is currently
    tasked with the responsibility of receiving
    remotely sensed Advanced Very High Resolution
    Radiometer (AVHRR) and Sea Wide Field-of-View
    Sensor (SeaWiFS) data for research projects year
    round. This data is collected, processed,
    annotated, and transformed into images in the
    Tagged Image File Format (tiff). These tiff
    images are then uploaded to the CERSER archive
    library server located at http//cerser.ecsu.edu.
    Once uploaded, they are converted into various
    resolutions and their information is added to a
    tracking database maintained with Microsoft
    Access software. This database provides a
    searchable means for retrieving satellite image
    data through various parameters.

3
Abstract (cont)
  • The automatic conversion of the original tiff
    file to various Joint Photographic Experts Group
    (jpeg) format sizes and the entry of information
    into the tracking database were completed during
    this project. Active Server Pages were developed
    utilizing Visual Basic Scripting, Structured
    Query Language, and Command Line instructions to
    the software package ImageMagick to complete the
    tasks. The final file developed was added as a
    scheduled task to be implemented at a certain
    time each day on the CERSER platform. This file
    inventories the original folder located on the
    CERSER server to determine if any files have been
    uploaded and then processes those that have.

4
Introduction - Overview
  • Starting State of CERSER Image Process
  • MMT Tasking

5
Introduction - Process Goals
  • Call the ASP page daily
  • ASP Image Conversion Tasks
  • Convert Date and Satellite information from the
    file name
  • Open Terascan Database to obtain new file name
  • Write new record to the database
  • Open ImageMagick
  • Convert/Resize/Rename original image to Actual,
    Medium, Low, and thumbnail folders
  • Delete original image file

6
Active Server Pages
  • Defined
  • Their Use
  • Languages
  • Microsoft Internet Information Services (IIS)
    Server

7
Database - Overview
  • Project Use
  • Defined
  • Rolodex Card System

8
Database - Fields
  • Cells that contain actual data
  • TeraScan DB field titles are ID, Date,
    Satellite, Product, Description, and Event
  • Field Title gt Data Type Selected
  • Examples Currency, Date Time, Number, text,
    etc...

9
Database - The Project
  • Select information provided by the image file
    name ID, Satellite, and Date
  • Convert this information to the correct format
    (example 060330 to 03/30/2006)
  • Add a new record for each image

10
ImageMagick - Overview
  • Description
  • Formats Supported
  • Actions Available
  • MMT Project Use

11
ImageMagick - Command Line
  • Description
  • Input/Output, Text only
  • Punchcards gt Command Line gt GUI

12
Scheduled Tasks - Overview
  • CERSER Operating System
  • Scheduled Tasks
  • Scheduling the ASP file

13
Scheduled Tasks - Getting Started
  • Opening Task Scheduler

14
Scheduled Tasks Opening
  • Selecting program to run.

15
Scheduled Tasks - Naming
  • Name scheduled task.

16
Scheduled Tasks - Time Date
  • Configure day and time.

17
Scheduled Tasks User Name Password
  • Enter User Name Password

18
Scheduled Tasks - Created
  • Completion

19
Scheduled Tasks - Modifications
  • Modifying a Task

20
Code -Pseudocode
  • Defined
  • Example
  • Pseudocode - Display on the screen the variable
    X
  • VBScript Coding- response.write(x)

21
Code - Begin ASP Code
  • lt!--BEGIN ASP CODE--gt
  • lt
  • lt!--

22
Code - Declare Variables
  • 'Declare Variables
  • dim fs,fo,x, cnvrtDate, imgSat, dbPath, Con,
    fdb, description, curevent, product, jsfExc
  • PUBLIC lastID
  • Public utilized due to varible use in multiple
    methods

23
Code - Create File System Object
  • 'Set File System Object
  • set fsServer.CreateObject("Scripting.FileSystemO
    bject")
  • 'Set path to uploaded images folder
  • set fofs.GetFolder(server.mappath("\mmt\Pictures
    \original\"))

fs Instance of FileSystemObject fo
c\\inetpub\wwwroot\mmt\Pictures\original\
24
Code - Begin Image Processing Loop
  • 'BEGIN Loop for files in Original Folder
  • for each x in fo.files

fo.files All the files located in the folder
represented by fo fo c\\inetpub\wwwroot\mmt\Pic
tures\original\
25
Code - Date Conversion
  • 'START Date conversion
  • cnvrtDateMid(x.name,3,2) "/" Mid(x.name,5,2)
    "/20" Mid(x.name,1,2)

cnvrtDate reformatted date (YYMMDD to
MM/DD/YYYY) Mid(string, start, length) example
Mid(CERSER, 3, 2) RS
26
Code - Satellite Name Conversion
  • 'START Satellite Conversion
  • if Mid(x.name,13,1)"n" then
  • imgSat "NOAA-" Mid(x.name,14,2)
  • End if
  • if Mid(x.name,13,1)"s" then
  • imgSat "Seawifs-" Mid(x.name,14,2)
  • End if

imgSat reformatted satellite name (n17 to
NOAA-17)
27
Code - Set Path to Database
  • 'Set path to Database
  • Set fdb(fs.GetFolder(server.mappath("/mmt/")))
  • dbPath fdb "\terascan_trial.mdb"

server.mappath c\\inetpub\wwwroot\ fdb Path
to folder containing the database -
c\\inetpub\wwwroot\mmt\ dbpath Path to
Database - c\\inetpub\wwwroot\mmt\terascan_trial.
mdb
28
Code - Open Database
  • 'create connection object, Con is now an instance
    of ADODB.Connection
  • SET Con Server.CreateObject(
    "ADODB.Connection")
  • 'open the database
  • Con.Open "ProviderMicrosoft.Jet.OLEDB.4.0Dat
    a Source" dbPath

dbpath Path to Database - c\\inetpub\wwwroot\mm
t\terascan_trial.mdb
29
Code - Open Records
  • 'create recordset (rs) object, rs is now an
    instance of ADODB.recordset
  • set rsServer.CreateObject("ADODB.recordset")
  • 'Select ONLY the ID column, order it descending
    using the Con connection
  • rs.Open "SELECT ID FROM Images ORDER BY ID
    DESC", Con

30
Code - Create New ID
  • 'Add one to the ID highest number retrieved and
    place it in lastID, close connection
  • for each y in rs.fields
  • lastIDy.value 1
  • next
  • rs.close

31
Code - Assign Values
  • 'Assign null or zero values to empty fields
  • description""
  • curevent"0"
  • product"0"

32
Code - Open the Image Table
  • 'open the "Images" table in the
    terascan_trial.mdb
  • rs.Open "Images", Con , 1, 3, 2

rs.open source, connection, CursorTypeEnum,
LockTypeEnum, CommandTypeEnum
33
Code - Add Values
  • 'Use AddNew method to create the new record
  • rs.AddNew
  • rs("date") cnvrtdate
  • rs("id") lastID
  • rs("description") description
  • rs("event") curevent
  • rs("product") product
  • rs("satellite") imgSat

34
Code - Update DB
  • 'Set update to true and confirm update, Update
    method confirms the update
  • rs.Update
  • 'close the recordset and database connection
  • rs.close
  • Con.close

35
Code - Copy/Rename Original
  • 'Copy Original file to Actual Folder and rename
    using the Copyfile method
  • fs.CopyFile fo "\" x.name, fdb
    "\Pictures\Actual\" lastID ".tiff"

fo c\\inetpub\wwwroot\mmt\Pictures\original\ fd
b c\\inetpub\wwwroot\mmt\
36
Code - Define New Variables
  • ' Define variables for Image Conversion with
    ImageMagick
  • Dim WshShell, oExec, CommandLine, imageMagick,
    orgTiff, desJpg

37
Code - Initialize Variables
  • 'Set current position of executable convert.exe
  • imageMagick "C\Program Files\ImageMagick-6.2.6
    -Q8\convert.exe"
  • 'Set position of orginal file to be converted
  • orgTiff fdb "\Pictures\Actual\" lastID
    ".tiff"

fdb c\\inetpub\wwwroot\mmt\
38
Code - Create Windows Object
  • ' Creating a Windows Shell object in order to
    access the command line prompt
  • Set WshShell Server.CreateObject("WScript.Shell
    ")

39
Code - Medium Conversion
  • 'Set Destination of Medium Copy, no size change,
    just type tiff to jpg
  • desJpg fdb "\Pictures\Medium\" lastID
    ".jpg"
  • 'Compile arguments into one variable
  • CommandLine imageMagick " " orgTiff " "
    desJpg
  • ' Launching imgmagick
  • Set oExec WshShell.Exec(CommandLine)

fdb c\\inetpub\wwwroot\mmt\ imageMagick
c\Program Files\ImageMagick-6.2.6-Q8\convert.exe
orgTiff c\\inetpub\wwwroot\mmt\Pictures\Actual\
lastID.tiff
40
Code - Low Conversion
  • 'Set Destination of Low Copy, resize 50, type
    tiff to jpg
  • desJpg fdb "\Pictures\Low\" lastID
    ".jpg"
  • 'Compile arguments into one variable
  • CommandLine imageMagick " " orgTiff "
    -resize 50" " " desJpg
  • ' Launching imgmajic
  • Set oExec WshShell.Exec(CommandLine)

fdb c\\inetpub\wwwroot\mmt\ imageMagick
c\Program Files\ImageMagick-6.2.6-Q8\convert.exe
orgTiff c\\inetpub\wwwroot\mmt\Pictures\Actual\
lastID.tiff
41
Code - Thumbnail Conversion
  • 'Set Destination of Thumbnail Copy, resize 15,
    type tiff to jpg
  • desJpg fdb "\Pictures\Thumbs\" lastID
    ".jpg"
  • 'Compile arguments into one variable
  • CommandLine imageMagick " " orgTiff "
    -resize 15" " " desJpg
  • ' Launching imgmajic
  • Set oExec WshShell.Exec(CommandLine)

fdb c\\inetpub\wwwroot\mmt\ imageMagick
c\Program Files\ImageMagick-6.2.6-Q8\convert.exe
orgTiff c\\inetpub\wwwroot\mmt\Pictures\Actual\
lastID.tiff
42
Code - Free Up Memory
  • 'Free WshShell memory
  • Set WshShell Nothing
  • Set oExec Nothing

43
Code - Delete Original/End loop
  • 'Delete Original Image
  • fs.DeleteFile(fo "\" x.name)
  • next

fo c\\inetpub\wwwroot\mmt\Pictures\original\
44
Code - Memory/Update Time
  • 'Free fo, fs, and fdb memory
  • set fonothing
  • set fsnothing
  • set fdbnothing
  • 'Write out the time that the Database was updated
  • response.write("Terascan Database Updated "
    now() " (Eastern Time)")

45
Code - End Comment/ASP
  • --gt
  • gt

46
Results
  • Trial Code
  • reponse.write()
  • Final Version
  • Folder Permissions

47
Results Update Notification
  • TeraScan Database - New Table
  • ASP Modification

48
Future Work
  • Modify Records
  • Email Notification

49
Questions
Write a Comment
User Comments (0)
About PowerShow.com