I'm implementing a CNN with Theano. In the paper, I have to do this image preprocess before train the CNN
We extracted RGB patches of 61x61 dimensions associated with each poselet activation, subtracted the mean and used this data to train the convnet model shown in Table 1
Can you tell me what does it mean with "subtracted the mean"? Tell me if these steps are correct (it is what I understood) 1) Compute the mean for Red Channel, Green Channel and Blue Channel for the whole image 2) For each pixel, subtract from red value the mean of red channel, from green value the mean of green channel and the same for the blue channel 3) Is it correct to have negative value or do I have use the abs?
Thanks all!!
Image subtraction or pixel subtraction is a process whereby the digital numeric value of one pixel or whole image is subtracted from another image. This is primarily done for one of two reasons – levelling uneven sections of an image such as half an image having a shadow on it, or detecting changes between two images.
mean: simply divide the sum of pixel values by the total count - number of pixels in the dataset computed as len(df) * image_size * image_size.
While image averaging is usually utilized for noise reduction, image subtraction can be employed to mitigate the effect of uneven illuminance. Moreover, we'll see that image subtraction allows us to compare images and detect changes.
Mean image is an image where i,j,c pixel is an average of i,j,c pixels from all images. So you take a mean separately for each position and each color channel. It requires all images to have the same size of course, otherwise it is not defined.
You should read paper carefully, but what is the most probable is that they mean mean of the patches, so you have N
matrices 61x61
pixels, which is equivalent of a vector of length 61^2
(if there are three channels then 3*61^2
). What they do - they simple compute mean of each dimension, so they calculate mean over these N
vectors in respect to each of the 3*61^2
dimensions. As the result they obtain a mean vector of length 3*61^2
(or mean matrix/mean patch if you prefer) and they substract it from all of these N
patches. Resulting patches will have negatives values, it is perfectly fine, you should not take abs value, neural networks prefer this kind of data.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With