I found the answer in this article: Effectively Using Won's MPEG-7 Histogram Descriptor.
My goal was to find the following ribs:

4 , :

5 :

, :
program SetEdgeType(max, m_nd, m_h, m_v, m_d_45, m_d_135)
{
if (max < TEdge) then EdgeHisto(0)++
else
{
if (m_nd > T0) then EdgeHisto(1)++
if (m_h > T1) then EdgeHisto(2)++
if (m_v > T1) then EdgeHisto(3)++
if (m_d_45 > T2) then EdgeHisto(4)++
if (m_d_135 > T2) then EdgeHisto(5)++
}
endif
return(EdgeHisto)
}
. : TEdge = 14, T0 = 0,68, T1 = T2 = 0,98.