create an image like this

17 ビュー (過去 30 日間)
majid
majid 2015 年 6 月 10 日
コメント済み: Ayush singhal 2021 年 5 月 19 日
hello all. i want to create this pattern using Matlab for image processing goal .
please help me , it's a part of my project.

採用された回答

Joseph Cheng
Joseph Cheng 2015 年 6 月 10 日
編集済み: Joseph Cheng 2015 年 6 月 10 日
You can try something like this. If you think about what you're trying to do is create stripes based on degrees. And how do we get degrees in an image. by performing the arctan of pixel location based off a reference point.
halfI = zeros(1024,512);
x = 1:size(halfI,2);
y = 1:size(halfI,1);
[x y]=meshgrid(x,y);
Ang = flipud(atand(y./x));
figure,imagesc(Ang),colormap(gray),axis equal , axis tight
So here we have the angle for each pixel position from the horizontal and bottom left corner.
So how do we get stripes? well we define how wide each stripe is in angles and then alternate each one
dtheta = 2; %degrees per stripe
stripes = 0:dtheta:90;
for ind = 1:2:length(stripes)-1;
halfI(stripes (ind)<Ang & stripes (ind+1)>Ang)=1;
end
figure,imagesc(halfI),colormap(gray),axis equal , axis tight
So now we have half the image.
Img = ~[fliplr(halfI) halfI];
figure,imagesc(Img),colormap(gray), axis , axis tight
Center stripe is doubly thick in my example but i'll let you figure out that part.
  2 件のコメント
majid
majid 2015 年 6 月 10 日
編集済み: majid 2015 年 6 月 10 日

OH MY GOD , YOUR SOLUTION TO THIS PROBLEM IS AWESOME !! THANK YOU FOR YOUR PROMPT RESPONSE. but , would you please help me to solve middle stripe size ?

Ayush singhal
Ayush singhal 2021 年 5 月 19 日
Is it possible to project these stripes on a 3d cube?

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeComputer Vision with Simulink についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by