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 : Wednesday, January 17, 2007 2:17:30 AM(UTC)
Raymond Lee

Groups: Registered
Posts: 30


Hi,

I figured out a strange scenario, that is rotation command on different IRasterImages will produce different rotation speed. I tried rotations on IRasterImage loaded by RasterCodes.Load() and IRasterImage returned by acquire() method (without file save). I found that the speed of rotation 90 degrees on image is much higher than the one in rotation on image loaded by RasterCodes.Load().

Time measurement:

Case (1) : rotations on IRasterImage loaded by RasterCodes.Load(), a TIF with file size 40KB

Output of my program :

Image size : 171356
It is compressed!
Rotate image 0 : 1156.25
Rotate image 1 : 796.875
Rotate image 2 : 796.875
Rotate image 3 : 812.5
Rotate image 4 : 781.25
Rotate image 5 : 843.75
Rotate image 6 : 796.875
Rotate image 7 : 796.875
Rotate image 8 : 796.875
Rotate image 9 : 781.25
Load Test 90 deg :  : 8359.375

Time taken was measured in milliseconds.

Caes (2) : rotations IRasterImage returned by acquire() method

A4 ROTATE90 15.625
A4 ROTATE90 15.625
A4 ROTATE90 15.625
A4 ROTATE90 15.625
A4 ROTATE90 15.625
A4 ROTATE90 15.625
A4 ROTATE90 15.625
A4 ROTATE90 15.625
A4 ROTATE90 31.25
A4 ROTATE90 15.625
A4 ROTATE90 15.625
A4 ROTATE90 15.625
A4 ROTATE90 15.625
A4 ROTATE90 15.625
A4 ROTATE90 15.625
A4 ROTATE90 0
A4 ROTATE90 15.625
A4 ROTATE90 0
A4 ROTATE90 15.625
A4 ROTATE90 0

Most of the rotation opertions were completed in 16 milliseconds, even some of them took 0 (I don't understand this, can leadtools support kindly explain?)

Does anyone help to explain this scenario? This can kindly help us to improve the efficency of our
program.

The case 1 coding is listed as follow:

RasterCodecs rasterCodecs = new RasterCodecs();   
rasterCodecs.Options.Load.Compressed = true;
IRasterImage image = rasterCodecs.Load(@"C:\tmp\images\output1.tif");
Console.Out.WriteLine("Image size : {0}", image.DataSize);
if ( image.IsCompressed )
 Console.Out.WriteLine("It is compressed!");
else
 Console.Out.WriteLine("It is non-compressed!");

RotateCommand rotate_cmd = new RotateCommand();
rotate_cmd.Angle = 90;    
rotate_cmd.Flags = RotateCommandFlags.None;

DateTime startTime = DateTime.Now;

for ( int i = 0; i < 10; i++ )
{
 DateTime time1 = DateTime.Now;
 rotate_cmd.Run(image);
 BenchMark("Rotate image " + i, time1);
}

startTime = BenchMark("Load Test 90 deg : ", startTime);

Thanks for your kind attention,
Raymond

 

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 : Wednesday, January 17, 2007 4:21:59 AM(UTC)

Bashar  
Guest

Groups: Guests
Posts: 3,022

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

Generally, the speed of rotation is primarily dependent on the size of
the bitmap in memory (not the file size on disk), assuming that the
same rotation code is used for all test images..  The larger the
size the more time it will take.  As for the 0 ms rotation time,
the only logical explanation I can think of is that the bitmap was so small that it took less than 1 ms to rotate.


What are the bitmap sizes (in memory) of the images loaded by the Load
method vs. the ones acquired from the scanner?  If the bigger
images took longer time than the smaller ones then this is normal behavior.

 
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.092 seconds.