Main Page | Report this Page
 
   
Science Forum Index  »  Image Processing Forum  »  Improving the quality of a blocky image...
Page 1 of 2    Goto page 1, 2  Next
Author Message
AJ...
Posted: Mon Jun 09, 2008 1:38 am
Guest
Hi All,

I have an image which is very blocky (image can be seen at
http://img222.imageshack.us/my.php?image=degradedimagesh2.png ) and
would like to try and improve it's quality as much as possible.

I understand that the image is of such a poor quality that I do not
expect any huge improvements - that is not my aim, my aim is to see if
it can be improved at all, and if so, which method(s) could yield the
best results.

So far I have tried some iterative restoration techniques such as
Richardson-Lucy deconvolution and Blind deconvolution - both have
proved to give a slight improvement.

I was hoping someone would have some other suggestions as to how I
could possibly improve the image.

Just in case understanding how the image was degraded in the first
place might help lead to a good suggestion for improvement algorithms,
I created the image using the following steps:

* 8x8 Sub-Block and DCT image
* store top 2 coefficients from each sub-block
* use these to create a new image

Many thanks,

AJ
illywhacker...
Posted: Mon Jun 09, 2008 3:02 am
Guest
On Jun 9, 1:38 pm, AJ <arandal... at (no spam) gmail.com> wrote:
Quote:
Hi All,

I have an image which is very blocky (image can be seen athttp://img222.imageshack.us/my.php?image=degradedimagesh2.png) and
would like to try and improve it's quality as much as possible.

I understand that the image is of such a poor quality that I do not
expect any huge improvements - that is not my aim, my aim is to see if
it can be improved at all, and if so, which method(s) could yield the
best results.

So far I have tried some iterative restoration techniques such as
Richardson-Lucy deconvolution and Blind deconvolution - both have
proved to give a slight improvement.

I was hoping someone would have some other suggestions as to how I
could possibly improve the image.

Just in case understanding how the image was degraded in the first
place might help lead to a good suggestion for improvement algorithms,
I created the image using the following steps:

* 8x8 Sub-Block and DCT image
* store top 2 coefficients from each sub-block
* use these to create a new image

This is certainly a homework problem, and I was disposed to help you,
but then all those pop-ups came up...

illywhacker;
AJ...
Posted: Mon Jun 09, 2008 5:38 am
Guest
On Jun 9, 2:13 pm, bugbear <bugbear at (no spam) trim_papermule.co.uk_trim> wrote:
Quote:
illywhacker wrote:
This is certainly a homework problem, and I was disposed to help you,
but then all those pop-ups came up...

Perhaps the OP should use photobucket.

Very nice hosting IMHO.

Arbitrary link sample:

http://i48.photobucket.com/albums/f234/bugbear33/wdibb.jpg

BugBear

Apologies for the poor choice of image hosting, I simply Googled for
"free image hosting" and took the first link!

I have uploaded the image again, using Photobucket as suggested -
http://i287.photobucket.com/albums/ll146/arandall85/degraded_image.png
Hopefully now you may be more willing to take a look :)

P.S Not quite homework, I'm had some ideas for how I can add to my MSc
Dissertation, but require some knowledge outside of the resources
currently available to get me there, hence hoping to be able to pick
the group members brains!

Many thanks in advance for any guidance/suggestions you may have,

AJ
aruzinsky...
Posted: Mon Jun 09, 2008 6:49 am
Guest
On Jun 9, 5:38 am, AJ <arandal... at (no spam) gmail.com> wrote:
Quote:
Hi All,

I have an image which is very blocky (image can be seen athttp://img222.imageshack.us/my.php?image=degradedimagesh2.png) and
would like to try and improve it's quality as much as possible.

I understand that the image is of such a poor quality that I do not
expect any huge improvements - that is not my aim, my aim is to see if
it can be improved at all, and if so, which method(s) could yield the
best results.

So far I have tried some iterative restoration techniques such as
Richardson-Lucy deconvolution and Blind deconvolution - both have
proved to give a slight improvement.

I was hoping someone would have some other suggestions as to how I
could possibly improve the image.

Just in case understanding how the image was degraded in the first
place might help lead to a good suggestion for improvement algorithms,
I created the image using the following steps:

* 8x8 Sub-Block and DCT image
* store top 2 coefficients from each sub-block
* use these to create a new image

Many thanks,

AJ

Is this an improvement?:

http://www.general-cathexis.com/images/degradedimagesh2_2.png

I modeled your image as an 8X nearest neighbor (box) enlargement in
both horizontal and vertical directions. All variation within a block
is horizontal. In other words, the box model is exact only in the
vertical direction. I reduced 0.125 X using box kernel and then
enlarged 8X using a proprietary nonlinear enlargement method available
in SAR Image Processor.
AJ...
Posted: Mon Jun 09, 2008 7:07 am
Guest
On Jun 9, 5:36 pm, Martin Brown <|||newspam... at (no spam) nezumi.demon.co.uk>
wrote:
Quote:
AJ wrote:
Hi All,

I have an image which is very blocky (image can be seen at
http://img222.imageshack.us/my.php?image=degradedimagesh2.png) and
would like to try and improve it's quality as much as possible.

I understand that the image is of such a poor quality that I do not
expect any huge improvements - that is not my aim, my aim is to see if
it can be improved at all, and if so, which method(s) could yield the
best results.

So far I have tried some iterative restoration techniques such as
Richardson-Lucy deconvolution and Blind deconvolution - both have
proved to give a slight improvement.

I was hoping someone would have some other suggestions as to how I
could possibly improve the image.

You could play the match boundary continuity game with a cosmetic
enhancement. I think the IJG codec can be persuaded to do this with
suitable options.



Just in case understanding how the image was degraded in the first
place might help lead to a good suggestion for improvement algorithms,
I created the image using the following steps:

* 8x8 Sub-Block and DCT image
* store top 2 coefficients from each sub-block
* use these to create a new image

So your reconstruction is from DC and lowest frequency horizontal
component only? I don't think you can do much starting from there.

Taking a subset square of low frequency coefficients around the DC
component would give you a classic undersampling problem. eg 2x2 or 3x3
measured components. But unless the reconstructed image clips against 0
or 255 you don't get much by way of clues to regain resolution lost by
the downsampling. And your test image is well clear of either.

A simple field of white dots on a pure black ground would give you a
test image where you might stand a better chance of success.

In an ideal world maxent or another optimised nonlinear reconstruction
might hope to extrapolate resolution to 3x the highest measured
frequency for regions with the best signal to noise.

Regards,
Martin Brown
** Posted fromhttp://www.teranews.com**

Thanks for the reply.

Could you elaborate on the "match boundary continuity game" for the
IJG codec. I had a search but couldn't find any useful information.

Many thanks
AJ...
Posted: Mon Jun 09, 2008 7:57 am
Guest
On Jun 9, 5:49 pm, aruzinsky <aruzin... at (no spam) general-cathexis.com> wrote:
Quote:
On Jun 9, 5:38 am, AJ <arandal... at (no spam) gmail.com> wrote:



Hi All,

I have an image which is very blocky (image can be seen athttp://img222.imageshack.us/my.php?image=degradedimagesh2.png) and
would like to try and improve it's quality as much as possible.

I understand that the image is of such a poor quality that I do not
expect any huge improvements - that is not my aim, my aim is to see if
it can be improved at all, and if so, which method(s) could yield the
best results.

So far I have tried some iterative restoration techniques such as
Richardson-Lucy deconvolution and Blind deconvolution - both have
proved to give a slight improvement.

I was hoping someone would have some other suggestions as to how I
could possibly improve the image.

Just in case understanding how the image was degraded in the first
place might help lead to a good suggestion for improvement algorithms,
I created the image using the following steps:

* 8x8 Sub-Block and DCT image
* store top 2 coefficients from each sub-block
* use these to create a new image

Many thanks,

AJ

Is this an improvement?:

http://www.general-cathexis.com/images/degradedimagesh2_2.png

I modeled your image as an 8X nearest neighbor (box) enlargement in
both horizontal and vertical directions. All variation within a block
is horizontal. In other words, the box model is exact only in the
vertical direction. I reduced 0.125 X using box kernel and then
enlarged 8X using a proprietary nonlinear enlargement method available
in SAR Image Processor.

I'm impressed! The edges are very crisp, much better than I am
currently getting. Thank you for going to the effort of experimenting
with it and uploading your results.

It would be great if I could use my results (iterative restoration and
interpolation) and then apply your technique to edges, as I think that
the "inner" details such as the face look quite good with my
restoration technique, and the edges of the image look much better
with yours.

I would be really grateful if you could expand on the process you took
to achieve this image, such as the "8X nearest neighbor (box)
enlargement". Did you implement this in Matlab? I'm not sure what
you mean by this...is it a filter you have applied?

Many thanks
bugbear...
Posted: Mon Jun 09, 2008 8:13 am
Guest
illywhacker wrote:
Quote:
This is certainly a homework problem, and I was disposed to help you,
but then all those pop-ups came up...

Perhaps the OP should use photobucket.

Very nice hosting IMHO.

Arbitrary link sample:

http://i48.photobucket.com/albums/f234/bugbear33/wdibb.jpg

BugBear
aruzinsky...
Posted: Mon Jun 09, 2008 11:30 am
Guest
Interspersed comments:

On Jun 9, 11:57 am, AJ <arandal... at (no spam) gmail.com> wrote:
Quote:

I'm impressed!  The edges are very crisp, much better than I am
currently getting.  Thank you for going to the effort of experimenting
with it and uploading your results.

It would be great if I could use my results (iterative restoration and
interpolation) and then apply your technique to edges, as I think that
the "inner" details such as the face look quite good with my
restoration technique, and the edges of the image look much better
with yours.


The edge preserving method is not post processing and is proprietary.

Quote:

I would be really grateful if you could expand on the process you took
to achieve this image, such as the "8X nearest neighbor (box)
enlargement".

http://en.wikipedia.org/wiki/Nearest_neighbor_interpolation

I didn't produce any box enlargement. I pretended that your image was
a box enlargement of a hypothetical image 1/8 its size. Thusly, only
for my convenience, I threw away all information contained in your DCT
coefficients above 0 frequency. With respect to reduction, an
interpolation kernel is typically expanded by a factor inversely
proportional to the scale. More specifically, the pixels in each of
your 8x8 blocks were simply averaged to produce one pixel in a reduced
image. Then that reduced image was enlarged by my proprietary method
which incorporates prior knowledge that the image was a box reduction.

Quote:
Did you implement this in Matlab?  I'm not sure what
you mean by this...is it a filter you have applied?


No, I implemented SAR Image Processor in C++. You can download a free
save disabled demo to play with. Google it.
Martin Brown...
Posted: Mon Jun 09, 2008 11:36 am
Guest
AJ wrote:
Quote:
Hi All,

I have an image which is very blocky (image can be seen at
http://img222.imageshack.us/my.php?image=degradedimagesh2.png ) and
would like to try and improve it's quality as much as possible.

I understand that the image is of such a poor quality that I do not
expect any huge improvements - that is not my aim, my aim is to see if
it can be improved at all, and if so, which method(s) could yield the
best results.

So far I have tried some iterative restoration techniques such as
Richardson-Lucy deconvolution and Blind deconvolution - both have
proved to give a slight improvement.

I was hoping someone would have some other suggestions as to how I
could possibly improve the image.

You could play the match boundary continuity game with a cosmetic
enhancement. I think the IJG codec can be persuaded to do this with
suitable options.
Quote:

Just in case understanding how the image was degraded in the first
place might help lead to a good suggestion for improvement algorithms,
I created the image using the following steps:

* 8x8 Sub-Block and DCT image
* store top 2 coefficients from each sub-block
* use these to create a new image

So your reconstruction is from DC and lowest frequency horizontal
component only? I don't think you can do much starting from there.

Taking a subset square of low frequency coefficients around the DC
component would give you a classic undersampling problem. eg 2x2 or 3x3
measured components. But unless the reconstructed image clips against 0
or 255 you don't get much by way of clues to regain resolution lost by
the downsampling. And your test image is well clear of either.

A simple field of white dots on a pure black ground would give you a
test image where you might stand a better chance of success.

In an ideal world maxent or another optimised nonlinear reconstruction
might hope to extrapolate resolution to 3x the highest measured
frequency for regions with the best signal to noise.

Regards,
Martin Brown
** Posted from http://www.teranews.com **
AJ...
Posted: Mon Jun 09, 2008 11:43 am
Guest
On Jun 9, 10:30 pm, aruzinsky <aruzin... at (no spam) general-cathexis.com> wrote:
Quote:
Interspersed comments:

On Jun 9, 11:57 am, AJ <arandal... at (no spam) gmail.com> wrote:



I'm impressed! The edges are very crisp, much better than I am
currently getting. Thank you for going to the effort of experimenting
with it and uploading your results.

It would be great if I could use my results (iterative restoration and
interpolation) and then apply your technique to edges, as I think that
the "inner" details such as the face look quite good with my
restoration technique, and the edges of the image look much better
with yours.

The edge preserving method is not post processing and is proprietary.



I would be really grateful if you could expand on the process you took
to achieve this image, such as the "8X nearest neighbor (box)
enlargement".

http://en.wikipedia.org/wiki/Nearest_neighbor_interpolation

I didn't produce any box enlargement. I pretended that your image was
a box enlargement of a hypothetical image 1/8 its size. Thusly, only
for my convenience, I threw away all information contained in your DCT
coefficients above 0 frequency. With respect to reduction, an
interpolation kernel is typically expanded by a factor inversely
proportional to the scale. More specifically, the pixels in each of
your 8x8 blocks were simply averaged to produce one pixel in a reduced
image. Then that reduced image was enlarged by my proprietary method
which incorporates prior knowledge that the image was a box reduction.

Did you implement this in Matlab? I'm not sure what
you mean by this...is it a filter you have applied?

No, I implemented SAR Image Processor in C++. You can download a free
save disabled demo to play with. Google it.

Thanks for your reply.

I did find SAR Image Processor after I had responded to your last
message. However, I am running a Linux OS so unfortunately cannot run
it.

I did however use interpolation to improve the quality of my image, so
thank you for that suggestion. I have uploaded my "best" attempt at
restoring the image, and it can be seen at:

http://i287.photobucket.com/albums/ll146/arandall85/interpolated_iterated_image.png

To get to this point, I have used blind deconvolution, and then
interpolated the result. I'm quite happy with this outcome, although
it is a little blurry. What do you all think?

Ideally, I would like to "fix" the edges in some way, as they are
still a bit blocky, and I would like to sharpen the whole image
slightly - but I think I may be hoping for a bit too much! ;)

If anyone has any further suggestions to improve this image, I would
be really grateful. Nearly there...

Kind regards,

AJ
aruzinsky...
Posted: Mon Jun 09, 2008 6:04 pm
Guest
On Jun 9, 5:43 pm, AJ <arandal... at (no spam) gmail.com> wrote:
Quote:
On Jun 9, 10:30 pm, aruzinsky <aruzin... at (no spam) general-cathexis.com> wrote:





Interspersed comments:

On Jun 9, 11:57 am, AJ <arandal... at (no spam) gmail.com> wrote:

I'm impressed!  The edges are very crisp, much better than I am
currently getting.  Thank you for going to the effort of experimenting
with it and uploading your results.

It would be great if I could use my results (iterative restoration and
interpolation) and then apply your technique to edges, as I think that
the "inner" details such as the face look quite good with my
restoration technique, and the edges of the image look much better
with yours.

The edge preserving method is not post processing and is proprietary.

I would be really grateful if you could expand on the process you took
to achieve this image, such as the "8X nearest neighbor (box)
enlargement".

http://en.wikipedia.org/wiki/Nearest_neighbor_interpolation

I didn't produce any box enlargement.  I pretended that your image was
a box enlargement of a hypothetical image 1/8 its size.   Thusly, only
for my convenience, I threw away all information contained in your DCT
coefficients above 0 frequency.  With respect to reduction, an
interpolation kernel is typically expanded by a factor inversely
proportional to the scale.  More specifically, the pixels in each of
your 8x8 blocks were simply averaged to produce one pixel in a reduced
image.  Then that reduced image was enlarged by my proprietary method
which incorporates prior knowledge that the image was a box reduction.

Did you implement this in Matlab?  I'm not sure what
you mean by this...is it a filter you have applied?

No, I implemented SAR Image Processor in C++.  You can download a free
save disabled demo to play with.  Google it.

Thanks for your reply.

I did find SAR Image Processor after I had responded to your last
message.  However, I am running a Linux OS so unfortunately cannot run
it.

I did however use interpolation to improve the quality of my image, so
thank you for that suggestion.  I have uploaded my "best" attempt at
restoring the image, and it can be seen at:

http://i287.photobucket.com/albums/ll146/arandall85/interpolated_iter...

To get to this point, I have used blind deconvolution, and then
interpolated the result.  I'm quite happy with this outcome, although
it is a little blurry.  What do you all think?

Ideally, I would like to "fix" the edges in some way, as they are
still a bit blocky, and I would like to sharpen the whole image
slightly - but I think I may be hoping for a bit too much! ;)

If anyone has any further suggestions to improve this image, I would
be really grateful.  Nearly there...

Kind regards,

AJ- Hide quoted text -

- Show quoted text -

But, although similar, this is not a deconvolution problem. Like
convolution, you have a linear transformation which can be put in
matrix form,

Ax = y

and you want to estimate x from y, but, unlike convolution, most of
the eigenvalues of A are zero and (I am uncertain so check me) A is
idempotent, i.e., A^2 = A. In low rank cases, it is generally good
practice to constrain a solution, x', so that Ax' = y. I checked your
result and it violates this constraint because the averages of the 8x8
blocks in your result are not equal to those of your input image. If
you check my result, you will see that the averages are equal to those
of the input image. You also want the non-zero frequency DCT
coefficients for the results to equal those of your input image,
which, of course, my result violated.

As an experiment, I added the non-zero frequency DCT components to my
previous result and got,

http://www.general-cathexis.com/images/degradedimagesh2_3.png

, which is one of an infinite number of possible solutions, x', for
Ax' = y.
...
Posted: Tue Jun 10, 2008 2:47 am
Guest
My result
http://i287.photobucket.com/albums/ll123/ememek/r23.png

It's done with Gimp. Final result given by dissolve of two images r2.png and
r3.png (in above folder).

Exact procedure forgotten - all done empirically:(
As I remeber:

r3: steps:
- downsample to 512x64
- upsample to 1536x1536
- GREYCstoration filter
- Smart sharpen

r2 steps:
- custom convolution matrix (more smooth in vertical direction) used until
blocks dissapear (I think it was about 10 convolutions)
- I'm not sure if a little "Smart sharpen" was in use.
Martin Brown...
Posted: Tue Jun 10, 2008 3:46 am
Guest
aruzinsky wrote:
Quote:
On Jun 9, 5:43 pm, AJ <arandal... at (no spam) gmail.com> wrote:

http://i287.photobucket.com/albums/ll146/arandall85/interpolated_iter...

To get to this point, I have used blind deconvolution, and then
interpolated the result. I'm quite happy with this outcome, although
it is a little blurry. What do you all think?

Ideally, I would like to "fix" the edges in some way, as they are
still a bit blocky, and I would like to sharpen the whole image
slightly - but I think I may be hoping for a bit too much! ;)

If anyone has any further suggestions to improve this image, I would
be really grateful. Nearly there...

One cheeky trick you could do is exploit the redundancy in the image you
have been given (or have you been given the masked DCT?). By
construction the blocky image consists of sets of 8 identical rows. If
you downsample by throwing away 7 out of 8 rows you get a cleaner
problem to solve and can interpolate back up again in the vertical
dimension later. You have only really got two independent numbers in the
horizontal direction too so you could apply a similar trick there.
Quote:

Kind regards,

AJ- Hide quoted text -

- Show quoted text -

But, although similar, this is not a deconvolution problem. Like
convolution, you have a linear transformation which can be put in
matrix form,

Ax = y

One part of the problem is a pure deconvolution but with a lot of
missing data. Every individual 8x8 block has been DCTd and then masked.
Multiplication in the DCT domain is equivalent to convolution in real
space. The thing is that for every 64 image numbers input you only get
two numbers out. All the other eigenvalues are zero.

So the deconvolution will be strongly dependent on any prior knowledge
incorporated through the choice of regularising function.

There is then a secondary problem that each 8x8 block is absolutely
independent of all the others as far as the matrix setup for encoding
(and decoding) is concerned. Fixing this up is the subject of a whole
bunch of patents. Various commercial codecs have proprietory solutions.

The 8x8 block boundary discontinuity is often very obvious as a result.
Have a look at the JPEG std K.8 or in IJG code jdcoefct.c under
BLOCK_SMOOTHING_SUPPORTED for one approach.

Quote:
and you want to estimate x from y, but, unlike convolution, most of
the eigenvalues of A are zero and (I am uncertain so check me) A is
idempotent, i.e., A^2 = A. In low rank cases, it is generally good
practice to constrain a solution, x', so that Ax' = y. I checked your
result and it violates this constraint because the averages of the 8x8
blocks in your result are not equal to those of your input image.

You shouldn't expect them to be exactly equal. That is overconstrained.
The best you can hope for is that the DC and First AC component (which
is all he has) computed from the model image are on average within half
the quantisation error of the JPEG encoding in a least squares test.

Regards,
Martin Brown
** Posted from http://www.teranews.com **
aruzinsky...
Posted: Tue Jun 10, 2008 5:04 am
Guest
On Jun 9, 10:04 pm, aruzinsky <aruzin... at (no spam) general-cathexis.com> wrote:
Quote:
...
http://www.general-cathexis.com/images/degradedimagesh2_3.png

, which is one of an infinite number of possible solutions, x', for
Ax' = y.- Hide quoted text -

- Show quoted text -

That last part is wrong or, at best, right by accident.
aruzinsky...
Posted: Tue Jun 10, 2008 6:49 am
Guest
On Jun 10, 2:46 am, Martin Brown <|||newspam... at (no spam) nezumi.demon.co.uk>
wrote:
Quote:

and you want to estimate x from y, but, unlike convolution, most of
the eigenvalues of A are zero and (I am uncertain so check me) A is
idempotent, i.e., A^2 = A.   In low rank cases, it is generally good
practice to constrain a solution, x', so that Ax' = y.  I checked your
result and it violates this constraint because the averages of the 8x8
blocks in your result are not equal to those of your input image.

You shouldn't expect them to be exactly equal.

I didn't. For my result, the RMS of differences in block averages was
0.042 before 8 bit quantization and 0.29 after 8 bit quantization.
For the OP's result, the RMSE is 6.35. For engineers, that's equal
vs. unequal.

Quote:
That is overconstrained.

That is under-constrained.

Quote:
The best you can hope for is that the DC and First AC component (which
is all he has) computed from the model image are on average within half
the quantisation error of the JPEG encoding in a least squares test.


Who said it was JPEG encoding which uses gross quantization for lossy
compression? In the absence of an explicit statement of the OP that
it is JPEG encoding, it is reasonable to assume that the only
quantization error is 8 bit and, unless you examined the OP's PNG
format, for all you know, it could be 16 bit. Eight bit quantization
noise is invisible and computationally negligible in this case.
 
Page 1 of 2    Goto page 1, 2  Next   All times are GMT - 5 Hours
The time now is Thu Nov 20, 2008 7:08 pm