I am trying to code the following MATLAB lines into Python, but I’m not going anywhere! This is the MATLAB code that I’m trying to convert to Python:
width = 50;
Fs=zeros(600,800);
Fs(301-width:1:301+width,401-width:1:401+width) = ones(1:2*width+1,1:2*width+1);
Any help would be appreciated.
Thanks.
I think I have managed to solve it as follows:
filter_width = 50
F = np.zeros((600,800))
box_dim = 2*filter_width
Fones = np.ones((box_dim,box_dim))
F[int((mid_height+1)-
filter_width):int((mid_height+1)+filter_width),int((mid_width+1)- ...
filter_width):int((mid_width+1)+filter_width)] = Fones
Thanks.