• <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>
            隨筆:78 文章:7 評論:38 引用:0
            C++博客 首頁 發新隨筆
            發新文章 聯系 聚合管理

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


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

            從topcoder賺錢的方法~

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

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

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

            在所有操作中hash_map比map性能優越些。

            一、構造函數
                  默認構造函數、部分后全部復制另外一個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(); //成員函數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()成員函數;
                重新置hash_map為空:clear()成員函數;
                交換兩個hash_map之間的元素:swap(有兩種版本:一種是hash_map自身的成員函數;一種是<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()成員函數;
                判斷是否為空:empty()成員函數;
                統計hash_map中某個元素的個數:count( element );要么是1(即出現了該元素),要么是0(即沒出現這樣的元素)

                比較兩個hash_map之間的關系——操作符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()成員函數(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);

                  成員函數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); 
            }

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

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



            posted @ 2011-01-14 11:03 未央 閱讀(6842) | 評論 (0)編輯 收藏
             
            http://wenku.baidu.com/view/fdbf4ef5f61fb7360b4c657d.html
            簡單易懂,而且很好玩,呵呵
            posted @ 2010-12-02 20:07 未央 閱讀(760) | 評論 (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,假設安裝目錄為c:\opencv2.1。安裝過程中注意選擇添加環境變量,把 “add it to your Current User PATH “前的復選框勾上 .
            3. 為vs2008配置openvc,過程如下:
               工具->選項->項目和解決方案->vc++目錄,
                   “顯示一下內容的目錄”下拉列表中選擇“包含文件”,添加條目“C:\OpenCV2.1\include\opencv”;
                   “顯示一下內容的目錄”下拉列表中選擇“庫文件” ,添加條目“C:\OpenCV2.1\lib”;
             "顯示一下內容的目錄"下拉列表選擇“源文件”,添加條目”C:\OpenCV2.1\src\cv” ,”C:\OpenCV2.1\src\cvaux” ,”C:

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

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

            cv210.lib highgui210.lib
                   中間如果提示要保存的話,就保存。最后點擊確定。
               (3) 測試。用下列代碼代替源代碼,注意imagename中保存的是圖片的硬盤地址,程序的運行結果是顯示imagename指向的圖片。
              /***********************************************************************
             * OpenCV 2.0 測試例程
             * 于仕琪 提供
             ***********************************************************************/
             
            #include "stdafx.h"
            #include "highgui.h"
             
            //所有的以新風格命名的函數都在 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風格的 cvLoadImage 函數的另一種調用
                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); //創建窗口
             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是微軟推出的一款免費集成開發環境,如果你沒有足夠資金購買Visual C++,你可以使用Visual C++ Express。本安裝說明撰寫時,最新的版本是Visual C++ 2008 Express.

            Visual C++ 2008 Express可以從微軟網站下載安裝(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導出VC++項目文件

            • 運行cmake-gui,設置路徑為OpenCV安裝路徑(本文檔假定安裝位置為:D:\Program Files\OpenCV2.0),并創建子目錄D:\Program Files\OpenCV2.0\vc2008,用于存放編譯結果。
            • 然后點 configure,在彈出的對話框內選擇 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,然后執行如下操作:

            • 在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)將出現在D:\Program Files\OpenCV2.0\vc2008\bin目錄中;OpenCV的*d.lib文件(for debug)和*.lib文件(for release)將出現在D:\Program Files\OpenCV2.0\vc2008\lib目錄;頭文件*.h出現在D:\Program Files\OpenCV2.0\vc2008\include\opencv中。

            可以被VC++ 2008 Express調用的OpenCV動態庫生成完畢。

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

            配置Windows環境變量Path

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

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

            為VC++ 2008 Express配置OpenCV環境

            打開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

            關閉VC++ 2008 Express。

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

            使用OpenCV 2.0編程

            • 打開VC++ 2008 Express,創建一個Win32控制臺程序opencvhello;
            • 選擇Solution Explorer里的opencvhello項目,點擊鼠標右鍵,選擇Properties,在[鏈接器 LINKER]的[輸入INPUT]中;
            • 為項目的Debug配置增加依賴的庫:cxcore200d.lib cv200d.lib highgui200d.lib(注意,文件名cv200d.lib 可能是cv***d.lib等形式,具體應查看D:\Program Files\OpenCV2.0\vc2008\lib )
            • 為項目的Release配置增加依賴的庫:cxcore200.lib cv200.lib highgui200.lib
            • 配置屬性-字符集修改為使用“多字節字符集” (由于2008默認是以Unicode字符集編譯的)
            • 編譯運行下面的例程(需要將lena.jpg文件放在項目目錄下)。
            /***********************************************************************
            * OpenCV 2.0 測試例程
            * 于仕琪 提供
            ***********************************************************************/
             
            #include "stdafx.h"
            #include "highgui.h"
             
            //所有的以新風格命名的函數都在 cv 命名空間中
            //如果希望不要每次都輸入 cv:: ,則可使用下面語句
            //using namespace cv;
             
            int _tmain(int argc, _TCHAR* argv[])
            {
             
            const char* imagename = "lena.jpg";
             
            cv::Mat img = cv::imread(imagename); // Matlab風格的 cvLoadImage 函數的另一種調用
            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); //創建窗口
            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";
            
            取自"



             

            網上下了MATLAB7.0,解壓后,運行setup.exe,出現了以下安裝問題: 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.網上收集的解決方法,哈哈,可以正常使用MATLAB了。

            解決方法:

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

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

            posted @ 2010-11-30 09:11 未央 閱讀(2389) | 評論 (0)編輯 收藏
            僅列出標題
            共8頁: 1 2 3 4 5 6 7 8 
            CALENDER
            <2025年5月>
            27282930123
            45678910
            11121314151617
            18192021222324
            25262728293031
            1234567

            常用鏈接

            留言簿(6)

            隨筆檔案

            文章檔案

            搜索

            •  

            最新評論

            閱讀排行榜

            評論排行榜


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

            人妻精品久久久久中文字幕69| 国产精品午夜久久| 国内精品伊人久久久影院| 久久久久青草线蕉综合超碰| 午夜精品久久久久久影视riav| 久久久无码精品亚洲日韩京东传媒 | 久久久一本精品99久久精品66 | 久久综合丁香激情久久| 99久久精品免费看国产免费| 亚洲国产综合久久天堂| 久久婷婷五月综合97色| 久久免费视频一区| 97精品国产91久久久久久| 漂亮人妻被中出中文字幕久久 | 久久精品国产网红主播| 波多野结衣中文字幕久久| 无码人妻少妇久久中文字幕| 久久精品人人做人人妻人人玩| 久久国产精品免费一区二区三区| 亚洲欧美伊人久久综合一区二区 | 久久精品国产亚洲AV麻豆网站| 青草影院天堂男人久久| 国产69精品久久久久久人妻精品| 国产精品免费看久久久| 久久九九兔免费精品6| 久久影院久久香蕉国产线看观看| 久久久无码一区二区三区| 无码精品久久一区二区三区| 狠狠人妻久久久久久综合蜜桃 | 久久婷婷人人澡人人| 国产成人久久精品一区二区三区 | 国产精品亚洲综合久久 | 久久涩综合| 国产巨作麻豆欧美亚洲综合久久| 久久ZYZ资源站无码中文动漫| 久久人人超碰精品CAOPOREN| 国产精自产拍久久久久久蜜 | 久久国产午夜精品一区二区三区| 久久99国产精品一区二区| 久久久无码人妻精品无码| 久久久久人妻精品一区 |