-
Notifications
You must be signed in to change notification settings - Fork 0
MMD1426/Blurring-License-Plates-Russian-Cars
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
{ "cells": [ { "cell_type": "code", "execution_count": 20, "metadata": {}, "outputs": [], "source": [ "import cv2\n", "import matplotlib.pyplot as plt" ] }, { "cell_type": "code", "execution_count": 24, "metadata": {}, "outputs": [], "source": [ "haarcascade = 'haarcascade_russian_plate_number.xml'\n", "\n", "img = cv2.imread('car-russian.jpg')\n", "img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)\n", "img = cv2.resize(img, (640, 480))\n", "\n", "Cascade = cv2.CascadeClassifier(haarcascade)\n", "Cascade = Cascade.detectMultiScale(img, scaleFactor=1.2, minNeighbors=5)\n", "\n", "if len(Cascade) > 0:\n", " for (x, y, w, h) in Cascade:\n", " # cv2.rectangle(img, (x, y), (x+w, y+h), (0, 255, 0), 2)\n", " plate = img[y:y+h,x:x+w]\n", " blur = cv2.medianBlur(plate, 11)\n", " img[y:y+h,x:x+w] = blur\n", " cv2.imshow('Plate-Car',img)\n", " plt.imsave('car-russain-blur.jpg',img)\n", "else:\n", " print('Not Found Plate!')\n", "\n", "if cv2.waitKey(0) & 0xff == ord('q'):\n", " cv2.destroyAllWindows()" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.8.1" } }, "nbformat": 4, "nbformat_minor": 2 }
About
No description or website provided.
Topics
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published