You may chage the image path.
[sourcecode language="cpp"]
#include "stdafx.h"
#include<opencv\cv.h>
#include<opencv\cxcore.h>
#include<opencv\highgui.h>
int _tmain(int argc, _TCHAR* argv[])
{
IplImage *img = cvLoadImage("C:\\opencv3\\img\\opencv.png",1);
cvNamedWindow("Image:",1);//Create new window
cvShowImage("Image:",img);//Display image in the window
cvWaitKey(0);//Wait until user press any key
cvDestroyWindow("Image:");//Destroy the window named 'Image'
cvReleaseImage(&img);//Release memory used for the image
return 0;
}
[/sourcecode]
Thursday, January 31, 2013
Wednesday, January 30, 2013
Install OpenCV 2.4.3 on Visual Studio 2010
[youtube=http://www.youtube.com/watch?feature=player_embedded&v=cgo0UitHfp8]
Tuesday, January 29, 2013
Capture Video With OpenCV
[sourcecode language="cpp"]
#include "stdafx.h"
#include<opencv\cv.h>
#include<opencv\cxcore.h>
#include<opencv\highgui.h>
using namespace cv;
int _tmain(int argc, _TCHAR* argv[])
{
CvCapture *capture = cvCaptureFromCAM(0);
if( !capture ) return 1;
cvNamedWindow("Video");
while(true) {
IplImage* frame = cvQueryFrame( capture );
if( !frame ) break;
cvShowImage( "Video", frame );
int c = cvWaitKey(40);
if((char)c==20 ) break;
}
cvDestroyWindow("Video");
cvReleaseCapture( &capture );
return 0;
}
[/sourcecode]
#include "stdafx.h"
#include<opencv\cv.h>
#include<opencv\cxcore.h>
#include<opencv\highgui.h>
using namespace cv;
int _tmain(int argc, _TCHAR* argv[])
{
CvCapture *capture = cvCaptureFromCAM(0);
if( !capture ) return 1;
cvNamedWindow("Video");
while(true) {
IplImage* frame = cvQueryFrame( capture );
if( !frame ) break;
cvShowImage( "Video", frame );
int c = cvWaitKey(40);
if((char)c==20 ) break;
}
cvDestroyWindow("Video");
cvReleaseCapture( &capture );
return 0;
}
[/sourcecode]
Sunday, January 27, 2013
Crawl Site For Keywords
[sourcecode language="python"]
import re
import urllib2
keywordregex = re.compile('<meta\sname=["\']keywords["\']\scontent=["\'](.*?)["\']\s/>')
try:
response = urllib2.urlopen("http://fun-lanka.site50.net/");
except Exception, e:
print e.args
msg = response.read()
keywordlist = keywordregex.findall(msg)
if len(keywordlist) > 0:
keywordlist = keywordlist[0]
keywordlist = keywordlist.split(", ")
print keywordlist
[/sourcecode]
import re
import urllib2
keywordregex = re.compile('<meta\sname=["\']keywords["\']\scontent=["\'](.*?)["\']\s/>')
try:
response = urllib2.urlopen("http://fun-lanka.site50.net/");
except Exception, e:
print e.args
msg = response.read()
keywordlist = keywordregex.findall(msg)
if len(keywordlist) > 0:
keywordlist = keywordlist[0]
keywordlist = keywordlist.split(", ")
print keywordlist
[/sourcecode]
Subscribe to:
Posts (Atom)
How to enable CORS in Laravel 5
https://www.youtube.com/watch?v=PozYTvmgcVE 1. Add middleware php artisan make:middleware Cors return $next($request) ->header('Acces...
-
< Requirements Java Development Kit (JDK) NetBeans IDE Apache Axis 2 Apache Tomcat Server Main Topics Setup Development Environ...
-
Download Sourcecode [sourcecode language="csharp"] using System; using System.Collections.Generic; using System.Linq; using System...