Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Friday, November 21, 2008 9:05:59 AM(UTC)

George  
George

Groups: Registered
Posts: 12


Hi,

I need a code example to see how to create and load j2k or jp2 files using tiles, with Leadtools Image Pro 16, under C# (.NET)
Actually i can do that, but reading becomes slower than loading the original TIFF file.

Original image files are about 12.000 x 12.000 pixels in 24 bits /pixel.

Thanks.

- Jorge -

 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Sunday, November 23, 2008 5:15:20 AM(UTC)

Yasir Alani  
Guest

Groups: Guests
Posts: 3,022

Was thanked: 2 time(s) in 2 post(s)

Jorge,

If you are compressing a large image using JPEG2000 compression and then re-load the full image, the loading processes could take more time. The reason is that LEADTOOLS will decompress the image upon loading and store the full image size in memory. These steps (de-compression, loading and storing) could take more time than simply loading and storing an already uncompressed image.
 
#3 Posted : Sunday, November 23, 2008 11:32:53 PM(UTC)

George  
George

Groups: Registered
Posts: 12


Thanks for reply Yasir.

But what i want to know is how to have random access to "tiles" or "precincts" of a J2K or JP2 file to show a specific region of the image, similar to : Codecs.Load(stream, rectangle).

The idea is take advantage of the JPEG-2000 structure, to do it in a determinated resolution and having rectangle size equal to the tile or precinct size (i believe it will be fast enought to display the specific regions in real time).

So i need a code example to see how create a J2K / JP2 file from a TIFF file, and later how to access ramdomly to precincts or tiles in the created file, without the need of uncompress and load the complete JPEG-2000 file.

It will be similar to the JPIP.RasterImageViewer and a JPIP.Server, but in the same computer. (I think)


Note: Excuse my English.

Thanks

    - Jorge -
 
#4 Posted : Monday, November 24, 2008 6:45:23 AM(UTC)

Yasir Alani  
Guest

Groups: Guests
Posts: 3,022

Was thanked: 2 time(s) in 2 post(s)

Jorge,

If you save a J2K as tiles (which is supported by LEADTOOLS), you can use the method codecs.Load(Image, Rectangle); to load the rectangles.

This works whether the loaded rectangle is within one or more tiles.

However, if you load rectangles of the JPEG2000 image that are within the boundaries of the tiles of the image, the loading will be considerably faster than if you load rectangles that cross into multiple tiles in the image. This is because when you do the latter, the loading function will decompress all tiles that have areas inside the rectangle, while the former only decompresses the needed tile(s).
 
#5 Posted : Monday, November 24, 2008 7:07:56 AM(UTC)

George  
George

Groups: Registered
Posts: 12


All right, thanks.

But i readed somewhere that it´s better not to use tiles in the JPEG-2000 files, because it makes "artifacts" for the boundary tiles (those that cannot have the ReferenceTile Height and Width.

I understood that was better the use of the "precincts" defined in the JPEG-2000 structure, and wonder if there´s any way to access from leadtools to those precincts, that are similar to tiles.

Thanks again.
 
#6 Posted : Tuesday, November 25, 2008 5:44:44 AM(UTC)

Yasir Alani  
Guest

Groups: Guests
Posts: 3,022

Was thanked: 2 time(s) in 2 post(s)

Jorge,

You are correct. If you save a J2K image with tiles, there is a chance that some artifacts might be added to the image near the tile boundaries.

About precincts, they are rectangular regions in the wavelet domain NOT the image itself. This means you cannot decode a specific precinct to obtain a part of the bitmap. If you use one big tile and enable the precincts feature, loading a small tile will work, but cannot be optimized the same way when the image is tiled.
 
#7 Posted : Wednesday, December 3, 2008 1:25:43 AM(UTC)

George  
George

Groups: Registered
Posts: 12


I understand.

So, which is the best way to save a JPEG-2000 image to read several tiles later, as fast as posible ?

i'll do it using different resolutions (to take advantage of the different levels of resolution).
 
#8 Posted : Wednesday, December 3, 2008 5:41:55 AM(UTC)

Yasir Alani  
Guest

Groups: Guests
Posts: 3,022

Was thanked: 2 time(s) in 2 post(s)

It should be better (for loading) to save the J2K image as tiles. Because when you load such an image using codecs.Load(Image, Rectangle), only the tile(s) that make part of the rectangle would be decompressed. This is most useful if you are dealing with huge images.

Using different resolutions might improve the image's quality (near the tile's edges).
 
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.079 seconds.