Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use Python+OpenCV+GAN to realize license plate image enhancement

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly explains "how to use Python+OpenCV+GAN to achieve license plate image enhancement", the content of the article is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in depth, together to study and learn "how to use Python+OpenCV+GAN to achieve license plate image enhancement" bar!

In Hollywood crime movies, we often see detectives solve cases with the help of computer experts. They can find hidden information in blurred, low-quality images. Technically, the dark magic in the movie is called (SISR)

In a variety of SISR applications, the super-resolution of vehicle license plate is definitely among the best because of its great potential. For example, it can be used for law enforcement and to improve the accuracy of license plate recognition and street recognition (map services). In this paper, we will introduce the license plate image enhancement implemented in Python. The Jupyter notebook tutorial can be found here (https://github.com/zzxvictor/License-super-resolution). Show you the capabilities of the model before delving into the details of the model architecture and training strategy:

We found a problem in the escape accident case: the license plate was taken by a low-quality camera in the dark, and our model can not only improve the resolution, but also enhance the readability of the license plate by denoising the image and adjusting the brightness and contrast. The data set we used in this project is China Urban parking data set (https://github.com/detectRecog/CCPD), which contains 200k+ car images under different conditions, but the original data can not be used directly, but we only need license plate images instead of street views and cars, so the first step is to use the annotations provided by the data set to cut out the license plate image from the image.

We also filter out images with poor brightness and contrast, leaving only the good parts as tags. We generate license plate image data (input,label) manually, in which the input is subjected to downsampling and noise, and the brightness and contrast are destroyed randomly at the same time, while the label is unchanged. Model details our model is inspired by the ESRGAN model (https://arxiv.org/abs/1809.00219). As the name implies, our model is trained in an adversarial manner-generators and discriminators confront each other. Generator our generator is based on two state-of-the-art models-RRDB networks in ESRGAN and residual dense networks. The generator uses subpixel convolution (called tf.depth_to_space in tensorflow and Pixel Shuffle in Pythorch) to sample 8x on low-resolution images. Basically, the role of subpixel convolution is to compress a feature map with a size of 10 x 10 x 64 into another larger feature map with a lighter depth (80 x 80 x 1 if the upper sampling rate is 8). The discriminator is a simple VGG-style network that outputs 0 (false) or 1 (true). Ideally, the discriminator should be able to distinguish between the reconstructed image and the real image. Adding a discriminator works better than using a generator that minimizes mean square error, which tends to create over-smoothing artifacts that are completely different from legal letters. Using a discriminator to constrain the output space helps to create letter-like refactoring. One of the problems of loss function and evaluation of license plate image reconstruction is that common indicators such as mean square error or peak signal-to-noise ratio are not particularly good at describing high-level features. For example, a blur reconstruction may have a higher PSNR than a reconstruction with offset brightness and high contrast. Therefore, it is important to focus on advanced features such as edges and letter directions. In SRGAN's paper, researchers found a new content loss function, which calculates the mean square error in the feature space of the VGG network, which highlights the characteristics of the original image rather than the mean square error in the image space. They define VGG loss as our model is optimized to minimize the mix of VGG loss and MSE (called content loss): content loss forces the model to pay attention to the edges when rebuilding to ensure that the high-level skeleton matches the real value. Thank you for your reading, the above is the content of "how to use Python+OpenCV+GAN to achieve license plate image enhancement". After the study of this article, I believe you have a deeper understanding of how to use Python+OpenCV+GAN to achieve license plate image enhancement, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report