【发布时间】:2014-01-04 11:56:40
【问题描述】:
我是 openCV 的新手,需要一点帮助
所以我的基本想法是使用opencv创建一个用于室内设计的小型应用程序。
问题
如何区分图片的墙壁和地板(即使图片中有一些噪点)。
例如
现在,我的想法是,如果我能以某种方式找到墙壁或瓷砖的边缘,然后如果有任何将用于室内装饰的物体(例如任何椅子),那么该物体将完美地放置在地板(即两个图像混合)
我的方法
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv/cv.h>
using namespace cv;
using namespace std;
int main(){
Mat image=imread("/home/ayusun/Downloads/IMG_20140104_143443.jpg");
Mat resized_img,dst,contours,detected_edges;
resize(image, resized_img, Size(1024, 768), 0, 0, INTER_CUBIC);
threshold(resized_img, dst, 128, 255, CV_THRESH_BINARY);
//Canny(image,contours,10,350);
namedWindow("resized image");
imshow("resized image",resized_img);
//imshow("threshold",dst);
blur( resized_img, detected_edges, Size(2,2) );
imshow("blurred", detected_edges);
Canny(detected_edges,contours,10,350);
imshow("contour",contours);
waitKey(0);
return 1;
}
我尝试了canny边缘检测算法,但似乎发现了很多边缘。而且我还是不知道怎么把房间的地板和椅子的地板结合起来
谢谢
【问题讨论】:
标签: c++ opencv image-processing edge-detection