create a loop to determine the pixel distance from the center using the distance formula
1 回表示 (過去 30 日間)
古いコメントを表示
Yogesh Bhambhwani
2020 年 11 月 12 日
コメント済み: Yogesh Bhambhwani
2020 年 11 月 13 日
using the distance formula I need to find the the pixel distance from the center of my image 'sunflower.jpg'. I have found the center of my image im just cofused on how to write the loop and what values my x and y would be.
d^2 = (x-x_c)^2 + (y-y_c)^2 (distance formula)
0 件のコメント
採用された回答
Setsuna Yuuki.
2020 年 11 月 12 日
編集済み: Setsuna Yuuki.
2020 年 11 月 12 日
you just have to move (x, y).
(x_c, y_x) are fixed.
image = imread('sunflower,jpg');
[l,h,~] = size(image);
%(x_c,y_c) = center of image
for x=1:l
for y=1:h
d = sqrt((x-x_c)^2+(y-y_c)^2);
end
end
6 件のコメント
Setsuna Yuuki.
2020 年 11 月 13 日
編集済み: Setsuna Yuuki.
2020 年 11 月 13 日
what is color ??
VinColor = Color * (1-r.^2) %maybe can be like that if r is a vector
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!