Write and put notation inside image?
이 질문을 팔로우합니다.
- 팔로우하는 게시물 피드에서 업데이트를 확인할 수 있습니다.
- 정보 수신 기본 설정에 따라 이메일을 받을 수 있습니다.
오류 발생
페이지가 변경되었기 때문에 동작을 완료할 수 없습니다. 업데이트된 상태를 보려면 페이지를 다시 불러오십시오.
이전 댓글 표시
0 개 추천
I people, I have two images and i applied the sift flow code, my images represent the blood flow.through the difference between the two images can obtain the direction of blood flow.this difference results in a single image (matrix), I converted all the values in the array into a vector, my idea is to sort an array positions for the non-repeated values, and adding to the sum of the other array positions repeated, for example:
A=[1 1 0 0 0; 0 0 0 1 1; 1 1 1 1 1]
vector=[1 1 0 0 0 0 0 0 1 1 1 1 1 1 1]
non-repeated=[0 1]
sum_positions=[6 9]
I'm trying to do this in order to group the values in an equal position. So when do imshow () values that have between 0 and 50 can write in the image "background". 51 and 100 "background or not" can someone help me
채택된 답변
Image Analyst
2014년 6월 29일
0 개 추천
In your example, what variables do you already have and which do you want to obtain? And what does imshow() have to do with anything? None of your variables have values like 51 or 100 . And how did you obtain sum_positions as 6 and 9? What is being summed????
댓글 수: 9
Biza's "Answer" moved here since it's not an answer to the original posted question but actually a reply to me.
Image Analyst, I have one matrix with 25345 values between 0 and 255 values some repeated. I want to create two vectors, one with no repeated values, and another that counts the values that repeat ... for example
clc;
clear all;
close all;
A=imread('imagem60.tif');%load image
A = double(A);
vector=A(:); %conversion image on vector
C=unique(vector') %turn values in one unique vector
dimentionA = length(vector);%count dimension of A
dimentionC = length(C);%count dimension of unique vector of C
count =0; % count initialise in 0
for (i=1:dimentionC) %
for (j=1:dimentionA)
end
end
Now with these two for loops, I want to check on the position c how many values of A are repeated. Like the first position equal to C 0, as many 0 exist in the vector A. He runs A vector and sum all 0. should you not find more moves to the next position in C vector and 2 is now the new value to find. And go to vector A and crosses the whole array and counts how many values there are 2. do this until there are no more values in the vector C.
Before that I command values or order (color) and between intrevalos color values between 0 and 50, I put a note on the image mark the region as "background", the interval between 51 and 100 to 255 other note.
You don't need to call unique(), simple call imhist() and look for bins that have only 1 count:
[pixelCounts, grayLevels] = imhist(A);
uniqueIndexes = pixelCounts == 1;
uniqueGrayLevels = grayLevels(uniqueIndexes);
Every gray level is counted, and this is a lot simpler than what you proposed.
I don't know what "intrevalos color values" are. Please define.
Image Analyst
2014년 6월 29일
Biza's "Answer" again moved here since it's not an Answer to his original question:
sorry I'am portuguese, intervals values "color between Gray levels"
Image Analyst
2014년 6월 29일
I don't know what color between gray levels means either, but I trust that my code will help you solve your problem. Let me know if you tried it and it does not do what you want.
I try your code but don't shoe anything, and just convert all value to zero
Biza's "Answer" yet again moved here since it's not an Answer to his original question. Biza, quit posting answers to your questions unless you've solved them. If you reply to someone, post it as a comment.
Image Analyst I checked what I needed for my work, and...
contagem =0;
for i=1:length(C) %
r =bwconncomp(direcao==C(i),4);
contagem = contagem+1;
end
end
Now I just need, grouping pixels of similar values, in short intervals and assign each interval a gray color
What are you doing? Do you just want to assign each connected component a unique color? If so, do this:
labeledImage = bwlabel(binaryImage, 8); % Label each blob so we can make measurements of it
coloredLabels = label2rgb (labeledImage, 'hsv', 'k', 'shuffle'); % pseudo random color labels
imshow(coloredLabels);
my image is in grayscale and I want to group similar pixels and assigning a color to each group. example: between 0 and 25 pixel's color "0" (black)
The code I just showed you does exactly that. Did you try it? It came from my Image Segmentation Tutorial http://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A31862 Run that if you want to see it in action.
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Contrast Adjustment에 대해 자세히 알아보기
참고 항목
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)
