Ask Your Question

Industrial measurements

asked 2016-03-24 15:19:15 -0600

bleeisme gravatar image

My experience is with industrial vision systems - Cognex Omron, and similar.

I am looking for width measurement functions similar to what they do... so far, I cannot find them. Am I searching for the wrong terms, or is this a function not commonly used outside of industrial measurement systems?

Full description of what I want: Get full image - assume a single bright object on a black background. Define a ROI (rectangle) Normalize it if not already aligned with the axis of interest. Also compress it to 1D Run a gradient filter on it Look for a minimum and maximum and compute the distance in pixels between the 2 edges

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted

answered 2016-03-24 15:58:05 -0600

Tetragramm gravatar image

Well, OpenCV is mostly low level functions, with more complicated things built from those. So to do what you want, you do each of those in turn. Here's links to the functions that do what you described.

If you think the whole function you are trying to do would be useful to others, feel free to write it up as a module or function and contribute it to the library.

edit flag offensive delete link more

answered 2016-03-24 16:16:01 -0600

matman gravatar image

updated 2016-03-24 16:35:19 -0600

Professional industrial computer vision libraries, such as Cognex or Halcon, are usually made to give a relative inexperienced user the possibility to write image processing code in a realy easy way (My point of view). So they provide some functions that combine a cluster of basic functions where as much as possible parameters are adjusted itself.

That has the advantage, that you don't have to care about a lot of problems, but the disadvantage is, that in many cases you don't know what the function really does. (I know that because I'm actually porting a Halcon written library into a OpenCV one).

Short description: You will have to do (often a lot) more handwork, but you can get faster and more accuracy code if you know what you do (not because the professional libraries are bad/slow/..., but because you can write more adapted code and debug into OpenCV code).

To your special problem: This sounds like (in a naive view):

binarize image with: cv::threshold, cv::Canny, ...

find contours (make problem to a 1D one): cv::findContours

choosing wanted contour using whatever

and do the tail by read in OpenCV docs or the previous answer ;) (But as far as I understood he has to extract the object ROI after identifying the object)

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2016-03-24 15:19:15 -0600

Seen: 3,520 times

Last updated: Mar 24 '16