ofxCLeye
Posted: 16 October 2010 08:59 AM   [ Ignore ]
New Member
Rank
Total Posts:  4
Joined  2010-03-30

Hey all

these boards seem a bit empty considering how many people are using this library

anyway, just wanted to announce i’ve sploshed together an openFrameworks extension that uses this library
it’s available on SVN at:
https://kimchiandchips.googlecode.com/svn/trunk/oF/addons/ofxCLeye

or an out of date but easy to download version is available to download at:
http://code.google.com/p/kimchiandchips/downloads/list

thanks for all the hard work!
this is a fantastic project

any news on osx development?

Elliot

Profile
 
 
Posted: 16 October 2010 11:34 PM   [ Ignore ]   [ # 1 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  585
Joined  2009-09-17

Hi Elliot,

Its great to see the CLEye running under openFrameworks.
Thanks for your great contribution.

AlexP

Profile
 
 
Posted: 17 October 2010 11:48 PM   [ Ignore ]   [ # 2 ]
Sr. Member
Avatar
RankRankRankRank
Total Posts:  162
Joined  2009-09-17

Awesome project! Thanks for sharing I’m sure this will help out alot! smile

Profile
 
 
Posted: 18 October 2010 05:43 PM   [ Ignore ]   [ # 3 ]
New Member
Rank
Total Posts:  17
Joined  2010-10-14
elliotwoods - 16 October 2010 08:59 AM

Hey all

these boards seem a bit empty considering how many people are using this library

anyway, just wanted to announce i’ve sploshed together an openFrameworks extension that uses this library
it’s available on SVN at:
https://kimchiandchips.googlecode.com/svn/trunk/oF/addons/ofxCLeye

or an out of date but easy to download version is available to download at:
http://code.google.com/p/kimchiandchips/downloads/list

thanks for all the hard work!
this is a fantastic project

any news on osx development?

Elliot

Thanks. I am going to port it to cinder, if you don’t mind.

-8

Profile
 
 
Posted: 19 October 2010 01:22 AM   [ Ignore ]   [ # 4 ]
New Member
Rank
Total Posts:  4
Joined  2010-03-30

At the moment I’m having an issue with my setup.
After a random amount of time, the camera seems to crash out
The result is that the capture function consistently times out and no new data arrives

At first I thought it was an issue with the camera needing to be on a seperate thread
(perhaps it gets unhappy if you dont consistently pull data off it regularly)
so I added multithreading to ofxCLeye.
(currently this is default enabled, though I am going to change that to default disabled, so please note that)
Can anybody else verify whether they have this issue?
or can somebody scan over the code to see if i’ve made any glaring errors?

I’ve used CL with oF a couple of times before without this issue (before writing ofxCLeye).
I’ve tried with 3 cameras here and get the same issue with all of them.


on another note..


currently this is only supporting mono mode
can anybody tell me what colour format is arriving (in COLOR_RAW or COLOR_PROCESSED)?
it definitely isn’t 3-byte RGB.

@eight : that’d be great!
note though , as you can see, it is still being developed so might be best to wait a week!

Profile
 
 
Posted: 19 October 2010 04:21 PM   [ Ignore ]   [ # 5 ]
New Member
Rank
Total Posts:  17
Joined  2010-10-14
elliotwoods - 19 October 2010 01:22 AM

At the moment I’m having an issue with my setup.

I ran two cams for an hour and saw no problems. Attached is my app, using your addon.

Have a look.

-8

File Attachments
clEye.zip  (File Size: 11KB - Downloads: 897)
Profile
 
 
Posted: 01 November 2010 12:10 AM   [ Ignore ]   [ # 6 ]
New Member
Rank
Total Posts:  3
Joined  2010-10-22

Hi Everybody,

First of all, thanks for sharing your code! I try to make CLeye working with Of and it’s a really good base to get in it.

I’ve got a first question, the ofxCLeye an the example given in the thread are working good for me only for 320X240 resolution in mono, otherwise it give me a memory bad access, it’s ok for mono but I can’t figure out why it doesn’t work with 640X480 resolution.
I go a little further deep in the code and remark that the memory allocation and memory copy does not have the same size than in the videograbber class from OF wich use a size of width*height*3 instead of width*height in ofxCLeye, is there an obvious reason that I missed on this point ? By changing this in ofxCLeye code, I’m able to work on 640X480 resolution.

Second point, Color management will be great, maybe using OpenCV could be a option ?
I found this on this point :

Note that to convert an ofxCvColorImage to IPLImage we use setFromPixels, to convert an IPLImage to grayscale or color we use cvCvtColor, and to convert the type of the image from IPL_DEPTH_8U to IPL_DEPTH_32F and vice-versa we use cvConvertScale. To convert from IPLImage to ofxCvColorImage the image must be in the IPL_DEPTH_8U format with 3 channels, and just use “=”.

Some OpenCv functions require that the image to be in 32 bit float format. For further information read the OpenCV reference. There is no need to include additional files, OpenFrameworks already includes the OpenCV headers.


here:

OpenCV and OpenFrameworks integration

In this case the problem is to convert the IPLImage in 3 channel in order to convert it to an OF compatible format.

Does it make sense ?

===========================
Edit:
I miss something obvious, I was a bit disappointed by the loop inside the CLeye project given in this thread…
So let make think clear, the format in MONO_RAW or MONO_PROCESSED seems to be 3-byte RGB in one channel,the loop inside testApp::updateClEye(int id) confusing me, because it make an implicit conversion of 3-byte RGB in one channel to 3-byte RGB in three channel for OF ?
This code seems to work correctly:

void testApp::updateClEye(int id){
    clEye[id]
->grabFrame();
    
    if (
clEye[id]->isFrameNew()){
        int totalPixels 
camWidth*camHeight;
        
unsigned char pixels clEye[id]->getPixels();
        for (
int i 0totalPixelsi++){
            videoInverted[i] 
255 pixels[i];
        
}
        videoTexture[id]
->loadData(videoInvertedcamWidth,camHeightGL_RGB);
    
}

for COLOR_RAW or COLOR_PROCESSED the format seems to 3-byte RGB but in four channel

It is correct ?

Profile
 
 
Posted: 01 November 2010 12:38 AM   [ Ignore ]   [ # 7 ]
New Member
Rank
Total Posts:  3
Joined  2010-10-22
elliotwoods - 19 October 2010 01:22 AM

on another note..


currently this is only supporting mono mode
can anybody tell me what colour format is arriving (in COLOR_RAW or COLOR_PROCESSED)?
it definitely isn’t 3-byte RGB.

@eight : that’d be great!
note though , as you can see, it is still being developed so might be best to wait a week!

It’s seems to be a 4 channel RGBA ?

from example of the SDK:

// Depending on color mode chosen, create the appropriate OpenCV image
        
if(_mode == CLEYE_COLOR_PROCESSED || _mode == CLEYE_COLOR_RAW)
            
pCapImage cvCreateImage(cvSize(wh), IPL_DEPTH_8U4);
        else
            
pCapImage cvCreateImage(cvSize(wh), IPL_DEPTH_8U1); 
Profile
 
 
Posted: 01 November 2010 09:43 PM   [ Ignore ]   [ # 8 ]
New Member
Rank
Total Posts:  3
Joined  2010-10-22

Here is a proposal for COLOR_PROCESSED and _COLOR_RAW support.

Convert the 4 channel 3-byte RGBA to 3 channel 3-byte RGB using this pseudo-code and black BGColor, maybe some possible optimisation inside the conversion loop :

             
Source => Target = (BGColor + Source) =

             
Target.R = ((1 - Source.A) * Source.R) + (Source.A * BGColor.R)

             
Target.G = ((1 - Source.A) * Source.G) + (Source.A * BGColor.G)

             
Target.B = ((1 - Source.A) * Source.B) + (Source.A * BGColor.B)

Resize is not implemented yet for COLOR_PROCESSED and _COLOR_RAW.

Again, thanks for sharing source code and knowledge.

File Attachments
ofxCLeye.zip  (File Size: 4KB - Downloads: 755)
Profile
 
 
Posted: 01 December 2010 12:38 AM   [ Ignore ]   [ # 9 ]
New Member
Rank
Total Posts:  4
Joined  2010-03-30

hey all
i’ve been making some updates to this recently.
just added colour support
http://kimchiandchips.googlecode.com/svn/trunk/oF/addons/ofxCLeye

I got XRGB (iirc), so i’ve copied it across readdressing the channels.
Source.A always=1 I think
it’s more an X channel than a real A channel (i.e. it’s only there so that every pixel is 32bits rather than 24)
which is very common in graphics apps. just didn’t notice the first time.

hope it’s useful!

Profile
 
 
Posted: 01 December 2010 12:40 AM   [ Ignore ]   [ # 10 ]
New Member
Rank
Total Posts:  4
Joined  2010-03-30

i also added threaded support, but that means you’ll need ofxThread in your project for ofxCLeye to compile.
good luck!

Profile
 
 
Posted: 20 April 2011 04:14 AM   [ Ignore ]   [ # 11 ]
New Member
Rank
Total Posts:  5
Joined  2011-04-19

Hello,

I am using ofxCLeye, but I am getting the following errors (Visual Studio 2010 - win xp)

1>main.obj warning LNK4075ignoring '/EDITANDCONTINUE' due to '/INCREMENTAL:NO' specification
1
>ofxCLeye.obj error LNK2019unresolved external symbol "struct _GUID __cdecl CLEyeGetCameraUUID(int)" (?CLEyeGetCameraUUID@@YA?AU_GUID@@H@Zreferenced in function "public: static int __cdecl ofxCLeye::listDevices(void)" (?listDevices@ofxCLeye@@SAHXZ)
1>ofxCLeye.obj error LNK2019unresolved external symbol "int __cdecl CLEyeGetCameraCount(void)" (?CLEyeGetCameraCount@@YAHXZreferenced in function "public: static int __cdecl ofxCLeye::listDevices(void)" (?listDevices@ofxCLeye@@SAHXZ)
1>ofxCLeye.obj error LNK2019unresolved external symbol "bool __cdecl CLEyeCameraGetFrameDimensions(void *,int &,int &)" (?CLEyeCameraGetFrameDimensions@@YA_NPAXAAH1@Zreferenced in function "public: void __thiscall ofxCLeye::grabFrame(void)" (?grabFrame@ofxCLeye@@QAEXXZ)
....
1>ofxCLeye.obj error LNK2019unresolved external symbol "bool __cdecl CLEyeCameraLED(void *,bool)" (?CLEyeCameraLED@@YA_NPAX_N@Zreferenced in function "public: void __thiscall ofxCLeye::setLED(bool)" (?setLED@ofxCLeye@@QAEX_N@Z)
1>bin\clEye_debug.exe fatal error LNK112010 unresolved externals 

It seems that Visual Studio 2010 is not finding the CLEyeMulticam.lib library. However, I think that I have included all the paths, libraries, etc.

Could someone share a basic working project for VS 2010? I started using the project posted by ‘eight’, but it was made in an older version of VS and I think that when the project is imported, something goes wrong

Thank you!

Marc

Profile
 
 
 
 


RSS 2.0     Atom Feed