Ninetynine is a creative design & coding agency

Setting up OpenCV 2.3.1 and Netbeans 7.1 on Ubuntu Oneiric 11.10

without comments

Hi there,

This is a follow-up of my previous post: Setting up OpenCV 2.3 and Netbeans 7.0 on Ubuntu Oneiric 11.10. A couple of days ago Gijzelaar’s PPA for OpenCV has updated from 2.3 to version 2.3.1. So I thought I’d share this with you guys. I also think this is a slightly better approach

OpenCV (Open Source Computer Vision Library) is a library of programming functions mainly aimed at real time computer vision, developed by Intel and now supported by Willow Garage. It is free for use under the open source BSD license. The library is cross-platform. It focuses mainly on real-time image processing. (Wikipedia)

The upgrade did leave my machine with some broken packages, so be cautious! I managed to fix the broken packages, but that’s another story and it probably was a rare case.

Okay, so here is a quick guide:

1. Installation of OpenCV 2.3.1

Launch a terminal and execute these commands. This adds the PPA of our friend Gijs Molenaar, which now contains OpenCV 2.3.1.

$ sudo add-apt-repository ppa:gijzelaar/cuda
$ sudo add-apt-repository ppa:gijzelaar/opencv2.3
$ sudo apt-get update
$ sudo apt-get install libopencv-dev

2. Installation of Netbeans 7.1

Ubuntu 11.10 also comes with Netbeans 6.9, just download the Netbeans 7.1 from the Netbeans Homepage and you’re all set. Be sure you download the version with C/C++ support.

Read the rest of this entry »

Written by ruben

January 8th, 2012 at 12:05 am

Setting up OpenCV 2.3 and Netbeans 7.0 on Ubuntu Oneiric 11.10

with 4 comments


I don’t like Eclipse. There, I said it. However, in the past Netbeans and C/C++ didn’t play along. Since I upgraded to Ubuntu 11.10, I decided to give it another go, and the results are pleasing! As there was no install guide available online for my situation, I decided to summarize the steps I used in order to get things running.
 

OpenCV (Open Source Computer Vision Library) is a library of programming functions mainly aimed at real time computer vision, developed by Intel and now supported by Willow Garage. It is free for use under the open source BSD license. The library is cross-platform. It focuses mainly on real-time image processing.

 

1. Installation of OpenCV 2.3

First of all, Ubuntu 11.10 comes with OpenCV 2.1, and I wanted 2.3. Luckely our friend Gijs Molenaar provides us with a PPA for OpenCV 2.3.

$ sudo add-apt-repository ppa:gijzelaar/cuda
$ sudo add-apt-repository ppa:gijzelaar/opencv2.3
$ sudo apt-get update
$ sudo apt-get install libopencv-dev

(Little notice: the package that comes with Ubuntu 11.10 is called libcv-dev, however in the PPA of Gijs the package is called libopencv-dev)

You might also want to install other packages related to OpenCV, just search for them in the Ubuntu Software Center. However, libopencv-dev will do.

2. Installation of Netbeans 7.0

Ubuntu 11.10 also comes with Netbeans 6.9, just download the new version from http://netbeans.org and you’re all set. Be sure you download the version with C/C++ support.

3. Set the project properties

Then create a new C/C++ project in Netbeans 7.0. First, set the project properties correctly. These settings worked for me.

In the C++ Compiler dialog add “/usr/locale/opencv2″ to the “Include Directories” field, also do this in the Linker dialog. In the Linker Dialog, also add the libraries opencv_core and opencv_highgui. You can find these libraries directly under “/usr/lib/”.

4. Set the includes

#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>

I find it easy to work with the cv and std namespace by default, so I don’t have to type “cv::” before every function.

using namespace cv;
using namespace std;

And if we put this all together in to a little program that shows an image, you have something like this:

#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <iostream>
using namespace cv;
using namespace std;
 
int main(int argc, char *argv[]) {
 
    Mat image;
    image = imread(argv[1], CV_LOAD_IMAGE_COLOR);
 
    if (!image.data) // Check for invalid input
    {
        cout &lt;&lt; "Could not open or find the image" &lt;&lt; endl;
        return -1;
    }
 
    namedWindow("Display window", CV_WINDOW_AUTOSIZE); // Create a window for display.
    imshow("Display window", image);
 
    return 0;
}

There we go: Our first OpenCV program in Netbeans! I hope this will work for you too ;)

Written by ruben

November 26th, 2011 at 1:47 pm

Analyzing Malicious SSH Login Attempts

without comments

While I was upgrading openssh to 5.x (to make it easier to setup chroot jails for users),
I came across the ssh login attempts from bots.

grep -ir 'invalid user' /var/log/*

Example output

/var/log/auth.log.0:Aug 15 18:14:40 sshd[20296]: Invalid user production from 85.214.40.85
/var/log/auth.log.0:Aug 15 18:14:42 sshd[20296]: Failed password for invalid user production from 85.214.40.85 port 54327 ssh2

That’s when I noticed usernames like

minecraft, eggbreaker2 ,batman ,sir , queen, elmo, frenzy, christmas, idiot, birdseed, einstein123, breast, knight, cookie, eminem, asshole123, googol, denied

and decided to make some graphs with the data.
Using perl I extracted the information from the log files.
This is what I got from ~20.000 failed attempts (spread over couple days)

Popular usernames

Existing usernames

Existing usernames top 20

Read the rest of this entry »

Written by michiel

August 18th, 2011 at 12:37 am

Posted in Server,Ubuntu

Quick workaround for missing “switch-display”-key or “lcd/crt”-key

with 6 comments

gnome-keybinding-propertiesWhat a wonderful day it is, sir

It’s been a while since I wrote something, but I liked to share this with you all. I bought a new Dell Studio 1558 and all the fn-keys were working except the one to switch the displays…

I enjoy switching between dual-screen, using only my external 22″ or using only my laptop, when I’m on the road. So I was looking for a workaround.

This laptop, is my first machine with Ubuntu that uses an ATI graphics chip, so this was all quite new to me. But I have to say; I’m very very pleased with it.

Ok, so what do you have to do to get things working?

1. Create the script
Create the script, I called it toggleDisplay.sh and this is how it looks in my case:

#!/bin/bash
# Script to toggle display configuration on Dell Studio 1558
# author: Ruben Verhack
 
config="/tmp/display.conf"
current=`cat $config`
 
# Check if config exists
if [ ! -a $config ]
then
   # Empty file executes default
   touch $config;
fi
 
# Check if CRT2 is connected
if xrandr -q | grep "CRT2 connected"
then
   # Toggle between states
   case "$current" in
   '')
      # default
      xrandr --output LVDS --auto --output CRT2 --left-of LVDS --output CRT2 --auto
      echo "dual" > $config
      ;;
   'dual')
      # was dual, now external only
      xrandr --output LVDS --off --output CRT2 --auto
      echo "external" > $config
      ;;
   'external')
      # was external, now laptop only
      xrandr --output LVDS --auto --output CRT2 --off
      echo "laptop" > $config
      ;;
   'laptop')
      # was laptop, now both
      xrandr --output LVDS --auto --output CRT2 --left-of LVDS --output CRT2 --auto
      echo "dual" > $config
      ;;
   esac
else
   xrandr --output LVDS --auto
fi

This toggles your displays from dual screen to external only to laptop only, and from there to dual screen again. Note that my monitors were called LVDS and CRT2, you can easily check how your monitors are called by executing:

xrandr -q

Read the rest of this entry »

Written by ruben

May 21st, 2010 at 9:53 pm

Posted in Ubuntu

Tagged with , ,

Doc? v3.0 BETA released

with 3 comments

Yesterday we’ve released a public beta from the new Doc? (v3.0)
Go and check it out at www.airdoc.be!

Doc? Air Local Livedocs

Here are some of the most important new features :

  • Minimize/Close to tray (WINDOWS)
  • Local Books
  • Online Books Download
  • Inline Search
  • Performance Upgrade (SQLITE)
  • Custom tree icons
  • Complete design makeover

Take a look on our website to learn more …


Written by michiel

December 27th, 2009 at 12:43 pm

Posted in AIR,AS3,Doc?,Flex

Tagged with , ,

Flex: TabNavigator Label Jump (Quick Fix)

without comments

Hey,

Somethings been bugging me while skinning a flex application :

The label from the selected tab from the TabNavigator component is 1px lower than the other tabs. As you can see in the example.
(It has something to to with the bottom border I’m guessing).

This can help as a visual support you are on a different tab, but I found it rather annoying, so here is my fix for it.
A quick fix by changing the “paddingTop” property.

View source is enabled so can download the example there.
http://ninetynine.be/blog/wp-content/uploads/2009/12/srcview/index.html

This movie requires Flash Player 9

Code after the jump.

Read the rest of this entry »

Written by michiel

December 20th, 2009 at 1:38 pm

Posted in AIR,AS3,Flex

Tagged with , ,

MamppControl : Xampp/Mampp Tray Launcher

without comments

MamppControl

MamppControl

Hey,

Yesterday I had some spare time, so I decided to take a look at the Cocoa collection of frameworks, APIs, and accompanying runtimes that make up the development layer of Mac OS X.
I’ve created this first application with XCode in Objective-C and named it MamppControl.

It allows you to start, stop, reload Mampp from the tray, with a handy tray icon & menu.
Mampp is the other name for Xampp on Mac.

XAMPP is an easy to install Apache distribution containing MySQL, PHP and Perl. XAMPP is really very easy to install and to use – just download, extract and start.

More information about Xampp here.

I know that there is a launcher includes in the xampp package, but it has no tray icon and stay’s visible in the dock.

Read the rest of this entry »

Written by michiel

May 24th, 2009 at 4:21 pm

Posted in Mac OSX,Tutorials,Xampp

Tagged with

Use CodeIgniter on localhost with Ubuntu Jaunty

with 2 comments

Hi,

As a PHP developer it comes in handy to run your websites without having to upload them to your server. You can run them on your own computer if you want to, there isn’t much to it. I also like using the CodeIgniter framework for my projects, this is a really speeds up the whole process!

I will take you through the basic steps to set up your localhost to get CodeIgniter running.

1) Use Synaptic package manager to install “apache2″, “php5″ and “mysql-server”.

During the installation you will be asked to enter the password for the root user for your mysql-server.

2) Create a symbolic link, so that when you go to localhost in your browser, you get the website you want.

sudo cd /var/
sudo rm -r www/
sudo ln -s /path/to/website www

Always look before you delete something with “rm -r”, normally there should only be a index.html file in your www/ folder.

I prefer creating a link to my website that I put somewhere in my home directory, as this is being back-upped frequently, and is on another partition.

Read the rest of this entry »

Written by ruben

May 2nd, 2009 at 1:22 pm

Posted in PHP,Tutorials,Ubuntu,Xampp

Tagged with , ,

Photoshop CS4 on Ubuntu 9.04

with 22 comments

Photoshop 9.04 on UbuntuYes, it is possible! To my own suprise, I was able to install Photoshop CS4 on Ubuntu.

I did it on a fresh install of Ubuntu 9.04 RC. It has known to work on Ubuntu 8.10, but it gave me a segmentation fault, probably because I had been messing around ;) . I tested it with the trial version downloaded from adobe.com.

To do so, you need Wine. I will take you through the steps that I’ve taken:

Read the rest of this entry »

Written by ruben

April 20th, 2009 at 10:08 pm

Posted in Photoshop,Ubuntu

Tagged with ,

Flex: Runtime font embedding using compiled CSS with loader

with one comment

A missing feature in Flex is the ability to load fonts at runtime.

‘Why is this useful?’, you could ask. Well one situation is you’re creating an online rich text editor, and you want to add a font
to the font list. You would only have to edit the css and upload the new swf instead of the whole application. Or you want a client
to be able to add fonts without him having the source code from the application.

Luckily it’s possible in Flex to load runtime CSS compiled as an SWF with the StyleManager class.
StyleManager on LiveDocs

Fonts.css Example :

1
2
3
4
@font-face {
    src:url("fonts/Arial.ttf");
    fontFamily:"Arial";
}

How to compile the CSS to SWF?
Read the rest of this entry »

Written by michiel

April 13th, 2009 at 9:57 pm

Posted in AIR,AS3,CSS,Flex,Tutorials

Tagged with , ,