Why do i keep getting x=1 when it should be a matrix??
Mostrar comentarios más antiguos
For some reason when i run this script x always equals one when it's suppose to be a matrix.
The program is for star dectection from the image and x suppose to be the threshold with steps.
stars=imread('stars.jpg');
GREY = rgb2gray(stars);
figure,imshow(GREY);
big = max( max (GREY)); %255
threshold = .4;
bwimage = GREY >= threshold*big;
figure(2),imshow(bwimage);
step=0.01;
for x = [0.0:step:1.0]
BW = GREY > big.*x;
count = sum(BW>=x);
end
Thanks ill greatly appreciate the help
Respuesta aceptada
Más respuestas (1)
the cyclist
el 5 de Mayo de 2013
The way you have coded this, x is in a for loop, and the code will step through values of x, one by one, starting from 0 and ending at 1.
Instead, did you mean to simply make x a vector? Then you just need
x = 0.0 : step : 1.0;
without the loop.
Categorías
Más información sobre Image Thresholding en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!