Counting Plotted Coordinates in image
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
I have a gray scale image given below:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/158951/image.jpeg)
I plot blue dot on certain coordinates given in 2xN matrix and get the following:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/158953/image.jpeg)
Now i convert the image into patches like below:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/158954/image.jpeg)
Now i want to count these blue dots in each patch as well as in image 2. How do i do that ?
0 Commenti
Risposte (1)
David J. Mack
il 12 Gen 2017
If you have your 2xN dot matrix dots which presumably contain the x (row 1) and y (row 2) coordinates, then N is the number of dots in the whole image and
ni = nnz(dots(1,:)>=xi & dots(1,:)<xi+wi) & dots(2,:)>=yi & dots(1,:)<yi+hi));
Gives you the number of dots in image patch i, which has its lower left corner at (xi,yi) and has a width x size of wi x hi.
0 Commenti
Vedere anche
Categorie
Scopri di più su Computer Vision with Simulink in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!