Integers can only be combined with integers of the same class, or scalar doubles.
조회 수: 3 (최근 30일)
이전 댓글 표시
charuleelaa vanilavarasu
2016년 2월 3일
댓글: charuleelaa vanilavarasu
2016년 2월 3일
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
Walter Roberson
2016년 2월 3일
You need to stop tagging your questions as Urgent. We typically close or delete "Urgent" questions.
채택된 답변
Walter Roberson
2016년 2월 3일
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
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!