RSS
 

IPhone: Nonoh on IPhone

24 Jun

Follow this steps to use Nonoh from your IPone:

  1. Download fring from AppStore
  2. Register with fring or signup
  3. Go to more setting
  4. Push Add-ons
  5. Push SIP item from the list
  6. and then input:
    user: nonoh username
    pass: nonoh pass
    proxy: sip.nonoh.net

They give you 60 free minutes to start with upon signup.

 
9 Comments

Posted in IPhone

 

PHP: Write to ini file array containing array

22 Jun
public function write_ini_file($data, $path, $mode) {

		foreach ($data as $key => $item) {
			if (is_array($item)) {
				$content .= "\n[$key]\n";
				foreach ($item as $key2 => $item2) {
					if(is_array($item2)){
						foreach ($item2 as $key3 => $item3) {
							$content .= $key2."[] = \"".$item3."\"\n";
						}
					} else {
						$content .= "$key2 = \"$item2\"\n";
					}
				}
			} else {
				$content .= "$key = \"$item\"\n";
			}
		}

		if (!$handle = fopen($path, $mode)) {
			return false;
		}

		if (!fwrite($handle, $content)) {
			return false;
		}

		fclose($handle);
		return true;
	} // end write_ini_file()

[ad#AdBrite inline]

 
No Comments

Posted in PHP

 

OpenCV: Haar training for different gesture forms

20 Jun

I found this good steps to train Haar classifier from OpenCV mailing list. So I am listing it in case it would help somebody or I need it in my research.

1- For positive set, it’s recommended to have ~2000 samples. The same is applied for the negative ones.

2- If you have different form of the object or gesture; try to make these images have the same conditions. Examples: – All hands are in the same range of degree of rotation. – If you are interested in hands; make your decision either to put wrist or not for ALL images.

3- When you define the ROI ‘Region of interest’ for the positive ones, try to mark an area that have some sort of rough marks. ‘Viola-Jones’ method is using HAAR features to detect candidates, and these features are simple and rough in some how.

4- Don’t include a lot of positions for the same detector; Instead, find the common area ‘if exist’ between all positions ‘forms’ of the object which has rough ‘clear’ marks in it.

Advice: Although machine-learning methods may give good results, but you have to understand their requirements and conditions well to utilize them. Also, they require a lot of GOOD !!! SAMPLES !!! to run the classification well.

At the end I’d like to thank everyone who get involved in this post.

 
No Comments

Posted in OpenCV

 

OpenCV: Crop an image from a camera

20 Jun

This is an example showing how to crop an image which is loaded from a capture device using matrix as a data storage:

cvNamedWindow("nocrop", CV_WINDOW_AUTOSIZE);
cvNamedWindow("crop", CV_WINDOW_AUTOSIZE);
CvCapture* capture = cvCaptureFromCAM(0);
if( !capture ){ printf("invalid camera\n"); return; }
IplImage* nocrop = cvQueryFrame(capture);
CvMat* crop = cvCreateMat(nocrop->width/2,nocrop->height/2,CV_8UC3);
for(;;) {
 nocrop=cvQueryFrame(capture);
 if(!nocrop) return;
 cvGetSubRect( nocrop, crop, cvRect( nocrop->width/4, nocrop->height/4, nocrop->height/2, nocrop->width/2 ) );
 cvShowImage("nocrop",nocrop);
 cvShowImage("crop",crop);
 int c=cvWaitKey(33);
 if(c==27) break;
}
cvReleaseCapture(&capture);
cvDestroyWindow("nocrop");
cvDestroyWindow("crop");
return;

[ad#AdBrite inline]

 
No Comments

Posted in OpenCV

 

Japan: It is sale in Sanki

17 Jun

I visited recently Sanki. For the occasion of the father day in Japan. I found a good sale of a variety of goods.

 
No Comments

Posted in Japan