Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

How can I resolve a crash with opencv::FindContour()?

Hi There.

I'm working on a project with opencv 2.4.9.

I linked the library and all the functions work fine exept for cv::FindContour(). The exeption thrown is "Access violation writing location 0x00000010". Threads related to this problems exist and suggest raising the stack size. However I can't seem to be able to do this on EU4 projects.

Any idea ? does anyone tried to do this ?

link text here is the source code of my class :

Product Version: Not Selected
example.txt (1.5 kB)
more ▼

asked Apr 29 '14 at 12:49 PM in C++ Programming

avatar image

20 4 3 9

avatar image maije Aug 04 '15 at 12:08 PM

Same problem here :-S

Any help or update would be very appreciated Best regards

avatar image rNix Aug 19 '15 at 03:59 AM

The same with UE 4.8.3 and OpenCV 2.4. Crash in FMallocTBB::free after [external code]. cv::cvtColor and cv::imshow works but cv::FindContours does not.

avatar image mitjaprelovsek Dec 12 '18 at 11:00 AM


Lightact media server allows you to use OpenCV with UE4. Have a look at this tutorial here, if you are interested.


DISCLAIMER: I am the founder of Lightact.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

3 answers: sort voted first

I have found one way. I moved my code with cv::findContours to different project and compiled my own DLL. Then I've linked it in UE4 like opencv and it works.

P.S.: I guess the problem in the vector of vector of Point param and other like it. Garbage Collector from UE4 destroys them (not confirmed).

more ▼

answered Aug 21 '15 at 01:23 AM

avatar image

36 2 2 5

avatar image valake Nov 02 '16 at 09:23 PM

Hi, I have the same problem now and i try to bulid my own dll like this: https://wiki.unrealengine.com/Linking_Dlls But I have a problem with if (DLLHandle != NULL), because the DLLHandle stay free and my function coms from dll doesn't work. Can you upload your code or share any solutions for me?

avatar image NymKappa Nov 15 '16 at 09:04 AM

Thanks rNix. I would add to your answer that I had to compile my DLL with "/MT" to make it work (/MD makes it crash as before)

avatar image daniel.vuljanic Oct 10 '17 at 01:23 PM

Hey rNix, i have the same problem here but don't know what you exactly mean with "compiled my own DLL." Can you explain it in more detail? Thank you and many greetings from Germany

avatar image rNix Oct 10 '17 at 04:17 PM
avatar image TestyRabbit Sep 26 '18 at 06:39 PM

I know I'm kind of reviving a dead thread, but I tried putting this into an external dll and I'm still getting the same issues. Do you remember what version of OpenCV you used?

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

Yep, I've implemented the same solution and it worked for me too.

Looks like Unreal reflection system doesn't know how to free a vector which has been filled inside an openCV method. In this case FindCountours.

Anyways I was looking for another solution because current one makes us precompile a library for each system/platform we need to use and when developing it becomes a bit annoying to compile the .dll, copy-paste dll, lib and new .h into corresponding directories (source and binary folders). I know I could create a building routine to make all the stuff in one execution, but I've been a little lazy about this and I kept on looking for more possible solutions.

Anybody knows how to tell unreal's reflection system to "ignore" some portion of code? Thanks for the update rNix and if I can find another solution I'll post here as well :-) Best regards, maije

more ▼

answered Aug 21 '15 at 07:10 AM

avatar image

6 5 8

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

Hi evryone. I'm creating a world which uses OpenCV. I'm not sure, but i feel that i found a reason of this issue. All because of unreal's Paper2D plugin's function, there you can check it: https://docs.unrealengine.com/latest/INT/API/Plugins/Paper2D/UPaperSprite/FindContours/index.html

more ▼

answered Nov 13 '16 at 01:38 AM

avatar image

1 1

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question