Integers can only be combined with integers of the same class, or scalar doubles.
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
charuleelaa vanilavarasu
am 3 Feb. 2016
Kommentiert: charuleelaa vanilavarasu
am 3 Feb. 2016
mask = 1-double(im2bw(gray, graythresh(gray)));
strel = [0 1 1 1 0; 1 1 1 1 1; 1 1 1 1 1; 1 1 1 1 1; 0 1 1 1 0];%structuring element
shadowavg_red = sum(sum(image(:,:,1).*shadow_core)) / sum(sum(shadow_core));
2 Kommentare
Walter Roberson
am 3 Feb. 2016
You need to stop tagging your questions as Urgent. We typically close or delete "Urgent" questions.
Akzeptierte Antwort
Walter Roberson
am 3 Feb. 2016
Whatever your shadow_core is, it is double precision, but your image variable is integer data type.
shadowavg_red = sum(sum(double(ImageArray(:,:,1)).*shadow_core)) / sum(sum(shadow_core));
or better yet,
mean(ImageArray(logical(shadow_core)))
Note the renaming of image to ImageArray. Using a variable named "image" always leads to problems.
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Resizing and Reshaping Matrices finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!