Find pattern in image

From: Chris (CHRISSS)21 Mar 2019 15:47
To: ALL18 of 22
I think I have found a solution that works  :-O~~~ Assuming that the contour detection manages to pick out the 3 specific points that are needed.

It's a lot more computationally... er, computational. Somewhere between 10-30,000 iterations for the tests I've tried. I could probably optimise it further, some tests it's doing where the points are not far enough apart, or not the 3 points are in a straight line.

I still need to do some more testing, but initial tests are looking good.
From: Chris (CHRISSS)21 Mar 2019 22:30
To: ALL19 of 22
I think I found why I was running out of memory in the big loop. OpenCV. Maybe cos it's wrapping C++ in Java. You can call release() on some objects to release it's memory.
From: Peter (BOUGHTONP)22 Mar 2019 00:26
To: Chris (CHRISSS) 20 of 22
Try Java Mission Control and/or Eclipse Memory Analyzer - helps find objects causing memory leaks. Or for stuff like seeing if you've got too many instances of something you only expect to have one of.
From: Chris (CHRISSS)23 Mar 2019 09:54
To: Peter (BOUGHTONP) 21 of 22
Eclipse!? No thanks :S What can I use with IntelliJ?

According to Stack Overflow it's because Java doesn't see the memory being used by the C++ classes so it doesn't know it's using as much memory as it is.

I tried another test, writing an image in a big loop and it crashed using too much memory. If I call release on the image before each loop finishes, the memory use doesn't go up and it works.
From: Peter (BOUGHTONP)23 Mar 2019 16:41
To: Chris (CHRISSS) 22 of 22
You can point Eclipse MAT at any JVM, local or remote. You don't need to be developing with Eclipse JDT to use it - the default download is a standalone non-IDE version.

It can't be used to analyse C/C++, which isn't surprising since it'll be a separate process and different memory structure.

Might be able to use tools from NirSoft or SysInternals to do that, if necessary, but probably not to the same degree of detail/interactivity.

EDITED: 23 Mar 2019 16:43 by BOUGHTONP