0

So, I am sending gray jpg images over a network. I compress them in memory using jpge: https://code.google.com/p/jpeg-compressor/, and then pass them over the network. When I go to display them using opencv or write them to file, I get the same problem:

The first image is being captured and displayed, and then only a small upper section of every image after that is being displayed. Based on my intuition and debugging: normally, a 100 x 100 gray pixel image would be a 100 * 100 = 10000 bytes. After jpg compression, it is much less (depending on the quality I set it to), so let's say it is then 5000 bytes after compression, it then updates half the image.

Any idea why this is happening?

Also, it is weird because the first image is displayed in it's entirety, but the top area that does change is slightly lighter gray.

Jomnipotent17
  • 451
  • 7
  • 23
  • What are you using to decompress the image before you display it? – Mark Ransom Mar 11 '13 at 22:50
  • I am not decompressing it, I guess that is my problem then. I thought that I could write it in compressed jpg form, and a program like 'eog' would know how to read it. I am mostly interested in saving as much space as possible for sending it over the network, that is why I am compressing it in the first place. – Jomnipotent17 Mar 11 '13 at 22:56
  • So, I tried using imencode with opencv, and then imdecode. I am still having the same problem though even after the imdecode. – Jomnipotent17 Mar 12 '13 at 00:49

0 Answers0