Archive for the 'coding' Category

OSX + Growl | Compilation complete notification

If you’re bored to wait for the end of your project compilation,
you can use growlnotify utility ( it can be found inside of growl.dmg )

You can use it like this:

make; growlnotify -s -m “Compilation complete”

‘-s’ param make the notify bubble sticky.

And it will look something like this:

XCode | Embedding frameworks and libraries to an APP

It can be done by this two utilities:

otool
install_name_tool

Read full instruction at cocoaism

OSX + fopen | Relative Paths Not Working in Xcode C++

There are numerous post over the net that detail how relative paths don’t work in Xcode. I do have an Xcode template that I downloaded where the relative paths DO work, however I have not been able to figure out why nor replicate it in other projects.

#ifdef __APPLE__
#include "CoreFoundation/CoreFoundation.h"
#endif

// ----------------------------------------------------------------------------
// This makes relative paths work in C++ in Xcode by changing directory to the Resources folder inside the .app bundle
#ifdef __APPLE__
CFBundleRef mainBundle = CFBundleGetMainBundle();
CFURLRef resourcesURL = CFBundleCopyResourcesDirectoryURL(mainBundle);
char path[PATH_MAX];
if (!CFURLGetFileSystemRepresentation(resourcesURL, TRUE, (UInt8 *)path, PATH_MAX))
{
// error!
}
CFRelease(resourcesURL);

chdir(path);
std::cout << "Current Path: " << path << std::endl;
#endif

via stackoverflow

FR-041 Debris

Оновление библиотеки SiON до версии 0.6

ASIFT vs SIFT

Хммм

Overview:
A fully affine invariant image comparison method, Affine-SIFT (ASIFT) is introduced. While SIFT is fully invariant with respect to only four parameters namely zoom, rotation and translation, the new method treats the two left over parameters : the angles defining the camera axis orientation.

Against any prognosis, simulating all views depending on these two parameters is feasible. The method permits to reliably identify features that have undergone very large affine distortions measured by a new parameter, the transition tilt.

State-of-the-art methods hardly exceed transition tilts of 2 (SIFT), 2.5 (Harris-Affine and Hessian-Affine) and 10 (MSER). ASIFT can handle transition tilts up 36 and higher.

Flex SDK 4 (Gumbo) embed fonts, ‘cff’ param problem

After an migration to a newest Flex SDK 4+, you can lost all your embedded fonts!
To solve such problem, you must add an new  param to your font embedding meta tag: cff=’false’

If you get an error like this:

transcoding parameter ‘cff’ is not supported by ‘flex2.compiler.media.FontTranscoder’

It’s because developers changing it, try another version: embedAsCFF=’false’

Example:

[Embed(source = "Arial.ttf", fontFamily = "Arial", mimeType = "application/x-font", embedAsCFF='false')]

OpenCV 2.0 on SnowLeopard 64bit via MacPorts

OpenCV 2.0 on SnowLeopard 64bit via MacPorts

Posted by Matthias in guides | 17 Comments

Updated 1/17/10: The Portfile now includes a “+disable_openmp” variant. I encountered some OpenMP related segfaults in cvCalcOpticalFlowPyrLK which can be prevented with this variant.

In case you need OpenCV 2.0 on SnowLeopard in 64bit and can live without quicktime support (OpenCV 2.0 it has FFMPEG support so you should be OK in most cases) this tutorial is for you.

In case you want OpenCV 2.0 in 32 bit on 10.5 this probably works too, but I haven’t tested it. Just download the attached “Portfile” and follow the short steps underneath:

1. Before starting execute

sudo port selfupdate

so that the most recent dependencies will be installed later on. Otherwise the build might fail.

2. Make your own port directory somewhere, e.g.

/Users/sam/ports

3. Let macports know about it by editing sources.conf, e.g.

> cd /opt/local/etc/macports

> sudo vim sources.conf

4. Add the local port directory to the sources.conf before the rsync:// at the bottom of the file, e.g.

file:///Users/sam/ports # That is 3 slashes after file ;)

5. Create a graphics/OpenCV subfolder so that we have in our example

/Users/sam/ports/graphics/OpenCV

6. Copy the downloaded Portfile into the above directory, make sure it is called Portfile not Portfile.txt

7. Execute portindex in your local port directory, e.g.

> cd /Users/sam/ports

> portindex

You should see a message telling you that the total number of parsed ports is 1

8. Check if OpenCV 2.0 is found

> port search OpenCV

9. Install OpenCV via

> sudo port install OpenCV

or on SnowLeopard in 64 bit but without quicktime support

> sudo port install OpenCV +sl_64bit

10. Enjoy the time you have saved by not having to implement the algorithms in the new MachineLearning package all by yourself ;)

via random thoughts » Blog Archive » OpenCV 2.0 on SnowLeopard 64bit via MacPorts.

Why you should use OpenGL and not DirectX

http://feeds.wolfire.com

Often, when we meet other game developers and say that we use OpenGL for our game Overgrowth, we’re met with stares of disbelief — why would anyone use OpenGL? DirectX is the future. When we tell graphics card representatives that we use OpenGL, the temperature of the room drops by ten degrees.

This baffles us. It’s common geek wisdom that standards-based websites, for instance, trounce Silverlight, Flash, or ActiveX. Cross-platform development is laudable and smart. No self-respecting geek enjoys dealing with closed-standard Word documents or Exchange servers. What kind of bizarro world is this where engineers are not only going crazy over Microsoft’s latest proprietary API, but actively denouncing its open-standard competitor?

Continue reading ‘Why you should use OpenGL and not DirectX’

Fool around with pepsi penguins