Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Improve image quality

I need to improve image quality, from low quality to high hd quality. I am using OpenCV libraries. I experimented a lot with GaussianBlur(), Laplacian(), transformation functions, filter functions etc, but all I could succeed is to convert image to hd resolution and keep the same quality. Is it possible to do this? Do I need to implement my own algorithm or is there a way how it's done? I will really appreciate any kind of help. Thanks in advance.

like image 532
Lazar Avatar asked Jun 24 '26 03:06

Lazar


1 Answers

I used this link for my reference. It has other interesting filters that you can play with.

If you are using C++:

detailEnhance(Mat src, Mat dst, float sigma_s=10, float sigma_r=0.15f)

If you are using python:

dst = cv2.detailEnhance(src, sigma_s=10, sigma_r=0.15)

The variable 'sigma_s' determines how big the neighbourhood of pixels must be to perform filtering.

The variable 'sigma_r' determines how the different colours within the neighbourhood of pixels will be averaged with each other. Its range is from: 0 - 1. A smaller value means similar colors will be averaged out while different colors remain as they are.

Since you are looking for sharpness in the image, I would suggest you keep the kernel as minimum as possible.

Here is the result I obtained for a sample image:

1. Original image:

enter image description here

2. Sharpened image for lower sigma_r value:

enter image description here

3. Sharpened image for higher sigma_r value:

enter image description here

Check the above mentioned link for more information.

like image 83
Jeru Luke Avatar answered Jun 28 '26 06:06

Jeru Luke



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!