edge detection on digital images
来源:互联网 发布:java实现解压缩tar.gz 编辑:程序博客网 时间:2024/06/08 09:31
I did this for the project proposal of D. Actually, there were no benefits for me to do this on digital images. I am working on point clouds which contains depth information, that is 3D image information.
However, it did not take me much time to do it. It was quite easy:
OpenCV is quite helpful on this aspect. I downloaded the source code from Canny Edge Detector tutorial
#include "opencv2/imgproc/imgproc.hpp"#include "opencv2/highgui/highgui.hpp"#include <stdlib.h>#include <stdio.h>using namespace cv;/// Global variablesMat src, src_gray;Mat dst, detected_edges;int edgeThresh = 1;int lowThreshold;int const max_lowThreshold = 100;int ratio = 3;int kernel_size = 3;char* window_name = "Edge Map";/** * @function CannyThreshold * @brief Trackbar callback - Canny thresholds input with a ratio 1:3 */void CannyThreshold(int, void*){ /// Reduce noise with a kernel 3x3 blur( src_gray, detected_edges, Size(3,3) ); /// Canny detector Canny( detected_edges, detected_edges, lowThreshold, lowThreshold*ratio, kernel_size ); /// Using Canny's output as a mask, we display our result dst = Scalar::all(0); src.copyTo( dst, detected_edges); imshow( window_name, dst ); }/** @function main */int main( int argc, char** argv ){ /// Load an image src = imread( argv[1] ); if( !src.data ) { return -1; } /// Create a matrix of the same type and size as src (for dst) dst.create( src.size(), src.type() ); /// Convert the image to grayscale cvtColor( src, src_gray, CV_BGR2GRAY ); /// Create a window namedWindow( window_name, CV_WINDOW_AUTOSIZE ); /// Create a Trackbar for user to enter threshold createTrackbar( "Min Threshold:", window_name, &lowThreshold, max_lowThreshold, CannyThreshold ); /// Show the image CannyThreshold(0, 0); /// Wait until user exit program by pressing a key waitKey(0); return 0; }
I made a ros package out of it by adding some dependencies in manifest.xml and executable in CMakeLists.txt.
Then I captured an photo of the object I wanted to detect with the toolbox a ROS packageperception_pcl : convert_pointcloud_to_image
rosrun pcl_ros convert_pointcloud_to_image input:=/camera/dth_registered/points output:=/my_image
So, I got a topic published with image data, and then images could be generated by subscribing to the topic and right click on the image GUI. EASY!
rosrun image_view image_view image:=/my_image
- edge detection on digital images
- edge detection
- Canny Edge Detection Tutorial
- POJ 1009 Edge Detection
- poj 1009 Edge Detection
- Edge Detection: Sobel operator
- 1009 Edge Detection
- poj 1009 Edge Detection
- Sobel edge detection
- POJ 1009 Edge Detection
- POJ-1009-Edge Detection
- [POJ][1009]Edge Detection
- POJ 1008 Edge detection
- POJ 1009: Edge Detection
- POJ 1009 Edge Detection
- poj1009 Edge Detection
- POJ 1009--Edge Detection
- Holistically-Nested Edge Detection
- c++网络库调研
- linux 内核编程
- WCF单元测试
- hadoop 大数据开发5 --伪分布式hbase配置异常
- C++命名空间
- edge detection on digital images
- 软件升级流程图
- 大数据量,海量数据处理方法总结
- Linux(CentOS)系统下安装好apache(httpd)服务后,其他电脑无法访问的原因
- Linux,Apache,php,mysql常用的查看版本信息的方法
- oracle索引使用及索引失效总结
- win7系统不用通过软件给U盘加密
- nutch2.1 关于batchId的个人看法
- MongoDB Java 客户端占用大量内存