delmottea / libCMT

c++ port of the python code from https://github.com/gnebehay/CMT
BSD 3-Clause "New" or "Revised" License
67 stars 45 forks source link

Modify code to process video from camera #6

Open lanyusea opened 9 years ago

lanyusea commented 9 years ago

Hi, I'm trying to modify the code in order to process with my camera.

But I got a segmentation fault (core damped) after compile.

I use the cv::VideoCapture cap(1) to read my camera, then put cv::Mat img and cv::Mat im_gray out of the for loop then cap>>img; inside the loop. Also comment the num2str and sprintf.

But it doesn't work, Can anyone tell me what else should I modify?

Thanks.

bwang22 commented 9 years ago

I got same problem. The after building this, it should run to demonstrate it works. Instead I got code that have a nonsensical input that can't run.

delmottea commented 9 years ago

The example use the cokecan sequence (from the dataset available in the CMT project page http://www.gnebehay.com/cmt/ ).

for the video capture, you use something like : cv::VideoCapture cap(cameraId); cv::Mat img; cap >> img; to obtain your images the first call to CMT must be the initialise with the first image and the top-left and bottom-right coordinates of the bounding box of the target. then you call processFrame on the next images

bwang22 commented 9 years ago

wow thanks for the quick response.