Optimize Image Transform Function

Optimize an image transform function that uses OpenCV. The objective is to reorganize the OpenCV code into a new function, and reduce the number of steps that this function does to achieve the Image Transform.



I have an image processing C++ tool that uses OpenCV to transform images (translate, rotate and scale). This tool works correctly, but it's not efficient.

My Image library defines the images from bottom left, so the first pixel (0, 0) is on the bottom-left corner of the image.


| |

| |


The transform variables are also defined from bottom left so that they are consistent with the image coordinate space.

To do the transformation with OpenCV the Transform function converts the images to OpenCV format, converts the transform matrix to OpenCV format, transforms the OpenCV image, converts the transformed OpenCV image back to my lib image, and finally trims all the transparent pixels out of the new image.



The source code is organized in a cross platform CMake project that can generate projects for any platform or compiler, but I have tested it only in Visual Studio 2015.

The project has 3 libraries:



The image processing library. This library reads and writes images from disk (TGA) and does operations on the images (create, fill, blend). Images are in bottom left order, and have a position defined by two integers. All operations on the Image library understand and use this position.

class Image

This class that defines an image. The image pixels are in RGBA format, and each channel is represented by a floating point value. Images have 4 properties: Size in X, Size in Y, Color Mode (RGBA) which defines the Number of Channels (fixed to 4) and Position in X and Y. The pixel 0,0 is the bottom left pixel.

Image* Transform

The function that takes as input an image, applies a transformation (translation, rotation, scale), and returns a new image. The transform function knows that the images have a Position in X and Y, and transforms the position of the output image too.



A snapshot of the OpenCV library.



An executable with multiple Test functions that read images from the test/input directory, apply some transformations and blends, and save new images to the test/output directory.

This functions use a CRC32 algorithm on the output images to test if the generated images are correct.

Build the Project


To generate the project for your IDE use CMake and generate the binaries to a different directory:

Source code: E:/Temp/ImageProcessing/code

Binaries: E:/Temp/ImageProcessing/vs2015_64b



Optimize the Image* Transform function so that the OpenCV code is copied directly into the transform function, and there is no need to convert the image or matrixes to OpenCV format. This new function should create the output image only once and write to it the transformed pixel values from the in_image.

Image* Transform(const Image* in_image, float translate_x, float translate_y, float rotate, float scale_x, float scale_y)


if (rotate != 0.0f || scale_x != 1.0f || scale_y != 1.0f)


// Compute the Position and Size of the out_image.

// Transform the in_image and write the resulting pixels to the out_image.

// Trim transparent borders on out_image.

// Translate the position of the out_image




// Copy in_image to out_image

// Translate the position of the out_image



You can use the OpenCV code and reorganize it in a way that is compatible with the Image library.

The new function should produce the same CRC32 hashes for the output images in the Test executable.

Beceriler: C++ Programlama, Image Processing, Yazılım Mimarisi

Daha fazlasını görün: imagemagick convert examples, imagemagick convert png to jpg, imagemagick convert crop, imagemagick convert resize, imagemagick convert quality, google image optimizer tool, optimize images online, imagemagick batch convert, dynamic image php function, swap image using function flash, shopping cart customer friendly image upload function, j2me image transform, image transform using program, image resize function cnet, image resize function website path image

İşveren Hakkında:
( 0 değerlendirme ) Canada

Proje NO: #15398109



Hi, I understand image transformation (affine, homography) very well. I can modify your code in the form of matrix multiplication even without using OpenCV so that your code will be clean and fast. Relevant Skills Daha fazlası

4 gün içinde 150$ CAD
(1 Değerlendirme)

11 freelancers are bidding on average $242 for this job


Hello, I am Smile Song. I'm interesting your project very well I'm a Good Linux, C++, c#, Python, OpenCV, Math, Java, Algorithm expert. Relevant Skills and Experience I m quite well experienced in these jobs. Let's go Daha fazlası

in 3 gün içinde206$ CAD
(518 Değerlendirme)
in 3 gün içinde250$ CAD
(40 Değerlendirme)

I am an image processing expert in [url removed, login to view] can see my profile to check my past projects. Relevant Skills and Experience As I can understand from your codes you have used belongs to earlier versions of openCV which Daha fazlası

in 10 gün içinde250$ CAD
(17 Değerlendirme)

Hi, Dear Employer! How are you? I have enough experience on /C++, java image processing project development. I am really interested in your project. I am 100% sure i can satisfy your requirements perfectly. User- Daha fazlası

in 3 gün içinde266$ CAD
(5 Değerlendirme)

I can do this project using C++/OpenCV. I am expert in Signal/image processing, machine learning, pattern recognition and computer vision and doing projects in these areas since 2004. Relevant Skills and Experience Daha fazlası

in 7 gün içinde250$ CAD
(5 Değerlendirme)

Hello sir I have just read your description. I am have strong experience about OpenCV,ImageProcessing. So your project is very easy for me. I am looking forward to discuss. [url removed, login to view] Relevant Skills and Experience Ope Daha fazlası

in 7 gün içinde200$ CAD
(1 Değerlendirme)

Hi, i am a full stack mobile & web dev having similar technical skills & experience & have already worked on a similar project before so can do this Ref : [url removed, login to view] Relevant Skills a Daha fazlası

in 3 gün içinde155$ CAD
(0 Değerlendirme)

Hi, I'm a computer vision developer for AR systems. Relevant Skills and Experience I can see that you're going to make your own transform functions that work exactly as OpenCV but faster. I'm looking forward to disc Daha fazlası

in 3 gün içinde277$ CAD
(0 Değerlendirme)

I'm an italian electronic engineer with more than 14 years of work experience. I work as HW designer; FW and SW developer. Competenze ed esperienze rilevanti openCV development Pietre Miliari proposte $500 CAD - Proj Daha fazlası

in 30 gün içinde500$ CAD
(0 Değerlendirme)

!!!!!!!!!!!! Hello !!!!!!!!!!!!!!! How are you? I've a great interesting about your project as a computer vision professional who has been specializing in this field for over 10 years. Relevant Skills and Experience Daha fazlası

in 3 gün içinde155$ CAD
(0 Değerlendirme)