i have passed a lot of time searching on how to convert from cv::Mat or CvMat to CvArr but with no gain ,please help me in that,thanks.
Are you sure you want to convert it? sometimes there is equivalent function that use what you have. For example cvMorphologyEx is using CvArr but morphologyEx is using cv::Mat.
cvMorphologyEx
CvArr
morphologyEx
cv::Mat