 				__FILE__,__LINE__);
 			exit(EXIT_FAILURE);
 		}
-		
-		//cout<<*(lines + 0)<<endl;
-		//cout<<(lines)->x<<endl;
-		*/
-		//cout<<"votes"<<*(votes + 0)<<endl;
-		/*
-		for(int i = 0;i<countlines;i++)
-		{
-			cout<<"rho"<<lines[i].x<<endl;
-			cout<<"theta"<<lines[i].y<<endl;
+	
+		if(debug)
+		{
+			Mat gray_image = imread("/home/nvidia/Lane_Detection/Test_Images/IPM_test_image_4.png",0);
+		
+			for(int i =0;i<countlines;i++)
+			{
+				float theta_line = (lines + i)->y;
+				float rho = (lines + i)->x;
 				
-		}
-		*/
-
-
+				cout<<"Rho - "<<rho<<"theta- "<<theta_line<<endl;
+				Point pt1, pt2;
+	
+				double a = cos(theta_line);
+				double b = sin(theta_line);
+
+				double x0 = a*rho;
+				double y0 = b*rho;
+	
+				pt1.x = (int)(x0 + 400*(-b));
+				pt1.y = (int)(y0 + 400*(a));
+				pt2.x = (int)(x0 - 400*(-b));
+				pt2.y = (int)(x0 - 400*(a));
+				
+				
+				line(gray_image, pt1,pt2, (255,0,0),1);
+				
+			}
+			imshow("IMage", gray_image);
+			waitKey(0);
+
+		}
+
+				
 
 }
 


	const int curVotes = *(hough_space + (n+1)*(numrho + 2)+ (r+1));

	if(curVotes > threshold && curVotes > *(hough_space + (n+1)*(numrho + 2) +
				r) && curVotes >= *(hough_space + (n+1)*(numrho +2) + (r+2)) &&
			curVotes > *(hough_space + n*(numrho +2) + (r+1)) && curVotes >=
			*(hough_space + (n+2)*(numrho + 2) +  (r+1)))
	{
		const float radius = (r - (numrho -1)*0.5f)*rho;
		const float angle = n*theta;

		}
	
		
		c_err = cudaMemcpy(votes, d_votes, countlines*sizeof(int),
				cudaMemcpyDeviceToHost);
		if(c_err != cudaSuccess)
		{
