diff --git a/src/PBBiology/include/PBImageProcess.h b/src/PBBiology/include/PBImageProcess.h index 5c8ba53..5e95fb8 100644 --- a/src/PBBiology/include/PBImageProcess.h +++ b/src/PBBiology/include/PBImageProcess.h @@ -10,28 +10,28 @@ using namespace std; using namespace cv; -//生长函数 +//鐢熼暱鍑芥暟 int RegionGrow(cv::Mat& src, cv::Mat& matDst, cv::Point2i pt, int th); -//最小二乘法取圆 +//鏈灏忎簩涔樻硶鍙栧渾 void FitCircleCenter(vector& Circle_Data, Point2f& Circle_Center, float& Circle_R); -//最优最小二乘法取圆 +//鏈浼樻渶灏忎簩涔樻硶鍙栧渾 int RANSAC_FitCircleCenter(vector& Circle_Data, Point2f& Circle_Center, float& Circle_R, float thresh); -//生长最优最小二乘法取圆 +//鐢熼暱鏈浼樻渶灏忎簩涔樻硶鍙栧渾 void RANSAC_FitCircleCenter_with_throw(vector& Circle_Data, Point2f& Circle_Center, float& Circle_R); -//二值化阈值计算 +//浜屽煎寲闃堝艰绠 int IJIsoData(int* data); int defaultIsoData(int* data); -////根据mask渲染图像 -////src、mask:输入CV_16UC1图像 -////dst:输出CV_8UC3彩色图像 -////max、min:mask像素选择渲染的最大最小值 -////color:颜色类型 -////reverse:是否反转颜色 +////鏍规嵁mask娓叉煋鍥惧儚 +////src銆乵ask锛氳緭鍏V_16UC1鍥惧儚 +////dst锛氳緭鍑篊V_8UC3褰╄壊鍥惧儚 +////max銆乵in锛歮ask鍍忕礌閫夋嫨娓叉煋鐨勬渶澶ф渶灏忓 +////color锛氶鑹茬被鍨 +////reverse锛氭槸鍚﹀弽杞鑹 //int render_mask_image(Mat src, Mat mask, Mat dst, float max, float min, ColorTable color, bool reverse); // ///// -///// 融合两张图 +///// 铻嶅悎涓ゅ紶鍥 ///// ///// ///// @@ -40,41 +40,41 @@ int defaultIsoData(int* data); ///// //int blendImages(const Mat& src, const Mat& mark, const Mat& dst, double alpha); ////int render_image(Mat src, Mat& dst, float max, float min, ColorTable color, bool reverse); -////合成渲染图像,src是老鼠图,pseudoImg是光子渲染图,brightness_offset亮度,contrast_factor对比度,contrast_factor透明度,返回融合图 -////brightness_offset:亮度偏移范围 -255 到 +255 -////contrast_factor:对比度因子范围 0.1 到 3.0(1.0为不变) -////opacity_factor:透明度因子范围 0 到 1(0为透明,1为不透明) +////鍚堟垚娓叉煋鍥惧儚锛宻rc鏄侀紶鍥撅紝pseudoImg鏄厜瀛愭覆鏌撳浘锛宐rightness_offset浜害锛宑ontrast_factor瀵规瘮搴︼紝contrast_factor閫忔槑搴︼紝杩斿洖铻嶅悎鍥 +////brightness_offset:浜害鍋忕Щ鑼冨洿 -255 鍒 +255 +////contrast_factor:瀵规瘮搴﹀洜瀛愯寖鍥 0.1 鍒 3.0锛1.0涓轰笉鍙橈級 +////opacity_factor:閫忔槑搴﹀洜瀛愯寖鍥 0 鍒 1锛0涓洪忔槑锛1涓轰笉閫忔槑锛 //Mat render_mask_image(Mat src, Mat pseudoImg, int brightness_offset, double contrast_factor, double opacity_factor); -////获取颜色表,color颜色类型,bgr_tab是有空间的颜色表指针,reverse是否反转 +////鑾峰彇棰滆壊琛紝color棰滆壊绫诲瀷锛宐gr_tab鏄湁绌洪棿鐨勯鑹茶〃鎸囬拡锛宺everse鏄惁鍙嶈浆 //void get_bgr_tab(ColorTable color, uint8_t(*bgr_tab)[3], bool reverse); -////生产颜色表的直条图,w=200,h_color=10是一个颜色高,bgr_tab是有空间的颜色表指针 +////鐢熶骇棰滆壊琛ㄧ殑鐩存潯鍥撅紝w=200,h_color=10鏄竴涓鑹查珮锛宐gr_tab鏄湁绌洪棿鐨勯鑹茶〃鎸囬拡 //Mat bgr_tab_image(int w, int h_onecolor, uint8_t(*bgr_tab)[3]); //int pseudo_color_processing(Mat src, Mat dst, float max, float min, uint8_t(*bgr_tab)[3]); // -//// 获得选中区域的光子数 +//// 鑾峰緱閫変腑鍖哄煙鐨勫厜瀛愭暟 //PseudoInfo get_pseudo_info(Mat src,int x,int y,int w,int h,float max,float min); // //Mat bgr_scale_image(Mat src, float maxVal, float minVal); -//合成渲染图像,src是老鼠图,pseudoImg是光子渲染图,brightness_offset亮度,contrast_factor对比度,contrast_factor透明度,返回融合图 -//brightness_offset:亮度偏移范围 -255 到 +255 -//contrast_factor:对比度因子范围 0.1 到 3.0(1.0为不变) -//opacity_factor:透明度因子范围 0 到 1(0为透明,1为不透明) +//鍚堟垚娓叉煋鍥惧儚锛宻rc鏄侀紶鍥撅紝pseudoImg鏄厜瀛愭覆鏌撳浘锛宐rightness_offset浜害锛宑ontrast_factor瀵规瘮搴︼紝contrast_factor閫忔槑搴︼紝杩斿洖铻嶅悎鍥 +//brightness_offset:浜害鍋忕Щ鑼冨洿 -255 鍒 +255 +//contrast_factor:瀵规瘮搴﹀洜瀛愯寖鍥 0.1 鍒 3.0锛1.0涓轰笉鍙橈級 +//opacity_factor:閫忔槑搴﹀洜瀛愯寖鍥 0 鍒 1锛0涓洪忔槑锛1涓轰笉閫忔槑锛 Mat render_mask_image(Mat src, Mat pseudoImg, int brightness_offset, double contrast_factor, double opacity_factor); -//获取颜色表,color颜色类型,bgr_tab是有空间的颜色表指针,reverse是否反转 +//鑾峰彇棰滆壊琛紝color棰滆壊绫诲瀷锛宐gr_tab鏄湁绌洪棿鐨勯鑹茶〃鎸囬拡锛宺everse鏄惁鍙嶈浆 void get_bgr_tab(ColorTable color, uint8_t(*bgr_tab)[3], bool reverse); -//生产颜色表的直条图,w=200,h_color=10是一个颜色高,bgr_tab是有空间的颜色表指针 +//鐢熶骇棰滆壊琛ㄧ殑鐩存潯鍥撅紝w=200,h_color=10鏄竴涓鑹查珮锛宐gr_tab鏄湁绌洪棿鐨勯鑹茶〃鎸囬拡 Mat bgr_tab_image(int w, int h_onecolor, uint8_t(*bgr_tab)[3]); -//统计计算结果,src是输入图像,16bit的count图或者float的光子计算结果图都可以输入;mask是掩膜图;max和min是设定的大小 +//缁熻璁$畻缁撴灉锛宻rc鏄緭鍏ュ浘鍍忥紝16bit鐨刢ount鍥炬垨鑰協loat鐨勫厜瀛愯绠楃粨鏋滃浘閮藉彲浠ヨ緭鍏ワ紱mask鏄帺鑶滃浘锛沵ax鍜宮in鏄瀹氱殑澶у皬 PseudoInfo get_pseudo_info(Mat src, Mat mask, float max, float min); -//生成光子渲染图,src是渲染前图,dst是渲染后图,max和min是设定的大小,bgr_tab是有空间的颜色表指针 +//鐢熸垚鍏夊瓙娓叉煋鍥撅紝src鏄覆鏌撳墠鍥撅紝dst鏄覆鏌撳悗鍥撅紝max鍜宮in鏄瀹氱殑澶у皬锛宐gr_tab鏄湁绌洪棿鐨勯鑹茶〃鎸囬拡 int pseudo_color_processing(Mat src, Mat dst, float max, float min, uint8_t(*bgr_tab)[3]); -//生成带标尺的直条图,src是bgr_tab_image生成的图,maxVal和minVal是设定的大小,scientific_flag是否科学计数法 +//鐢熸垚甯︽爣灏虹殑鐩存潯鍥撅紝src鏄痓gr_tab_image鐢熸垚鐨勫浘锛宮axVal鍜宮inVal鏄瀹氱殑澶у皬锛宻cientific_flag鏄惁绉戝璁℃暟娉 Mat bgr_scale_image(Mat src, float maxVal, float minVal, int scientific_flag); -//获取光子计算图,src输入渲染前原始图,sec是拍摄秒数,Wcm=27是实际宽,Hcm=18是实际高,sr是默认1.0;返回CV_32FC1的浮点光子结果图 +//鑾峰彇鍏夊瓙璁$畻鍥撅紝src杈撳叆娓叉煋鍓嶅師濮嬪浘锛宻ec鏄媿鎽勭鏁帮紝Wcm=27鏄疄闄呭锛孒cm=18鏄疄闄呴珮锛宻r鏄粯璁1.0锛涜繑鍥濩V_32FC1鐨勬诞鐐瑰厜瀛愮粨鏋滃浘 Mat get_photon_image(Mat src, float sec, float Wcm, float Hcm, float sr); -//魔术棒功能,src是处理成8bit的图,x,y是点击位置的坐标, -//th是设定的像素差(10或20之类的,可以实际调一下),就是和点击位置的像素差在th范围内的连在一起的像素,都会被框选 -Mat get_magic_wand_image(Mat src, int x, int y, int th); \ No newline at end of file +//榄旀湳妫掑姛鑳斤紝src鏄鐞嗘垚8bit鐨勫浘锛寈,y鏄偣鍑讳綅缃殑鍧愭爣锛宮ax鍜宮in鏄瀹氱殑澶у皬,max鍜宮in闇瑕佹敞鎰忛櫎浠256锛屼娇鐢0-255鏁版嵁 +//鐐瑰嚮浣嶇疆鐨勫儚绱犲樊鍦╗min,max]鑼冨洿鍐呯殑杩炲湪涓璧风殑鍍忕礌锛岄兘浼氳妗嗛 +Mat get_magic_wand_image(Mat src,int x,int y,float max,float min); \ No newline at end of file