int main (int argc, char** argv)
{
	std::string sampleFile = "resources/test2.mov";
	lk::VideoProvider vid(sampleFile);
	lk::TrackFile trackFile("resources/human2.txt");

	cv::namedWindow(sampleFile, 0);
	cv::setMouseCallback(sampleFile, mouseClick, 0);

	bool play = true;
	cv::Mat frame;

	while (play)
	{
		for (size_t i = 0; i < 10 && !pause; i++)
		{
			// Read video
			if (!vid.isOpen())
			{
				play = false;
				break;
			}
			frame = vid.getFrame();
			frameCount++;
			cv::imshow(sampleFile, frame);
		}

		// skip reading whilst waiting for user input
		pause = true;
		cv::waitKey(10);
	}

	dataVec interpolatedData;
	interpolate(clickData, interpolatedData);

	std::for_each
	(	
	 	begin(interpolatedData),
		end(interpolatedData),
		[&frame](lk::trackDatum& d) 
		{ 
			cv::circle(frame, std::get<1>(d), 2, cv::Scalar(255,0,0), 3, 8);
		}
	);

	trackFile.save(interpolatedData);

	bool quit = false;
	while (!quit)
	{
		cv::imshow(sampleFile, frame);
		quit = cv::waitKey(5) == 'q';
	}

	return EXIT_SUCCESS;
}
示例#2
0
}

IVersionControl::TopicCache::~TopicCache()
{
}

/*!
   Returns the topic for repository under \a topLevel.

   If the cache for \a topLevel is valid, it will be used. Otherwise it will be refreshed.
 */
QString IVersionControl::TopicCache::topic(const QString &topLevel)
{
    QTC_ASSERT(!topLevel.isEmpty(), return QString());
    TopicData &data = m_cache[topLevel];
    QString file = trackFile(topLevel);

    if (file.isEmpty())
        return QString();
    const QDateTime lastModified = QFileInfo(file).lastModified();
    if (lastModified == data.timeStamp)
        return data.topic;
    data.timeStamp = lastModified;
    return data.topic = refreshTopic(topLevel);
}

} // namespace Core

#if defined(WITH_TESTS)

#include <QFileInfo>