2017年8月31日 星期四

VMware vSphere Client使用英文環境

VMware vSphere Client使用英文環境

在捷徑的目標加上: -locale en_US

"C:\Program Files (x86)\VMware\Infrastructure\Virtual Infrastructure Client\Launcher\VpxClient.exe" -locale en_US



2017年8月4日 星期五

opencv 影像讀取儲存 - 指令


從硬碟讀取檔案,並將影像秀在螢幕上,當使用者按下任一鍵,
從硬碟讀取檔案將影像設定成灰階圖,把影像儲存在硬碟,並將影像秀在螢幕上,
當使用者按下任一鍵,或是關閉視窗後程式終止:






#include <cstdio>
#include <opencv2/opencv.hpp>
using namespace cv;

int main(){
    //Show原影像
    Mat img1 = imread("lena.jpg",CV_LOAD_IMAGE_UNCHANGED);
    namedWindow("Display CV_LOAD_IMAGE_UNCHANGED", WINDOW_AUTOSIZE);
    imshow("Display CV_LOAD_IMAGE_UNCHANGED", img1);
    waitKey(0);

    //Show灰階影像
    Mat img2 = imread("lena.jpg",CV_LOAD_IMAGE_GRAYSCALE);
    imwrite("output.jpg",img2);
    namedWindow("Display CV_LOAD_IMAGE_GRAYSCALE", WINDOW_AUTOSIZE);
    imshow("Display CV_LOAD_IMAGE_GRAYSCALE", img2);
    waitKey(0);

    return 0;
}

Ref:
http://monkeycoding.com/?p=540

2017年8月3日 星期四

Install opencv3.2 on centos7 - 安裝 指令

Install opencv3.2 on centos7

1.Download
http://opencv.org/opencv-3-2.html

The latest version can be downloaded from SourceForge and GitHub:
https://sourceforge.net/projects/opencvlibrary/files/opencv-unix/3.2.0/

20170802
[hen@localhost 下載]$ ll
總計 80112
-rw-rw-r--. 1 hen hen 82033498  8月  2 12:15 opencv-3.2.0.zip
[hen@localhost 下載]$ md5sum opencv-3.2.0.zip
bfc6a261eb069b709bcfe7e363ef5899  opencv-3.2.0.zip

2. Require
yum install cmake gcc gtk2-devel numpy pkconfig
yum install gcc-c++
yum install epel-release
yum install libdc1394-devel
yum install libv4l-devel
yum install gstreamer-plugins-base-devel

3. Make
unzip opencv-3.2.0.zip
cd opencv-3.2.0/
# pwd
/root/opencv/opencv-3.2.0
mkdir build
cd build/
cmake -D CMAKE_BUILD_TYPE=DEBUG -D CMAKE_INSTALL_PREFIX=/usr/local ..
make
make install

4.Config
  root:
  echo '/usr/local/lib/' >> /etc/ld.so.conf.d/opencv.conf
  執行 ldconfig 將 /etc/ld.so.conf 的資料讀入快取當中
  將動態函式庫載入快取記憶體當中

  user:
  export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig/

  env:
  PKG_CONFIG_PATH=:/usr/local/lib/pkgconfig/


5.Test
wget https://raw.githubusercontent.com/kyshel/template/master/src/hello_cv.cpp
wget https://raw.githubusercontent.com/kyshel/template/master/file/lena.jpg
g++ -o hello_cv hellocv.cpp `pkg-config opencv --cflags --libs`
./hello_cv lena.jpg lena_gray.jpg

[root@localhost ~]# rpm -qa|grep cmake
cmake-2.8.12.2-2.el7.x86_64


Ref:http://www.linuxfromscratch.org/blfs/view/cvs/general/opencv.html


2017年8月2日 星期三

yum install epel-release - 安裝 指令

[root@localhost ~]# yum install epel-release
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package epel-release.noarch 0:7-9 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=======================================================================
 Package           Arch       Version         Repository         Size
=======================================================================
Installing:
 epel-release     noarch        7-9           extras             14 k

Transaction Summary
=======================================================================
Install  1 Package

Total download size: 14 k
Installed size: 24 k
Is this ok [y/d/N]: y
Downloading packages:
epel-release-7-9.noarch.rpm                                                                   |  14 kB  00:00:00  
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : epel-release-7-9.noarch                                                                           1/1
  Verifying  : epel-release-7-9.noarch                                                                           1/1

Installed:
  epel-release.noarch 0:7-9                                                                                        

Complete!

CentOS-Base.repo

CentOS-Base.repo

http://ftp.ksu.edu.tw

[root@localhost ~]# cat /etc/yum.repos.d/CentOS-Base.repo
[base]
name=CentOS-$releasever - Base
baseurl=http://ftp.ksu.edu.tw/FTP/CentOS/7/os/x86_64/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

[updates]
name=CentOS-$releasever - Updates
baseurl=http://ftp.ksu.edu.tw/FTP/CentOS/7/updates/x86_64/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

[extras]
name=CentOS-$releasever - Extras
baseurl=http://ftp.ksu.edu.tw/FTP/CentOS/7/extras/x86_64/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus&infra=$infra
#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
baseurl=http://ftp.isu.edu.tw/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

在Android Studio中安裝OpenCV SDK

1. 安裝 Cmake (編譯工具), NDK (環境), LLDB (調試器)