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 : Tuesday, July 24, 2018 8:11:14 AM(UTC)

AmolS  
AmolS

Groups: Registered
Posts: 1


I am using LT 17.5.0.4.
DotNet framework 4 with C#.

My application receive images from external video control (NOT LT) at 30 frames per seconds.
I am rotating each incoming image before displaying it in RasterImageViewer using

Code:
RasterImageViewer.RotateAngle = 10;


This way is fast enough; but this resize (on display only) the image. I want to crop the image instead.

So, I use following code:

Code:
internal void Rotate(RasterImage rasterImage, int angle)
{
    RotateCommand rotateCommand = new RotateCommand();
    rotateCommand.Angle = angle * 100;
    rotateCommand.FillColor = new RasterColor();
    rotateCommand.Flags = RotateCommandFlags.Bicubic;
    rotateCommand.Run(rasterImage);
}


This fulfills my requirement. This crops the image properly. But it slows down the performance.

When changing actual pixel data in second code snippet, Flags must be "RotateCommandFlags.Bicubic" to maintain the quality. In first code snippet, this is not needed because pixel data is not changed at all.

Please suggest the way to FAST rotate the image without resizing it.
 

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 : Tuesday, July 24, 2018 8:50:14 AM(UTC)
Anthony Northrup

Groups: Registered, Tech Support, Administrators
Posts: 199

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

Hello,

As with any form of image processing, it is always a trade-off between quality and speed. Unfortunately, there is no way to rotate an image at the speeds you are looking for if you also want to preserve the quality of the image. I believe the reason rotating the viewer works as quickly as it does is because it uses your graphics card for the rendering on screen, unfortunately I don't believe we have a method for using IP commands on the graphics card, so you will be limited by your CPU processing speed. My suggestion would be to just not interpolate the image if you are wanting real time performance, if you will be rendering and exporting a video the quality vs speed consideration will be different.

Thanks,
Anthony Northrup
Developer Support Engineer
LEAD Technologies, Inc.

LEAD Logo
 
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.053 seconds.