Update samples
This commit is contained in:
parent
474126b09c
commit
efb6ce6f5a
|
@ -39,23 +39,7 @@ message(STATUS "Found OpenCV: ${OpenCV_VERSION}")
|
|||
include(${PRO_DIR}/cmake/Common.cmake)
|
||||
|
||||
set(OUT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/_output")
|
||||
set_outdir(
|
||||
"${OUT_DIR}/lib"
|
||||
"${OUT_DIR}/lib"
|
||||
"${OUT_DIR}/bin"
|
||||
)
|
||||
|
||||
include_directories(
|
||||
${PRO_DIR}/src
|
||||
)
|
||||
# samples above uvc layer
|
||||
|
||||
## 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()
|
||||
add_subdirectory(uvc)
|
||||
|
|
22
samples/uvc/CMakeLists.txt
Normal file
22
samples/uvc/CMakeLists.txt
Normal 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()
|
|
@ -71,7 +71,7 @@ int main(int argc, char *argv[]) {
|
|||
auto name = uvc::get_name(*device);
|
||||
auto vid = uvc::get_vendor_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;
|
||||
}
|
||||
|
||||
|
@ -112,6 +112,8 @@ int main(int argc, char *argv[]) {
|
|||
cv.notify_one();
|
||||
});
|
||||
|
||||
LOG(INFO) << "Press ESC/Q on windows to terminate";
|
||||
|
||||
cv::namedWindow("frame");
|
||||
uvc::start_streaming(*device, 0);
|
||||
|
Loading…
Reference in New Issue
Block a user