Hello all,
I need to create a file containing random numbers (let's say on a 64x64 grid) and then smooth the data to create a correlated function with an arbitrary correlation distance L. I basically need to create something like this :
Random_correlated_data.png
The random grid is easily created using
random_grid = (b-a).*rand(64,64) + a;
[a,b] being the interval in which the random numbers are generated.
  • I have trouble finding a way to smooth the data that creates bumps on the surface that have the desired size;
  • If i also could control the maximum local slope that'd be top tier.
Does anyone know a way to do this ? Thanks !

 채택된 답변

KALYAN ACHARJYA
KALYAN ACHARJYA 2019년 9월 25일
편집: KALYAN ACHARJYA 2019년 9월 25일

0 개 추천

data_image=randi(255,64,64);
% Smooth the image as per your requirements
% or Bluring the image see the fspecial documentation
h=fspecial('average',3);
data_result=imfilter(data_image,h);
image(data_result);
colorMap=jet(256);
colormap(colorMap);
colorbar;
Detail fspecial here
4567.png
Similar question answer see here (@Image Analyst)
Also check with
h=fspecial('motion',some_value,some_value);
Hope it helps!

추가 답변 (1개)

Gregoose
Gregoose 2019년 9월 30일

0 개 추천

Thanks for your answer, I'll now have to play with the kernel size/type to fit my needs, as well as the edges !

카테고리

도움말 센터File Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기

제품

릴리스

R2017a

태그

질문:

2019년 9월 25일

답변:

2019년 9월 30일

Community Treasure Hunt

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

Start Hunting!

Translated by