2011-04-14 20:37:47 +02:00
|
|
|
========================================================================
|
2011-11-16 17:54:53 +01:00
|
|
|
OpenJPIP software 2.1 ReadMe
|
2011-04-14 20:37:47 +02:00
|
|
|
|
|
|
|
OpenJPEG:
|
|
|
|
http://www.openjpeg.org
|
|
|
|
|
|
|
|
Written by:
|
|
|
|
Kaori Hagihara
|
|
|
|
UCL/SST/ICTM/ELEN
|
|
|
|
February 18 2011
|
|
|
|
========================================================================
|
|
|
|
|
|
|
|
Contents:
|
|
|
|
1. Introduction
|
|
|
|
2. License
|
|
|
|
3. System requirements
|
|
|
|
4. Implementing instructions
|
|
|
|
5. JP2 encoding instructions
|
|
|
|
|
|
|
|
|
|
|
|
----------
|
|
|
|
1. Introduction
|
|
|
|
----------
|
|
|
|
|
|
|
|
OpenJPIP software is an implementation of JPEG 2000 Part9: Interactivity tools, APIs and protocols (JPIP).
|
|
|
|
( For more info about JPIP, check the website: http://www.jpeg.org/jpeg2000/j2kpart9.html)
|
|
|
|
The current implementation uses some results from the 2KAN project (http://www.2kan.org).
|
|
|
|
|
2011-11-16 17:54:53 +01:00
|
|
|
Version 2.1 covers:
|
2011-10-10 11:50:18 +02:00
|
|
|
- JPT-stream (Tile) and JPP-stream (Precinct) media types
|
2011-04-14 20:37:47 +02:00
|
|
|
- Session, channels, cache model managements
|
2011-11-30 15:54:41 +01:00
|
|
|
- JPIP over HTTP, HTTP requests and TCP return
|
2011-04-14 20:37:47 +02:00
|
|
|
- Indexing JPEG 2000 files
|
|
|
|
- Embedding XML formatted metadata
|
|
|
|
- Region Of Interest (ROI) requests
|
2011-11-16 17:54:53 +01:00
|
|
|
- Access to JP2 files with their URL
|
2011-04-14 20:37:47 +02:00
|
|
|
|
|
|
|
----------
|
|
|
|
2. License
|
|
|
|
----------
|
|
|
|
|
|
|
|
This software is released under the BSD license, anybody can use or modify the library, even for commercial applications.
|
|
|
|
The only restriction is to retain the copyright in the sources or the binaries documentation.
|
|
|
|
Neither the author, nor the university accept any responsibility for any kind of error or data loss which may occur during usage.
|
|
|
|
|
|
|
|
----------
|
|
|
|
3. System requirements
|
|
|
|
----------
|
|
|
|
|
|
|
|
- FastCGI development kit (C libraries) at server (http://www.fastcgi.com)
|
2011-11-16 17:54:53 +01:00
|
|
|
- libcURL library
|
2011-04-14 20:37:47 +02:00
|
|
|
- Java application launcher at client
|
|
|
|
<Optional>
|
|
|
|
- Xerces2 java XML parser on the client for accessing embedded image metadata (http://xerces.apache.org/xerces2-j)
|
|
|
|
|
2011-05-25 14:07:39 +02:00
|
|
|
We tested this software with a virtual server running on the same Linux machine as the clients.
|
2011-04-14 20:37:47 +02:00
|
|
|
|
|
|
|
----------
|
|
|
|
4. Building instructions
|
|
|
|
----------
|
|
|
|
|
|
|
|
A Makefile is available in the same directory as this README file. Simply type 'make' and it will build all the required C-executables.
|
|
|
|
Concerning the java-based opj_viewer, simply type 'ant' in the corresponding directory (requires 'ant' utility of course)
|
|
|
|
|
|
|
|
The documentation can be build this way (requires doxygen utility):
|
|
|
|
cd doc
|
|
|
|
doxygen Doxyfile
|
|
|
|
|
|
|
|
----------
|
|
|
|
5. Usage
|
|
|
|
----------
|
|
|
|
|
|
|
|
Preliminary notes :
|
|
|
|
* HTML documentation is available at http://www.openjpeg.org/jpip/doc/html
|
|
|
|
* Example image is available at http://www.openjpeg.org/jpip/data/copenhague1.zip (20 Mb !)
|
|
|
|
|
|
|
|
Webserver:
|
|
|
|
You need a webserver running with the fastcgi module enabled and correctly configured.
|
|
|
|
For Apache, add the following line to your /etc/apache2/mods-available/fastcgi.conf configuration file:
|
|
|
|
|
|
|
|
FastCGIExternalServer /var/www/myFCGI -host localhost:3000
|
|
|
|
|
|
|
|
where /var/www is your DocumentRoot.
|
|
|
|
Please refer to 'http://www.openjpeg.org/jpip/doc/ApacheFastCGITutorial.pdf' for more details.
|
|
|
|
|
|
|
|
Server:
|
|
|
|
1. Store JP2 files in the same directory as opj_server
|
|
|
|
|
|
|
|
2. Launch opj_server from the server terminal:
|
|
|
|
% spawn-fcgi -f ./opj_server -p 3000 -n
|
2011-08-27 14:53:38 +02:00
|
|
|
|
|
|
|
For shutting down JPIP server:
|
|
|
|
%GET http://hostname/myFCGI?quitJPIP
|
|
|
|
Notice, http://hostname/myFCGI is the HTTP server URI (myFCGI refers to opj_server by the server setting)
|
|
|
|
Requst message "quitJPIP" can be changed in Makfile, modify -DQUIT_SIGNAL=\"quitJPIP\"
|
2011-04-14 20:37:47 +02:00
|
|
|
|
|
|
|
Client:
|
|
|
|
1. Launch image decoding server, and keep it alive as long as image viewers are open
|
|
|
|
% ./opj_dec_server
|
|
|
|
|
|
|
|
You might prefer to implement this program from another directory since cache files are saved in the working directory.
|
|
|
|
% mkdir cache
|
|
|
|
% cd cache
|
|
|
|
% ../opj_dec_server
|
|
|
|
|
|
|
|
2. Open image viewers (as many as needed)
|
2011-11-30 15:54:41 +01:00
|
|
|
% java -jar opj_viewer.jar http://hostname/myFCGI path/filename.jp2 [stateless/session] [jptstream/jppstream] [tcp/udp]
|
2011-04-14 20:37:47 +02:00
|
|
|
( The arguments
|
|
|
|
- http://hostname/myFCGI is the HTTP server URI (myFCGI refers to opj_server by the server setting)
|
2011-11-16 17:54:53 +01:00
|
|
|
- path/filename.jp2 is the server local path or URL of a JP2 file
|
2011-10-11 09:24:58 +02:00
|
|
|
- request type stateless for no caching, session (default) for caching
|
2011-11-30 15:54:41 +01:00
|
|
|
- return media type, JPT-stream tile based stream, or JPP-stream (default) precinct based stream
|
|
|
|
- auxiliary return protocol, tcp or udp (udp is not implemented yet), if not given, return data is filled in http chunk
|
2011-04-14 20:37:47 +02:00
|
|
|
Image viewer GUI instructions:
|
|
|
|
Scale up request: Enlarge the window
|
|
|
|
ROI request: Select a region by mouse click and drag, then click inside the red frame of the selected region
|
|
|
|
<If Xerces2 is installed>
|
2011-05-25 14:07:39 +02:00
|
|
|
% java -jar opj_viewer_xerces.jar http://hostname/myFCGI JP2_filename.jp2
|
2011-04-14 20:37:47 +02:00
|
|
|
Annotate image with ROI information in XML metadata: Click button "Region Of Interest"
|
|
|
|
Open a new window presenting an aligned image with a locally stored image: Click button "Image Registration" (Under Construction)
|
|
|
|
|
|
|
|
3. Quit the image decoding server through the telnet, be sure all image viewers are closed
|
2011-11-30 15:54:41 +01:00
|
|
|
% telnet localhost 50000
|
2011-04-14 20:37:47 +02:00
|
|
|
quit
|
|
|
|
|
|
|
|
----------
|
|
|
|
5. JP2 encoding instructions
|
|
|
|
----------
|
|
|
|
|
|
|
|
An example to encode a TIF image "copenhague1.tif" at resolution 4780x4050, 8bit/pixel, grayscale.
|
2011-11-02 00:28:07 +01:00
|
|
|
% ./image_to_j2k -i copenhague1.tif -o copenhague1.jp2 -p RPCL -c [64,64] -t 640,480 -jpip -TP R
|
2011-10-11 09:24:58 +02:00
|
|
|
|
|
|
|
options
|
|
|
|
-jpip : embed index table box into the output JP2 file (obligation for JPIP)
|
2011-11-02 00:28:07 +01:00
|
|
|
-TP R : partition a tile into tile parts of different resolution levels (obligation for JPT-stream)
|
2011-04-14 20:37:47 +02:00
|
|
|
|
|
|
|
<Option>
|
|
|
|
3. Embed metadata into JP2 file
|
|
|
|
% ./addXMLinJP2 copenhague1.jp2 copenhague1.xml
|
|
|
|
Input metadata file "copenhague1.xml" looks like:
|
|
|
|
<xmlbox>
|
|
|
|
<roi name="island" x="1890" y="1950" w="770" h="310"/>
|
|
|
|
<roi name="ship" x="750" y="330" w="100" h="60"/>
|
|
|
|
<roi name="airport" x="650" y="1800" w="650" h="800"/>
|
|
|
|
<roi name="harbor" x="4200" y="1650" w="130" h="130"/>
|
|
|
|
<irt refimg="name1.jp2" m1="0.50" m2="-0.50" m3="0" m4="0.80" m5="-0.80" m6="0" m7="500" m8="1000" m9="0"/>
|
|
|
|
</xmlbox>
|