RSS
 

Archive for October, 2009

OpenCV: Image range from [0...255] to [0...1]

21 Oct

Some time we need the image to be in some special range to be useful for some algorithm. In this case I needed my image to be in [0...1] range. I found this helpful piece of code, I tried it and I wanted to share it.

//read in a image
//this will result in a 8bit image [0...255]
IplImage* image_8U = cvLoadImage("test.jpg");

//to change the bit-depth you will have to allocate new memory
IplImage* image_32F = cvCreateImage(cvGetSize(image_8U),IPL_DEPTH_32F,image_8U->nChannels);

//now convert the 8bit Image into 32bit floating points
cvCvtScale(image_8U,image_32F);

//now all your data is stored in float values but in the original scale [0...255]
//to change this you'll have to normalize your matrix

// this will result in an image that is scaled to [0...1] by dividing through the highest value in the array
cvNormalize(image_32F,image32_F,0,1,CV_MINMAX);

[ad#AdBrite inline]

 
No Comments

Posted in OpenCV

 

OpenCV: Qt and OepnCV Development Tips

21 Oct

1 – Makefiles and others, that’s are used by the make tool, are generated by building systems. In particular, Qt uses qmake and OpenCV, cmake. And I like more CMake, because are more projects that’s use, then you can give some help and tips easily. Qt Creator supports CMake. More: www.cmake.org

2 – If you include some header from some lib, you needs to link against this lib. An example, you was included highgui.h but not linked against the libhighgui. Another common mistake: you link your program to a lib A that’s
are linked with lib B, and don’t link against B. You’ll probably got a lot of undefined symbols too, since lib A needs things are in B, but you aren’t linking against B.

 
No Comments

Posted in OpenCV

 

OpenCV: Older versions

21 Oct

You can download older version of OpenCV using this link.

Of course, obsolete versions are also there.

 
No Comments

Posted in OpenCV

 

Write-hand it and get its LATEX code

15 Oct

Anyone who works with LaTeX knows how time-consuming it can be to find a symbol in symbols-a4.pdf that you just can’t memorize. Detexify is an attempt to simplify this search.

Just draw the symbol you are looking for into the square area above and look what happens!

The symbol may not be trained enough or it is not yet in the list of supported symbols. In the first case you can do the training yourself. In the second case just drop me a line (danishkirel@gmail.com)!

You could spare some time training Detexify. You could also look at the source on GitHub and if you want to contribute you’re welcome. If you really, really like this you can also donate.

 

Joomla: Installation manual

13 Oct

This a very good manual which include steps starting from the test environment installation and finishing with the publishing in the production environment.
It includes also an example of website to implement. It shows step by step the way of its implementation.
Enjoy :-)

 
No Comments

Posted in Joomla