RSS
 

OpenCV: Homography Matrix

22 Aug

As it is well explained in Wikipedia. The Homography matrix given:
|h1 h2 h3|
|h4 h5 h6|
|h7 h8 h9|
It is used to express the relationship between a source point and a destination point and vis-versa.
You want to map src -> dst and therefore find the homography matrix using openCV function. Then :
dst.x = (src.x*h1+src.y*h2+h3 )/(src.x*h7+src.y*h8+h9);
dst.y = (src.x*h4+src.y*h5+h6 )/(src.x*h7+src.y*h8+h9);

The function is :

public static void cvFindHomography(
IntPtr srcPoints,
IntPtr dstPoints,
IntPtr homography,
HOMOGRAPHY_METHOD method,
double ransacReprojThreshold,
IntPtr mask
)

[ad#AdBrite inline]

 
No Comments

Posted in OpenCV

 

PHP: Gmail with RoundCube

12 Aug

Some times I have problem accessing Gmail because of some Firewall restrictions. Or I would like to have my own WebMail client for my mail service hosted with Google Apps. I tried several setting and I found out that it is not that difficult just you have to know the right parameters.

Here are the parameters that worked for me:
In your main.inc.php try to modify these setting:

// IMAP settings
$rcmail_config['default_host'] = 'ssl://imap.gmail.com:993';
$rcmail_config['default_port'] = 993;
$rcmail_config['imap_auth_type'] = null;

$rcmail_config['username_domain'] = 'gmail.com';
$rcmail_config['mail_domain'] = 'gmail.com';

//SMTP settings
$rcmail_config['smtp_server'] = 'ssl://smtp.gmail.com';
$rcmail_config['smtp_port'] = 465;
$rcmail_config['smtp_user'] = '%u';
$rcmail_config['smtp_pass'] = '%p';

//MBox settings
$rcmail_config['drafts_mbox'] = '[Gmail]/Drafts';
$rcmail_config['junk_mbox'] = '[Gmail]/Spam';
$rcmail_config['sent_mbox'] = '';
$rcmail_config['trash_mbox'] = '';
$rcmail_config['default_imap_folders'] = array('INBOX', 'Drafts', 'Sent', 'Junk', 'Trash');

[ad#AdBrite inline]

If you want to try. I made this setting on my sub domain mygmail.kristou.com. It is a RoudCube with the above settings.

 
2 Comments

Posted in PHP

 

OpenCV: Image cropping

01 Aug

Here is a useful function to crop an image or to get the region of interest (ROI).

IplImage* crop( IplImage* src,  CvRect roi){
  // Must have dimensions of output image
  IplImage* cropped = cvCreatImage( cvSize(roi.width,roi.height), src->depth, src->nChannels )

  // Say what the source region is
  cvSetImageROI( src, roi );

  // Do the copy
  cvCopy( src, cropped );
  cvResetImageROI( src );

  return cropped;
}

[ad#Amazon Opencv]

usage will be like this:

IplImage* cropped = crop(source, cvRect( 0,0, 1280,500 ));

Be careful not to give a cvRect bigger then source image. It will crash your program with an awful error message.

 
3 Comments

Posted in OpenCV

 

Ubuntu: Intel Graphics on X200 with intrepid

29 Jul

I installed ubuntu intrepid on my thinkpad x200. It is mostly working but the graphics were big enough to annoy me.
I tried many xorg.conf configuration and this on worked perfectly for me to fix the screen resolution to wxga.

Section “Device”
Identifier “Configured Video Device”
Driver “intel”
Option “monitor-HDMI-1″ “HDMI-1″
Option “monitor-HDMI-2″ “HDMI-2″
EndSection

Section “Monitor”
Identifier “Configured Monitor”
EndSection

Section “Monitor”
Identifier “HDMI-1″
Option “Ignore” “True”
EndSection

Section “Monitor”
Identifier “HDMI-2″
Option “Ignore” “True”
EndSection

Section “Screen”
Identifier “Default Screen”
Monitor “Configured Monitor”
Device “Configured Video Device”
DefaultDepth 24
SubSection “Display”
Modes “1280×800″ “1024×768″
Virtual 2432 864
EndSubSection
EndSection

 
No Comments

Posted in Ubuntu

 

Ubuntu: Very good HowTo for everything

29 Jul

I found in Internet a good web page to install many useful thing for Ubuntu.
I paste it for my own reference and it may help othres.
Here is the page
—————–
Here is the summery

Initial setup

  1. Install Ubuntu
  2. Update and upgrade package sources
  3. Turn on the firewall
  4. Install the graphics driver

Multimedia

Internet & Networking

Filesystem

Scientific & Programming

Misc

 
No Comments

Posted in Ubuntu