From e93f8165d45424bdbc906bffcad6f12a205f9011 Mon Sep 17 00:00:00 2001 From: Chao Qu Date: Thu, 11 Sep 2014 01:47:39 -0400 Subject: [PATCH] some more processing --- calib/circles_grid.png | Bin 19841 -> 14428 bytes calib/draw_circles_grid.py | 2 +- cfg/CalibProcDyn.cfg | 8 +++++ src/calib_proc/calib_proc_node.cpp | 48 +++++++++++++++++++---------- 4 files changed, 41 insertions(+), 17 deletions(-) diff --git a/calib/circles_grid.png b/calib/circles_grid.png index 39b80d4f6e5dbe0310982318ff6410a359731fd8..ed3632f2dd6d45fed8dfbb014d6c6bff1d58f522 100644 GIT binary patch literal 14428 zcmeHu2~?Bkx^7x`Wjmln5l{?NtRjjaGRl;y2r2>!RAy3Uks&f8Q)(*$0zpLvK|n-6 zlo^?aR0%{tz<`WlP$H8|hA}`$&ii58(|z_`cb#?Dy8GU<*6vzGk>t<+f8YDP?=um0 zQCEw1^PbHZ42JjISq*&*W`iUK^R?~YH^RTn&88oMKmO)%>YU-<;lF^t+lIpTo35QT z@xWlVTcQ8IdWy?*#9+R|oYOdI==*T0KQR9OaG><(!79n@?FqohJ zwo4cbxA>D0zX05n$!7SsJCecQU@&K6Uww_ie6MZw6$W!JJs)1vpl=Lsu$6%4{h{#R zFaK|>OtyR4hC3vAr%pAaJ2*Jhw>rO%$XzS=>E$mQ7$EEXe*Dz459GcK}^e05KD^OpX-L97olL2Q;LwL5Fy>093? z9@WdX2{fkmn$)i3|9*k-qXVAX|7o*dN0LY+O|2`NI}6maZKkrV;9c;R;-Xvgv8Q6~ zOwvxj^*v&g8?kBUK@B6LIK?+#VRWdL;^eCTe+y@xFEiQiYSmoQjI-xf45s_&W^K`Y zSlqI?7L~M%hvZ-jFp~no=?!XJ_MF?xZv-hXc|`lh;85q&`C||Iw44~FoD)ytr(%7~ zZB07Il;8(u@B{C;W<_f4cHG`BJh8g)Ys?Q)F~ZoN2MYWaKCy-b$wH+AeokA36|!k= z7|bKBs#k3{3njz#0zVlrKWrx|W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JI@w-46rZXi55 z&ezAVsmBq%sRM?43i6@RR4<4EJ&xsej+j_v(YV0caF=t!$kU7?@Lvl=QeOA)%3gJ; z*Pw?6z=ZA#Q=klIH8ehK(0aJAG(;zE<-^Jb0On1k4-na)Lyu{2mX{}Tar)>Slxrc zW6rhyS{(Oky1w_=Exo-*aOAD|-MfG(pWO*?+P7~{a*b$6HS5XWK37V6_X5WjiMoSaJHK4x@*;_X zzbD`&JBL2x93Px5I6gl!#the8WJ+gi}y~M@{&G;+^&;Xi?hJx%z6t*t~9Xj63ZnID7=fDDg7>X;n+Q!iGAc_W?;yN3YC}m~^g&lw7s4xN+IIvyVj*0I zPHKRpfLvoA$QMe$Y(tgnE%$1f7oYYW#~}fL0mvW^XvN%Iptcd`(b%<$-mYV&wqB$41d^Z-y8}ynhi&^`SdwOOoQ_S>c-Q00X>_`d$kyg9$F$#W#`soCoEj zt`D~y{;aimw~Y=2(+;}jJ6P0p7%u}zcU<~4_lt4R@@Z=7aDHt6vkw!-V{a;!mlm$! z#U`hvog5ACC@(LE63)Lg=y~;*J26HGUHcGt3hTQcva26-lb6_cxiO(FE@FZ=Ae!OO zu5%4`oIYmp8g$}X7;XB5^r#TGVLTY`qjb~IiRym}J^o+9mH#%>J0j-)z(yp>>h}bm Ph)nvdyhP?1z1#l_#rgEP diff --git a/calib/draw_circles_grid.py b/calib/draw_circles_grid.py index e3c2321..e19db1a 100644 --- a/calib/draw_circles_grid.py +++ b/calib/draw_circles_grid.py @@ -5,7 +5,7 @@ fig = plt.gcf() n_cols = 5 n_rows = 4 -r = 0.2 +r = 0.1 for x in range(0, n_cols): for y in range(0, n_rows): circle = plt.Circle((x, y), r, color='k') diff --git a/cfg/CalibProcDyn.cfg b/cfg/CalibProcDyn.cfg index e7a7ac9..5dceeba 100755 --- a/cfg/CalibProcDyn.cfg +++ b/cfg/CalibProcDyn.cfg @@ -7,8 +7,16 @@ gen = ParameterGenerator() # name / type / level / description / default / min / max # Flir A35 has a maximum resolution of 320 x 256 +gen.add("sigma", double_t, 0, + "gaussian sigma", 1, 1, 20) +gen.add("min_area", double_t, 0, + "contour min area", 40, 1, 1000) +gen.add("max_area", double_t, 0, + "contour max area", 200, 100, 10000) gen.add("thresh_window", int_t, 0, "adaptive threshold window size", 11, 3, 100) +gen.add("erosion_size", int_t, 0, + "erosion size", 1, 1, 10) size_enum = gen.enum([gen.const("mean", int_t, 0, "Adaptive thresh mean"), gen.const("gaussian", int_t, 1, "Adaptive thresh gaussian")], "Adaptive thresh type ") diff --git a/src/calib_proc/calib_proc_node.cpp b/src/calib_proc/calib_proc_node.cpp index 9ceda6c..f662b30 100644 --- a/src/calib_proc/calib_proc_node.cpp +++ b/src/calib_proc/calib_proc_node.cpp @@ -36,39 +36,55 @@ void CalibProcNode::ConfigCb(CalibProcDynConfig &config, int level) { if (!(config.thresh_window % 2)) { config.thresh_window += 1; } + if (config.min_area > config.max_area) { + config.max_area = config.min_area + 1; + } config_ = config; } void CalibProcNode::ImageCb(const sensor_msgs::ImageConstPtr &image_msg) { cv::Mat image = cv_bridge::toCvCopy(image_msg, image_msg->encoding)->image; - // cv::imshow("image", image); cv::Mat inverted; cv::bitwise_not(image, inverted); - // cv::imshow("inverted", inverted); - /* + // Threshold cv::Mat thresh; cv::adaptiveThreshold(image, thresh, 255, config_.thresh_type, cv::THRESH_BINARY, config_.thresh_window, 0); cv::imshow("thresh", thresh); - */ - /* - std::vector> contours; - cv::findContours(raw, contours, CV_RETR_EXTERNAL, CV_CHAIN_APPROX_NONE); + // Gaussian blur + cv::Mat gauss; + cv::GaussianBlur(thresh, gauss, cv::Size(), config_.sigma, config_.sigma, + cv::BORDER_DEFAULT); + cv::imshow("gauss", gauss); + + // Erosion + cv::Mat eroded; + int erosion_size = config_.erosion_size; + cv::Mat element = cv::getStructuringElement( + cv::MORPH_RECT, cv::Size(2 * erosion_size + 1, 2 * erosion_size + 1), + cv::Point(erosion_size, erosion_size)); + cv::erode(thresh, eroded, element); + cv::imshow("erosion", eroded); - cv::Mat contour_image; - cv::cvtColor(raw, contour_image, CV_GRAY2BGR); - for (size_t i = 0; i < contours.size(); ++i) { - cv::drawContours(contour_image, contours, i, cv::Scalar(255, 0, 0), 2, 8); - } - cv::imshow("contour", contour_image); - */ + // Contour + std::vector> contours; + cv::findContours(eroded, contours, CV_RETR_EXTERNAL, CV_CHAIN_APPROX_NONE); + + cv::Mat ctr_image; + cv::cvtColor(image, ctr_image, CV_GRAY2BGR); + for (size_t i = 0; i < contours.size(); ++i) { + double area = cv::contourArea(contours[i]); + if (area > config_.min_area && area < config_.max_area) { + cv::drawContours(ctr_image, contours, i, cv::Scalar(255, 0, 0), 2, 8); + } + } + cv::imshow("contour", ctr_image); - // Detect circles grid cv::Mat display; - DetectAndDrawCriclesGrid(inverted, cv::Size(4, 5), display); + DetectAndDrawCriclesGrid(inverted, cv::Size(5, 4), display); cv::Mat calib(inverted);