【OpenCV学习】brg转换hsv函数
作者:gnuhpc
出处:http://www.cnblogs.com/gnuhpc/
/* Converts a BGR image to HSV colorspace @param bgr image to be converted @return Returns bgr converted to a 3-channel, 32-bit HSV image with S and V values in the range [0,1] and H value in the range [0,360] */ IplImage* bgr2hsv( IplImage* bgr ) { IplImage* bgr32f, * hsv; bgr32f = cvCreateImage( cvGetSize(bgr), IPL_DEPTH_32F, 3 ); hsv = cvCreateImage( cvGetSize(bgr), IPL_DEPTH_32F, 3 ); cvConvertScale( bgr, bgr32f, 1.0 / 255.0, 0 ); cvCvtColor( bgr32f, hsv, CV_BGR2HSV ); cvReleaseImage( &bgr32f ); return hsv; }
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步