青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品

隨筆:78 文章:7 評論:38 引用:0
C++博客 首頁 發(fā)新隨筆
發(fā)新文章 聯(lián)系 聚合管理

char *name = const_cast<char*> (sname.c_str());


posted @ 2011-03-06 20:31 未央 閱讀(398) | 評論 (0)編輯 收藏
 
突然想起來那年去寧波比賽,等待結(jié)果時候的焦慮,當主持人念到我們隊名時,我激動的和ht握緊雙手,那叫一個激動啊,搖頭晃腦的,恨不得哭了。然后ht說別那么夸張,yc他們都在后面看著呢,現(xiàn)在想想真是好傻啊,一個銅牌至于的嗎,人家拿金牌都比這淡定多了,呵呵,好傻好傻。。。。。。
posted @ 2011-03-02 16:29 未央 閱讀(281) | 評論 (0)編輯 收藏
 
 

從topcoder賺錢的方法~

 (2006-11-15 19:22)
  • 標簽: -  分類: 未分類

1. 算法
1.1  SRM
 錢少($30左右),而且很難。
1.2  Tournament
 錢多($1000~$10000),太難~

2. 設(shè)計和開發(fā)
2.1  構(gòu)件設(shè)計和開發(fā)
 錢比較多($1000左右),而且機會很多,王道啊!
2.2  Digital Run
 分季度,前5名有很多錢($1000~$10000),而且可以去米國接受榮譽~可以爭取!
2.3  Rookie of the Year
 只要在一年賽季(對于我就是2007.5.3)前通過review的submission少于6個,
 就可以參評,前十有幾千刀,第一名可以去米國接受榮譽~可以爭取!
 
差點忘了,還有3系列: 當reviewer,這個可是固定工資啊!
 
總結(jié):
 以1系列和ACM修煉內(nèi)功,以2系列和3系列修煉外功和賺錢~爭取在研究生階段掙個幾萬刀!
 
 
看了一下WishingBone的發(fā)展歷程,我主要關(guān)注掙錢的事哈:
開始階段他主要是做development,特點是工作量大,掙錢“少”,
對他來說這已經(jīng)是03年的事了~
那時他最多的03年5月,做了9個~一個掙100~200刀。
然后他開始做design,特點是工作量小,掙錢多,
對他主要是05年的事,一個能掙500~1500刀。
再然后就開始他最掙錢的工作了,做reviewer!
這個工作特點是工作量極小,錢很多,一個200~1000刀。
他最多05年10月做了20個,掙了8000刀。。。。
 
牛人的經(jīng)驗是要學(xué)習(xí)的。
 
另外象minhu那樣猛做一季的development或者design,
得個Digital Run Payment 的10000多刀也是很爽的。
另外我還有一次Rookie的機會,
要是抓住了也有好幾千刀啊。
 
努力努力,money就在眼前啊!
posted @ 2011-02-25 00:47 未央 閱讀(9228) | 評論 (0)編輯 收藏
 
    為什么煩躁呢?原因有很多吧,最直接的原因有兩個,一 research做的不順,二 感情方面走不出來。有什么辦法嗎?琦說做不出來就一直鉆,直到做出來為止,因為沒有別的辦法,所以只能這樣很痛苦的一直鉆,讓我想起了vuze,呵呵,總會有這樣的難題發(fā)生,今天有,今后也還會有。至于感情方面,理性的我告訴自己,不合適就是不合適,現(xiàn)在不分早晚也會分的,委屈不一定能求全,為了別人放棄自己的理想是件大事,即使這個人非常值得這么做,時間長了也會有后悔的一天,更何況這個人并不值得;感性上的自己卻不停的因為這件事而郁郁寡歡。昨天看到一個師姐的狀態(tài)“看完將愛,在一起的人要堅持,因為錯過的就真的回不去了”,于是鼓起勇氣去了他的校內(nèi),想給他留言,問問他我們就真的這樣錯過了嗎?結(jié)果看到他已經(jīng)在move on了,自己笑了笑,我又何嘗不是呢~于是想算了吧,就當教訓(xùn)吧,下次說分手不要那么沖動就是了,而且這個也確實不合適。今天上午還是不開心,程序又好多bug,發(fā)現(xiàn)寫寫文字真是能調(diào)節(jié)情緒啊,現(xiàn)在已經(jīng)舒服多了,呵呵。
posted @ 2011-02-20 11:04 未央 閱讀(244) | 評論 (0)編輯 收藏
 
    我一直不明白,為什么越是傷害過我的人,我越是不能忘記。而那些愛我的關(guān)心我的有恩于我的人,反而到不容易記的深刻與長久。我知道我現(xiàn)在一切的糾結(jié)都來自于我的不自信,心情不好的時候總是想起傷心事和那些我因愛生恨的人。所以要忘掉他們就該讓自己高興吧,自己開心了是誰也替代不了的,我不可能用我的生活去懲罰任何人,所以不要為了別人的關(guān)注而過的好或者不好,你想他的時候他存在,你不想他的時候他就不存在,那么讓他消失吧,每天少想一點,總會有一天就忘記了要去想。有時候就想,找個人結(jié)婚,過一輩子,這個人得千挑萬選啊,不能隨便啊,可是人就是這樣,在各種環(huán)境中焦慮,于是就想隨便找一個差不多的算了吧,省心了,可是這樣其實很對不起自己啊,而真正找到一個我愛并且愛我的人,能真心對待彼此的人又是件難于登天的事啊。既然這種事情如此困難,以至于我可以把它當做一個夢想去企及,不如還是定一個簡單一點兒的目標吧,這樣奮斗起來還希望一些。好吧,我未來三年的目標就是進google!至于后面的路,我是真的希望能有自己的事業(yè),不過這只是個愿景,還沒有具體的想法和行動方案。還是google簡單一點,嗯嗯,好好學(xué)習(xí)理論,好好編寫代碼,多思考,這些做起來更有確定性,更在我的控制范圍之內(nèi)。所以朝著這個相對簡單的目標出發(fā)吧,我會越來越好噠!層次會越來越高噠! O(∩_∩)O哈哈~
  
posted @ 2011-02-16 14:36 未央 閱讀(612) | 評論 (3)編輯 收藏
 
C++中hash_map用法 orz錕大神

在所有操作中hash_map比map性能優(yōu)越些。

一、構(gòu)造函數(shù)
      默認構(gòu)造函數(shù)、部分后全部復(fù)制另外一個hash_map。
#include <ostream>
#include <hash_map>
#include <iostream>
#include <fstream>
#include <string.h>
using namespace std;

typedef char * MyStr;

struct MyInt
{
    int i;
    friend ostream& operator<<(ostream& ii, MyInt& jj);
    MyInt(int j = 0) {
        i = j;
    }
};

struct greater_str
{
    bool operator()(const MyStr & x, const MyStr & y) const {
        if (strcmp(x, y) < 0)
            return true;

        return false;
    }
};


struct less_str {
    bool operator()(const MyStr & x, const MyStr & y) const
    {
        if (strcmp(x, y) > 0)
            return true;

        return false;
    }
};

ostream& operator<<(ostream& o, MyInt& j) {
    o << j.i;
    return o;
}

int main()
{
    using namespace stdext;
    typedef pair <MyStr, MyInt> Int_Pair;
    hash_map<MyStr, MyInt>::iterator hm1_Iter, hm3_Iter, hm4_Iter, hm5_Iter, hm6_Iter, hm7_iter;
    hash_map<MyStr, MyInt, hash_compare<MyStr, greater_str> >::iterator hm2_Iter;

    // Create an empty hash_map hm0 of key type integer
    hash_map<MyStr, MyInt> hm0;

    // Create an empty hash_map hm1 with the key comparison function of less than, then insert 4 elements
    hash_map<MyStr, MyInt, hash_compare<MyStr, less_str> > hm1;
    hm1.insert(Int_Pair("one", 0));
    hm1.insert(Int_Pair("two", 10));
    hm1.insert(Int_Pair("three", 20));
    hm1.insert(Int_Pair("four", 30));
    hm1.insert(Int_Pair("five", 40));

    // Create an empty hash_map hm2 with the key comparison function of geater than, then insert 2 elements
    hash_map<MyStr, MyInt, hash_compare<MyStr, greater_str> > hm2;
    hm2.insert(Int_Pair("one", 10));
    hm2.insert(Int_Pair("two", 20));

    // Create a hash_map hm3 with the allocator of hash_map hm1
    hash_map<MyStr, MyInt>::allocator_type hm1_Alloc;
    hm1_Alloc = hm1.get_allocator(); //成員函數(shù)get_allocator(Returns a copy of the allocator object used to construct the hash_map)
    hash_map<MyStr, MyInt, hash_compare<MyStr, less_str> > hm3(hash_compare<MyStr, less_str > (), hm1_Alloc);
    hm3.insert(Int_Pair("three", 30));

    // Create a copy, hash_map hm4, of hash_map hm1
    hash_map<MyStr, MyInt, hash_compare<MyStr, less_str> > hm4(hm1);

    // Create a hash_map hm5 by copying the range hm1[_First, _Last)
    hash_map<MyStr, MyInt>::const_iterator hm1_bcIter, hm1_ecIter;
    hm1_bcIter = hm1.begin();
    hm1_ecIter = hm1.begin();
    hm1_ecIter++;
    hm1_ecIter++;
    hash_map<MyStr, MyInt> hm5(hm1_bcIter, hm1_ecIter);

    // Create a hash_map hm6 by copying the range hm4[_First, _Last) and with the allocator of hash_map hm2
    hash_map<MyStr, MyInt>::allocator_type hm2_Alloc;
    hm2_Alloc = hm2.get_allocator();
    hash_map<MyStr, MyInt, hash_compare<MyStr, less_str> > hm6(hm4.begin(), ++hm4.begin(), hash_compare<MyStr, less_str > (), hm2_Alloc);

    cout << "hm1 =";
    for (hm1_Iter = hm1.begin(); hm1_Iter != hm1.end(); hm1_Iter++)
        cout << " " << hm1_Iter -> second;
    cout << endl;

    cout << "hm2 =";
    for (hm2_Iter = hm2.begin(); hm2_Iter != hm2.end(); hm2_Iter++)
        cout << " " << hm2_Iter -> second;
    cout << endl;

    cout << "hm3 =";
    for (hm3_Iter = hm3.begin(); hm3_Iter != hm3.end(); hm3_Iter++)
        cout << " " << hm3_Iter -> second;
    cout << endl;

    cout << "hm4 =";
    for (hm4_Iter = hm4.begin(); hm4_Iter != hm4.end(); hm4_Iter++)
        cout << " " << hm4_Iter -> second;
    cout << endl;

    cout << "hm5 =";
    for (hm5_Iter = hm5.begin(); hm5_Iter != hm5.end(); hm5_Iter++)
        cout << " " << hm5_Iter -> second;
    cout << endl;

    cout << "hm6 =";
    for (hm6_Iter = hm6.begin(); hm6_Iter != hm6.end(); hm6_Iter++)
        cout << " " << hm6_Iter -> second;
    cout << endl;

    // Create a copy, hash_map hm7, of hash_map hm1 by moving
    hash_map<MyStr, MyInt, hash_compare<MyStr, less_str> > hm7(move(hm1));

    cout << "hm7 =";
    for (hm7_Iter = hm7.begin(); hm7_Iter != hm7.end(); hm7_Iter++)
        cout << " " << hm7_Iter -> second;
    cout << endl;
}

二、基本操作方法
      訪問元素——正向迭代和反向迭代:begin()、end() 與 rbegin()、rend()
      返回迭代器——hash_map::iterator(最常用的) 和 hash_map::const_iterator、hash_map::reverse_iterator(雙向迭代器)

      操作符operator[ ](Inserts an element into a hash_map with a specified key value)
   typedef pair <const int, int> cInt2Int;
   hash_map <int, int> hm1;
   hash_map <int, int> :: iterator pIter;
   
   // Insert a data value of 10 with a key of 1 into a hash_map using the operator[] member function
   hm1[ 1 ] = 10;

   // Compare other ways to insert objects into a hash_map
   hm1.insert ( hash_map <int, int> :: value_type ( 2, 20 ) );
   hm1.insert ( cInt2Int ( 3, 30 ) );

   cout << "The keys of the mapped elements are:";
   for ( pIter = hm1.begin( ) ; pIter != hm1.end( ) ; pIter++ )
      cout << " " << pIter -> first;
   cout << "." << endl;

   cout << "The values of the mapped elements are:";
   for ( pIter = hm1.begin( ) ; pIter != hm1.end( ) ; pIter++ )
      cout << " " << pIter -> second;
   cout << "." << endl;

   // If the key already exists, operator[] changes the value of the datum in the element
   hm1[ 2 ] = 40;

   // operator[] will also insert the value of the data type's default constructor if the value is unspecified
   hm1[5];

   cout << "The keys of the mapped elements are now:";
   for ( pIter = hm1.begin( ) ; pIter != hm1.end( ) ; pIter++ )
      cout << " " << pIter -> first;
   cout << "." << endl;

   cout << "The values of the mapped elements are now:";
   for ( pIter = hm1.begin( ) ; pIter != hm1.end( ) ; pIter++ )
      cout << " " << pIter -> second;
   cout << "." << endl;

    hash_map的大小:size()成員函數(shù);
    重新置hash_map為空:clear()成員函數(shù);
    交換兩個hash_map之間的元素:swap(有兩種版本:一種是hash_map自身的成員函數(shù);一種是<algrithm>中方法)
   hash_map <int, int> hm1, hm2, hm3;
   hash_map <int, int>::iterator hm1_Iter;
   typedef pair <int, int> Int_Pair;

   hm1.insert ( Int_Pair ( 1, 10 ) );
   hm1.insert ( Int_Pair ( 2, 20 ) );
   hm1.insert ( Int_Pair ( 3, 30 ) );

   hm2.insert ( Int_Pair ( 10, 100 ) );
   hm2.insert ( Int_Pair ( 20, 200 ) );

   hm3.insert ( Int_Pair ( 30, 300 ) );

   hm1.swap( hm2 );//此時,hs1中的元素就是100,200

   swap( hm1, hm3 );//此時,hs1中的元素就是300

    查找某個元素:find()成員函數(shù);
    判斷是否為空:empty()成員函數(shù);
    統(tǒng)計hash_map中某個元素的個數(shù):count( element );要么是1(即出現(xiàn)了該元素),要么是0(即沒出現(xiàn)這樣的元素)

    比較兩個hash_map之間的關(guān)系——操作符operator==、operator!=、operator>=、operator<=
   hash_map <int, int> hm1, hm2, hm3, hm4;
   typedef pair <int, int> Int_Pair;

   for ( int i = 1 ; i < 3 ; i++ )
   {
      hm1.insert ( Int_Pair ( i, i ) );
      hm2.insert ( Int_Pair ( i, i * i ) );
      hm3.insert ( Int_Pair ( i, i - 1 ) );
      hm4.insert ( Int_Pair ( i, i ) );
   }

   if ( hm1 == hm2 )
      cout << "The hash_maps hm1 and hm2 are equal." << endl;
   else
      cout << "The hash_maps hm1 and hm2 are not equal." << endl;

   if ( hm1 <= hm2 )
      cout << "The hash_map hm1 is less than or equal to the hash_map hm2." << endl;
   else
      cout << "The hash_map hm1 is greater than the hash_map hm2." << endl;

   if ( hm1 != hm2 )
      cout << "The hash_maps hm1 and hm2 are not equal." << endl;
   else
      cout << "The hash_maps hm1 and hm2 are equal." << endl;
   if ( hm1 >= hm3 )
      cout << "The hash_map hm1 is greater than or equal to the hash_map hm3." << endl;
   else
      cout << "The hash_map hm1 is less than the hash_map hm3." << endl;

   if ( hm1 == hm4 )
      cout << "The hash_maps hm1 and hm4 are equal." << endl;
   else
      cout << "The hash_maps hm1 and hm4 are not equal." << endl;

    移除元素:erase()成員函數(shù)(Removes an element or a range of elements in a hash_map from specified positions or removes elements that match a specified key)

    hash_map<int, int> hm1, hm2, hm3;
    hash_map<int, int> :: iterator pIter, Iter1, Iter2;
    hash_map<int, int>::size_type n;
    typedef pair<int, int> Int_Pair;

    for ( int i = 1; i < 5; i++)
    {
        hm1.insert(Int_Pair (i, i));
        hm2.insert(Int_Pair (i, i*i));
        hm3.insert(Int_Pair (i, i-1));
    }

    // The 1st member function removes an element at a given position
    Iter1 = ++hm1.begin();
    hm1.erase(Iter1);

    // The 2nd member function removes elements n the range [_First, _Last)
    Iter1 = ++hm2.begin();
    Iter2 = --hm2.end();
    hm2.erase(Iter1, Iter2);

    // The 3rd member function removes elements with a given _Key
    n = hm3.erase(2);

    // The dereferenced iterator can also be used to specify a key
    Iter1 = ++hm3.begin();
    hm3.erase(Iter1);

      成員函數(shù)make_value()和value_type()用法:
#include <cliext/hash_map> 

typedef cliext::hash_map<wchar_t, int> Myhash_map; 
int main() 

    Myhash_map c1; 
    c1.insert(Myhash_map::make_value(L'a', 1)); 
    c1.insert(Myhash_map::make_value(L'b', 2)); 
    c1.insert(Myhash_map::make_value(L'c', 3)); 

    // display contents " [a 1] [b 2] [c 3]" 
    for each (Myhash_map::value_type elem in c1) 
        System::Console::Write(" [{0} {1}]", elem->first, elem->second); 
    System::Console::WriteLine(); 
    return (0); 
}

   成員函數(shù)to_array():
cli::array<hash_map<Key, Mapped>::value_type>^ to_array();

posted @ 2011-01-23 20:07 未央 閱讀(3795) | 評論 (0)編輯 收藏
 
在編譯VS時候,出現(xiàn)fatal error C1010: unexpected end of file while looking for precompiled head。問題詳細解釋:致命錯誤C1010,在尋找預(yù)編譯指示頭文件時,文件未預(yù)期結(jié)束。就是沒有找到預(yù)編譯指示信息的問文件。問題一般發(fā)生在:通過添加文件的方式,添加了一些cpp文件到一個MFC的程序,但該cpp文件并不是MFC,而是標準的C++。 解決方案1: 右鍵單擊項目工程中的cpp文件,在菜單Project->Settings->C/C++->Precompile Header,設(shè)置為第一項:Not using precompile headers。 解決方案2:在.cpp文件開頭添加包含文件stdafx.h。 #include"stdafx.h"



posted @ 2011-01-14 11:03 未央 閱讀(6863) | 評論 (0)編輯 收藏
 
http://wenku.baidu.com/view/fdbf4ef5f61fb7360b4c657d.html
簡單易懂,而且很好玩,呵呵
posted @ 2010-12-02 20:07 未央 閱讀(768) | 評論 (0)編輯 收藏
 

 vs2008 + OpenCV-2.1.0-win32安裝配置
http://blog.csdn.net/scarletty/archive/2010/05/05/5559295.aspx

vs2008 + OpenCV-2.1.0-win32-vs2008安裝
1. 安裝vs2008+sp1
2. 安裝opencv-2.1.0-win32-vs2008,假設(shè)安裝目錄為c:\opencv2.1。安裝過程中注意選擇添加環(huán)境變量,把 “add it to your Current User PATH “前的復(fù)選框勾上 .
3. 為vs2008配置openvc,過程如下:
   工具->選項->項目和解決方案->vc++目錄,
       “顯示一下內(nèi)容的目錄”下拉列表中選擇“包含文件”,添加條目“C:\OpenCV2.1\include\opencv”;
       “顯示一下內(nèi)容的目錄”下拉列表中選擇“庫文件” ,添加條目“C:\OpenCV2.1\lib”;
 "顯示一下內(nèi)容的目錄"下拉列表選擇“源文件”,添加條目”C:\OpenCV2.1\src\cv” ,”C:\OpenCV2.1\src\cvaux” ,”C:

\OpenCV2.1\src\cxcore” ,”C:\OpenCV2.1\src\highgui”。
        點擊“確定”。
4. 為單個工程配置運行環(huán)境,如:
   (1) 新建一個win32命令控制臺項目opencvhello
   (2) 在解決方案資源管理器中右鍵點擊項目名稱opencvhello,選擇“屬性”,
       在“配置(C)”下拉列表中選擇Debug, 然后“配置屬性”->“鏈接器”->“輸入”->附加依賴項,添加    cxcore210d.lib

cv210d.lib highgui210d.lib
       在“配置(C)”下拉列表中選擇Release, 然后“配置屬性”->“鏈接器”->“輸入”->附加依賴項,添加   cxcore210.lib

cv210.lib highgui210.lib
       中間如果提示要保存的話,就保存。最后點擊確定。
   (3) 測試。用下列代碼代替源代碼,注意imagename中保存的是圖片的硬盤地址,程序的運行結(jié)果是顯示imagename指向的圖片。
  /***********************************************************************
 * OpenCV 2.0 測試例程
 * 于仕琪 提供
 ***********************************************************************/
 
#include "stdafx.h"
#include "highgui.h"
 
//所有的以新風(fēng)格命名的函數(shù)都在 cv 命名空間中
//如果希望不要每次都輸入 cv:: ,則可使用下面語句
//using namespace cv;
 
int _tmain(int argc, _TCHAR* argv[])
{
 
    const char* imagename = "E:\\OpenCV2.1\\samples\\c\\lena.jpg";
 
 cv::Mat img = cv::imread(imagename); // Matlab風(fēng)格的 cvLoadImage 函數(shù)的另一種調(diào)用
    if(img.empty())
    {
        fprintf(stderr, "Can not load image %s\n", imagename);
        return -1;
    }
 
    if( !img.data ) // 檢查是否正確載入圖像
        return -1;
 
 cv::namedWindow("image", CV_WINDOW_AUTOSIZE); //創(chuàng)建窗口
 cv::imshow("image", img); //顯示圖像
 
 cv::waitKey();
 
 return 0;
}

VC 2008 Express下安裝OpenCV2.0/2.1

http://www.opencv.org.cn/index.php/VC_2008_Express%E4%B8%8B%E5%AE%89%E8%A3%85OpenCV2.0

安裝VC++ 2008 Express

Visual C++ Express是微軟推出的一款免費集成開發(fā)環(huán)境,如果你沒有足夠資金購買Visual C++,你可以使用Visual C++ Express。本安裝說明撰寫時,最新的版本是Visual C++ 2008 Express.

Visual C++ 2008 Express可以從微軟網(wǎng)站下載安裝(http://www.microsoft.com/express/product/default.aspx )。

安裝OpenCV

http://www.opencv.org.cn/index.php/Download 下載OpenCV 2.0,并安裝,本文檔假定安裝目錄為:D:\Program Files\OpenCV2.0

安裝CMake

http://www.cmake.org/cmake/resources/software.html 下載 Windows (Win32 Installer) 安裝。

編譯OpenCV

用CMake導(dǎo)出VC++項目文件

  • 運行cmake-gui,設(shè)置路徑為OpenCV安裝路徑(本文檔假定安裝位置為:D:\Program Files\OpenCV2.0),并創(chuàng)建子目錄D:\Program Files\OpenCV2.0\vc2008,用于存放編譯結(jié)果。
  • 然后點 configure,在彈出的對話框內(nèi)選擇 Visual Studio 9 2008。
  • 如果是VC++2008的Express版本,則不支持OpenMP,所以需要取消ENABLE_OPENMP選項,取消后再次選擇“Congfigure”,完成后選擇“Generate”。VC++ 2008(不是Express版本)支持OpenMP,如果你使用VC++2008,強烈建議不要取消這個選項。

點擊看大圖
Enlarge
點擊看大圖
點擊看大圖
Enlarge
點擊看大圖
點擊看大圖
Enlarge
點擊看大圖

編譯 OpenCV Debug和Release版本庫

完成上一步驟后,將在D:\Program Files\OpenCV2.0\vc2008目錄下生成OpenCV.sln的VC Solution File,請用VC++ 2008 Express打開OpenCV.sln,然后執(zhí)行如下操作:

  • 在Debug下,選擇Solution Explorer里的 Solution OpenCV,點右鍵,運行"Rebuild Solution";如編譯無錯誤,再選擇INSTALL項目,運行"Build"。
  • 在Release下,選擇Solution Explorer里的 Solution OpenCV,點右鍵,運行"Rebuild Solution";如編譯無錯誤,再選擇INSTALL項目,運行"Build"。

此時,OpenCV的*d.dll文件(for debug)和*.dll文件(for release)將出現(xiàn)在D:\Program Files\OpenCV2.0\vc2008\bin目錄中;OpenCV的*d.lib文件(for debug)和*.lib文件(for release)將出現(xiàn)在D:\Program Files\OpenCV2.0\vc2008\lib目錄;頭文件*.h出現(xiàn)在D:\Program Files\OpenCV2.0\vc2008\include\opencv中。

可以被VC++ 2008 Express調(diào)用的OpenCV動態(tài)庫生成完畢。

點擊看大圖
Enlarge
點擊看大圖
點擊看大圖
Enlarge
點擊看大圖
點擊看大圖
Enlarge
點擊看大圖
點擊看大圖
Enlarge
點擊看大圖
點擊看大圖
Enlarge
點擊看大圖

配置Windows環(huán)境變量Path

將D:\Program Files\OpenCV2.0\vc2008\bin加入Windows系統(tǒng)環(huán)境變量Path中。加入后可能需要注銷當前Windows用戶(或重啟)后重新登陸才生效。

點擊看大圖
Enlarge
點擊看大圖
點擊看大圖
Enlarge
點擊看大圖

為VC++ 2008 Express配置OpenCV環(huán)境

打開VC++ 2008 Express,菜單 Tools -> Options -> Projects and Solutions -> VC++ Directories

  • Show directories for選擇include files,加入目錄 D:\Program Files\OpenCV2.0\vc2008\include\opencv
  • Show directories for選擇library files,加入目錄 D:\Program Files\OpenCV2.0\vc2008\lib

關(guān)閉VC++ 2008 Express。

點擊看大圖
Enlarge
點擊看大圖
點擊看大圖
Enlarge
點擊看大圖

使用OpenCV 2.0編程

  • 打開VC++ 2008 Express,創(chuàng)建一個Win32控制臺程序opencvhello;
  • 選擇Solution Explorer里的opencvhello項目,點擊鼠標右鍵,選擇Properties,在[鏈接器 LINKER]的[輸入INPUT]中;
  • 為項目的Debug配置增加依賴的庫:cxcore200d.lib cv200d.lib highgui200d.lib(注意,文件名cv200d.lib 可能是cv***d.lib等形式,具體應(yīng)查看D:\Program Files\OpenCV2.0\vc2008\lib )
  • 為項目的Release配置增加依賴的庫:cxcore200.lib cv200.lib highgui200.lib
  • 配置屬性-字符集修改為使用“多字節(jié)字符集” (由于2008默認是以Unicode字符集編譯的)
  • 編譯運行下面的例程(需要將lena.jpg文件放在項目目錄下)。
/***********************************************************************
* OpenCV 2.0 測試例程
* 于仕琪 提供
***********************************************************************/
 
#include "stdafx.h"
#include "highgui.h"
 
//所有的以新風(fēng)格命名的函數(shù)都在 cv 命名空間中
//如果希望不要每次都輸入 cv:: ,則可使用下面語句
//using namespace cv;
 
int _tmain(int argc, _TCHAR* argv[])
{
 
const char* imagename = "lena.jpg";
 
cv::Mat img = cv::imread(imagename); // Matlab風(fēng)格的 cvLoadImage 函數(shù)的另一種調(diào)用
if(img.empty())
{
fprintf(stderr, "Can not load image %s\n", imagename);
return -1;
}
 
if( !img.data ) // 檢查是否正確載入圖像
return -1;
 
cv::namedWindow("image", CV_WINDOW_AUTOSIZE); //創(chuàng)建窗口
cv::imshow("image", img); //顯示圖像
 
cv::waitKey();
 
return 0;
}

點擊看大圖
Enlarge
點擊看大圖
點擊看大圖
Enlarge
點擊看大圖
點擊看大圖
Enlarge
點擊看大圖
點擊看大圖
Enlarge
點擊看大圖
點擊看大圖
Enlarge
點擊看大圖
點擊看大圖
Enlarge
點擊看大圖

作者

注:使用OpenCV 2.1 的,請將上圖中的 *200.lib 和 *200d.lib 分別改為 *210.lib 和 *210d.lib


Win7 下使用opencv2.1 VC++2008時該程序中加載圖像時要寫完整路徑,不然加載不了。例如:

   const char* imagename = "lena.jpg";

需要修改為

   const char* imagename = "D:\\lena.jpg";
取自"



 

網(wǎng)上下了MATLAB7.0,解壓后,運行setup.exe,出現(xiàn)了以下安裝問題: The installer cannot read the mwinstall.dll file, This is probably due to a CD reader which can only read files with an eight.three naming convention.網(wǎng)上收集的解決方法,哈哈,可以正常使用MATLAB了。

解決方法:

下面進行軟件安裝:我們下載的文件大多是鏡像文件,這里我們需要的是一個較為穩(wěn)定的虛擬光驅(qū)。我用的是VirtualCloneDrive是一個windows7下較為好的虛擬光驅(qū)軟件。用虛擬光驅(qū)加載MATLAB   CD1(如果是只有一個鏡像文件的話 就沒有插入cd2的一部 . 要是rar 文件就直接雙擊setup.exe    記住 不要解壓   直接在winrar 下雙擊setup),然后打開虛擬光盤,再在內(nèi)部雙擊setup文件,現(xiàn)在就可以正常安裝了。

安裝結(jié)束后,我們雙擊MATLAB快捷方式,會發(fā)現(xiàn)怎么打不開,出現(xiàn)一大堆的warning,不要著急,windows7有個很好的功能,就是可以設(shè)置兼容模式,在MATLAB的圖標右鍵--屬性--兼容性下選擇windows vista (service pack 1)點確定。現(xiàn)在再雙擊,就可以正常開啟MATLAB了
設(shè)置兼容性是關(guān)鍵!!
來自: http://hi.baidu.com/lan2xhy27/blog/item/c37913faa672ab1c6d22ebce.html

posted @ 2010-11-30 09:11 未央 閱讀(2402) | 評論 (0)編輯 收藏
僅列出標題
共8頁: 1 2 3 4 5 6 7 8 
CALENDER
<2013年5月>
2829301234
567891011
12131415161718
19202122232425
2627282930311
2345678

常用鏈接

留言簿(6)

隨筆檔案

文章檔案

搜索

  •  

最新評論

閱讀排行榜

評論排行榜


Powered By: 博客園
模板提供滬江博客

青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            国产农村妇女精品| 久久视频一区二区| 国产网站欧美日韩免费精品在线观看 | 欧美一区二区福利在线| 亚洲欧美综合v| 久久精品成人一区二区三区蜜臀| 久久国产精品网站| 久久久99久久精品女同性| 免费日韩成人| 欧美午夜激情在线| 在线国产精品播放| 国产精品99久久久久久www| 日韩午夜激情av| 欧美一级免费视频| 欧美国产日本在线| 亚洲无限av看| 老色鬼久久亚洲一区二区| 欧美女同视频| 黄色日韩网站| 中文一区二区在线观看| 久久日韩粉嫩一区二区三区| 老司机免费视频久久| 亚洲电影天堂av| 亚洲另类一区二区| 久久精品99无色码中文字幕 | 欧美在线视频一区二区三区| 亚洲欧美在线一区| 免费成人小视频| 亚洲美女视频在线免费观看| 亚洲永久精品大片| 免费观看国产成人| 国产伦精品一区二区三区高清版 | 国产在线麻豆精品观看| 亚洲最新中文字幕| 欧美在线你懂的| 亚洲三级电影全部在线观看高清| 欧美在线播放一区| 欧美日韩一区不卡| 亚洲欧洲日产国产网站| 欧美一区二区三区在线观看| 亚洲国产天堂久久综合网| 亚洲在线免费视频| 欧美日韩中字| 999亚洲国产精| 欧美成人精品三级在线观看| 香蕉久久夜色精品国产| 欧美色综合网| 这里只有精品丝袜| 亚洲精品黄网在线观看| 欧美成人在线免费观看| 一区二区视频在线观看| 久久天堂av综合合色| 欧美一区二区免费| 国产精品福利久久久| 亚洲精品视频啊美女在线直播| 免费永久网站黄欧美| 欧美亚洲一区在线| 国产一区二区精品丝袜| 性色一区二区| 亚洲愉拍自拍另类高清精品| 欧美性猛交视频| 亚洲午夜激情在线| 亚洲一区久久久| 欧美视频亚洲视频| 亚洲综合第一| 午夜精品久久久久影视| 国产精品久久久久久久久免费桃花| 99视频一区| 亚洲无人区一区| 国产亚洲欧洲一区高清在线观看| 久久九九99| 欧美在线免费视频| 在线观看视频亚洲| 欧美激情影院| 欧美日韩一区二区免费在线观看 | 久久久国产视频91| 久久久久久一区| 亚洲成人在线视频播放| 母乳一区在线观看| 欧美精品不卡| 欧美一区二区三区免费在线看 | 欧美国产日韩一区| 欧美超级免费视 在线| 在线观看一区欧美| 欧美成人69av| 欧美日韩国产综合视频在线观看 | 性做久久久久久久免费看| 国产拍揄自揄精品视频麻豆| 久久久99精品免费观看不卡| 久久久噜噜噜久久久| 亚洲黄网站黄| 亚洲天堂偷拍| 亚洲第一二三四五区| 日韩午夜中文字幕| 一区二区亚洲精品| 欧美午夜片在线观看| 欧美一区二区啪啪| 久久色在线播放| av成人天堂| 久久九九热re6这里有精品| 日韩午夜三级在线| 欧美专区在线观看| 一区二区久久久久久| 久久国产加勒比精品无码| 99在线精品视频| 久久精品一区蜜桃臀影院| 一区二区三区视频在线播放| 久久国产精品久久久久久久久久| 亚洲视频在线观看网站| 久久国产日本精品| 午夜精品区一区二区三| 欧美精品导航| 欧美第一黄网免费网站| 国产亚洲人成a一在线v站| 亚洲精品国精品久久99热| 一区久久精品| 亚洲欧美日韩国产另类专区| 亚洲精品综合| 久色成人在线| 久久久www成人免费毛片麻豆| 欧美视频精品在线| 亚洲精品极品| 亚洲毛片在线观看.| 久久天堂精品| 麻豆九一精品爱看视频在线观看免费| 国产精品视频观看| 亚洲视频每日更新| 亚洲永久精品国产| 国产精品电影网站| 亚洲自拍高清| 欧美亚洲日本一区| 国产伦精品一区二区三区在线观看| 一区二区不卡在线视频 午夜欧美不卡'| 在线视频你懂得一区| 一区二区高清视频| 欧美精品一区在线发布| 欧美大片免费观看| 最新成人av在线| 亚洲国产精品久久久久婷婷老年| 国产亚洲永久域名| 欧美一区二区三区精品电影| 久久av红桃一区二区小说| 国产精品日本一区二区 | 久久超碰97中文字幕| 性色av一区二区三区| 国产一区二区视频在线观看 | 久久精品亚洲精品国产欧美kt∨| 久久久久久亚洲精品杨幂换脸 | 亚洲香蕉伊综合在人在线视看| 亚洲最新视频在线播放| 欧美日韩性生活视频| 亚洲视频免费在线观看| 久久高清福利视频| 亚洲高清视频在线| 欧美日韩国产大片| 午夜国产精品视频| 欧美承认网站| 亚洲视频高清| 黄色精品网站| 欧美日本亚洲| 欧美在线视频网站| 欧美激情一区二区| 亚洲一区综合| 在线观看一区| 国产精品欧美风情| 久久久亚洲精品一区二区三区| 欧美高清视频在线播放| 亚洲一二区在线| 在线观看日韩专区| 国产精品视频九色porn| 欧美**字幕| 亚洲欧美成人一区二区在线电影 | 一本久久知道综合久久| 国产精品欧美日韩一区二区| 久久免费午夜影院| 宅男噜噜噜66一区二区| 免费欧美高清视频| 午夜精品久久一牛影视| 亚洲欧洲精品一区二区| 国产精品网站一区| 欧美阿v一级看视频| 午夜伦理片一区| 亚洲免费电影在线| 老司机aⅴ在线精品导航| 亚洲欧美清纯在线制服| 亚洲激情网址| 国语自产偷拍精品视频偷| 欧美午夜不卡在线观看免费| 久久午夜电影| 欧美一进一出视频| 亚洲天堂免费观看| 91久久国产精品91久久性色| 久热re这里精品视频在线6| 亚洲一区二区视频| 日韩小视频在线观看专区| 亚洲国产日韩欧美在线图片 | 欧美视频在线免费| 欧美激情一区二区三区不卡| 久久久精品日韩欧美| 亚洲欧美一区二区精品久久久|