 		index++;
 	}
 
-	//print1dvector(z_vec_length);
-	//print1dvector(x_vec_length);
 	
 	if(debug)
 	{


};
*/

void print1dvector(row_t vector)
{   

	thrust::copy_if(result_begin, result_end, uv_begin, checkSanity());

*/
	int count  = 0;

	for(int i =0;i<numCol;i++)
	{
		if((*(result_row_1 + i) >=1) & (*(result_row_0 +i) >=1) &
						(*(result_row_1 + i) <= this->imSize.b) &
						(*(result_row_0 + i) <= this->imSize.a))
		{
			xi_1[count] = *(result_row_0 + i);
			yi_1[count] = *(result_row_1 + i);
			z_vec_sel[count] = z_index_vec_copy[i];
			x_vec_sel[count] = x_index_vec_copy[i];
			count++;	
		}

	}


	z_vec_sel.resize(count);
	x_vec_sel.resize(count);
	xi_1.resize(count);
	yi_1.resize(count);
	

	if(debug)
	{
		for(const auto& i: xi_1)
			cout<<i<<"\t";
		cout<<endl;
	}
	
	if(debug)
	{
		for(const auto& i : z_vec_sel)
			cout<<i<<"\t";
    	cout<<endl;
	}
	
	
	
	vector<int>::const_iterator m,k;
	row_t::const_iterator i,j;

	Mat output_image((this->bevParams)->bev_size.a,(this->bevParams)->bev_size.b,CV_8UC1);

	unsigned char* i_im = image.data;
	unsigned char* o_im = output_image.data;


	for(i = xi_1.begin() , j = yi_1.begin(), m = x_vec_sel.begin(), k = z_vec_sel.begin();i != xi_1.end();i++,j++,m++,k++)
	{
		int row = (int)*j -1;
		int column = (int)*i -1;

		int row_output_image = (int)*k -1;
		int column_output_image = (int)*m -1;
	
		//cout<<"Row \t"<<row<<"Column \t"<<column<<endl;

		*(o_im + row_output_image*200 + column_output_image) = *(i_im + row*1242+ column);

	}

	imshow("result", output_image);
	waitKey(0);

	double e2 = getTickCount();
	double time_lookup = (e2 -e1)/getTickFrequency();
	cout<<"Time for lookup \t"<<time_lookup<<endl;
}


