Ask Your Question

bradfield's profile - activity

2017-08-22 20:11:56 -0500 received badge  Student (source)
2016-10-04 17:41:39 -0500 commented question destroying mousecallback in python

yes. no success. the damn thing must be callable

2016-10-03 17:45:49 -0500 asked a question destroying mousecallback in python

In C++ it is necessary to explicitly destroy a mousecallback by passing in a null pointer. But is this automatically done in python? since there is nothing like a null pointer in python, the only thing I can think of is to give reference to a callback-function, which does do nothing.

2016-09-05 11:22:40 -0500 commented question How to utilize opencv3.1.0's GeneralizedHough

What else is not accessible with python? Do you think it would be generally better to use c++ instead of python, to get the most performance out of opencv? For example I also found functions like parallelCanny, which also lacks a python wrapper. I need to execute this on a raspberry pi 3, and since it has 4 cores a parallelCanny is beneficial. So far my scripts only execute on a single core.

2016-09-05 10:53:22 -0500 commented answer How to utilize opencv3.1.0's GeneralizedHough

yes I know that page, but this one is written in c++, and may not be able to simply transfer it, not to speak about efficient implementation. My hope was that the GeneralizedHough implementation has already been optimized. How problematic is it to write a wrapper for opencv's generalized Hough?

2016-09-04 16:50:14 -0500 asked a question How to utilize opencv3.1.0's GeneralizedHough

I am wondering if it is possible to actually use the Generalized Houghtransform which is available in version 3.1.0.

How can I perform generalized Hough transform in python? The generalizedHough is different from, for example, functions like HoughLines. It can not be simply called. Something is missing, to be able to simply access it with a one-line python call (its called wrapper? the thing which is missing?)

2016-09-03 02:38:37 -0500 commented question TBB affecting HoughCircles?

can you tell me the resources which explain the basics behind that, which needs to be known for the implementation? I havnt yet looked through that parallel_for_ wrapper, although I have already seen multiple examples.

2016-09-03 02:32:47 -0500 received badge  Enthusiast
2016-09-02 19:57:32 -0500 asked a question cv2.imshow inside a seperate process?

Consider the following illustration:

import cv2
from multiprocessing import Process

def f(x):
    cv2.imshow('window',x)
    pass

if __name__=='__main__':
    cv2.namedWindow('window')
    img=cv2.imread("name.jpg",0)
    p=Process(target=f,args=(img,))
    p.start()
   ...

The named Window does open, but the image does not show up, unless I execute the imshow in the main process. Why is that?

2016-09-02 17:29:20 -0500 commented question TBB affecting HoughCircles?

mein deutsch ist nicht perfekt. aber vielleicht können wir uns über die implementierung auf andere weise unterhalten? ich tue mich in moment noch schwer damit zu verstehen, wie parallel_for_ überhaupt funktioniert. ich habe zwar einige beispiele gesehen, aber aufgrund meiner schwachen c++ kenntnisse liegt die betonung auf 'relativ' einfach.

2016-09-02 06:01:44 -0500 received badge  Supporter (source)
2016-09-01 03:46:56 -0500 asked a question TBB affecting HoughCircles?

I recently installed OpenCV via cmake with the option WITH_TBB=ON on a raspberry pi 3.

The code I wanted to accalerate is basically a circle detection with HoughCircles. Unfortunately the CPU usage is the same as before having TBB enabled, that is somewhere below 30%.

Why is it that way? I supposed HoughCircles is highly parallelizable, according to this http://www.ijcsi.org/papers/IJCSI-9-6....

EDIT:

taking a look at the source code mentioned by matman (see here), at line 1058 there are two for-loops which as far as I can see are just filling up the accumulator. How can they be parallelized with parallel_for_, and would that actually help speeding up the detection?

2016-06-15 21:13:56 -0500 received badge  Editor (source)
2016-06-14 21:43:56 -0500 asked a question contour fitting and segmentation in python

lightbox

The above image shows a light table, with 3 liquidfilled vessels on top. The camera is approx. 30cm apart from the table, and one can see the parallactic effect on the left and right vessel, which is disturbing. Also disturbing are the little wires on each vessel.

One goal is to find the middlepoint (in terms of image coordinate) of the upper rims of each vessel, in the presence of all these disturbances. What I would like to do, is to especially search for circular contours, and so to speak "fit" closed circles to the noisy contours. How can this be done in python? First I need a kind of model for a circle of variable radius and middlepoint. I think a minimal radius has to be specified, in order to prevent the program from fitting little circles to little noisy spots. The number of vessels doesnt have to be necessarily three. So somehow the program has to detect the number of circles needed.

I appreciate any idea or suggestion.