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 two identical images. One was marked by an algorithm, and the other (already marked) serves as ground truth. I'm able to segment the marks from the images like in the following example.
GROUND_TRUTH
ALGORITHM
My question is what is the best way to compare the mark produced by the algorithm with the ground truth?
So far I´ve tried substracting the image marked by the algorithm from the ground truth and counting the remainig pixels to compute the success of the comparison using the equation success=1-(number of remaining pixels after substraction)/(number of pixels of the ground truth)
But I'm not convinced by this method especially in the case where the mark made by the algorithm and the ground truth are in different places. In the example the part of the mark made by the algorithm that is at the top is not accounted for in the comparison. How could I deal with this?
SUBSTRACTED
I'm using openCV and python to work with the images.
You have binary masks.
Calculate intersection over union ("IoU").
Both numpy itself and OpenCV have ways to calculate the logical and/or of two boolean arrays, and both have ways to count the number of non-zeros.
Related
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 11 months ago.
Improve this question
I'm trying to clean the line noises from this captcha, so I can implement an algorithm to read them. However, I'm finding some difficulties to make it readable to an AI using some techniques, such as Open CV threshold combined with some resources from pil.Image. I also tried an algorithm to "chop" the image, which gave me a better results, but stil far from the expected. I want to know if there is an alternative to remove noises from captchas like this one effectively.
(I'm using python)
Initially, the Captcha looks like this:
Once processed using OpenCV + Pillow, I've got this:
Later, using the "chop method" this what we have:
However, I need a better final image, but I think this methods combination is not appropriate. Is there a better alternative?
I think you could try minisom: https://github.com/JustGlowing/minisom
SOM (Self organizes maps) are a type of neural networks that group clusters of points in data, with an appropiate threshold it could help you removing those lines that are not surrounding the numbers/letters, combining that with chop method could do the job.
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 1 year ago.
Improve this question
I have a few lists of movement tracking data, which looks something like this
I want to create a list of outputs where I mark these large spikes, essentially telling that there is a movement at that point.
I applied a rolling standard deviation on the data with a window size of two and got this result
Now I can see the spikes which mark the point of interest, but I am not sure how to do it in code. A statistical tool to measure these spikes, which can be used to flag these spikes.
There are several approaches that you can use for an anomaly detection task.
The choice depends on your data.
If you want to use a statistical approach, you can use some measures like z-score or IQR.
Here you can find a tutorial for these measures.
Here instead, you can find another tutorial for a statistical approach which uses mean and variance.
Last but not least, I suggest you also to check how to use a control chart, because in some cases it's enough.
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 4 years ago.
Improve this question
I want to create a system that detects the type of image based on the color composition.
E.G =
Object A = Blue, Red, Orange, Green.
Object B = Red, Green, Blue, Black.
Whenever i scan an image with a color composition of Blue-red- Orange- Green, the answer will be Object A.
I scanned a couple of tuts but i can't grasp it. I want to ask on what algo to use, and where do i start.
So far, what i've found that will help me with my problem is the K-Nearest Neighbor Algo, but i'm still looking for a more options. Any help will do!
This looks to me as a classification problem. You have objects with features (color composition) and want to classify them into classes A or B.
K-Nearest Neighbors is a good starting point. A perceptron (a simple neural network) would be another simple algorithm to try out, as well as the linear discriminant analysis.
If it turns out that your data are too complex for linear-separating algorithms, you can try a multi-layer perceptron, support vector machines, or random forests. There are also many other possibilities, but one of the above should be enough to get you started.
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
My ground truth is oriented rectangle. How can I calculate IoU between my output rectangle and ground truth?
Ground truth has these parameters: x_centre,y_centre,height,width,angle of orientation.
The simplest way is using some library providing boolean operations over polygons. Choose one that has Python bindings.
Clipper library features:
Line and polygon clipping - intersection, union, difference & xor
The library is written in Delphi, C++, C# and Python
Third-party modules for Perl, Ruby and Python languages
If you want to make calculations 'by hands', consider O'Rourke algorithm (free code for his book is here) or Plante's approach to get intersection, and do some research to extend these methods and find union.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
Is it better to implement my own K-means Algorithm in Python or use the pre-implemented K-mean Algorithm in Python libraries like for example Scikit-Learn?
Before answering which is better, here is a quick reminder of the algorithm:
"Choose" the number of clusters K
Initiate your first centroids
For each point, find the closest centroid
according to a distance function D
When all points are attributed to a cluster, calculate the barycenter of the cluster which become its new centroid
Repeat step 3. and step 4. until convergence
As stressed previously, the algorithm depends on various parameters:
The number of clusters
Your initial centroid positions
A distance function to calculate distance between any point and centroid
A function to calculate the barycenter of each new cluster
A convergence metric
...
If none of the above is familiar to you, and you want to understand the role of each parameter, I would recommend to re-implement it on low-dimensional data-sets. Moreover, the implemented Python libraries might not match your specific requirements - even though they provide good tuning possibilities.
If your point is to use it quickly with a big-picture understanding, you can use existing implementation - scikit-learn would be a good choice.