![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/284800/image.png)
finding dense location and define centeriod of the each dense location
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
SatyaPrakash Gupta
el 15 de Abr. de 2020
Comentada: Image Analyst
el 17 de Abr. de 2020
I have attached .mat file and below zoomed figure of one section , I would like to find the centeriod of the dense location.
Since I have huge data around 400000 * 2, i am not able to use DBSCAN.
can you please do help me out with the loaded data ?![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/284621/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/284621/image.png)
7 comentarios
darova
el 16 de Abr. de 2020
Can i ask why do you need so many centroids? What are you doing further with them
Respuesta aceptada
darova
el 16 de Abr. de 2020
Here is simple but coarse (maybe not precise method)
Fill matrix Connect pixels Thin line Remove 'spur'
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/285041/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/285042/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/285043/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/285044/image.png)
Results (green point - rounded orinal data)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/285045/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/285046/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/285047/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/285048/image.png)
I suppose you want to order those points now (connect them)
4 comentarios
darova
el 17 de Abr. de 2020
I don't understand the question. This is your data:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/285307/image.png)
Can you make a simple sketch of the result you expect?
Más respuestas (2)
Image Analyst
el 17 de Abr. de 2020
Editada: Image Analyst
el 17 de Abr. de 2020
Looks like you already have an answer that you've accepted, however one way to approach it is to use fitPolynomialRANSAC() - it's in the Computer Vision Toolbox, if you have it. You can use this function twice. The first time it will get the first curve (one of them, not sure which one though). Then remove those points close to the first curve, and run it again to get the second curve and points close to it. fitPolynomialRANSAC() will return the polynomial coefficients of the curve and the indexes of the data points that are close to that curve.
2 comentarios
Image Analyst
el 17 de Abr. de 2020
Well, don't bother. You already have an answer that you've accepted that works.
SatyaPrakash Gupta
el 17 de Abr. de 2020
5 comentarios
darova
el 17 de Abr. de 2020
I can't, sorry. Your question is too difficult for me
I did my best. That is all i can
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!