\subsection{Inserting Tables for Performance Metrics}

Tables are used to present data in a structured format. Below is an example of how to insert a table in LaTeX.

\begin{table}[h!]
\setstretch{1.5}
\centering
\caption{Algorithm Performance Metrics}
\begin{tabular}{|c|c|c|c|}
\hline
\multirow{2}{*}{Metric} & \multicolumn{2}{c|}{Value} \ \cline{2-3}
& Before Enhancement & After Enhancement \ \hline
Accuracy & 85% & 92% \ \hline
Precision & 80% & 90% \ \hline
Recall & 82% & 91% \ \hline
\end{tabular}
\label{tab1}
\end{table}

\section{Project Parameters}

The following table provides details of different aspects of the project.

\begin{table}[h!]
\centering
\caption{Project Parameters}
\label{ece}
\resizebox{\columnwidth}{!}{%
\begin{tabular}{|cl|l|c|}
\hline
\multicolumn{2}{|c|}{Parameter} & Description & Value \ \hline
\multicolumn{1}{|c|}{1} & Image Size & Size of the input image & 224x224 pixels \ \hline
\multicolumn{1}{|c|}{2} & CLAHE Clip Limit & Contrast enhancement limit & 3.0 \ \hline
\multicolumn{1}{|c|}{3} & Gaussian Kernel Size & Size of the kernel for blurring & 5x5 \ \hline
\multicolumn{1}{|c|}{4} & Canny Thresholds & Low and high thresholds for edge detection & 50, 150 \ \hline
\end{tabular}
}
\end{table}
change these to include tables spelling out performance metrics of
import cv2
import numpy as np
import matplotlib.pyplot as plt
from google.colab import files

# Function to enhance the image
def enhance_image(image):
lab = cv2.cvtColor(image, cv2.COLOR_BGR2LAB)
l, a, b = cv2.split(lab)
clahe = cv2.createCLAHE(clipLimit=3.0, tileGridSize=(8,8))
cl = clahe.apply(l)
limg = cv2.merge((cl, a, b))
enhanced_img = cv2.cvtColor(limg, cv2.COLOR_LAB2BGR)
return enhanced_img

# Function to preprocess the image
def preprocess_image(image):
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
blurred = cv2.GaussianBlur(gray, (5, 5), 0)
edges = cv2.Canny(blurred, 50, 150)
return edges

# Function to define region of interest
def region_of_interest(image):
height, width = image.shape
mask = np.zeros_like(image)
polygon = np.array([[
(0, height),
(width, height),
(width // 2, height // 2)
]], np.int32)
cv2.fillPoly(mask, polygon, 255)
masked_image = cv2.bitwise_and(image, mask)
return masked_image

# Function to detect lines using Hough Line Transform
def detect_lines(image):
lines = cv2.HoughLinesP(image, 1, np.pi / 180, threshold=50, minLineLength=50, maxLineGap=200)
return lines

# Function to draw lines on the image
def draw_lines(image, lines):
line_image = np.zeros_like(image)
if lines is not None:
for line in lines:
for x1, y1, x2, y2 in line:
cv2.line(line_image, (x1, y1), (x2, y2), (0, 255, 0), 10)
return line_image

# Function to combine the original image with the line image
def combine_images(image, line_image):
combined_image = cv2.addWeighted(image, 0.8, line_image, 1, 1)
return combined_image

# Upload the image
uploaded = files.upload()
image_path = list(uploaded.keys())[0]
image = cv2.imread(image_path)

# Process the image
enhanced_image = enhance_image(image)
edges = preprocess_image(enhanced_image)
roi_edges = region_of_interest(edges)
lines = detect_lines(roi_edges)
line_image = draw_lines(enhanced_image, lines)
final_image = combine_images(enhanced_image, line_image)

# Display the result
plt.figure(figsize=(10, 10))
plt.imshow(cv2.cvtColor(final_image, cv2.COLOR_BGR2RGB))
plt.axis(‘off’)
plt.show()
this code