x


import video from camera

Hello, For my project I have to display live videos from Camera. I am receiving video frames in a different framework (Visual Studio), from there I have to send frames to unity3d. Now framework uses openCv library and so stores images in IplImage format AND from there I have to send these frames to unity3d (which uses Texture2D class), so I am stuck with this...

In IplImage format I can directly use Image Data (with pointer image->imageData), Is there anyway to access Texture2D image data also, so that I can fill colors from IplImage to Texture2D image ??

more ▼

asked Jul 16 '10 at 08:56 AM

Arjun gravatar image

Arjun
14 3 3 5

(comments are locked)
10|3000 characters needed characters left

3 answers: sort voted first

You can access the pixels of an Iplimage. So what you'll have to do is convert the iplimage to use the correct color format (i think it's rgba32) and send this data backt to unity to modify your texture2d. The fastest way (imo) to do this is create a Texture2D or pixel(Color) array in unity, then send a pointer to that array to opencv and memcpy the pixels of your currentframe to the pointer. Best thing is to do this in a separate thread so your webcams framerate won't block your games fps.

more ▼

answered Jul 16 '10 at 09:03 AM

StephanK gravatar image

StephanK
6k 40 53 93

(comments are locked)
10|3000 characters needed characters left

no no, not through sockets. actually i used some plugin /dll stuff to do this, i dont remember by now to do this. but i finally did it. if u need info, i will try to go through old source code files.

more ▼

answered Feb 02 '11 at 01:48 PM

Arjun gravatar image

Arjun
14 3 3 5

I have the same question, and I also use plugin / dll, can u share the source code with me, thank u very much.

Apr 23 at 09:19 AM tokutoku
(comments are locked)
10|3000 characters needed characters left

Do you mean to send necessary data through the network(sockets) ? Or there exists other way to send info from unity to opencv and vice versa

more ▼

answered Jan 31 '11 at 09:04 AM

RustemKamun gravatar image

RustemKamun
1 1 1 3

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

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

By RSS:

Answers

Answers and Comments

Topics:

x3128
x370
x292
x264
x26

asked: Jul 16 '10 at 08:56 AM

Seen: 3490 times

Last Updated: Apr 23 at 09:19 AM