Login | Register 
Products Applications Downloads Features Wiki forum Store
 

Using open CV in touch.

General discussion about anything TouchDesigner

Re: Using open CV in touch.

Postby malcolm » Wed Apr 04, 2012 10:29 am

I've posted the header files and libraries here:

http://www.derivative.ca/wiki077/index. ... DLL#OpenCV
User avatar
malcolm
Staff
 
Posts: 2182
Joined: Tue Nov 13, 2007 12:11 am

Re: Using open CV in touch.

Postby tcfr33 » Wed Apr 04, 2012 11:41 am

I tried again this morning with your libs and still no success. Could this be a 64bit OS issue?
I've attached the dmp file. I could send along the VC++ project, it's 58MB.

Thanks Again
Attachments
TouchCrashFTE077.16900.8.dmp
(131.78 KiB) Downloaded 7 times
tcfr33
 
Posts: 31
Joined: Mon Aug 22, 2011 6:28 pm

Re: Using open CV in touch.

Postby malcolm » Wed Apr 04, 2012 11:51 am

Hey, the crash is occurring in your .dll. Attach visual studio to the touchdesigner.exe process and then make it crash to see where things go wrong.
User avatar
malcolm
Staff
 
Posts: 2182
Joined: Tue Nov 13, 2007 12:11 am

Re: Using open CV in touch.

Postby tcfr33 » Thu Apr 05, 2012 7:32 pm

The original crash happened because I was starting without anything plugged into the cplusplus TOP so there was no texture to load. Then I realized the code was looking for a 640x480 image and would crash with anything larger.
Now I have an issue with the conversion of floats to ints.
Code: Select all
       int neighborhood= int(arrays->floatInputs->values[0]); //get TOP input floats

VC++ looks for ftol2.asm, can't find it and crashes. TD throws a VC++ Runtime error.
After some research it seems this may have to do with OpenGL32.lib but I'm not sure.
Any ideas?

Thanks
tcfr33
 
Posts: 31
Joined: Mon Aug 22, 2011 6:28 pm

Re: Using open CV in touch.

Postby malcolm » Thu Apr 05, 2012 8:59 pm

I don't think it has anything to do with opengl32.lib. It's a very strange issue though. It's something to do with how your compile environment is setup. What version of visual studio are you using?
User avatar
malcolm
Staff
 
Posts: 2182
Joined: Tue Nov 13, 2007 12:11 am

Re: Using open CV in touch.

Postby tcfr33 » Thu Apr 05, 2012 9:15 pm

Visual Studio 2010 on Win7 64bit. I'm used to developing in XCode so this is a bit foreign to me.
tcfr33
 
Posts: 31
Joined: Mon Aug 22, 2011 6:28 pm

Re: Using open CV in touch.

Postby tcfr33 » Wed Apr 11, 2012 11:39 am

Malcom,
Is there any chance you have a working OpenCV .dll project I can take a look at? I'm still having no luck. I even tried making a shared memory application which worked fine until I added OpenCV code to it. Everything compiles but dies when Touch Designer tries to connect. OpenCV console applications work just fine on their own. The Blob Track TOP doesn't work for me either so I think it is definitely something with my system. I'm just trying to track down what it is.
I may have to figure out adaptive thresholding using GLSL if I can't get any of this working.

Thanks again,
Thadeus
tcfr33
 
Posts: 31
Joined: Mon Aug 22, 2011 6:28 pm

Re: Using open CV in touch.

Postby malcolm » Thu Apr 12, 2012 5:18 pm

I don't have a working OpenCV example actually, sorry. What kind of crash are you getting in the Shared mem application? What does visual studio say it's crashing in?
User avatar
malcolm
Staff
 
Posts: 2182
Joined: Tue Nov 13, 2007 12:11 am

Re: Using open CV in touch.

Postby tcfr33 » Thu Apr 12, 2012 9:22 pm

The app runs fine. Touch Designer goes grey and hangs when I try to connect to "touchSHM". The app continues to run fine once I quit TD. I'm not sure how else to debug/log what's going on inside TD.

I based my shared memory top on Achim's code
viewtopic.php?f=4&t=2536&hilit=shared+memory#p8816

I've added
Code: Select all
IplImage* img = cvLoadImage("Jellyfish.jpg");
cvNamedWindow("myFirstWindow");
for (int i=0;i<=(size)-1;i++)
{
   ramp[i] = img->imageData[i]/255.0;
}
//and inside the while loop
cvShowImage("myFirstWindow",img);
Attachments
SMTD 2 - Copy.zip
(15.65 MiB) Downloaded 17 times
tcfr33
 
Posts: 31
Joined: Mon Aug 22, 2011 6:28 pm

Re: Using open CV in touch.

Postby adamS » Wed Apr 25, 2012 4:46 am

I'm interested to hear more about asynchronous uploads/downloads for open cv with c++ top. I've been working on a multi PS3 eye .dll for touch and it works fine but takes 16ms to grab a frame. It's fine for 1 camera @ 60fps but not 2 or 3 cams.
Cheers,
Adam
adamS
 
Posts: 93
Joined: Tue Jul 08, 2008 8:52 am

PreviousNext

Return to General TouchDesigner Discussion

Who is online

Users browsing this forum: No registered users and 1 guest