simplest adaptive thresholding custom code
이 질문을 팔로우합니다.
- 팔로우하는 게시물 피드에서 업데이트를 확인할 수 있습니다.
- 정보 수신 기본 설정에 따라 이메일을 받을 수 있습니다.
오류 발생
페이지가 변경되었기 때문에 동작을 완료할 수 없습니다. 업데이트된 상태를 보려면 페이지를 다시 불러오십시오.
이전 댓글 표시
0 개 추천
Hi all,
I got this far with the adaptive thresholding, Can a professional explain my errors please?
i am trying to do an adaptive thresholding via (Custom For Loop)manual coding!!
I am not sure if this can work! need a break down of what should happen please!!
Thanks in advance!!
function adthres;
[row col]=size(x);
for i=1:1:n
for j=1:n
x = i - n/2;
y = j - n/2;
j(i,j) = exp(-(x*x)/two_sigma_sq);
end
end
end
채택된 답변
KALYAN ACHARJYA
2019년 6월 30일
adaptive thresholding menas, the threshold value is not fixed, its depends on image or input data
In the first view, This code is messed. As you defined j=1:n, here j is scalar, also j(i,j)>> Here j >> representing vector. I didnot find any statement, which relate to calculate the threshold value or replacing vector elements based the threshold.
some_vector(i,j)=exp(-(x*x)/two_sigma_sq);
This statement finding the each element of 2D vector/matrix
댓글 수: 13
I know my code is a mess and I am trying to understand what I am doing!
Can you give me an example of what it should be? So in the future I can reference that example and learn progressively!!
A simple for loop calculating the mean and standard deviation is my aim!!
Can you or anyone provide and example of this please? So that I can learn the processes and it's requirements!
Thank you for aacknowledging my digital presence!!
A simple for loop calculating the mean and standard deviation is my aim!!
Lest one objective at a time: Mean
Input data?? Mean of ??
Ok! I am following your lead i really would like to learn and understand this @KALYAN ACHARJYA! Seeing that my values and understanding is off, you chose! Thank you for responding!
KALYAN ACHARJYA
2019년 6월 30일
편집: KALYAN ACHARJYA
2019년 6월 30일
Thanks once more @ KALYAN ACHARJYA! I have seen those/your example, that is not my issue. I am having trouble doing it as a for loop! implementing the mean in a for loop as well as the standard deviation. I was hoping you can provide a demonstration of the task in the simplest form so that I can comprehend it. I have been searching online for an example that shows this so that i can go over it on my own, so that it sticks....
Please assist anticipating your response positively!
KALYAN ACHARJYA
2019년 6월 30일
편집: KALYAN ACHARJYA
2019년 6월 30일
Thats why I am asking, please provide the input? Mean of what?? Any array?
Pls elaoborate with example (Maths)?
can you help me do a for loop for these arrays please?
threshold = 30
Standard Dev x = [2 2 4; 3 1 2; 6 2 3];
utilisng this mean x = [0 1 1; 1 1 2]
KALYAN ACHARJYA
2019년 6월 30일
편집: KALYAN ACHARJYA
2019년 6월 30일
Sorry I didnot get the question. Loop is use to do just reapeating task. The question is, loop use to calculate ??
I assumed, you know the basic of loop.
yes I understand the basic loop but I am trying to understand how to do adaptive threshold via a for loop!! To do this adaptive threshold, does it require calculating the mean as well as standard deviation? I have been reading but some how I am not getting it. I deceided to see this happen as an example so that it would be a little clearer!
Thank for responding and acknowledging me!
this is normal thresholding, I am not sure how to do the mean calculation in the same code for adaptive thresholding, This where i reach :
function Car = Thresholding(Gcar)
[rows, cols] = size(Gcar);
Car = zeros(rows, cols);
for i = 1:r
for j = 1:c
if Gcar(i,j) > 100
Car(i,j) = 1;
end
end
end
Replace all that with these simple two lines of code:
function Car = Thresholding(Gcar)
Car = Gcar > 100;
No for loops at all needed.
Hi thanks for responding @ Image Analyst! But i still ould liketo understand it utilisng the for loops!! can you guide me in the right direction please?
I understood the;
function Car = Thresholding(Gcar)
Car = Gcar > 100;
but still would like to solve the adaptive threshold via for loop and thanks in advance for responding and acknowledging my comments and anwers!!
Hi @ Image Analysis,
Can you help me understand this Error Please?
Error using images.internal.imageDisplayValidateParams>validateCData (line 119)
If input is logical (binary), it must be two-dimensional.
Error in images.internal.imageDisplayValidateParams (line 27)
common_args.CData = validateCData(common_args.CData,image_type);
Error in images.internal.imageDisplayParseInputs (line 78)
common_args = images.internal.imageDisplayValidateParams(common_args);
Error in imshow (line 246)
images.internal.imageDisplayParseInputs({'Parent','Border','Reduce'},preparsed_varargin{:});
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 File Operations에 대해 자세히 알아보기
참고 항목
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)
