Ask Your Question
0

Saving High Quality Image

asked 2013-04-24 08:01:32 -0600

NightLife gravatar image

updated 2013-04-24 08:03:18 -0600

In my Android-OpenCV application, I am saving the Image with ".JPG" extention. they are 1056-by-704 and are acceptable but quality is not good and the image is not sharp enough for processing.

It is the format of saved matrix as image : Mat(height, width, CvType.CV_32FC4)

Can I save them with better quality? If no!! does anybody have idea to make the image more shorp with better quality?

Thanks

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
1

answered 2013-04-24 08:54:06 -0600

Rogeeeer gravatar image

JPEG is a lossy format, so even with 100 for CV_IMWRITE_JPEG_QUALITY the quality will decrease. Maybe you should try PNG instead which is lossless format and more logic when you have an alpha channel.

edit flag offensive delete link more

Comments

1

You are right, Thanks :)

NightLife gravatar imageNightLife ( 2013-04-24 09:02:11 -0600 )edit
0

answered 2013-04-24 09:09:35 -0600

zerog80 gravatar image

Are you setting the correct parameters for JPG compression while saving image? Regards to the second question, there is no better "quality" than the original image (i.e. no JPEG compression) ;) Any other processing (filtering, sharpening, histogram stretching) would "invent" pixels not exisiting in the original image... you may "perceive" better contrast or definition, but you are actually losing quality.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2013-04-24 08:01:32 -0600

Seen: 2,149 times

Last updated: Apr 24 '13