matrix of image, imagine processing toolbox
이 질문을 팔로우합니다.
- 팔로우하는 게시물 피드에서 업데이트를 확인할 수 있습니다.
- 정보 수신 기본 설정에 따라 이메일을 받을 수 있습니다.
오류 발생
페이지가 변경되었기 때문에 동작을 완료할 수 없습니다. 업데이트된 상태를 보려면 페이지를 다시 불러오십시오.
이전 댓글 표시
0 개 추천
I am beginner in image processing toolbox, i have to use this image

how i create matrix of image, when I need only the points that are black so I could continue to work with the coordinates.
THANKS
댓글 수: 1
Tomas
2013년 11월 16일
편집: Walter Roberson
2013년 11월 17일
I = imread('image.png');
imshow(I)
[m n]=size(I)
I = double(I);
i dont know how to get matrix from binary image,
채택된 답변
Image Analyst
2013년 11월 17일
If the badly-named I matrix is already a binary image as you said, then you already have the coordinates as the binary image. In the event that I is really a gray scale image and not a binary image, you can turn it into a binary image (class will be "logical") by thresholding:
binaryImage = I < 127; % or whatever value is between black and white.
In the unlikely event that the binary image is not suitable and you really need vectors of rows and columns, you can do this to binaryImage:
[rows, columns] = find(binaryImage);
So rows(k) and columns(k) refer to the same pixel if k is the same. If you want in a single matrix, of (x,y) form, then you can do
xy = [columns, rows];
댓글 수: 13
Tomas
2013년 11월 17일
i need basically a simple binary imagine,shows clustering. clustering will only be black places in image, white be background. I want to create matrix from binary image, i dont know how to get matrix coordinates only black colors
Image Analyst
2013년 11월 17일
My first line of code above showed you how to do that. The image is most likely what you need. If you do need the row and column arrays, then my second line of code shows you how to do that. I guess I'm confused why you're asking again because I'm just giving you the same answer and don't know why you don't understand it.
Tomas
2013년 11월 17일
I dont understand the image, so my questions are incomprehensible and my english is quite poor, Thank you for your answers and time
Image Analyst
2013년 11월 17일
편집: Image Analyst
2013년 11월 17일
Why don't you tell us what your final objective is, rather than the next step in some unspecified multi-step algorithm? The coordinates is not the final step of whatever you want to do - it's only the next step. What do you want to do after that? Then I can see whether the image is fine, or if you really need the coordinates.
i have to clustering image, for example this picture

I have to clustering black points on picture I have to use hierarchical clustering(Agglomerative- i have a program ) My output will be the black point in the clusters, by using the clustering methods.
I dont know, how to get matrix to work out a picture
Image Analyst
2013년 11월 17일
Is that one cluster, or 14 or 15 clusters?
Tomas
2013년 11월 17일
at the beginning you can choose how much I want clusters
So use the code I gave you
[rows, columns] = find(binaryImage);
and plug rows and columns into kmeans or something.
Tomas
2013년 11월 17일
ok, thanks
Image Analyst
2013년 11월 17일
You're welcome. If we're done, close out the question by marking as Accepted. Thanks.
Tomas
2013년 11월 17일
편집: Walter Roberson
2013년 11월 17일
one more question, how i use [rows, columns] = find(binaryImage); I dont know, how i have to use.
my code is so far
I = imread('image.png');
imshow(I);
[m n]=size(I)
I = double(I);
binaryImage = I < 127
[rows,columns]=find(binaryImage)
[idx,ctrs] = kmeans(X,2,.......)
how create to matrix X with rows and columns ?, maybe stupid question, i dont know :)
Thanks
Walter Roberson
2013년 11월 17일
편집: Image Analyst
2013년 11월 17일
X = [rows(:), columns(:)];
Tomas
2013년 11월 17일
ok thanks
추가 답변 (1개)
Walter Roberson
2013년 11월 17일
find(~I)
카테고리
도움말 센터 및 File Exchange에서 Multirate Signal Processing에 대해 자세히 알아보기
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
