JAI problem

Hi all,
I have small problem. In my application I'm using JAI package (imported). When I run my app in Eclipse, everything works perfectly. But when I compile this app to JAR file (Export to JAR), I have error in console as follows:
java.lang.NoClassDefFoundError: com/sun/media/jai/codec/SeekableStream bla bla bla...
follows by definition of error position and so on...
Why this error does not ocure in Eclipse?
Other task:
I have imported JAI classes into build path. Later I uninstal JAI package and install it back into different location, imported in buildpath new versions, but Eclispe is still looking for the old ones. I'm getting message :
"Class E:/JAVA/jai/lib/jai_codec.jar which is referenced by the classpath, does not exist"
even if the newly imported .jar faile has other location path.
Anybody can help?

because eclipse builds a classpath for the application and adds the JAI jar to it. When you run the exported jar, the JAI jar most likely is not there, or it is not in the location that java expects it to be. Open the exported jar and find the META-INF/manifest.mf file - check the class-path line; does it contain the jai jar?

Similar Messages

  • JAI - problem displaying additional pages from multi-page image

    Hi,
    I have 10 page multipage tiff images. And i would like to show the images one-by-one on a ScrollingImagePanel.
    I have a Main frame with two panels. Panel1 which shows the ScrollingImagePanel.
    And Panel2 has two buttons. LOAD Button show the 1st page on the ScrollingImagePanel.
    And NEXT button is suppose to show the 2nd page and continue until the end of the multipage images.
    I am having problem with the NEXT button. I wrote a program that show the page number and page height
    on the output screen. It shows the page# and different heights. But it would not show the images on the ScrollingImagePanel.
    It just shows the 1st page. I would appreciate if you can help me out with this problom.
    Please find the code which is written in JBuilder.
    // Main class
    package untitled1;
    import java.awt.*;
    import javax.swing.UIManager;
    import java.awt.*;
    import java.io.File;
    import java.io.IOException;
    import java.awt.Frame;
    import java.awt.image.RenderedImage;
    import javax.media.jai.widget.ScrollingImagePanel;
    import javax.media.jai.NullOpImage;
    import javax.media.jai.OpImage;
    import com.sun.media.jai.codec.SeekableStream;
    import com.sun.media.jai.codec.FileSeekableStream;
    import com.sun.media.jai.codec.TIFFDecodeParam;
    import com.sun.media.jai.codec.ImageDecoder;
    import com.sun.media.jai.codec.ImageCodec;
    import java.awt.event.WindowAdapter;
    import java.awt.event.WindowEvent;
    import java.awt.event.*;
    * <p>Title: </p>
    * <p>Description: </p>
    * <p>Copyright: Copyright (c) 2002</p>
    * <p>Company: </p>
    * @author unascribed
    * @version 1.0
    public class Application1 {
    boolean packFrame = false;
    //Construct the application
    public Application1() {
    Frame2 frame = new Frame2();
    frame.setSize(820,700);
    //Validate frames that have preset sizes
    //Pack frames that have useful preferred size info, e.g. from their layout
    if (packFrame) {
    frame.pack();
    else {
    frame.validate();
    //Center the window
    Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
    Dimension frameSize = frame.getSize();
    if (frameSize.height > screenSize.height) {
    frameSize.height = screenSize.height;
    if (frameSize.width > screenSize.width) {
    frameSize.width = screenSize.width;
    frame.setLocation((screenSize.width - frameSize.width) / 2, (screenSize.height - frameSize.height) / 2);
    frame.setVisible(true);
    //Main method
    public static void main(String[] args) {
    new Application1();
    // Frame2 Class
    package untitled1;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.UIManager;
    import java.io.File;
    import java.io.IOException;
    import java.awt.Frame;
    import java.awt.image.RenderedImage;
    import javax.media.jai.widget.ScrollingImagePanel;
    import javax.media.jai.NullOpImage;
    import javax.media.jai.OpImage;
    import com.sun.media.jai.codec.SeekableStream;
    import com.sun.media.jai.codec.FileSeekableStream;
    import com.sun.media.jai.codec.TIFFDecodeParam;
    import com.sun.media.jai.codec.ImageDecoder;
    import com.sun.media.jai.codec.ImageCodec;
    import java.awt.event.WindowAdapter;
    import java.awt.event.WindowEvent;
    import java.awt.event.*;
    import java.awt.image.renderable.ParameterBlock;
    import javax.media.jai.*;
    import javax.media.jai.widget.*;
    import com.sun.media.jai.codec.*;
    import java.util.*;
    * <p>Title: </p>
    * <p>Description: </p>
    * <p>Copyright: Copyright (c) 2002</p>
    * <p>Company: </p>
    * @author unascribed
    * @version 1.0
    public class Frame2 extends Frame {
    JPanel jPanel1 = new JPanel();
    JPanel jPanel2 = new JPanel();
    JButton loadButton = new JButton();
    public static ScrollingImagePanel panel, panels;
    JButton nextButton = new JButton();
    public String filename= "144.tif";
    public File file;
    public SeekableStream s;
    public ImageDecoder dec;
    protected int imageWidth, imageHeight;
    public int nextpage = 1;
    public RenderedOp image2 = null;
    public RenderedImage op = null;
    //Frame Constructor
    public Frame2() {
    try {
    jbInit();
    catch(IOException e) {
    e.printStackTrace();
    private void jbInit() throws IOException {
    this.setLayout(null);
    this.addWindowListener(new java.awt.event.WindowAdapter() {
    public void windowClosing(WindowEvent e) {
    this_windowClosing(e);
    jPanel1.setBackground(Color.white);
    jPanel1.setBorder(BorderFactory.createLineBorder(Color.black));
    jPanel1.setBounds(new Rectangle(1, 7, 816, 648));
    jPanel1.setLayout(null);
    jPanel2.setBackground(Color.lightGray);
    jPanel2.setBorder(BorderFactory.createLineBorder(Color.black));
    jPanel2.setBounds(new Rectangle(1, 657, 816, 42));
    loadButton.setText("Load");
    loadButton.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(ActionEvent e) {
    try{                          
    loadButton_actionPerformed(e);
    catch(IOException IOE){
    System.out.println(IOE);
    nextButton.setText("Next");
    nextButton.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(ActionEvent e) {
    try {
    nextButton_actionPerformed(e);
    catch(IOException IOE){
    System.out.println(IOE);
    this.setResizable(false);
    this.add(jPanel1, null);
    this.add(jPanel2, null);
    jPanel2.add(loadButton, null);
    jPanel2.add(nextButton, null);
    void this_windowClosing(WindowEvent e) {
    System.exit(0);
    //Load Image Button
    void loadButton_actionPerformed(ActionEvent e) throws IOException { 
    file = new File(filename);
    s = new FileSeekableStream(file);
    dec = ImageCodec.createImageDecoder("tiff", s, null);
    RenderedImage op =
    new NullOpImage(dec.decodeAsRenderedImage(),
    null,
    OpImage.OP_IO_BOUND,
    null);
    Interpolation interp = Interpolation.getInstance(Interpolation.INTERP_BILINEAR);
    ParameterBlock params = new ParameterBlock();
    params.addSource(op);
    params.add(0.55F); // x scale factor
    params.add(0.335F); // y scale factor
    params.add(0.00F); // x translate
    params.add(0.00F); // y translate
    params.add(interp); // interpolation method
    image2 = JAI.create("scale", params);
    int width = (int)(image2.getWidth() * .73);
    int height = (int)(image2.getHeight() * .73);
    panel = new ScrollingImagePanel(image2, 819, 648);
    jPanel1.add(panel);
    this.setVisible(true);
    //Next Image Button
    void nextButton_actionPerformed(ActionEvent e) throws IOException {
    TIFFDecodeParam param = null;
    file = new File(filename);
    s = new FileSeekableStream(file);
    dec = ImageCodec.createImageDecoder("tiff", s, param);
    nextpage++;
    System.out.println(nextpage);
    RenderedImage op1 =
    new NullOpImage(dec.decodeAsRenderedImage(nextpage),
    null,
    OpImage.OP_IO_BOUND,
    null);
    Interpolation interp = Interpolation.getInstance(Interpolation.INTERP_BILINEAR);
    ParameterBlock params = new ParameterBlock();
    params.addSource(op1);
    params.add(0.55F); // x scale factor
    params.add(0.335F); // y scale factor
    params.add(0.00F); // x translate
    params.add(0.00F); // y translate
    params.add(interp); // interpolation method
    image2 = JAI.create("scale", params);
    int width = (int)(image2.getWidth() * .73); //1.03);
    int height = (int)(image2.getHeight() * .73); //1.03);
    panels = new ScrollingImagePanel(image2, width, height);
    System.out.println(op1.getHeight());
    jPanel1.add(panels);
    this.setVisible(true);
    thanks in advance

    Take a look at this code.
    //Search the Policynumber
    void searchButton_actionPerformed(ActionEvent e) {
    try{
    nextButton.setEnabled(false);
    previousButton.setEnabled(false);
    String query = "SELECT * FROM PINFO WHERE POLICYNUMBER = '" +
    searchTextfield.getText().toUpperCase() + "'";
    ResultSet rs = Application1.stmt.executeQuery(query);
    while(rs.next()){
    pid = (rs.getInt("PID"));
    policynumber = rs.getString("POLICYNUMBER");
    firstName = rs.getString("FIRSTNAME");
    lastName = rs.getString("LASTNAME");
    jLabel2.setText(policynumber);
    jLabel3.setText(firstName);
    jLabel4.setText(lastName);
    catch(SQLException ex){
    System.err.println("SQLException: " + ex.getMessage());
    try{
    String query = "SELECT * FROM (UNMATCH U LEFT JOIN DOCUMENTTYPE D ON U.DOCUMENTTYPE=D.DOCNUMBER) WHERE PID = '" + pid + "' ORDER BY D.DOCUMENTCODE";
    ResultSet rs1 = Application1.stmt.executeQuery(query);
    clearJList();
    v.removeAllElements();
    jList1.setListData(v);
    v1.clear();
    while(rs1.next()){
    documentcode = rs1.getString("DOCUMENTCODE");
    uindex = rs1.getString("UINDEX");
    v.add(documentcode);
    v1.add(uindex);
    jList1.setListData(v);
    clearTextfield();
    catch(SQLException s){
    System.err.println("SQLException: " + s.getMessage());
    public void clearJList(){
    jList1.setListData(v);
    public void clearTextfield(){
    searchTextfield.setText("");
    // ****** Loads the selected Image
    void jList1_mouseClicked(MouseEvent e){
    try{
    vector.clear();
    nextpage = 1;
    currentpage = 1;
    nextButton.setEnabled(true);
    previousButton.setEnabled(false);
    if (spane != null)
    jPanel1.removeAll();
    seek = null;
    String query1 = "SELECT * FROM UNMATCH WHERE UINDEX = '" + v1.get(jList1.getSelectedIndex()).toString() + "'";
    rs2 = Application1.stmt.executeQuery(query1);
    while (rs2.next()){
    stream = rs2.getBinaryStream("IMAGE");
    seek = new MemoryCacheSeekableStream(stream);
    TIFFDecodeParam param = null;
    dec = ImageCodec.createImageDecoder("tiff", seek, param);
    try{
    totalPages = dec.getNumPages();
    jLabel1.setText("Page 1 of "+totalPages);
    if (nextpage==totalPages)
    nextButton.setEnabled(false);
    op1 =
    new NullOpImage(dec.decodeAsRenderedImage(nextpage-1),
    null,
    OpImage.OP_IO_BOUND,
    null);
    vector.addElement(op1);
    // ParameterBlock params = new ParameterBlock();
    // params.addSource(op1);
    // panel = new DisplayJAI(op1);
    panel = new DisplayJAI((RenderedImage)vector.elementAt(0));
    spane = new JScrollPane(panel);
    jPanel1.add(spane);
    jPanel1.validate();
    this.setVisible(true);
    catch(IOException dfs){
    } // while
    } // try
    catch(SQLException s){
    System.err.println("SQLException: " + s.getMessage());
    // Next Image
    void nextButton_actionPerformed(ActionEvent e) {
    try{
    if (spane != null)
    jPanel1.removeAll();
    ++nextpage;
    if (nextpage==totalPages)
    nextButton.setEnabled(false);
    previousButton.setEnabled(true);
    jLabel1.setText("Page " + nextpage +" of "+totalPages);
    TIFFDecodeParam param = null;
    dec = ImageCodec.createImageDecoder("tiff", seek, param);
    currentpage = nextpage;
    ParameterBlock paramblock = new ParameterBlock();
    paramblock.addSource(op1);
    vector.addElement(new NullOpImage(dec.decodeAsRenderedImage(nextpage-1),
    null,
    OpImage.OP_IO_BOUND,
    null));
    panel = new DisplayJAI((RenderedImage)vector.elementAt(currentpage-1));
    // panel = new DisplayJAI(op1);
    spane = new JScrollPane(panel);
    jPanel1.add(spane);
    setVisible(true);
    catch(IOException o){
    System.out.println(o);
    finally{
    // PreviousButton
    void previousButton_actionPerformed(ActionEvent e) {
    try{
    if (spane != null)
    jPanel1.removeAll();
    --nextpage;
    if (nextpage==1)
    previousButton.setEnabled(false);
    nextButton.setEnabled(true);
    jLabel1.setText("Page " + nextpage +" of "+totalPages);
    TIFFDecodeParam param = null;
    dec = ImageCodec.createImageDecoder("tiff", seek, param);
    currentpage = nextpage;
    vector.addElement(new NullOpImage(dec.decodeAsRenderedImage(nextpage-1),
    null,
    OpImage.OP_IO_BOUND,
    null));
    panel = new DisplayJAI((RenderedImage)vector.elementAt(currentpage-1));
    spane = new JScrollPane(panel);
    jPanel1.add(spane);
    setVisible(true);
    catch(IOException o){
    System.out.println(o);
    // Zoom ComboBox Item Select
    void jComboBox1_itemStateChanged(ItemEvent e) {
    if (e.getStateChange() == ItemEvent.DESELECTED)
    if (spane != null)
    jPanel1.removeAll();
    Interpolation interp = Interpolation.getInstance(Interpolation.INTERP_BICUBIC);
    ParameterBlock params = new ParameterBlock();
    params.addSource(op1);
    params.add(Float.valueOf(jComboBox1.getSelectedItem().toString()).floatValue()/100.0f);
    params.add(Float.valueOf(jComboBox1.getSelectedItem().toString()).floatValue()/100.0f);
    params.add(0.0F);
    params.add(0.0F);
    params.add(interp);
    // image2 = JAI.create("scale",params);
    vector.add(currentpage-1,JAI.create("scale",params));
    panel = new DisplayJAI((RenderedOp)vector.elementAt(currentpage-1));
    spane = new JScrollPane(panel);
    jPanel1.add(spane);
    jPanel1.validate();
    this.setVisible(true);
    repaint();
    // Rotate ComboBox Item Select
    void jComboBox2_itemStateChanged(ItemEvent e) {
    if (e.getStateChange() == ItemEvent.DESELECTED)
    if (spane != null)
    jPanel1.removeAll();
    type =null;
    type = transposeTypes[jComboBox2.getSelectedIndex()];
    ParameterBlock pb = new ParameterBlock();
    pb.addSource((RenderedImage)vector.elementAt(currentpage-1));
    pb.add(type);
    PlanarImage im2 = JAI.create("transpose", pb, renderHints);
    vector.add(currentpage-1,im2);
    panel = new DisplayJAI((RenderedOp)vector.elementAt(currentpage-1));
    spane = new JScrollPane(panel);
    jPanel1.add(spane);
    jPanel1.validate();
    this.setVisible(true);
    void printButton_actionPerformed(ActionEvent e) {
    print();
    protected void print() {
    PrinterJob pj = PrinterJob.getPrinterJob();
    pj.setPrintable(this);
    // PageFormat format = pj.pageDialog(pj.defaultPage());
    // Book bk = new Book();
    // bk.append(this,pj.defaultPage());
    // pj.setPageable(bk);
    if(pj.printDialog()){
    try{
    pj.print();
    catch(Exception e){
    System.out.println(e);
    else{
    System.out.println("Did Not Print Any Pages");
    public int print(Graphics g, PageFormat f, int pageIndex){
    if(pageIndex >= 1){
    return Printable.NO_SUCH_PAGE;
    Graphics2D g2d = (Graphics2D) g;
    g2d.translate(f.getImageableX(), f.getImageableY());
    if(op1 != null){
    double scales = Math.min(f.getImageableWidth()/ op1.getWidth(), f.getImageableHeight()/ op1.getHeight());
    g2d.scale(scales,scales);
    printImage(g2d, op1);
    return Printable.PAGE_EXISTS;
    else{
    return Printable.NO_SUCH_PAGE;
    public void printImage(Graphics2D g2d, RenderedImage image){
    if((image == null)|| (g2d == null)) return;
    int x = printLoc.x;
    int y = printLoc.y;
    AffineTransform at = new AffineTransform();
    at.translate(x,y);
    g2d.drawRenderedImage(image,at);
    public void setPrintLocation(Point d) {
    printLoc = d;
    public Point getPrintLocation() {
    return printLoc;

  • Archivelog files and Rman backup

    Hi all,
    Please somebody guide me regarding the following concept.
    We have the oracle server version 10.2.0.1.0, working with Windows OS,
    I had set the parameter log_archive_dest_1 for locating archivelog files, then I had changed the archivelog files to the flash recovery area(located in another disk) by using the parameters db_recovery_file_dest_size and db_recovery_file_dest.
    Now the archivelog files are being located at two different location. At this point, If I take backup for archivelog files with the aid of RMAN, then ,
    How will the RMAN take backup from those two different locations?
    Thanks&Regards,
    Jai.

    PROBLEM :
    I have archivelogs duplexed - when running RMAN - rman backups up the archivelogs from both duplexed destinations - from the user manual - this should not be the case, any ideas?
    Details:
    I have archivelogs duplexed
    I have the following set in rman :
    CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 2 DAYS;
    CONFIGURE BACKUP OPTIMIZATION ON;
    CONFIGURE DEFAULT DEVICE TYPE TO DISK;
    CONFIGURE CONTROLFILE AUTOBACKUP ON;
    CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/backup/rman/WPPMD/control_%F';
    CONFIGURE DEVICE TYPE 'SBT_TAPE' PARALLELISM 10 BACKUP TYPE TO BACKUPSET;
    CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
    CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
    CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '/backup/rman/WPPMD/backup_%d_%T_%U' MAXPIECESIZE 10 G;
    CONFIGURE MAXSETSIZE TO UNLIMITED; # default
    CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
    CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
    CONFIGURE COMPRESSION ALGORITHM 'LOW' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE;
    CONFIGURE ARCHIVELOG DELETION POLICY TO BACKED UP 1 TIMES TO DISK;
    CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/app/oracle/product/11.2.0/dbhome_1/dbs/snapcf_WPPMD.f'; # default
    When I run backups via a script :
    backup incremental level=$RMAN_LEVEL database plus archivelog;
    ($RMAN_LEVEL changes between 0 and 1 depending on the day of the week)
    It backs both duplex copies of the same archivelog
    From the document :
    Oracle10g / 11g - Getting Started with Recovery Manager (RMAN) [ID 360416.1]
    It says :
    Even if your redo logs are being archived to multiple destinations and you use RMAN to back up archived redo logs,
    RMAN selects only one copy of the archived redo log file to include in the backup set. (Since logs with the same log sequence number are identical, there is no need to include more than one copy.)
    But this is not the case ie
    RMAN> list archivelog sequence 2445;
    using target database control file instead of recovery catalog
    List of Archived Log Copies for database with db_unique_name WPPMD
    =====================================================================
    Key Thrd Seq S Low Time
    4640 1 2445 A 17-DEC-10
    Name: /log/recovery_area/WPPMD/archivelog2/1_2445_735315419.dbf
    4639 1 2445 A 17-DEC-10
    Name: /log/recovery_area/WPPMD/archivelog/2010_12_17/o1_mf_1_2445_6jpx9n7c_.arc
    So it still backing up both copies of the archive log.
    Any ideas? is this a bug?
    Thanks
    Luca
    Edited by: user4599449 on 17-Dec-2010 07:05
    Edited by: user4599449 on 17-Dec-2010 07:06

  • Image Processing (JAI-API) Instalation problem

    I am developing the software in Image processing (remote sensing). I am facing the following problem when i run the program.
    C:\java_ex>javac SimpleJAITest.java
    SimpleJAITest.java:23: cannot resolve symbol
    symbol : class ScrollingImagePanel
    location: class SimpleJAITest
    ScrollingImagePanel panel1, panel2;
    ^
    SimpleJAITest.java:36: cannot resolve symbol
    symbol : class ScrollingImagePanel
    location: class SimpleJAITest
    panel1 = new ScrollingImagePanel(loadImage, 300, 300);
    ^
    SimpleJAITest.java:78: cannot resolve symbol
    symbol : class ScrollingImagePanel
    location: class SimpleJAITest
    panel2 = new ScrollingImagePanel(outImage, 300, 300);
    ^
    Note: SimpleJAITest.java uses or overrides a deprecated API.
    Note: Recompile with -deprecation for details.
    3 errors
    Please send the information regarding installation of Java Advance Imaging kit
    and link to download JAI API
    Also send the solution of this problem

    C:\java_ex>javac SimpleJAITest.java -Xlint:deprecation
    SimpleJAITest.java:23: cannot find symbol
    symbol : class ScrollingImagePanel
    location: class SimpleJAITest
    ScrollingImagePanel panel1, panel2;
    ^
    SimpleJAITest.java:29: warning: [deprecation] set(java.lang.Object,java.lang.Str
    ing) in javax.media.jai.ParameterBlockJAI has been deprecated
    loadPB.set(argv[0], "hs");
    ^
    SimpleJAITest.java:36: cannot find symbol
    symbol : class ScrollingImagePanel
    location: class SimpleJAITest
    panel1 = new ScrollingImagePanel(loadImage, 300, 300);
    ^
    SimpleJAITest.java:39: warning: [deprecation] show() in java.awt.Window has been
    deprecated
    window1.show();
    ^
    SimpleJAITest.java:78: cannot find symbol
    symbol : class ScrollingImagePanel
    location: class SimpleJAITest
    panel2 = new ScrollingImagePanel(outImage, 300, 300);
    ^
    SimpleJAITest.java:81: warning: [deprecation] show() in java.awt.Window has been
    deprecated
    window2.show();
    ^
    SimpleJAITest.java:87: warning: [deprecation] set(java.lang.Object,java.lang.Str
    ing) in javax.media.jai.ParameterBlockJAI has been deprecated
    savePB.set(argv[1], "filename");
    ^
    SimpleJAITest.java:88: warning: [deprecation] set(java.lang.Object,java.lang.Str
    ing) in javax.media.jai.ParameterBlockJAI has been deprecated
    savePB.set(argv[2], "format");
    ^
    3 errors
    5 warnings

  • Blur video frame with NI PCI-1411 and JAI CV M-300 camera (urgent problem)

    Hello,
    I am new with Vision and I need some advice with a problem, which I encountered.
    I have a computer with integrated  NI PCI-1411 board, which is connected to a JAI CV M-300 camera. I am measuring a steel part which is positioned in a dark chamber. The part is put on a glass board and is illuminated from underneath with light.
    The part is moving. I have to measure this part when it reaches the camera region. I have made a test with not-moving part and everything is perfect. Now, when I move the part I get blur frames from video (with these no part measurement is possible). I need specify, that the camera has no trigger, so it makes video all the time (this video is later inspecting with Vision Builder).
    I have tried to change parameters in MAX, but no involvement. I have found no proper icd/file for the camera.
    I also could use a SONY DXC-950P camera, if this is better.
    How can I eliminate the blur from video frames? Or what am I doing wrong? Is the camera not good enough? Camera + trigger would get better images.
    I have attached the video frame with moving object (static) and the blur video frame with moving object (dynamic).
    Please give me a answer or ideas as soon as possible.
    Thanks.
    Attachments:
    static.jpg ‏391 KB
    dinamic.jpg ‏421 KB

    You are using an interlaced camera.  It takes half the picture (every other line), waits a split second, then takes the other half of the picture (the other lines).  When it puts the two images together, you can see the two positions it was in when the images were taken.
    The best solution is to use a non-interlaced or progressive scan camera, which takes the entire image at one time.  The Sony might be this type of camera, since it has a P in its name.  I didn't look up the specs.
    If you can't get the right kind of camera, your only other option is to use fields instead of frames.  One field is the half image taken at one time.  The image will be half the height of the original image, though, which can mess things up.
    Another possibility is the reduce the resolution of the image.  If you take every other pixel in both directions, you will have a very clear image that is half the size of the original.  You can do this with Extract in LabVIEW, not sure if it is available in VBAI.
    Bruce
    Bruce Ammons
    Ammons Engineering

  • Image border problem using JAI

    I've written some very simple code to scale an image down to a small
    thumbnail in JPG format but the quality is quite horrible. Is there a way of making it look nicer?
    src = JAI.create("fileload","filepath")
    ParameterBlock params = new ParameterBlock();
    params.addSource(src);
    params.add(xScale);//x scale factor
    params.add(yScale);//y scale factor
    params.add(0.0F);//x translate
    params.add(0.0F);//y translate
    params.add(Interpolation.getInstance(Interpolation.INTERP_NEAREST));
    dest = JAI.create("scale", params,null);
    I switched to InterpolationBicubic, instead of Interpolationnearest the quality was much better but the resulting image contained borders.
    could some one tell me is there any other way to get better and nicer results.

    Yes you can fix the border problem by setting a render hint to change the way the borders are handled. Something like the following will do the trick.
    You can also use BORDER_WRAP instead of BORDER_COPY, both seem to have a similar result. Mind you I am still very dissapointed with the quality of the bicubic resampling in JAI, but at least this will fix the problem with the borders.
    RenderingHints rh = new RenderingHints(JAI.KEY_BORDER_EXTENDER, BorderExtender.createInstance(BorderExtender.BORDER_COPY));
    dest = JAI.create("scale", params,rh);

  • DFT problem in JAI

    Hello!
    I have a strange problem with the JAI classes that perform DFT and IDFT. I perform both the operations on an image but the result I get is not the original image. What 's wrong with my code?
    Thanks for the help.
    My code is as follows
    import javax.media.jai.*;
    import javax.media.jai.operator.*;
    import java.awt.image.renderable.*;
    import java.awt.image.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.color.*;
    import javax.swing.*;
    import com.sun.image.codec.jpeg.*;
    import java.awt.RenderingHints;
    public class dftchain extends JPanel{
         PlanarImage img1;
         PlanarImage img2;
         PlanarImage finim;
         BufferedImage im;
         ImagePanel viewer;
         public static void main(String[] args) {
              dftchain s = new dftchain();
         public dftchain() {
         Image im1= readImage("ref.jpg");
         img1 = JAI.create("awtimage", im1);
         PlanarImage gray1 = convertColorToGray(img1,30);
         RenderedOp rop1 = DFTImage(gray1, DFTDescriptor.SCALING_NONE, DFTDescriptor.REAL_TO_COMPLEX);
         RenderedOp mag = magnitudeImage(rop1);
         RenderedOp refphase = phaseImage(rop1);
         RenderedOp complex = polarToComplexImage(mag, refphase);
         PlanarImage finim = inverseDFTImage(complex,DFTDescriptor.SCALING_NONE, DFTDescriptor.COMPLEX_TO_REAL);
         im = finim.getAsBufferedImage();
         diplay(im);
         public RenderedOp DFTImage (PlanarImage image, DFTScalingType scalingType, DFTDataNature dataNature){
              ParameterBlock pb = new ParameterBlock();
              pb.addSource(image);
              pb.add(scalingType).add(dataNature);
              return JAI.create("dft",pb);
         public RenderedOp inverseDFTImage (PlanarImage image, DFTScalingType scalingType, DFTDataNature dataNature) {
              ParameterBlock pb = new ParameterBlock();
              pb.addSource(image);
              pb.add(scalingType).add(dataNature);
              return JAI.create("idft", pb);
         public RenderedOp magnitudeImage (PlanarImage image){
              ParameterBlock pb = new ParameterBlock();
              pb.addSource(image);
              return JAI.create("magnitude",pb);
         public RenderedOp phaseImage (PlanarImage image){
              ParameterBlock pb = new ParameterBlock();
              pb.addSource(image);
              return JAI.create("phase",pb);
         public RenderedOp polarToComplexImage( RenderedOp mag, RenderedOp phase) {
              ParameterBlock pb = new ParameterBlock();
              pb.addSource(mag);
              pb.addSource(phase);
              return JAI.create("polartocomplex", pb);
         public void diplay (BufferedImage img) {
              int width = img.getWidth();
              int height = img.getHeight();
              JFrame fr = new JFrame();
              fr.addWindowListener(
              new WindowAdapter() {
                   public void windowClosing(WindowEvent e){
                        System.exit(0);
              fr.setTitle("Viewer");
              viewer = new ImagePanel(img);
              viewer.setPreferredSize(new Dimension(width,height));
              Container cp = fr.getContentPane();
              fr.getContentPane().setLayout(new GridLayout(1,1));
              cp.add(viewer);
              fr.pack();
              fr.getSize(new Dimension(width, height));
              fr.show();
              viewer.repaint();
         public Image readImage(String imageName) {
              Image image = Toolkit.getDefaultToolkit().getImage(imageName);
              MediaTracker imageTracker = new MediaTracker(this);
              imageTracker.addImage(image,0);
              try{
                   imageTracker.waitForID(0);
              catch (InterruptedException e) {
                   System.out.println(e);
              return image;
         // produce a 3 band luminance image from a 3 band color image */
        public PlanarImage convertColorToGray(PlanarImage src, int brightness) {
            PlanarImage dst = null;
            double b = (double) brightness;
            double[][] matrix = {
                                    { .114D, 0.587D, 0.299D, b },
                                    { .114D, 0.587D, 0.299D, b },
                                    { .114D, 0.587D, 0.299D, b }
            if ( src != null ) {
                ParameterBlock pb = new ParameterBlock();
                pb.addSource(src);
                pb.add(matrix);
                dst = JAI.create("bandcombine", pb, null);
            return dst;
        class ImagePanel extends JComponent {
              BufferedImage image;
              public ImagePanel (BufferedImage img) {
                   image = img;
              public void paintComponent(Graphics g) {
                   Rectangle rect = this.getBounds();
                   if (image!=null){
                        g.drawImage(image,0,0,rect.width,rect.height,this);
    }

    I am not saying it will work, but I would ask if you tried "Dilate"? I don't know what the parameters are supposed to be for the different methods, but I do know how to get a listing of them. See the code below:
              OperationRegistry ory = JAI.getDefaultInstance().getOperationRegistry();
              String [] temp = ory.getRegistryModes();
              String []temp2;
              for (int which = 0; which < temp.length; which++) {
                   temp2 = ory.getDescriptorNames(temp[which]);
                   System.out.println("\t"+temp[which]+":");
                   for (int cual = 0; cual < temp2.length; cual++) {
                        System.out.println("\t\t"+temp2[cual]);
    That will get you a listing of all of the registry modes and the descriptor names within each mode. For parameters and explanations, well, I guess check out the source code for the JAI library and then rifle through it until you find an example, or use trial-and-error, since the only documentation seems to refer to deprecated calls (as I have noted in the most recent version of JAI).

  • Problem while loading a JApplet ( which uses JAI ) on Netscape across ssl

    Hi Folks...
    I m having some problem in applet.. can any1 of u guys help me???? My problem is as follows..
    I m having 2 JApplets (Swing applet) one of the applet is using JAI (Java Advance Imaging APIs). I m trying 2 load both the applets in IE as well as in Netscape across SSL (ie thru https protocol) .Both the applet can be loaded on IE across SSL. but when i m trying to load the applet on Netscape, one of the applet which is using JAI is not getting loaded across SSL. The other applet which is not using JAI is running fine across SSL on Netscape also.
    I m getting some exception.. Is this exception comming bcoz JAI is not compatible with Netscape r bcoz of somethinf else??? If it is bcoz of the fact that Netscape does'nt have any support for JAI across SSL. then watz the possible solution 4 that. How can i overcome by this problem. Its very urgent.. i need to do it any how... Plz plz help me out if u guys have any idea abt this.. any help is most welcome..
    My ids r
    [email protected]
    [email protected]
    tks...
    Jameel

    Exactly what exception are you getting? That will really help in determining the problem. Also, do you have the same problems when going over a regular connection (i.e. not over SSL)?
    Kate

  • Problem to find the javax.media.jai package

    hi everyone!! it's not the first time I ask this question, but i have troubles to find javax.media.jai..
    I've downloaded the jai 1.1 and everything is fine... However, I have to use classes from the javax.media.jai... I made the import, and it doesn't find it, as if it doesn't exist... Someone tells me that the jai contained it, so why doesn't it find it??
    i'm using a java version 1.2.. do you think that is the problem?
    thanks a lot, and sorry for my bad english!!
    Anne.

    thanks a lot!!! it helps me but doesn't resolve my problem!! ;o)
    you may be right,, it's a classpath problem. well i work under unix, so i have to give my classpath by the command setenv CLASSPATH ...
    i didn't find the jai_core.jar in my JAI 1.1, I have only the BugFixes.jar...
    I tried to download the latest version of JAI, and unfortunately i have a new problem with the .tar, i don't manage to "open" it... the command
    tar xvf [archieve file] gives me some errors!!
    so I don't know what I'm gonna do.... I think I'm going to ask someone to send me the package, or the specific classes I need, it would be more easier!!
    Thanks
    Anne.

  • Problem with continuous scale, crop JAI operations

    Hi,
    I am using JAI in my application, i need to do the following operations in order, for the given image.
    1. Scale
    2. Crop
    3. Crop
    Each operation gets the RenderdOp object given by the previous operation as input [Output of the 1st operation is provided as input to the 2nd, etc.]
    I am facing a problem while doing the 3rd operation. This crop gives an IllegalArgumentException : Crop The rectangular crop area must not be outside the image.
    When i debug the program i found that minX and minY values are causing the problem. Input for the third operation is a 45x46 image and the crop is for 45x45 and the minY is 10, the crop recatangle is 0,0 to 45,45 the crop considers the minX and minY as the starting positions of the image and result the exception.
    Can anybody guide me to solve this problem!
    - Rakesh

    Very late, but I've just faced the same problem today. Since I'm in a hurry I've not been able to research if that behaviour is OK or some kind of bug. I guess it's OK but are missing something...
    Anyway, I just summed the values from getMinX () and getMinY () to the x and y variables which I passed to the Crop operator. That way it's like if I were working in the 0,0 coordinate which I expected to be.

  • JAI + JAI Image IO - ImageWrite operation problem: color reversed

    I installed jai 1.1.3 and jai imageio 1.1 on jdk 1.6 and did a test with the following code.
         public static void main(String args[]) {
              Byte[] bandValues = new Byte[3];
              bandValues[0] = (byte)255;
              bandValues[1] = (byte)0;
              bandValues[2] = (byte)0;
              ParameterBlock params = new ParameterBlock();
              params.add((float)300).add((float)200);
              params.add(bandValues);
              PlanarImage bim = JAI.create("constant", params);
              JAI.create("imagewrite", bim, "d:/dev/baseImage.png", "PNG");
              JAI.create("filestore", bim, "d:/dev/baseImage2.png", "PNG");
              PlanarImage pi = JAI.create("imageread", "d:/dev/baseImage.png");
              PlanarImage pi2 = JAI.create("imageread", "d:/dev/baseImage2.png");
              JFrame frame = new JFrame();
              frame.setTitle("Output Image");
              Container contentPane = frame.getContentPane();
              contentPane.setLayout(new GridLayout(1,3));
              contentPane.add(new JScrollPane(new DisplayJAI(bim)));
              contentPane.add(new JScrollPane(new DisplayJAI(pi)));
              contentPane.add(new JScrollPane(new DisplayJAI(pi2)));
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              frame.setSize(960, 400);
              frame.setVisible(true);
         }I found that the color in the output file created by "imagewrite" was reversed - bim is red but pi is blue.
    The one created by "filestore" was correct: pi2 was red.
    Did I use the "imagewrite" operation incorrectly? How should I use the imagewrite operation?

    I think you are using it correctly and you've encountered a bug. The same thing occurs on my machine. PlanarImage is using an interlaced raster which stores pixels as BGRBGRBGR ect... But the only way I can see this causing a problem is if the imagewrite operation was going directly to the DataBuffer for the pixels. If it retrieved it through the raster the colors should not be switched.
    Interestingly enough if I do this
    JAI.create("imagewrite", bim.getAsBufferedImage(), "d:/dev/baseImage.png", "PNG");then it works correctly. This suggests even more that the fault is with imagewrite operation interpreting the PlanarImage wrongly.

  • Jai som.vistech compilation problem

    Hello!
    The problem is that when I try to import a class from com.vistech, I get a "packave com.vistech.jai.imageio does not exist".
    The strange thing is that I can import classes form com.sun and javax.media so I suppose the installation has been made ok.
    What could be the problem?
    Please help!!!

    is the package is pre defined in java? ( I Think that package is not a predefined package from java. It is user defined pacakage). If not u have to set classpath to that package first and then u have to compile.
    since com.sun and javax.media are predefined they will be automatically added to classpath but user defined packages will not be added.

  • JAI TIFF - JPEG colour problem

    Hi all...
    I want to use JAI to convert from TIFF to JPEG. Here is my test program:
    import javax.media.jai.JAI;
    import javax.media.jai.RenderedOp;
    import java.awt.image.renderable.ParameterBlock;
    public class Test {
         public static void main( String[] args ) {
              String srcFile = args[0];
              String dstFile = args[1];
              RenderedOp op = JAI.create( "fileload", srcFile );
              ParameterBlock p = new ParameterBlock()
                        .addSource( op )
                        .add( dstFile )
                        .add( "JPEG" );
              RenderedOp saveOp = JAI.create( "filestore", p );
    }It works fine, except the colours in the output are all wrong.
    After running
    java Test NEC_LCD3000+Soundb_R.tif bad.jpg
    my output looks like
    http://xtuml.jdns.org/bad.jpg (if you can even see it. Firefox refuses to display the image. Gimp and KView can open it though, but all the colours are messed up)
    The output should look like
    http://xtuml.jdns.org/good.jpg
    The original was ripped from NEC's website:
    http://www.nec-display-solutions.com/coremedia/download/18634/LCD3000-ProductPicture-Soundbar-Side-R-TIF.zip
    I suspect it's a problem to do with Color Models or something, but I'm way out of my depth in this area.
    Can anybody suggest a solution?
    Thanks in advance!
    Regards,
    James

    Maybe this is the problem... the original image has an alpha channel. When I used the GIMP to flatten it back to RGB (with no alpha channel), JAI works fine...
    Does JAI support RGBA? Am I posting in the wrong forum? Is the whole world against me? :P

  • [JAI] Palette problem

    Hello,
    I want to have a image with a palette looking like :
    0->255 Red
    256->512 Green
    512->768 Blue
    How can I do that with JAI ?

    the problem is how you want to treat to border of your image. The blur works by calculating the average value of the neighbouring pixels for a given center pixel. So you have to tell your algorithm what to do if your "center" pixel sits on the outside border and lacks its neighbours...
    take a look at the docu on java.awt.image.ConvolveOp which specifies two types of "edge_conditions", i.e. solutions to the problem: EDGE_NO_OP, EDGE_ZERO_FILL

  • Problem with JAI instruction

    the line code is
    input = JAI.create("fileload",file);
    when i compile my project there is no problem but when i run it i have this error
    Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0
         at algorithms.fuzzycmeans.FuzzyCMeansImageClusteringApp.main(FuzzyCMeansImageClusteringApcan you telle me what is the problem

    Thanks both for answering!!!
    yes I agree with The fiscal periods could be different systems, but documents were created  as PRD case, same month and year.
    where could I check "Fiscal Year variant" ( If you are not talking about program variant ).
    Guys, I was debugging and I check that exactly on GET BKPF ( is like a loop ) for my document 1600003538 bkpf-monat = 03, but suddenly in GET instruction with another document 1700003522 bkpf-monat = 01
    and this is the value printed
    document = 1600003538 .
    monat      = 01 ( must be monat = 03).
    I really appreciate your answer, thanks.

Maybe you are looking for

  • How does Full Update works in BI 7.0???

    Dear Experts, I have a question on BI 7.0 Full Updtae.. How does it works exactly... My question is am loading data from Flat-file as a Full Update... Once If load the data through infopackage.. As we all knew dat. It brings the data to PSA.. later w

  • Basic error handling: how to catch all errors in a portion of code (and act accordingly)

    I have a portion of code in a VI that I know is likely to fail at some point (opening a file, then reading two arrays from it: the file can be absent, or contain the wrong data). I would like to be able to catch any errors that may occur during this

  • Premiere CC 2014 Time Change + Movement issue

    Hi all, I bumped over a problem. There is a pic attached to get it more clear. In my timeline I got 2 layers of clips. They are the same layers. One is the seccond half and the upper the left half. (using Masking tool) Both clips are speed up a littl

  • Adobe Plugin Crash

    My Adobe Flasher Player plugin keeps crashing and I get a warning message : A script in this movie is causing Adobe Flasher Player to run slowly.If it continues your computer may become unresponsive. Do you want to abort this script.Yes or No.When th

  • Informatica checkout does not allow updates

    I am using Informatica 7.9.6.1. I checkout a Workflow and am trying to add a pre sql to the target table object to change the parallelism to 4. But the sql popup is dark grey and will not allow me to enter the sql. It seems as if I am in readonly mod