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

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.

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.

detecting the center of an arc by using open cv [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 2 years ago.
Improve this question
I am trying to detect the center&radius of an arc like shown below for my thesis by using open cv. I tried many things and searched a lot, but cant figure out. Could please somebody help me? I would be really glad.
I would not do the center finding itself with OpenCV but with simple 2D geometry instead see first bullet in Circular approximation of polygon (or its part) so:
filter out blobs not on curve
segmentate and remove too small (unconnected) blobs
find 3 points on your curve
They should be far enough from each and should form 2 lines (black). You can apply thinning algorithms to enhance precision. than simply find 2 most distant points from the curve and one that is in half way between them.
cast normal axises from their mid points (brown)
simply rotate the line slope by 90 deg by swapping x,y of direction vector and negating one of them so (-y,x) or (y,-x).
find the intersection its the center you are looking for
find radius
its the average of distance between center and the 3 points ...
Here a small example I just did in paint (its hand drawn so not pixel perfect):
Here is my simple approach algorithm:
Look at the angle contour by wide-view, like:
Check each pixel of this wide-view image one by one and find the norms(lengths) for each point of the contours. (To be clear: for each pixel, find lengths to those contour points)
If all lengths are equal for a pixel then that pixel is the center of the circle.
Note: This is simple approach and absolutely works. Just not sure about does it take long time to calculate for cpu.

Finding a modified image - image forensics [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 have a couple of standard ways of detecting a modified image such as
Luminance gradient
Copy move detection
Metadata Extraction
Histogram analysis
ELA(Error level analysis)
Quantization matrix analysis
Thumbnail analysis
are there any other standard ways of detecting a modified image?
Tried out
Finding the EXIF of the image to check the created and modified date and check for modification. I also had some rules for EXIF camera make and make note validation along with checking for the software used such as photoshop, Shotwell, etc.
Was able to segment the image and use SLIC(simple linear iterative clustering) to find out the similar cluster regions in an image
Find the largest contour with less pixel inconsistency with luminance gradient to mark that as a potential modified region
Largest contour with ELA as a potential modified region
Check for inconsistencies in histogram graph and mark it as a potential editted image.
Here are my questions
Are there any standard logics to verify the image with metadata such as using the created and modified dates, the camera make or maker note, etc. As these details are not consistent for any given image.
Finding out the least pixel inconsistency contour in the Luminance gradient would always give me an image that is modified?
If the histogram graph has a regular interval fluctuation could it be considered a modified image?
How could I use Quantization matrices to find out image anomalies
what is the best way to compare the thumbnail image to the original image to check for inconsistencies?
The answer to this question needs more detailed so, I will give some references to the subject itself and I will share with you the code of every part of your question :
You need to use exif to verify the image with metadata
For Anomaly Detection in Images see here
To compare the thumbnail image to the original image read this. where it showed you how to compare two images using Python.
References :
ccse.kfupm.edu.sa
github.com/redaelli
github.com/Ghirensics
www.amazon.com/Learning
books.google.com.tw
hal.inria.fr/

Removing lower pixel valued connected components from 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 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.

How to determine if an image is dark? [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 6 years ago.
Improve this question
I have some images i'm using for face recognition.
Some of the images are very dark.
I don't want to use Histogram equalisation on all the images only on the dark ones.
How can i determine if an image is dark?
I'm using opencv in python.
I would like to understand the theory and the implementation.
Thanks
To determin if an image is dark, simply calculate the average intensity and judge it.
The problem for the recognition although is not that the image is dark, but that it has a low contrast. A bright image with the same contrast would yield the same bad results.
Histogram equalization is a method that is used to improve images for human vision. Humans have difficulties to distinguish between very similar intensity values. A problem that a computer does not have, unless your algorithm is somehow made to mimic human vision with all its flaws.
A low contrast image bears little information. There is no image enhancement algorithm in the world that will add any further information.
I won't get into too much detail about image characterization. You'll find plenty of resources online or in text books.
A simple measure would be to calculate the standard deviation of image regions you are interested in.
You can try using CLAHE instead of the using histogram equalization. I am not sure if it will work for all your images (if you post some images I can try), however, conceptually, it should work better than "global" histogram equalization.

Categories

Resources