distance measurement
Hi,
I would like to find the distance between a colored dot to an edge in an image. How do I proceed with this?
Hi,
I would like to find the distance between a colored dot to an edge in an image. How do I proceed with this?
Find the position of the colored dot in the image, e.g. by thresholding / template-matching. Having its x and y coordinate you can get the distances to the image edges easily: left_dist = x, right_dist = image.cols-1-x, upper_dist = y, lower_dist = image.rows-1-y. The Euclidian distance between two points 'pos' and 'other' in general is sqrt( (pos.x-other.x)^2, (pos.y-other.y)^2). So if you haven't meant image edge but an arbitrary edge in the image then you have to compute the edges first (e.g. by Canny()) and find it's nearest distance by comparing each distance of the point to the edge-points. Hope it is clear enough.
Asked: 2013-06-24 05:58:38 -0600
Seen: 597 times
Last updated: Jun 24 '13
Area of a single pixel object in OpenCV
build problems for android_binary_package - Eclipse Indigo, Ubuntu 12.04
OpenCV DescriptorMatcher matches
Can't compile .cu file when including opencv.hpp
Using OpenCV's stitching module, strange error when compositing images
compile error in opencv2/flann/lsh_table.h when compiling bgslibrary