Ask Your Question
0

[JAVA] Extreme points in contours

asked 2019-02-11 05:20:13 -0600

updated 2019-02-11 05:48:02 -0600

Hi everyone!

I need to find the coordinate of the top point of the largest contour in the scene. I can find the largest contour but I can't find info about extreme points in java. This is what I found in Python:

extTop = tuple(c[c[:, :, 1].argmin()][0])
extBot = tuple(c[c[:, :, 1].argmax()][0])

Can someone help me to understand how to do that in Java?

Thank you!

edit retag flag offensive close merge delete

Comments

sorry, but the code you show is numpy not from opencv or even c++

berak gravatar imageberak ( 2019-02-11 05:31:13 -0600 )edit

Yes sorry, it was Python, I got confused...Do you know how to find the extreme points of a contours?

GuybrushThreepwood gravatar imageGuybrushThreepwood ( 2019-02-11 05:49:02 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2019-02-13 00:54:27 -0600

Lucy8 gravatar image

updated 2019-02-13 00:56:35 -0600

You can find all extreme points and then compare them with each other.

Here is solution of finding all extreme points for c++ and here is solution for Javascript. Look at them and try to convert to Java.

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2019-02-11 05:20:13 -0600

Seen: 822 times

Last updated: Feb 11 '19