Counting Plotted Coordinates in image
조회 수: 5 (최근 30일)
이전 댓글 표시
I have a gray scale image given below:

I plot blue dot on certain coordinates given in 2xN matrix and get the following:

Now i convert the image into patches like below:

Now i want to count these blue dots in each patch as well as in image 2. How do i do that ?
댓글 수: 0
답변 (1개)
David J. Mack
2017년 1월 12일
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
참고 항목
카테고리
Help Center 및 File Exchange에서 Point Cloud Processing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!