I have the following image in fits format. I want to remove all stars and other small dots from this image using matlab.
I performed the following operations with the matrix to remove stars in it.
I = imread('NGC_0253.jpg');
if size(I,3)==3
I=rgb2gray(I);
end
K = imcomplement(I);
L = I-K;
M = medfilt2(L);
imshow(M)
I get the image as follows: 
I also try the following:
I = imread('NGC_0253.jpg');
if size(I,3)==3
I=rgb2gray(I);
end
K = imcomplement(I);
L = I-K;
M = bwareaopen(L,1000);
N = medfilt2(M);
imshow(N)
but it also does not satisfy me: 
This is not my goal. My goal is to remove all stars from the image.
So, what should I do to remove all stars left without a galaxy from the image?
source
share