4

In my Caffe 'train.prototxt' I'm doing some input data transformation, like this:

  transform_param {
    mirror: true
    crop_size: 321
    mean_value: 104 # Red ?
    mean_value: 116 # Blue ? 
    mean_value: 122 # Green ? 
  }

Now I want to store a modified version of my input images such that certain image regions are set to those mean values. The rational is that those regions are then set to 0 during mean subtraction. However I don't know what the order of channels is that caffe expects in such a prototxt file and I couldn't look it up in the caffe code either.
Does someone now whether the 3 values given above are in RGB or BGR order?

(I'm not sure since caffe is using opencv internally which stores images in the unusual BGR format)

Shai
  • 93,148
  • 34
  • 197
  • 325
mcExchange
  • 4,998
  • 12
  • 43
  • 81

1 Answers1

6

https://groups.google.com/forum/#!topic/caffe-users/9opH6AW3Irw (answer by Evan Shelhamer):

[Mean] values are BGR for historical reasons -- the original CaffeNet training lmdb was made with image processing by OpenCV which defaults to BGR order.

Franck Dernoncourt
  • 62,576
  • 61
  • 286
  • 446