<jupyter_start><jupyter_text>Import Libraries<jupyter_code>import cv2
import numpy as np
import matplotlib.pyplot as plt

%matplotlib inline<jupyter_output><empty_output><jupyter_text>Open Image<jupyter_code>img = cv2.imread('Images/car_plate.jpg')<jupyter_output><empty_output><jupyter_text>Convert Image<jupyter_code>def display(img):
    fig = plt.figure(figsize=(10, 8))
    ax = fig.add_subplot(111)
    new_img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
    ax.imshow(new_img)
display(img)<jupyter_output><empty_output><jupyter_text>Create Classifier<jupyter_code>plate_cascade = cv2.CascadeClassifier('Haarcascades/haarcascade_plate_number.xml')<jupyter_output><empty_output><jupyter_text>It's a Kind of Magic<jupyter_code>def detect_plate(img):
    
  
    plate_img = img.copy()
  
    plate_rects = plate_cascade.detectMultiScale(plate_img, scaleFactor=1.1, minNeighbors=1) 
    
    for (x,y,w,h) in plate_rects: 
        cv2.rectangle(plate_img, (x, y), (x + w, y + h), (255, 255, 255), 9) 
        
    return plate_img<jupyter_output><empty_output><jupyter_text>Check the Results<jupyter_code>result = detect_plate(img)
display(result)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.12, 'fraction_numerical': 0.022127659574468085, 'mean_word_length': 6.538461538461538, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 1}, '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}}
{'chain_length': '6', 'dir': 'jupyter-structured-clean-dedup', 'id': '325502', 'license': 'Apache-2.0', 'n_tokens_mistral': 491, 'n_tokens_neox': 465, 'n_words': 61, 'path': '16_Car_Plates_Detection.ipynb', 'repo_name': 'EliasPapachristos/Computer_Vision_with_OpenCV', 'size': '1175'}