Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How to encode 2 images with exactly same jpeg headers in OpenCV?

Hi, I'm pretty new to opencv and image processing, so please forgive me if im asking something really silly. I would like to know if there is a way to encode multiple images in Jpeg in some way that they have the same header as a result.

Basically I'm trying to send a image block by block after splitting it first. And it would be very convenient if they all share the same header so i dont need to send them multiple times. These blocks of the image have the same size, color depth and components for sure. And I assume that as long as I can specify the Huffman and Quantization tables they use, they would end up with the same header?

Or maybe I should encode the whole image first and then send parts of its data according to my splitting? So they would automatically be using the same DHT and DQT. But then is there anything else in the header that I need to mess around with if I do it this way like the image size part of header?

How to encode 2 jpeg images with exactly same jpeg headers huffman and quantization tables in OpenCV?

Hi, I'm pretty new to opencv and image processing, so please forgive me if im asking something really silly. silly.

I would like to know if there is a way its possible to tell the encoder to use certain huffman table and quantization table when encoding jpeg, so that I can encode multiple images in Jpeg in some way that they have the (of same header as a result.size, component, etc.) with their headers interchangeable.

Basically I'm trying to send a image block by block after splitting it first. And it would be very convenient if they all share the same header so i dont need to send them multiple times. These blocks of the image have the same size, color depth and components for sure. And I assume that as long as I can specify the Huffman and Quantization tables they use, they would end up with the same header?

Or maybe I should encode the whole image first and then send parts of its data according to my splitting? So they would automatically be using the same DHT and DQT. But then is there anything else in the header that I need to mess around with if I do it this way like the image size part of header?

How to encode jpeg images with same huffman and quantization tables in OpenCV?

Hi, I'm pretty new to opencv and image processing, so please forgive me if im asking something really silly.

I would like to know if its possible to tell the encoder to use certain huffman table and quantization table when encoding jpeg, so that I can encode multiple images (of same size, component, etc.) with their headers interchangeable.

Basically I'm trying to send a image block by block after splitting it first. And it would be very convenient if they all share the same header so i dont need to send them multiple times. These blocks of the image have the same size, color depth and components for sure. And I assume that as long as I can specify the Huffman and Quantization tables they use, they would end up with the same header?

*Edit: *

I cant simply put the images in a single Mat and encode them as 1 big image, because whether or not to send the next one depends on the result of the previous image sent. So I have to send them separately.

How to encode jpeg images with same huffman and quantization tables in OpenCV?

Hi, I'm pretty new to opencv and image processing, so please forgive me if im asking something really silly.

I would like to know if its possible to tell the encoder to use certain huffman table and quantization table when encoding jpeg, so that I can encode multiple images (of same size, component, etc.) with their headers interchangeable.

Basically I'm trying to send a image block by block after splitting it first. And it would be very convenient if they all share the same header so i dont need to send them multiple times. These blocks of the image have the same size, color depth and components for sure. And I assume that as long as I can specify the Huffman and Quantization tables they use, they would end up with the same header?

*Edit: *

  • Edit: I cant simply put the images in a single Mat and encode them as 1 big image, because whether or not to send the next one depends on the result of the previous image sent. So I have to send them separately.

How to encode jpeg images with same huffman and quantization tables in OpenCV?

Hi, I'm pretty new to opencv and image processing, so please forgive me if im asking something really silly.

I would like to know if its possible to tell the encoder to use certain huffman table and quantization table when encoding jpeg, so that I can encode multiple images (of same size, component, etc.) with their headers interchangeable.

Basically I'm trying to send a image block by block after splitting it first. And it would be very convenient if they all share the same header so i dont need to send them multiple times. These blocks of the image have the same size, color depth and components for sure. And I assume that as long as I can specify the Huffman and Quantization tables they use, they would end up with the same header?

  • Edit: I cant simply put the images in a single Mat and encode them as 1 big image, because whether or not to send the next one depends on the result of the previous image sent. So I have to send them separately.