0

JAIを使用して、それぞれが5000x5000の4つのTIF画像で構成される単一のモザイクを作成しようとしています。作成したコードは次のとおりです。

    RenderedOp mosaic=null;
    ParameterBlock pbMosaic=new ParameterBlock();
    pbMosaic.add(MosaicDescriptor.MOSAIC_TYPE_OVERLAY);
    RenderedOp in=null;
    // Get 4 tiles and add them to the Mosaic
    in=returnRenderedOp(path,"northwest.tif");
    pbMosaic.addSource(in);
    in=returnRenderedOp(path,"northeast.tif");
    pbMosaic.addSource(in);
    in=returnRenderedOp(path,"southwest.tif");
    pbMosaic.addSource(in);     
    in=returnRenderedOp(path,"southeast.tif");
    pbMosaic.addSource(in);
    // Setup the ImageLayout
    ImageLayout imageLayout=new ImageLayout(0,0,10000,10000);
    imageLayout.setTileWidth(5000);
    imageLayout.setTileHeight(5000);
    imageLayout.setColorModel(in.getColorModel());
    imageLayout.setSampleModel(in.getSampleModel());
    mosaic=JAI.create("mosaic",pbMosaic,new RenderingHints(JAI.KEY_IMAGE_LAYOUT,imageLayout));

問題は、4つの画像すべてがモザイクの左上隅の同じ場所に配置されているため、残りの4分の3が空になっていることです。モザイクを構成する各画像の位置を選択して、それぞれが正しい場所に表示されるようにする方法を教えてもらえますか?

ありがとう

イアン

4

1 に答える 1

1

http://download.oracle.com/docs/cd/E17802_01/products/products/java-media/jai/forDevelopers/jai-apidocs/javax/media/jai/operator/MosaicDescriptor.html

操作前に各ソース画像の minX minY を設定する必要があるドキュメントを誤解していると思います。

northwest.tif には minX=0 と minY=0 が必要です。

northeast.tif には、minX=5000 および minY=0 が必要です。

southwest.tif には、minX=0、minY=5000、および

southeast.tif には、minx=5000 および minY = 5000 が必要です。

ドキュメントでは、逆シリアル化操作でレンダリングのヒントを使用して、ファイルを直接「移動」して逆シリアル化することをお勧めします。

どういうわけか、モザイクは単なる通常の合成操作です。

于 2010-12-15T01:55:42.970 に答える