MATLAB: How to remove stars (background stars) from image

...

124.JPG
i want to remove stars from above image.

Best Answer

Here forced all pixels (those all pixels having more than 150) to zero(black)
You can edit the as per your requirements-
im1=imread('star_image.jpeg');
im2=rgb2gray(im1);
idx=find(im2>150);
im2(idx)=0;
imshow(im2);
777.png
Is this you are looking for?
Please accept the answer, only if the answered is as per your question.