文本末尾添加“/usr/local/lib”,按下Ctrl + O,回車保存修改,Ctrl + X退出修改(Add “/usr/local/lib” in the text end,push “Ctrl + O” and “Enter” to save modification,and push “Ctrl + X” to exit)
1.You can choose other version OpenCV,but it maybe generate other compile issue because of compatibility,you can find other version OpenCV library on their official website(https://opencv.org/),or search on SourceForge(https://sourceforge.net/).
2.The speed of compiling OpenCV library will a little slow,please wait patiently.
3.If you dp it on RPI or other minitype devic,the device maybe generate system jammed issue because of performance,now,you need power off the device and restart it and continue to compile.
4.If you dp it on RPI or other minitype devic,please pay attention to heat dissipation.
4.安裝Qt Creator (Install Qt Creator)
$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get install qt5-default
$ sudo apt-get install qtcreator
注:
1.若樹莓派下執行第一步update時提示404 Not Found,需要修改本機DNS(If system note “404 Not Found” issue when execute “sudo apt-get update” on RPI,you need modify device DNS),
$ sudo nano /etc/resolv.conf
修改127.0.1.1為8.8.8.8,Ctrl + O,回車保存修改,Ctrl + X退出修改(Modify 127.0.1.1 to 8.8.8.8,push “Ctrl + O” and “Enter” to save modification,and push “Ctrl + X” to exit)
$ service network restart
2.多數情況下Qt Creator安裝好后會自動配置好編譯器套件,不過有時也會發生編譯套件未配置或配置出錯的情況,需要手動檢查一下,檢查方法如下(In most cases,Qt Creator will auto configure compile kits after install,but somtimes,an unconfigured or misconfigured build suite will occurs,so you need check it by yourself,the method of check as follow ):
$ sudo qtcreator
程序運行起來之后點擊工具(Tools)-> 選項(Options)-> 編譯套件(Kits),查看編譯套件是否有錯誤提示,如果有請按照如下步驟配置編譯套件(After Qt Creator has been run,click Tools->Options->Kits,check if the kits has error note,if has error,please configure kits as follow),
1.設置編譯器:點擊添加選擇MinGW,選擇g++編譯器的路徑,ABI選擇arm-linux-guneabihf-elf(Setup compiler:click Add and select MinGW,choose teh path of g++ compiler,ABI choose arm-linux-gnueabihf-elf);
2.設置編譯套件:編譯器選擇剛才設置好的MinGW,選擇調試器(Setup compile kits:choose the MinGW you setuped just now to be compiler,and choose debuger);
5.下載并安裝QHYCCD SDK(Download and Install QHYCCD SDK)
請根據自己使用的Linux版本下載對應版本的SDK,可以通過”uname -a”命令查看所使用的Linux版本(Please download the corresponding version of the SDK according to the Linux version you are using. You can check the Linux version used by the “uname -a” command.),
若結果為x86_32,則對應Linux (If the result is x86_32, it corresponds to Linux);
若結果為x86_64,則對應Linux_x64 (If the result is x86_64, it corresponds to Linux_x64);
若結果為armv7l,則對應RPI3 (If the result is armv7l, it corresponds to RPI3);
若結果為aarch64,則對應AARCH64 (If the result is aarch64, it corresponds to AARCH64)。
此次以armhf為例(This time with armhf as an example),
$ tar -xvf RPI3_qhyccd_V20191115_0.tgz
$ cd RPI3_qhyccd_V20191115_0
$ chmod 777 *.sh
$ sudo ./install.sh
6.下載EZCAP_Qt源碼并編譯(Download EZCAP_Qt source code and compile it)
Qt Creator程序運行起來之后需要進行以下操作(After running the Qt Creator program, you need to do the following):
6.1 點擊文件(File)->打開文件或項目(Open File or Project),進入剛才解壓得到的EZCAP_QT目錄,找到EZCAP.pro文件并打開(Click File->Open File or Project,enter the EZCAP_QT directory that was just extracted)
6.2 選擇編譯套件,點擊Configure Project按鈕(Select the build suite and click the Configure Project button)
6.3 打開并修改EZCAP.pro文件(Open and modify EZCAP.pro file)
1.INCLUDEPATH is the location of the header files. The header files of QHYCCD SDK and OpenCV will be saved to the /usr/local/ include directory after installation; the header files of libusb-1.0 need to be passed “sudo find / -name libusb.h”. Find the location of the file and modify it accordingly.
2. LIBS is the location of the library files. Both the QHYCCD SDK and OpenCV library files are installed in the “/usr/local/lib” directory. The locations of the cfitsio and libusb-1.0 library files are stored in the system library directory.
The path of armv7l is /usr/lib/arm-linux-gnueabihf;
the path of aarch64 is / usr / lib / aarch64-linux-gnu;
The path of x86_32 is / usr / lib / x86_32-linux-gnu;
The path of x86_64 is / usr / lib / x86_64-linux-gnu;
You need to modify it according to the actual situation. The above picture uses armv7l as an example. If it is an aarch64 device, you need to modify it to “LIBS + = / usr / lib / aarch64-linux-gnu -lusb-1.0 -lcfitsio”.
6.4 按照下圖修改qhyccdStatus.h、main.cpp和myStruct.h三個文件,修改好后在左下角選擇Release模式,點擊編譯按鈕開始編譯(Modify the three files qhyccdStatus.h, main.cpp and myStruct.h according to the following figure. After modification, select Release mode in the lower left corner and click the compile button to start compiling)