Hi,
I'm quite new to Matlab, so that's probably a dumb question. Anyway.. I'd appreciate any help.
I basically need to understand how:
1) to create a filled circle image (without background) in cielab space. The circle should have a r=125 pixels and fixed saturation (38) and luminance (85) values. the hue should be of 0 in cielab space
2) to apply a Gaussian low-pass filter of size 100 x 100 with a standard deviation of 10 only to the circle
3) to create a loop to replicate this operation, in order to save different circle images with same luminance and saturation, and different hue degrees in steps of 5 degrees each. in particular I would need the first circle to be 0 hue degrees, the second to be 5, the third to be 10 and so on – until they reach 250 degrees. so at the end I should have 51 circles with slightly different colours.
I had a look online and I understood – correct me if I'm wrong – that Matlab isn't able to manage image transparency. what would you suggest? After having those images, I would basically need to superimpose them on a black screen, so it would probably be a solution to save the final filtered image with a black background – but I have to be sure they will be reliable because they will be part of a behavioural visual experiment, and there is no room for errors.
below some code I used to create the filtered circle, but I'm not able to export it in cielab space and with no (or black) background. Also, I don't know how to create a loop!
% create a red circle.
set(gca,'Color','black')cerchio_fig = rectangle('Position',[1,1,5,5],...'Curvature',[1,1], 'FaceColor','r')axis equal off;saveas (cerchio_fig,'cerchio.png') %%create a gaussian filter and save as a tiff
cerchio = imread('cerchio.png') set(gcf,'Color','black') cerchioblur = imgaussfilt(cerchio,10) imwrite (cerchioblur,'cerchioblur.tiff') %%imwrite (cerchioblur,'cerchioblur.tiff','Colorspace','cielab') %%when I
%%do that, my circle will be saved with completely different colours and
%%when opened back in matlab it will be converted to a different colour
%%space
imshow (cerchioblur)
Any suggestion?
Thanks in advance
Best Answer