<commit_before>#include <image_cloud/common/small_helpers.hpp>
#include <image_cloud/common/type.hpp>
#include <image_cloud/common/transform.hpp>
#include <image_cloud/common/calibration/structs.hpp>
#include <image_cloud/common/calibration/score.hpp>

#include <math.h>
#include <opencv2/core/core.hpp>

#ifndef MUTLI_SCORE_H_
#define MUTLI_SCORE_H_

namespace score
{



template <typename PointT, typename ImageT>
inline void
multi_score(
		std::vector<Projected_pointcloud<PointT> > &idx,
		std::vector<cv::Mat> &edge_images,
		long unsigned &score)
{
	assert(idx.size() == edge_images.size());

	for(int i = 0; i< idx.size(); ++i){
		long unsigned score_temp;
		objective_function(idx.at(i), edge_images.at(i),score_temp);
		score += score_temp;
	}
}

/****
 * Transforms Pointclouds and calculates a result using the objective_function
 */
template <typename PointT, typename ImageT>
inline void
multi_score(
		const image_geometry::PinholeCameraModel &camera_model,
		const std::vector<pcl::PointCloud<PointT> >& pointclouds,
		const std::vector<cv::Mat> &edge_images,
		search::Search_value &search
		)
{
	assert(pointclouds.size() == edge_images.size());


	for(int i = 0; i< pointclouds.size(); ++i){
		long unsigned score_temp;
		pcl::PointCloud<PointT> transformed;

		image_cloud::transform_pointcloud<PointT>(pointclouds.at(i), transformed, search.x, search.y, search.z, search.roll, search.pitch, search.yaw);

		Projected_pointcloud<PointT> p;

		project2d::project_2d<PointT>( camera_model, transformed, p, edge_images.at(i).cols, edge_images.at(i).rows );
		objective_function<PointT, ImageT>( p, edge_images.at(i), score_temp);

		search.result += score_temp;
	}
}


/****
 * Transforms Pointclouds and calculates a result using the objective_function
 */
template <typename PointT, typename ImageT>
inline void
multi_score(
		const image_geometry::PinholeCameraModel &camera_model,
		const std::deque<pcl::PointCloud<PointT> >& pointclouds,
		const std::deque<cv::Mat> &edge_images,
		search::Search_value &search
		)
{
	assert(pointclouds.size() == edge_images.size());


	for(int i = 0; i< pointclouds.size(); ++i){
		long unsigned score_temp;
		pcl::PointCloud<PointT> transformed;

		image_cloud::transform_pointcloud<PointT>(pointclouds.at(i), transformed, search.x, search.y, search.z, search.roll, search.pitch, search.yaw);

		Projected_pointcloud<PointT> p;

		project2d::project_2d<PointT>( camera_model, transformed, p, edge_images.at(i).cols, edge_images.at(i).rows );
		objective_function<PointT, ImageT>( p, edge_images.at(i), score_temp);

		search.result += score_temp;
	}
}

}

#endif<commit_msg>added option to use deque and optional filtering<commit_after>#include <image_cloud/common/small_helpers.hpp>
#include <image_cloud/common/type.hpp>
#include <image_cloud/common/transform.hpp>
#include <image_cloud/common/calibration/structs.hpp>
#include <image_cloud/common/calibration/score.hpp>

#include <math.h>
#include <opencv2/core/core.hpp>

#ifndef MUTLI_SCORE_H_
#define MUTLI_SCORE_H_

namespace score
{



template <typename PointT, typename ImageT>
inline void
multi_score(
		std::vector<Projected_pointcloud<PointT> > &idx,
		std::vector<cv::Mat> &edge_images,
		long unsigned &score)
{
	assert(idx.size() == edge_images.size());

	for(int i = 0; i< idx.size(); ++i){
		long unsigned score_temp;
		objective_function(idx.at(i), edge_images.at(i), score_temp);
		score += score_temp;
	}
}

template <typename PointT, typename ImageT>
inline void
multi_score(
		std::deque<Projected_pointcloud<PointT> > &idx,
		std::deque<cv::Mat> &edge_images,
		long unsigned &score)
{
	assert(idx.size() == edge_images.size());

	for(int i = 0; i< idx.size(); ++i){
		long unsigned score_temp;
		objective_function(idx.at(i), edge_images.at(i), score_temp);
		score += score_temp;
	}
}


/****
 * Transforms Pointclouds and calculates a result using the objective_function
 */
template <typename PointT, typename ImageT>
inline void
multi_score(
		const image_geometry::PinholeCameraModel &camera_model,
		const std::vector<pcl::PointCloud<PointT> >& pointclouds,
		const std::vector<cv::Mat> &edge_images,
		search::Search_value &search
		)
{
	assert(pointclouds.size() == edge_images.size());


	for(int i = 0; i< pointclouds.size(); ++i){
		long unsigned score_temp;
		pcl::PointCloud<PointT> transformed;

		image_cloud::transform_pointcloud<PointT>(pointclouds.at(i), transformed, search.x, search.y, search.z, search.roll, search.pitch, search.yaw);

		objective_function<PointT, ImageT>( camera_model, transformed, edge_images.at(i), score_temp);

		search.result += score_temp;
	}
}

/****
 * Transforms Pointclouds and calculates a result using the objective_function
 */
template <typename PointT, typename ImageT>
inline void
multi_score(
		const image_geometry::PinholeCameraModel &camera_model,
		const std::deque<pcl::PointCloud<PointT> >& pointclouds,
		const std::deque<cv::Mat> &edge_images,
		search::Search_value &search
		)
{
	assert(pointclouds.size() == edge_images.size());


	for(int i = 0; i< pointclouds.size(); ++i){
		long unsigned score_temp;
		pcl::PointCloud<PointT> transformed;

		image_cloud::transform_pointcloud<PointT>(pointclouds.at(i), transformed, search.x, search.y, search.z, search.roll, search.pitch, search.yaw);

		objective_function<PointT, ImageT>( camera_model, transformed, edge_images.at(i), score_temp);

		search.result += score_temp;
	}
}



/****
 * Transforms Pointclouds and calculates a result using the objective_function
 */
template <typename PointT, typename ImageT>
inline void
multi_score_filter_depth(
		const image_geometry::PinholeCameraModel &camera_model,
		const std::vector<pcl::PointCloud<PointT> >& pointclouds,
		const std::vector<cv::Mat> &edge_images,
		search::Search_value &search
		)
{
	assert(pointclouds.size() == edge_images.size());


	for(int i = 0; i< pointclouds.size(); ++i){
		long unsigned score_temp;
		pcl::PointCloud<PointT> transformed, filtered;

		image_cloud::transform_pointcloud<PointT>(pointclouds.at(i), transformed, search.x, search.y, search.z, search.roll, search.pitch, search.yaw);

		filter::filter_depth_intensity( camera_model, transformed, filtered, edge_images.at(i).rows, edge_images.at(i).cols);

		objective_function<PointT, ImageT>( camera_model, filtered, edge_images.at(i), score_temp);

		search.result += score_temp;
	}
}


/****
 * Transforms Pointclouds and calculates a result using the objective_function
 */
template <typename PointT, typename ImageT>
inline void
multi_score_filter_depth(
		const image_geometry::PinholeCameraModel &camera_model,
		const std::deque<pcl::PointCloud<PointT> >& pointclouds,
		const std::deque<cv::Mat> &edge_images,
		search::Search_value &search
		)
{
	assert(pointclouds.size() == edge_images.size());


	for(int i = 0; i< pointclouds.size(); ++i){
		long unsigned score_temp;
		pcl::PointCloud<PointT> transformed, filtered;

		image_cloud::transform_pointcloud<PointT>(pointclouds.at(i), transformed, search.x, search.y, search.z, search.roll, search.pitch, search.yaw);

		filter::filter_depth_intensity<PointT>( camera_model, transformed, filtered, edge_images.at(i).rows, edge_images.at(i).cols);

		objective_function<PointT, ImageT>( camera_model, filtered, edge_images.at(i), score_temp);

		search.result += score_temp;
	}
}

}

#endif
{'fraction_non_alphanumeric': 0.13944929116684843, 'fraction_numerical': 0.002044711014176663, 'mean_word_length': 6.109496124031008, 'pattern_counts': {'":': 0, '<': 85, '<?xml version=': 0, '>': 76, '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': '672897', 'n_tokens_mistral': 2667, 'n_tokens_neox': 2505, 'n_words': 510}