河南依尚恒立实业2017年有限公司2017年底招聘天猫运营吗

Install OpenCV 3.0 and Python 3.4+ on OSX - PyImageSearch花了週末兩天時間,將opencc移植成WIN10-UWP可用的庫,並完成自己的繁簡轉換工具。
我的繁簡轉換工具下載地址為:
移植後的代碼下載地址:
因為今天( 20:18)才上傳,所以如果你在今天或接下來的兩到三天,是找不到這款軟件的,因為微軟商店在審核。。
來個GIF圖來瞅瞅:
台灣的&軟體&可以轉換成大陸的&软件&哦。&
1)創建一個VC++,DLL通用工程
2)for(auto x : xs) 要全部換成 for each (auto x in xs)
3)要關閉安全檢測,這個是為了使strcpy等函數編譯通過。
4)所有opencc的cpp文件,要禁用預編譯頭。
5)在Config.cpp中,要將&#include &unordered_map& 放到最上面,不然編譯不過。具體原因待查。
搞完這幾步,一個DLL就創建成功了。
2.創建RuntineComponent
我不知道C#工程能否直接調用DLL,沒有試驗過。不過即便能調用,相信也是相當麻煩的,需要處理一大堆類型轉換的問題。
所以,我們有必要創建一個通用工程,所有語言都可以調用的模塊,這個模塊就是RuntineComponent了。
具體可以參考博客:
還有C++/CX的一些參考,也是需要你去了解的:
我的例子,名為OpenCCx,後面加一個x,表示我這個是亂搞的,並不是原作者搞出來的。
3.使用RuntineComponent
創建一個C#的UWP工程,添加OpenCCxRuntineComponent工程到你的解決方案。
在UWP工程中,添加引用,選擇工程,點擊&確定&即可。
然後,在你的工程裡面就可以使用 OpenCCxRuntineComponent名字空間。
例子是非常簡單的:
OpenCCxRuntineComponent.OpenCCx opencc_s2t = new OpenCCxRuntineComponent.OpenCCx(); --- 創建
opencc_s2t.Load(OpenCCxRuntineComponent.ConverterType.Simple2Traditional);
----使用什麼轉換規則
private void btn2Simple_Click(object sender, RoutedEventArgs e)
string ret = opencc_t2s.Convert(textBox.Text); ---使用簡單的Convert就OK了。
if (ret != null)
textBox.Text =
你可以使用一個OpenCCx變量,用哪個就Load哪個。
我的代碼中,對已加載的東東進行了保存,不會重複加載的。
也可以使用多個OpenCCx變量,一個變量代表一種轉換,看個人需要了。
終於可以使用自己的繁簡轉換工具了^_^,感謝opencc作者。
帖上opencc代碼地址:
在線opencc轉換地址:
阅读(...) 评论()Raspberry Pi + OpenCV
Raspberry Pi + OpenCV
on Jun 14, 2012 in ,
OpenCV is a suite of powerful computer vision tools. Here is a quick overview of how I installed OpenCV on my Raspberry Pi with
The guide is based on the official . Before you begin, make sure you have expanded your SD card to allow for the install of OpenCV. Its a big package with lots of dependencies. You can follow my instructions .
Once you have expanded the SD card, open up a terminal and install the following packages:
UPDATE: You can execute the following steps with a simple call to the Ansible playbook . Note that you have to edit the pis.yml file with your pi ip address and update group_vars/pis.yml with your pi password.
git clone /chrismeyersfsu/playbook-opencv.git
ansible-playbook site.yml -i pis.yml -vvvv
Note: The make command will take HOURS to run. Please be patient.
sudo apt-get -y install build-essential cmake cmake-qt-gui pkg-config libpng12-0 libpng12-dev libpng++-dev libpng3 libpnglite-dev zlib1g-dbg zlib1g zlib1g-dev pngtools libtiff4-dev libtiff4 libtiffxx0c2 libtiff-tools
sudo apt-get -y install libjpeg8 libjpeg8-dev libjpeg8-dbg libjpeg-progs ffmpeg libavcodec-dev libavcodec53 libavformat53 libavformat-dev libgstreamer0.10-0-dbg libgstreamer0.10-0 libgstreamer0.10-dev libxine1-ffmpeg libxine-dev libxine1-bin libunicap2 libunicap2-dev libdc1394-22-dev libdc1394-22 libdc1394-utils swig libv4l-0 libv4l-dev python-numpy libpython2.6 python-dev python2.6-dev libgtk2.0-dev pkg-config
There are some dependency issues with the order of the install, mostly with regard to libjpeg issues, so be sure to install in this order. You will see some broken package errors if you attempt to install all the dependencies in one step.
Next, pull down the source files for OpenCV using wget:
wget http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/2.3.1/OpenCV-2.3.1a.tar.bz2
Once finished downloading, extract the archive, remove the no longer needed archive (to save space), change directory to the top of the source tree, make a directory for the build, and change into it:
tar -xvjpf OpenCV-2.3.1a.tar.bz2
rm OpenCV-2.3.1a.tar.bz2
cd OpenCV-2.3.1/
mkdir build
Next, you will need to configure the build using cmake. If you aren’t sure about what options you want/need or are unfamiliar with cmake, this line will create a standard configuration:
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D BUILD_PYTHON_SUPPORT=ON -D BUILD_EXAMPLES=ON ..
Alternatively, you can configure the build using a GUI interface. This can be helpful to build with support for additional OpenCV features. To use the cmake GUI, run:
cmake-gui ..
In the cmake GUI, click ‘configure’ to pre-populate the build options. Select or remove any desired features, then click ‘configure’ again, check the output and ensure that there are not any modules that cmake cannot find. If everything looks good, click ‘generate’ to create the makefiles, then close cmake-gui. Now we are ready to start the build! To compile, run make, then install with make install:
sudo make install
As you can see from the image, this will take a LONG time… over four and a half hours to compile!
Finally, we need to make a few configurations for OpenCV. First, open the opencv.conf file with the following code:
sudo nano /etc/ld.so.conf.d/opencv.conf
Add the following line at the end of the file(it may be an empty file, that is ok) and then save it:
/usr/local/lib
Then edit the system-wide bashrc file:
sudo nano /etc/bash.bashrc
Add the following new lines to the end of the file:
PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig export PKG_CONFIG_PATH
Now that everything is installed and configured, on to the demos!
The C demos are here:
cd ~/opencv/OpenCV-2.3.1/build/bin
C demos in build/bin demos worth checking out (that don’t require a webcam):
convexhull
The python demos are located in samples/python:
cd ~/opencv/OpenCV-2.3.1/build/bin
These demos also don’t require a webcam:
python ./minarea.py
python ./delaunay.py
python ./drawing.py
Share this:
Pingback: ()
Pingback: ()
Pingback: ()
Pingback: ()
Pingback: ()
Pingback: ()
Pingback: ()
Pingback: ()
Pingback: ()
Pingback: ()
Pingback: ()
Pingback: ()
Pingback: ()
Pingback: ()
Pingback: ()
Pingback: ()
Pingback: ()
Pingback: ()
Pingback: ()
Pingback: ()
Pingback: ()
Pingback: ()
Pingback: ()
Pingback: ()
Pingback: ()
#INCLUDE STD_DISCLAIMER
Always excercise caution when working with electronics. All software is provided on an "as is" basis without warranty of any kind, express or implied. Unless otherwise noted, all code content is licensed under the
Send to Email Address
Your Email Address
Post was not sent - check your email addresses!
Email check failed, please try again
Sorry, your blog cannot share posts by email.

我要回帖

更多关于 恒立实业2017年 的文章

 

随机推荐