python lib to detect blur image - python

Does anyone know the last techniques to detect a blur image in python (or any other lib/app) ?
Actually I use ffmpeg to extract frames from videos.
The idea is to check these extracted frames and remove the blured ones.

This is a bit late for the person asking this question.
I found a link here that can detected the amount of blur in the image.
By using OpenCV, Python, and the Laplacian operator.
Blur detection with OpenCV
Might be of some use to others

I don't know of any lib that does that, but I'd suggest you to look at Image gradient . Since blur images doesn't have "edges", the sum of the values of the gradient of a blur image is lower than the image gradient of the same non-blur image.

I tried this one and worked quite well. Not perfect but pretty well.
https://gist.github.com/shahriman/3289170

Related

Image segmentation python opencv

I want to ask for some advice about the procedure that I should implement for image segmentation working with opencv in python.
I have this kind of image and my purpose is to detect the white fiber like here
Does anyone have a proposition of the steps of image processing that I should do?
Since I can notice that object's color is different than the background, I found this guide helpful. The concept is the following :
1.apply RGB filters to your image,
2.grab contours using OpenCV, then
3.apply some handcraft conditions to them so as to fit your desired output, and finally
4.produce the box.
If all of your images share the same color patterns, this should work.. If not, it will prove noisy ..

How to draw contours around black areas in pixeld image?

i am quite new to Python and i try to write some code for image analysing.
Here is my initial image:
Initial image
After splitting the image in to the rgb channels, converting in to gradient, using a threshold and merging them back together i get the following image:
Gradient/Threshold
Now i have to draw contours around the black areas and get the size of the surrounded areas. I just dont know how to do it, since my trials with find/draw.contours in opencv are not succesfull at all.
Maybe someone also knows an easier way to get that from the initial image.
Hope someone can help me here!
I am coding in Python 3.
Try adaptive thresholding on the grayscale image of the input image.
Also play with the last two parameters of the adaptive thresholding. You will find good results as I have shown in the image. (Tip: Create trackbar and play with value, this will be quick and easy method to get best values of these params.)

OCR on images using python and opencv

I am a newbie to computer vision, image processing and OCR. As a part of task, i need to perform the OCR on attached emails. However, the problem is ROI is not constant in all images. For example, in all images we need to extract the information related with patient Yadav.
This needs to be achieved in Python and OpenCV. Please help. I have already tried the approach as given below:
Change DPI
Grayscale
Binarize
However, facing the problem with layout or zone analysis.
Thanks for help.
Welcome to the computer vision world.
I think you're not understanding your problem well enough. Just trying something and check whether it work will never work.
At first read how tesseract (OCR engine) do to improve their accuracy at https://github.com/tesseract-ocr/tesseract/wiki/ImproveQuality
Ok, then what make OCR do not work on your data. As you can see your data is clean, and there is nearly none of noise. So it is the border of printed email (as "ROI" in your question) does not correctly line up.
So have can we make the ROI line up correctly . we could use some perspective transformation. i took an example from https://www.pyimagesearch.com/2014/08/25/4-point-opencv-getperspective-transform-example/
So how can we perform perspective transformation. We have to find the 4 corners of the ROI and move it back to corners of the image. To find 4 corner of the ROI you could find some contours .
So here the summary, here is the steps.
1. Find the ROI (white color) using color segmentation
2. Find the contour which cover the ROI
3. Find 4 corners of the ROI's contour
4. Apply perspective transform
5. Run tesseract on transformed image
Hope that help

How to use opencv for poster detection

Is it possible to use opencv for better detection of posters (see example image)? I have tried following approach:
create mask of higher intensity pixels (higher v value)
apply erosion and dilation to remove noise and make smooth.
findContours and draw bounding boxes.
Result of this approach is only good if there are lights behind the posters(poster glowing). However, for my goal is to detect posters even when its not in the highest intensities. Please anyone guide me about it.
First thought was neural nets... and openCV has an implementation:
http://docs.opencv.org/2.4/modules/ml/doc/neural_networks.html
They call them 'Multi Layer Perceptrons'
Other machine learning examples in openCV here:
http://bytefish.de/blog/machine_learning_opencv/
If you know how the posters, you want to detect, look like, you could search for keypoints and match them by their descriptors.
See the example Features2D + Homography to find a known object in the documentation for code.

How to check the input image is matched with the cropped face pic or not?

I would like to check whether a given image is matched with a cropped face image. I tried to crop the face from the image using OpenCV Python. Now i want to check if the input image is a match with the cropped face or not. What methods can I use with OpenCV to achieve this?
For sufficiently small (and not scientifically accurate) purposes, you could use OpenCV's template matching.
Feature extraction and matching may give you more accurate results in many cases. Face detector comes in as a part of OpenCV. Face recognition, however, is a much larger problem altogether.

Categories