|
|
|
|
|
|
|
|
|
|
|
#include <iostream> |
|
|
|
|
|
#include <lfr.h> |
|
|
|
|
|
#include <lfr_socket.h> |
|
|
|
|
|
#include <uart_communication.h> |
|
|
|
|
|
|
|
|
|
|
|
int main(void) |
|
|
|
|
|
{ |
|
|
|
|
|
std::cout << "hello central" << std::endl; |
|
|
|
|
|
|
|
|
|
|
|
const int thresholdBinary = 140; |
|
|
|
|
|
const int videoHeight = 720; |
|
|
|
|
|
const int videoWidth = 1280; |
|
|
|
|
|
const int gaussKernelSize = 11; |
|
|
|
|
|
|
|
|
|
|
|
std::mutex mutex; |
|
|
|
|
|
|
|
|
|
|
|
std::cout << "create lfr" << std::endl; |
|
|
|
|
|
LFR lfr(videoHeight, videoWidth, thresholdBinary, gaussKernelSize, [&](std::exception const &ex) |
|
|
|
|
|
{ |
|
|
|
|
|
std::unique_lock<std::mutex> lock(mutex); |
|
|
|
|
|
std::cerr<<"camera exception:"<<ex.what()<<std::endl; |
|
|
|
|
|
return false; |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
std::cout << "create uart" << std::endl; |
|
|
|
|
|
LFR_UART uartCommunicator; |
|
|
|
|
|
|
|
|
|
|
|
std::cout << "create socket" << std::endl; |
|
|
|
|
|
LFR_Socket socket([&](std::exception const &ex) |
|
|
|
|
|
{ |
|
|
|
|
|
std::unique_lock<std::mutex> lock(mutex); |
|
|
|
|
|
std::cerr<<"socket exception:"<<ex.what()<<std::endl; |
|
|
|
|
|
return false; |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
return 0; |
|
|
|
|
|
} |