Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
API in Windows for Matlab - how to compile?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Douglas  
View profile  
 More options Sep 11, 4:09 pm
From: Douglas <dug.armad...@googlemail.com>
Date: Fri, 11 Sep 2009 13:09:41 -0700 (PDT)
Local: Fri, Sep 11 2009 4:09 pm
Subject: API in Windows for Matlab - how to compile?
Hi,

This is my third post in a row, but I promise that I am not trying to
dominate this mailing list.

I suspect that it might be David who is first to reply and, so I would
like to thank him for all the help he has already provided. (Did you
see my reply to your advice on
http://groups.google.co.uk/group/viper-toolkit/browse_thread/thread/d...
?)

Okay, here is my new question. I would like to import ViPER xml data
into Matlab. In theory, I could use Java calls from Matlab with the
ViPER api. Unfortunately, I am working in a Windows environment and I
assume that I will have to compile the specific Java in Windows for
this purpose - correct me if I am wrong.  I have downloaded the full
source and so would like advice on the compilation process, in
Windows, for the api part of the code. To get a clue,  I have had a
look at the make file in the api directory but don't understand it.

I have no Java experience but guess that my Visual Studio has hooks to
a Java compiler - it seems to recognise the Java source files.

Thank you,

Douglas


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
David Mihalcik  
View profile  
 More options Sep 11, 11:51 pm
From: David Mihalcik <kraka...@gmail.com>
Date: Fri, 11 Sep 2009 23:51:46 -0400
Local: Fri, Sep 11 2009 11:51 pm
Subject: Re: API in Windows for Matlab - how to compile?
Matlab supports native access to java, so you should be able to point
your copy of matlab to load all of the .jar files in the viper-light
distribution and access them that way. For an overview of how to add
java classes to your matlab instance, check out here:

http://www.mathworks.com/access/helpdesk/help/techdoc/index.html?/acc...

You will have to add most of the .jar files in the viper-light package
available.

On the viper web site, there  is some minimal documentation, for some
ideas about how to write scripts that read or write viper data files.
There are two formats, the .xgtf xml format, and an older,
easier-on-the-eyes plain text format (you can convert between the two
with the xml2gtf and gtf2xml tools). The main difference, other than
the way they look, is that the xml format supports describing multiple
media files from a single metadata file.

http://viper-toolkit.sourceforge.net/docs/scripting/

If you want to actually build the thing, I use Eclipse, IBM's free
java IDE. However, I'd suggest just munging with the files directly.
I'll see if I can upload a generated api documentation file somehow,
which would make it a lot easier to use the API for reading and
writing viper metadata files.

David Mihalcik


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
David Mihalcik  
View profile  
 More options Sep 12, 12:15 am
From: David Mihalcik <kraka...@gmail.com>
Date: Fri, 11 Sep 2009 21:15:28 -0700 (PDT)
Local: Sat, Sep 12 2009 12:15 am
Subject: Re: API in Windows for Matlab - how to compile?
I've uploaded the javadocs here:

http://github.com/dmihalcik/viper-toolkit/downloads

From the scripting viper documentation, to load a file, you'll have to
do something like this:

 -- first, import the necessary classes.. I might be missing a few.

import java.io.*
import javax.xml.*
import viper.api.*
import viper.api.impl.*

 -- next, load the file

FileInputStream inFile = new FileInputStream ("gt.xml");
Element documentEl = DocumentBuilderFactory.newInstance()
                                           .newDocumentBuilder()
                                           .parse(inFile)
                                           .getDocumentElement();
inFile.close();
ViperData newFile = ViperParser.parseDoc (documentEl);

 - finally, read data from newFile

for (Descriptor d : newFile.getSourcefile
("yourFile.mpg").getDescriptors()) {
    // do something with the descriptor

}

I don't have a copy of matlab handy, and i don't quite remember how to
translate java syntax into matlab syntax.

On Sep 11, 11:51 pm, David Mihalcik <kraka...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Douglas  
View profile  
 More options Sep 14, 10:40 am
From: Douglas <dug.armad...@googlemail.com>
Date: Mon, 14 Sep 2009 07:40:50 -0700 (PDT)
Local: Mon, Sep 14 2009 10:40 am
Subject: Re: API in Windows for Matlab - how to compile?
Hi David,

I was nearly going to give up but I seem to have made some small
progress. However, I am stuck again. I hope that you, or somone, can
assist.

This is what I have done in Matlab:

>> import javax.xml.parsers.*
>> docBuilder = DocumentBuilderFactory.newInstance()
>> docElement = docBuilder.newDocumentBuilder().parse('test.xgtf').getDocumentElement()
>> parser = viper.api.impl.ViperParser
>> parser.parseDoc(docElement)

14-Sep-2009 15:26:41 viper.api.datatypes.Lvalue setConfig

WARNING: lvalues should enumerate all possible values in the <lvalue-
possibles> tag.

14-Sep-2009 15:26:41 viper.api.impl.ViperParser parseAttr

SEVERE: Missing important XML attribute.

java.lang.NullPointerException

        at viper.api.impl.ViperParser.parseAttr(Unknown Source)

        at viper.api.impl.ViperParser.parseAttrs(Unknown Source)

        at viper.api.impl.ViperParser.parseSourcefile(Unknown Source)

        at viper.api.impl.ViperParser.parseData(Unknown Source)

        at viper.api.impl.ViperParser.parseDoc(Unknown Source)

14-Sep-2009 15:26:41 viper.api.impl.ViperParser parseAttr

SEVERE: Missing important XML attribute.

java.lang.NullPointerException

......

And the xml file is:

<?xml version="1.0" encoding="UTF-8"?>
<viper xmlns="http://lamp.cfar.umd.edu/viper#" xmlns:data="http://
lamp.cfar.umd.edu/viperdata#">
    <config>
        <descriptor name="Information" type="FILE">
            <attribute dynamic="false" name="SOURCETYPE" type="http://
lamp.cfar.umd.edu/viperdata#lvalue">
                <data:lvalue-possibles>
                    <data:lvalue-enum value="SEQUENCE"/>
                    <data:lvalue-enum value="FRAMES"/>
                </data:lvalue-possibles>
            </attribute>
            <attribute dynamic="false" name="NUMFRAMES" type="http://
lamp.cfar.umd.edu/viperdata#dvalue"/>
            <attribute dynamic="false" name="FRAMERATE" type="http://
lamp.cfar.umd.edu/viperdata#fvalue"/>
            <attribute dynamic="false" name="H-FRAME-SIZE"
type="http://lamp.cfar.umd.edu/viperdata#dvalue"/>
            <attribute dynamic="false" name="V-FRAME-SIZE"
type="http://lamp.cfar.umd.edu/viperdata#dvalue"/>
        </descriptor>
        <descriptor name="People" type="OBJECT">
            <attribute dynamic="false" name="Bounding box"
type="http://lamp.cfar.umd.edu/viperdata#circle"/>
        </descriptor>
    </config>
    <data>
        <sourcefile filename="file:/C:/Documents%20and%20Settings/
dougmacd/Desktop/testSequence/test_images/test_images.info">
            <file id="0" name="Information">

......ETC

I feel I am so close to getting this working.

Thank you for your kind help,

Douglas

On 12 Sep, 05:15, David Mihalcik <kraka...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google