caffe-segnet icon indicating copy to clipboard operation
caffe-segnet copied to clipboard

processing 4-channel images

Open Pepslee opened this issue 9 years ago • 5 comments

Can SegNet process 4-channel ( or more channel ) images ? What i need to change in source code, to process more then 3 channel images ?

Pepslee avatar Jun 17 '16 09:06 Pepslee

Yes absolutely. However PNG images in general cannot handle n-channel tensors. You will need to use another layer to input data. One option might be to arrange your data into an LMDB dataset and use the standard caffe data layer. Or you could modify the dense image data layer to support this.

alexgkendall avatar Jun 17 '16 11:06 alexgkendall

Why can't I use 4-channel .png image, or 4-channel .tif image ? Opencv imread can open 4-channel image, using CV_LOAD_UNCHANGED flag.

Pepslee avatar Jun 20 '16 07:06 Pepslee

Sure, you could do that. You'd need to make some changes to the dense_image_data_layer

alexgkendall avatar Jun 20 '16 08:06 alexgkendall

Hi, @alexgkendall, I would like to try RGBD data on SegNet, I followed your suggestions and created a lmdb database for RGBD, and a lmdb database for label. In the original SegNet, the data is first pasted into the NORM layer. My questions is that do I still pass the RGBD to the NORM layer? Thanks.

leihamilton avatar Jul 13 '16 12:07 leihamilton

Hi, alexgkendall , you said, that to process 4-channel images, I need to make some changes to the dense_image_data_layer. I made some changes to the ReadImageToCVMat function, to provide 4-channel image loading. But I have some strenge result , there are some vertical lines on the output mask. These vertical lines appear every 4 pixels, ie problem for the 4-th channel. Would I need to make some changes in the upsample_layer or in the compute_bn_statistic_py code ?????

Pepslee avatar Jul 15 '16 15:07 Pepslee