I’m recoding a lot of my eyetracker project, which I last mention in August
or so. Long story short, the image from the webcam is not coloured
properly. This is the code I am using:
I would guess that the masks passed to SDL_CreateRGBSurfaceFrom are off. I
don’t know how you would find the appropriate ones for the webcam data
though, besides the good old guess and check.
Jonny DOn Tue, Nov 16, 2010 at 1:17 PM, Alex Barry <alex.barry at gmail.com> wrote:
I’m recoding a lot of my eyetracker project, which I last mention in August
or so. Long story short, the image from the webcam is not coloured
properly. This is the code I am using:
Oh, the title of your message mentions YUV12. I’m not familiar with such
conversions, but someone else or the web might be.
Jonny DOn Tue, Nov 16, 2010 at 2:31 PM, Jonathan Dearborn <@Jonathan_Dearborn>wrote:
I would guess that the masks passed to SDL_CreateRGBSurfaceFrom are off.
I don’t know how you would find the appropriate ones for the webcam data
though, besides the good old guess and check.
Jonny D
On Tue, Nov 16, 2010 at 1:17 PM, Alex Barry <alex.barry at gmail.com> wrote:
I’m recoding a lot of my eyetracker project, which I last mention in
August or so. Long story short, the image from the webcam is not coloured
properly. This is the code I am using:
No problem. The thing I’m puzzled with is that SDL 1.2 had Overlay support,
which gave me the ability to set the pixels, and I could use this webcam no
problem. Now with SDL 1.3, it looks like I should directly be using
SDL_Texture, but I don’t have pixel access, and it doesn’t seem to make
sense to use SDL_Surface. I think I can probably do the conversion using
OpenCV, but I’m doing realtime face/eye tracking, so the less steps I have
to do each frame, the better.
Also, with my posted code, it seems like I probably shouldn’t be discarding
the texture every new frame…there should be a way for me to update the
texture without having to make a new one each time. I think the query
texture gives a double pointer to pixel data, so maybe I can try that, but I
don’t want to cause a nasty memory leak.
Suggestions?On Tue, Nov 16, 2010 at 2:32 PM, Jonathan Dearborn wrote:
Oh, the title of your message mentions YUV12. I’m not familiar with such
conversions, but someone else or the web might be.
Jonny D
On Tue, Nov 16, 2010 at 2:31 PM, Jonathan Dearborn wrote:
I would guess that the masks passed to SDL_CreateRGBSurfaceFrom are off.
I don’t know how you would find the appropriate ones for the webcam data
though, besides the good old guess and check.
Jonny D
On Tue, Nov 16, 2010 at 1:17 PM, Alex Barry <@Alex_Barry> wrote:
I’m recoding a lot of my eyetracker project, which I last mention in
August or so. Long story short, the image from the webcam is not coloured
properly. This is the code I am using: