Feature #2536

Type for binary encoded/compressed Images

Added by V. Richter almost 8 years ago. Updated almost 8 years ago.

Status:ResolvedStart date:04/25/2016
Priority:NormalDue date:
Assignee:J. Moringen% Done:

100%

Category:Type Proposal
Target version:Robotics Service Bus - rsb-0.15

Description

Because it is not always feasible to send uncompressed binary
images an image type for encoded/compressed images could be useful.

One proposal with typical image file formats could be:

package rst.vision;

option java_outer_classname = "EncodedImageType";

/**
 * An image encoded in a certain format.
 *
 * @author Viktor Richter <vrichter@techfak.uni-bielefeld.de>
 */
message EncodedImage {

    /**
     * Identifies an image encoding format.
     */
    enum Encoding {
        BMP = 0;
        PPM = 1;
        PNG = 2;
        JPG = 3;
        JP2 = 4;
        TIFF = 5;
    }

    /**
     * The encoding used to encode an image into binary data.
     */
    required Encoding encoding = 2;

    /**
     * Holds the binary image data.
     *
     * Can be decoded using the provided encoding information.
     */
    required bytes data = 1;

}

Associated revisions

Revision cd9344d3
Added by V. Richter almost 8 years ago

Added EncodedImage type in proto/sandbox/rst/vision/EncodedImage.proto

fixes #2536

  • proto/sandbox/rst/vision/EncodedImage.proto: new file; EncodedImage
    type

Signed-off-by: Jan Moringen <>

History

#1 Updated by J. Moringen almost 8 years ago

  • Status changed from New to Feedback
  • Target version set to rsb-0.14

This is a sane design choice.

There may be another valid design: When I thought about a similar type, I considered adding an ImageDimensions or ImageFormat type describing things like width, height, channels, … and using it for compressed and maybe at some point raw images. Of course, this information is available from data, but not without decoding.

What do you think?

#2 Updated by V. Richter almost 8 years ago

J. Moringen wrote:

There may be another valid design: When I thought about a similar type, I considered adding an ImageDimensions or ImageFormat type describing things like width, height, channels, … and using it for compressed and maybe at some point raw images. Of course, this information is available from data, but not without decoding.

I do not have a problem with the resulting redundancy when adding ImageDimension information to this type (the encoding information already is redundant because it should be encoded in the magic number in the data field).

ImageDimension seems pretty straight forward:

What would the definition of an ImageFormat type reflect? As I understand all other information in rst/vision/Image are encoding properties and mainly there to be able to decode the attached byte array.

#3 Updated by J. Moringen almost 8 years ago

  • Target version changed from rsb-0.14 to rsb-0.15

#4 Updated by V. Richter almost 8 years ago

Is there anything I can do to further advance the inclusion of this type?

#5 Updated by J. Moringen almost 8 years ago

V. Richter wrote:

Is there anything I can do to further advance the inclusion of this type?

Can you provide one-sentence descriptions of the enum values? For example, JP2 is not immediately clear to me. Also, maybe remove BMP to not encourage encoding uncompressed images via this type.

#6 Updated by J. Moringen almost 8 years ago

  • Assignee set to J. Moringen

#7 Updated by V. Richter almost 8 years ago

I added documentation to the enum elements and removed bmp.

#8 Updated by J. Moringen almost 8 years ago

V. Richter wrote:

I added documentation to the enum elements and removed bmp.

LGTM, thanks.

#9 Updated by V. Richter almost 8 years ago

  • Status changed from Feedback to Resolved
  • % Done changed from 0 to 100

Also available in: Atom PDF