Image Enhancement - clear this image from recording

enter image description here

I need to clear this photo by deleting the โ€œclear meโ€ entry and make it bright.

as part of my homework during image processing, I can use the matlab ginput functions to find specific points on the image (of course, in the script you need to copy the necessary coordinates).

You can use conv2, fft2, ifft2, fftshift, etc.

You can also use median, average, maximum, minimum, sort, etc.

My main idea was to use white and black values โ€‹โ€‹from the middle of the image and paste them into other parts of the black and white stripes. however, it gives a very synthetic look to the image.

Could you give me directions what to do? a median filter will not give good results.

+4
source share
4 answers

A common technique for doing such a thing is called Inpainting . But for this you need a mask of regions that you want to draw. So, suppose we were able to get a good mask and paint over the original image, given the morphological expansion of this mask:

enter image description hereenter image description here

To get this mask, we do not need anything special. Start by binarizing the difference between the original image and the result of media filtering it:

enter image description here

You can remove isolated pixels; attach the pixels representing the stars of your flag by combining dilatation in the horizontal direction, and then with another dilatation with a small square; delete this largest component you just created; and then perform a geodetic dilatation with the result so far against the initial mask. This gives a good mask above.

Now for inpaint there are many algorithms, but one of the simplest of them I found in Fast digital picture should be easy enough to implement. I did not use it, but you could check what results you can get.

EDIT: I missed that you would also like to brighten up the image.

An easy way to brighten up an image without making the brighter areas even brighter is to use the gamma factor <1. Being more specific to your image, you can first apply a relatively large low-pass filter, neutralize it, multiply the original image by it, and then apply gamma coefficient. In this second case, the final image is likely to be darker than the first, so you multiply it by a simple scalar value. Here are the results for these two cases (the left one is gamma 0.6):

enter image description hereenter image description here

If you really want to brighten up the image, you can apply a two-sided filter and split it into two parts:

enter image description here

+2
source

I see two clean me removal options. Both rely on horizontal similarities.

1) Use the long 1D low-pass filter only in the horizontal direction.

2) Use a 1D middle filter, maybe 10 pixels long

For both decisions, you must of course exclude the stellar part.

When it comes to brightness, you can try histogram alignment. However, this does not eliminate the unevenness of brightness. Perhaps a high level before leveling can fix this.

Hello

+1
source

The easiest way to delete text is, as KlausCPH said, to use a long 1-dimensional median filter in an area with stripes. In order not to damage the stars, you will need to save a backup copy of this part and replace it after starting the middle filter. To do this, you can use ginput to mark the lower right side of the star part:

 % Mark lower right corner of star-region figure();imagesc(Im);colormap(gray) [xCorner,yCorner] = ginput(1); close xCorner = round(xCorner); yCorner = round(yCorner); % Save star region starBackup = Im(1:yCorner,1:xCorner); % Clean up stripes Im = medfilt2(Im,[1,50]); % Replace star region Im(1:yCorner,1:xCorner) = starBackup; 

This gives enter image description here

To fix the problem with exposure (the middle part is brighter than the corners), you can put a two-dimensional Gaussian model in your image and perform normalization. If you want to do this, I suggest looking at fit , although it may be a bit technical if you have not worked with a model before.

My found 2-D Gaussian looks something like this: enter image description here

Combining these two things, let's: enter image description here

+1
source

I used the gausswin () function to create gaus. mask:

 Pic_usa_g = abs(1 - gausswin( size(Pic_usa,2) )); Pic_usa_g = Pic_usa_g + 0.6; Pic_usa_g = Pic_usa_g .* 2; Pic_usa_g = Pic_usa_g'; C = repmat(Pic_usa_g, size(Pic_usa,1),1); 

G_mask

and after multiplying the image with the mask you get a fixed image.

Res

0
source

All Articles