Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/oktopuzSlid/detectorPlacas/llms.txt

Use this file to discover all available pages before exploring further.

DetectorPlacas provides three independent detection modes — static images, video files, and live webcam — each implemented in its own Python script. Every mode loads the same frozen_inference_graph.pb and labelmap.pbtxt, but each has a distinct confidence threshold tuned for its use case: stricter for images where precision matters most, and progressively more permissive for video and real-time webcam capture where recall is more valuable.
Script: Object_detection_image.pyThe image script accepts a --ruta flag pointing to a directory of .jpg files. When the flag is omitted or empty, the script falls back to the current working directory. It collects every file ending in .jpg using os.listdir() combined with endswith('.jpg'), then runs inference on each one in sequence. A new window opens for each image; press any key to advance to the next.
SettingValue
Flag--ruta (path to image directory)
File filteros.listdir() + .endswith('.jpg')
Confidence thresholdmin_score_thresh=0.65
Line thickness8
Window title'Detector de Placas PRUEBA-IMAGEN'
AdvancePress any key
Usage:
# Detect plates in a specific directory
python Object_detection_image.py --ruta=/path/to/images

# Detect plates in the current working directory
python Object_detection_image.py
Key detection code:
image = cv2.imread(os.path.join(FLAGS.ruta, a))
image_rgb = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
image_expanded = np.expand_dims(image_rgb, axis=0)

(boxes, scores, classes, num) = sess.run(
    [detection_boxes, detection_scores, detection_classes, num_detections],
    feed_dict={image_tensor: image_expanded})

vis_util.visualize_boxes_and_labels_on_image_array(
    image,
    np.squeeze(boxes),
    np.squeeze(classes).astype(np.int32),
    np.squeeze(scores),
    category_index,
    use_normalized_coordinates=True,
    line_thickness=8,
    min_score_thresh=0.65)

cv2.imshow('Detector de Placas PRUEBA-IMAGEN', image)
cv2.waitKeyEx()
Each detection mode uses a different confidence threshold, intentionally tuned for its context:
ModeThresholdRationale
Image0.65Highest precision — reduces false positives on static images
Video0.55Balanced — trades some precision for better recall across frames
Webcam0.50Most permissive — maximises recall for real-time detection
All three modes convert each frame from OpenCV’s native BGR color order to RGB with cv2.cvtColor(frame, cv2.COLOR_BGR2RGB) before creating the input tensor. This conversion is required because the TensorFlow model expects RGB input, while cv2.imread and cv2.VideoCapture both return BGR arrays by default.

Build docs developers (and LLMs) love