mac 설치 clion,opencv 및 간단한 테스트

5968 단어
1. Clion 설치
  는 clion 홈페이지에서 다운로드한 설치 패키지입니다.알고 보니 이 소프트웨어 학생이 무료라는 여동생이 있었는데 한참을 찾았지만 그 링크를 찾지 못했다.인터넷에서 몇 개의 등록번호를 찾았지만 성공하지 못해서...나의 불같은 성질.바로 타오바오에 가서 하나 샀어요. 몇 원이에요. 시간 원가가 남아서 괜찮아요.하하하~ 이 등록번호를 붙여서 공유하세요.clion 버전은 맥 버전의 2017.2입니다.등록 번호는 다음과 같습니다.
BSJK89HP2N-eyJsaWNlbnNlSWQiOiJCU0pLODlIUDJOIiwibGljZW5zZWVOYW1lIjoi5b285bK4IOi9r+S7tjEiLCJhc3NpZ25lZU5hbWUiOiIiLCJhc3NpZ25lZUVtYWlsIjoiIiwibGljZW5zZVJlc3RyaWN0aW9uIjoiRm9yIGVkdWNhdGlvbmFsIHVzZSBvbmx5IiwiY2hlY2tDb25jdXJyZW50VXNlIjpmYWxzZSwicHJvZHVjdHMiOlt7ImNvZGUiOiJBQyIsInBhaWRVcFRvIjoiMjAxOC0wNy0yMCJ9LHsiY29kZSI6IkRNIiwicGFpZFVwVG8iOiIyMDE4LTA3LTIwIn0seyJjb2RlIjoiSUkiLCJwYWlkVXBUbyI6IjIwMTgtMDctMjAifSx7ImNvZGUiOiJSUzAiLCJwYWlkVXBUbyI6IjIwMTgtMDctMjAifSx7ImNvZGUiOiJXUyIsInBhaWRVcFRvIjoiMjAxOC0wNy0yMCJ9LHsiY29kZSI6IkRQTiIsInBhaWRVcFRvIjoiMjAxOC0wNy0yMCJ9LHsiY29kZSI6IlJDIiwicGFpZFVwVG8iOiIyMDE4LTA3LTIwIn0seyJjb2RlIjoiUFMiLCJwYWlkVXBUbyI6IjIwMTgtMDctMjAifSx7ImNvZGUiOiJEQyIsInBhaWRVcFRvIjoiMjAxOC0wNy0yMCJ9LHsiY29kZSI6IkRCIiwicGFpZFVwVG8iOiIyMDE4LTA3LTIwIn0seyJjb2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습니다.
2. opencv 설치
  bash에서 다음 명령을 사용하여 오픈cv를 설치합니다.
brew install homebrew/science/opencv

동시에 오픈cv와 오픈cv2는 동시에 존재할 수 있으며 아래 명령을 사용하여 오픈cv3를 설치할 수 있습니다.
brew install homebrew/science/opencv3

brew 명령을 사용하여 설치할 때 "-bash: brew: command not found"를 만났습니다. Homebrew가 설치되어 있지 않기 때문입니다. 다음 명령을 사용하여 해결하십시오.
 ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

3. clion+opencv 간단한 테스트
CMakeLists 수정txt, 세 줄 정보를 추가합니다. 수정된 모습은 다음과 같습니다.
cmake_minimum_required(VERSION 3.7)
project(untitled) # untitled        
find_package(OpenCV)
#  find_package(OpenCV3)
include_directories( ${OpenCV_INCLUDE_DIRS} )
set(CMAKE_CXX_STANDARD 11)
set(SOURCE_FILES main.cpp)
add_executable(untitled ${SOURCE_FILES})
target_link_libraries( untitled ${OpenCV_LIBS} )

테스트 용례 실행:
#include 
#include 

using namespace std;
using namespace cv;
int main() {
    Mat srcImage = imread("show.png");
    imshow("[img]", srcImage);
    waitKey(0);
    return 0;
}

좋은 웹페이지 즐겨찾기