Update samples

This commit is contained in:
John Zhao 2018-03-30 16:24:43 +08:00
parent 474126b09c
commit efb6ce6f5a
3 changed files with 27 additions and 19 deletions

View File

@ -39,23 +39,7 @@ message(STATUS "Found OpenCV: ${OpenCV_VERSION}")
include(${PRO_DIR}/cmake/Common.cmake) include(${PRO_DIR}/cmake/Common.cmake)
set(OUT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/_output") set(OUT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/_output")
set_outdir(
"${OUT_DIR}/lib"
"${OUT_DIR}/lib"
"${OUT_DIR}/bin"
)
include_directories( # samples above uvc layer
${PRO_DIR}/src
)
## camera add_subdirectory(uvc)
add_executable(camera camera.cc)
target_link_libraries(camera mynteye ${OpenCV_LIBS})
if(OS_WIN)
target_compile_definitions(camera
PUBLIC GLOG_NO_ABBREVIATED_SEVERITIES
)
endif()

View File

@ -0,0 +1,22 @@
get_filename_component(DIR_NAME ${CMAKE_CURRENT_LIST_DIR} NAME)
set_outdir(
"${OUT_DIR}/lib/${DIR_NAME}"
"${OUT_DIR}/lib/${DIR_NAME}"
"${OUT_DIR}/bin/${DIR_NAME}"
)
include_directories(
${PRO_DIR}/src
)
## camera
add_executable(camera camera.cc)
target_link_libraries(camera mynteye ${OpenCV_LIBS})
if(OS_WIN)
target_compile_definitions(camera
PUBLIC GLOG_NO_ABBREVIATED_SEVERITIES
)
endif()

View File

@ -71,7 +71,7 @@ int main(int argc, char *argv[]) {
auto name = uvc::get_name(*device); auto name = uvc::get_name(*device);
auto vid = uvc::get_vendor_id(*device); auto vid = uvc::get_vendor_id(*device);
auto pid = uvc::get_product_id(*device); auto pid = uvc::get_product_id(*device);
LOG(INFO) << i << " | name: " << name << ", vid: " << vid LOG(INFO) << "index: " << i << ", name: " << name << ", vid: " << vid
<< ", pid: " << pid; << ", pid: " << pid;
} }
@ -112,6 +112,8 @@ int main(int argc, char *argv[]) {
cv.notify_one(); cv.notify_one();
}); });
LOG(INFO) << "Press ESC/Q on windows to terminate";
cv::namedWindow("frame"); cv::namedWindow("frame");
uvc::start_streaming(*device, 0); uvc::start_streaming(*device, 0);