Open jackyfriend opened 5 years ago
Hello @jackyfriend , We are sorry for our delayed feedback to you. Yes, this library can be easily integrated with the bgslibrary for background-foreground separation. You need:
@jackyfriend just a bit of code to show you an example: References: https://github.com/andrewssobral/bgslibrary/blob/master/Demo.cpp https://github.com/carolinepacheco/lbplibrary/blob/master/Main.cpp
...
LBP *lbp;
lbp = new XCSLBP;
while (key != 's')
{
// Capture frame-by-frame
capture >> img_input;
frame_counter += 1;
if (img_input.empty()) break;
cv::imshow("input", img_input);
cv::Mat img_gray;
cv::cvtColor(img_input, img_gray, CV_BGR2GRAY);
imshow("gray", img_gray);
cv::Mat img_lbp;
lbp->run(img_gray, img_lbp);
cv::normalize(img_lbp, img_lbp, 0, 255, cv::NORM_MINMAX, CV_8UC1);
cv::imshow("lbp", img_lbp);
cv::Mat img_mask;
cv::Mat img_bkgmodel;
try
{
// use `img_lbp` instead of `img_input`
bgs->process(img_lbp, img_mask, img_bkgmodel); // by default, it shows automatically the foreground mask image
//if(!img_mask.empty())
// cv::imshow("Foreground", img_mask);
// do something
}
catch (std::exception& e)
{
std::cout << "Exception occurred" << std::endl;
std::cout << e.what() << std::endl;
}
key = cv::waitKey(33);
}
delete lbp;
...
Hello, this library is just a lbp-like descriptors, but I want to know how to use them to update backgrounds? How to use them together with KDE or MoG? Thank you!