<commit_before>#include <iostream>
#include "zedsvoin.hpp"
using namespace std;

#ifdef ZED_SUPPORT
using namespace cv;
using namespace sl::zed;

ZedSVOIn::ZedSVOIn(const char *inFileName, ZvSettings *settings) :
	SyncIn(settings),
	zed_(NULL)
{
	zed_ = new Camera(inFileName);
	if (!zed_)
		return;

	InitParams parameters;
	parameters.mode = PERFORMANCE;
	parameters.unit = MILLIMETER;
	parameters.verbose = 1;
	// init computation mode of the zed
	ERRCODE err = zed_->init(parameters);

	// Quit if an error occurred
	if (err != SUCCESS)
	{
		cout << errcode2str(err) << endl;
		delete zed_;
		zed_ = NULL;
		return;
	}
	//only for Jetson K1/X1 - see if it helps
	Camera::sticktoCPUCore(2);

	width_  = zed_->getImageSize().width;
	height_ = zed_->getImageSize().height;

	params_.init(zed_, true);
	startThread();

	while (height_ > 700)
	{
		width_  /= 2;
		height_ /= 2;
	}
}

ZedSVOIn::~ZedSVOIn()
{
	stopThread();
	if (zed_)
		delete zed_;
}

bool ZedSVOIn::isOpened(void) const
{
	return zed_ != NULL; 
}


bool ZedSVOIn::postLockUpdate(cv::Mat &frame, cv::Mat &depth)
{
	if (!zed_)
		return false;

	const bool left = true;
	sl::zed::Mat slFrame = zed_->retrieveImage(left ? SIDE::LEFT : SIDE::RIGHT);
	sl::zed::Mat slDepth = zed_->retrieveMeasure(MEASURE::DEPTH);
	slMat2cvMat(slFrame).copyTo(frame);
	slMat2cvMat(slDepth).copyTo(depth);<commit_msg>Add grab call to SVO in so more than 1 frame is read<commit_after>#include <iostream>
#include "zedsvoin.hpp"
using namespace std;

#ifdef ZED_SUPPORT
using namespace cv;
using namespace sl::zed;

ZedSVOIn::ZedSVOIn(const char *inFileName, ZvSettings *settings) :
	SyncIn(settings),
	zed_(NULL)
{
	zed_ = new Camera(inFileName);
	if (!zed_)
		return;

	InitParams parameters;
	parameters.mode = PERFORMANCE;
	parameters.unit = MILLIMETER;
	parameters.verbose = 1;
	// init computation mode of the zed
	ERRCODE err = zed_->init(parameters);

	// Quit if an error occurred
	if (err != SUCCESS)
	{
		cout << errcode2str(err) << endl;
		delete zed_;
		zed_ = NULL;
		return;
	}
	//only for Jetson K1/X1 - see if it helps
	Camera::sticktoCPUCore(2);

	width_  = zed_->getImageSize().width;
	height_ = zed_->getImageSize().height;

	params_.init(zed_, true);
	startThread();

	while (height_ > 700)
	{
		width_  /= 2;
		height_ /= 2;
	}
}

ZedSVOIn::~ZedSVOIn()
{
	stopThread();
	if (zed_)
		delete zed_;
}

bool ZedSVOIn::isOpened(void) const
{
	return zed_ != NULL; 
}


bool ZedSVOIn::postLockUpdate(cv::Mat &frame, cv::Mat &depth)
{
	if (!zed_)
		return false;

	if (zed_->grab())
		return false;
	const bool left = true;
	sl::zed::Mat slFrame = zed_->retrieveImage(left ? SIDE::LEFT : SIDE::RIGHT);
	sl::zed::Mat slDepth = zed_->retrieveMeasure(MEASURE::DEPTH);
	slMat2cvMat(slFrame).copyTo(frame);
	slMat2cvMat(slDepth).copyTo(depth);
{'fraction_non_alphanumeric': 0.14423765211166786, 'fraction_numerical': 0.00894774516821761, 'mean_word_length': 4.534653465346534, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 18, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '324409', 'n_tokens_mistral': 1134, 'n_tokens_neox': 1091, 'n_words': 253}