Removing lower pixel valued connected components from image [closed] - python

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
Is there any way to remove the lower pixel valued connected components from the below picture? Like I want the horizontal and vertical lines and small already printed texts removed except the handwritten text.
I want the handwritten text to be extracted like in this image.
Is there any specific library I can use for this purpose?
I was trying Python OpenCV's library to threshold the noise pixels out of the image but that is not giving perfect result.
The image I'm getting after using threshold is this.
If I increase the threshold then it is removing pixels from the handwritten text itself.

Combine the OpenCV methods erode and dilate. They are able to first (erode) get rid of noise and then amplify the main signale (dilate).

You can develop an algorithm based "connected component analysis" to remove undesired connected components. You just need to detect connected components and remove the small ones to extract the desired ones. A case study about it can be found in here and can be helpful for you to develop the solution for your case.

Related

Finding the top edge of a disk [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 days ago.
Improve this question
I have a stock of photos, of a spinning disk of varying angles. I wish to find the edge of the top of the disk. The top is colored in a distinct black color in comparison to the rest of the photo.
A
B
I first tried using canny edge detection which does a decent job, but also identifies the bottom half of the disk, which I wish to avoid.
Next idea was to use the distinct black color- perhaps by dividing the photo into domains characterized by colors\intensities- and by choosing the largest domain\most black domain or some other parameter, perhaps to isolate that black circle, and only then to use canny edge detector.
Is there any existing function that can divide a greyscale image into domains? Transferring from matlab to python, so I'm new to it's syntax and functions.
Thanks
The Canny disaster goes on !
People playing with image processing keep willing to rely on edge detection when they have beautifully segmenting scenes. With a careful selection of a binarization threshold, you can extract the ellipse as a single piece.

Is there a way to find the speed from analog speedometer? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 1 year ago.
Improve this question
I have an analog speedometer image, with the needle pointing to the current speed. I am trying to find a way to get the speed that the needle is pointing out to. I tried using HoughCircles() from OpenCV, but it is throwing an error as the image contains only speedometer and which is a semi-circle. Any resources to help me move forward will be appreciated.
Assuming the needle will have a different colour to the rest of the speedometer OR its size is distinctly larger than the rest of the elements on the speedometer (which is often the case), I'll do something like below.
Convert the image to grayscale.
Apply colour thresholding (or size-based thresholding) to detect the pixel area representing the needle.
Use HoughLines() or HoughLinesP() functions in OpenCV to fit a line to the shape you detected in Step 2.
Now it's a matter of measuring the angle of the line you generated in Step 3 (example provided here: How can I determine the angle a line found by HoughLines function using OpenCV?)
You can then map the angle of the line to the speed through a simple equation (Will need to see an image of the speedometer to generate this).
let me know how it went.

Python: Removing vertical and horizontal lines in google vision api [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I am trying to extract handwritten text from:
using https://cloud.google.com/vision/docs/handwriting
Without using any third party technology, is there any option in Google vision API to remove vertical and horizontal lines from the image before extracting the text?
Hahaha I literally did the exact same thing like 2 months ago.
No, the Vision API can't do this.
Here's how I did it:
1) create an image object with the Python PILLOW library.
2) Get the matrix representation of the image.
3) binarise the matrix.
4) Loop through it line by line and row by row. When you encounter a black pixel, start a counter. If you encounter a white pixel, reset the counter. If the counter goes higher than some high number, conclude that it is a line.
5) Change the black pixels in the line to white pixels.
6) Use Pillow to get a PNG back again.

TensorFlow - Text recognition in image [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I am new to TensorFlow and to Deep Learning.
I am trying to recognize text in naturel scene images. I used to work with an OCR but I would like to use Deep Learning. The text has always the same format :
ABC-DEF 88:88.
What I have done is recognize every character/digit. It means that I cropped the image around every character (so each picture gives me 10 characters) to build my training and test set and they build a two conv neural networks. So my training set was a set of characters pictures and the labels were just characters/digits.
But I want to go further. What I would like to do is just to give the full pictures and output the entire text (not one character such as in my previous model).
Thank you in advance for any help.
The difficulty is that you don't know where the text is. The solution is, given an image, you need to use a sliding window to crop different part of the image, then use a classifier to decide if there are texts in the cropped area. If so, use your character/digit recognizer to tell which characters/digits they really are.
So you need to train another classifer: given a cropped image (the size of cropped images should be slightly larger than that of your text area), decide if there are texts inside.
Just construct training set (positive samples are text areas, negative samples are other areas randomly cropped from the big images) and train it~

How to remove light's deflections [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I work with image processing in OpenCV in python.
My main problem is light deflection. Can these deflections be removed with some method?
I implemented a lot of code here, but cant find this particular lights deflections effect. 1)I implemented grayscale, sobel filter, median blur, histogram analysis for plates detections, but this deflections cause that my histogram is bad for edges from sobel filtering, removing these flashes cause that it should works good.
An input image:
Use a colorspace transformation. For instance, if you transform your image to the HSV space, you'll see the "light" components in the V("value") channel:
This is the HSV image:
This is the V channel:
This is the regions of the V channel above a certain level (i.e. a thresholded image):
Now, you can use this kind of stuff to get things done by removing the high values of this V channel, then merging the channels back again. Good luck!
NOTE: as you see, I'm not giving you the code. I think that this should be easy to program if you search the documentation on OpenCV's cvtColor, split/merge or threshold methods ;)

Categories

Resources