Ask Your Question
3

Does OpenCV implement any one of the root-finding algorithms?

asked 2014-09-27 22:27:18 -0600

rwong gravatar image

Does OpenCV implement any one of the root-finding algorithms, as listed on Root-finding algorithm (Wikipedia article)?

Something similar to Brent's method would be highly desirable, although Secant method would still be useful as a starting point.

In particular,

  • I would like to use it on a single variable input, single variable output "blackbox".
  • The "blackbox" is not an analytic function, so there is no derivatives.
    • In fact, it is not even a mathematical function in the usual sense - please read on.

The reason I am asking is because I would like to implement a JPEG compression file size goal-seeker, which I have described in my answer to this Stackoverflow question: Automatically choose JPEG compression level in OpenCV.

As part of the implementation, the image will be compressed multiple times with different JPEG compression levels, until it finds one with output file size approximately near the goal.

For efficiency, the number of "evaluations" (which involves actual JPEG compression of the image) need to be as small as possible, and hence a good non-analytic iterative root-finding algorithm is necessary.

edit retag flag offensive close merge delete

Comments

1

OpenCV will not supply of the shelf mathematical approaches. For its matematical approaches it depends on the boost library. It contains exactly what you may need. So use boost for the root finding and than pass the result to OpenCV.

StevenPuttemans gravatar imageStevenPuttemans ( 2014-09-29 06:27:32 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
1

answered 2014-09-29 07:28:37 -0600

rwong gravatar image

Thanks for your reply.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2014-09-27 22:27:18 -0600

Seen: 452 times

Last updated: Sep 27 '14