Using the SDK without cv
Posted: 06 February 2010 11:43 AM   [ Ignore ]
New Member
Rank
Total Posts:  3
Joined  2010-02-06

Im trying to simply use the camera’s sdk without the cv part and the capture command keeps failing, why is this? All the examples show that you simply pass in a PBYTE variable but before this happens a cv command does something to the PBYTE with the cvGetRawImage() command. What is this doing? and should capture work if I pass it a PBYTE variable or does it require this function?
**Ok so I have discovered what that function does and it should not be affecting why the cameras capture image function is failing, so any idea’s as to why this is? In the new sdk examples PBYTE is never instantiated but in the old ones it was, does Capture image want a pointer to an area in memory big enough for the image, or does it want a null pointer to the then point to the image it will place in memory itself?
****Okay so people dont seem to reply that often on this blog, but I am yet another step closer to getting this to work, in fact technically I have the CLEyeCamere Get frame function working but the area of memory it needs is bigger than the resolution times 3, for 24-bit colour. Why is this? It shouldnt need more the RESOLUTION WIDTH*RESOLUTION HEIGHT*BITDEPTH/8, unless it nows stores extra data the old SDK didnt store, any help, please?

Profile
 
 
Posted: 08 February 2010 02:10 PM   [ Ignore ]   [ # 1 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  585
Joined  2009-09-17
D.J.T.J - 06 February 2010 11:43 AM

Im trying to simply use the camera’s sdk without the cv part and the capture command keeps failing, why is this? All the examples show that you simply pass in a PBYTE variable but before this happens a cv command does something to the PBYTE with the cvGetRawImage() command. What is this doing? and should capture work if I pass it a PBYTE variable or does it require this function?
**Ok so I have discovered what that function does and it should not be affecting why the cameras capture image function is failing, so any idea’s as to why this is? In the new sdk examples PBYTE is never instantiated but in the old ones it was, does Capture image want a pointer to an area in memory big enough for the image, or does it want a null pointer to the then point to the image it will place in memory itself?
****Okay so people dont seem to reply that often on this blog, but I am yet another step closer to getting this to work, in fact technically I have the CLEyeCamere Get frame function working but the area of memory it needs is bigger than the resolution times 3, for 24-bit colour. Why is this? It shouldnt need more the RESOLUTION WIDTH*RESOLUTION HEIGHT*BITDEPTH/8, unless it nows stores extra data the old SDK didnt store, any help, please?

As you saw in the cv examples, the pointer that you are passing to the get frame have to point to your preallocated memory area. The SDK has nothing to do with OpenCV nor it depends on it. The OpenCV framework is used in the code samples for convenience and simplicity.
The get frame function will fill your memory with the camera image. As to the size, there are two color modes:

- Grayscale   -> size = width * height
- Color(RGBA) -> size = width * height * 4

Hope this helps.

AlexP

Profile
 
 
Posted: 09 February 2010 03:12 AM   [ Ignore ]   [ # 2 ]
New Member
Rank
Total Posts:  3
Joined  2010-02-06

Hey Alex
Yeh I noteiced that, and got it set up and it will now write into the memory space provided but still something seems confusing. When i make the allocated memory equal to 4 times the resolution this is more than it seems to need to hold the entire frame, also it seems to be adding in black space at the start of the image, ie the first 1000 and something bytes of the array are equal to 0, why is this, does this have anything to do with the zoom dial on the PS3 eye itself?

Profile
 
 
Posted: 09 February 2010 01:34 PM   [ Ignore ]   [ # 3 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  585
Joined  2009-09-17
D.J.T.J - 09 February 2010 03:12 AM

Hey Alex
Yeh I noteiced that, and got it set up and it will now write into the memory space provided but still something seems confusing. When i make the allocated memory equal to 4 times the resolution this is more than it seems to need to hold the entire frame, also it seems to be adding in black space at the start of the image, ie the first 1000 and something bytes of the array are equal to 0, why is this, does this have anything to do with the zoom dial on the PS3 eye itself?

This is normal. The frame buffer needs to be at least 4x the resolution because color mode operates in 32bits.

AlexP

Profile
 
 
Posted: 10 February 2010 01:13 AM   [ Ignore ]   [ # 4 ]
New Member
Rank
Total Posts:  3
Joined  2010-02-06

So is there a way to stop it storing extra 0’s or should I just run with it?
Just quickly to introduce myself, I am an honours student at Abertay University, and my Honours disitation is based on Computer Vision, hence why I am using your driver but not using OpenCV.

Profile
 
 
 
 


RSS 2.0     Atom Feed