How to histogram equilize an image?
1 次查看(过去 30 天)
显示 更早的评论
Suppose i have a set of face images I1,I2, ,IM ,size of each image being LxL,in the training set.Now how to histogram equalize all the images and represent them as row vectors of size L^2 (i mean L to the power 2)each...
0 个评论
回答(1 个)
Sean de Wolski
2012-2-24
doc histeq
doc reshape
2 个评论
Jurgen
2012-11-15
编辑:Jurgen
2012-11-15
Your error is because the matrix you want to equalize is not 2D. Im assuming its an RGB image. Either equalize all color channels separately (dangerous) or convert to a difference colorspace.
If you convert to e.g. L*a*b* or YCbCr you only need to equalize the luma channel, and then convert back again to RGB.
Note you can not represent an LxL RGB image as a vector of length L^2 without resorting to:
- throwing away data (e.g. color)
- indexing or some other form of encoding.This is because your RGB image contains LxLx3 elements.
Suppose you convert to grayscale then it is possible by using reshape or just J(:). To avoid columnwise dumping transpose first (permute for N-Dim.) e.g. (J = J').
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Image Filtering and Enhancement 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!