DSPRelated.com
Forums

Thresholding on EVMDM642

Started by H September 25, 2008
Hi everyone,
I have a working code (see
http://www.dsprelated.com/groups/c6x/show/9400.php) that enables my
EVMDM642 to display live video from a camera. I'm trying to modify
the code to do simple thresholding, IMG_thr_gt2max using IMGLIB.
However, I received the errors:
1. argument of type "FVID_Frame *" is incompatible with parameter of
type "const unsigned char *"
2. argument of type "FVID_Frame *" is incompatible with parameter of
type "unsigned char *restrict"

What I did was, first I defined cols, rows and threshold (needed by
IMG_thr_gt2max). Then I call the function first thing in the while
loop: IMG_thr_gt2max(capFrameBuf, disFrameBuf, cols, rows,
threshold);

I understand that the type of capFrameBuf/disFrameBuf is different
than that required by the function IMG_thr_gt2max. But I'm not
exactly sure what type FVID_Frame is, and how to solve this problem.
Thanks.
Hanief
Anyone can help?
Hanief
--- In c..., "H" wrote:
> Hi everyone,
> I have a working code (see
> http://www.dsprelated.com/groups/c6x/show/9400.php) that enables
> my EVMDM642 to display live video from a camera. I'm trying to
> modify the code to do simple thresholding, IMG_thr_gt2max using
> IMGLIB. However, I received the errors:
> 1. argument of type "FVID_Frame *" is incompatible with parameter
> of type "const unsigned char *"
> 2. argument of type "FVID_Frame *" is incompatible with parameter
> of type "unsigned char *restrict"
>
> What I did was, first I defined cols, rows and threshold (needed
> by IMG_thr_gt2max). Then I call the function first thing in the
> while loop: IMG_thr_gt2max(capFrameBuf, disFrameBuf, cols, rows,
> threshold);
>
> I understand that the type of capFrameBuf/disFrameBuf is different
> than that required by the function IMG_thr_gt2max. But I'm not
> exactly sure what type FVID_Frame is, and how to solve this
problem.
> Thanks.
> Hanief
hanief,

The fvid_frame data structure is fully defined in the TI document:
spra918a.pdf
This is application report:
"The TMS320DM642 Video Port Mini-Driver"
BTW:
That information took me less than 5 minutes to find, by searching the TI web
site and looking for keyword: FVID_Frame.
R. Williams

---------- Original Message -----------
From: "H"
To: c...
Sent: Tue, 07 Oct 2008 04:02:16 -0000
Subject: [c6x] Re: Thresholding on EVMDM642

> Anyone can help?
> Hanief
> --- In c..., "H" wrote:
> > Hi everyone,
> > I have a working code (see
> > http://www.dsprelated.com/groups/c6x/show/9400.php) that enables
> > my EVMDM642 to display live video from a camera. I'm trying to
> > modify the code to do simple thresholding, IMG_thr_gt2max using
> > IMGLIB. However, I received the errors:
> > 1. argument of type "FVID_Frame *" is incompatible with parameter
> > of type "const unsigned char *"
> > 2. argument of type "FVID_Frame *" is incompatible with parameter
> > of type "unsigned char *restrict"
> >
> > What I did was, first I defined cols, rows and threshold (needed
> > by IMG_thr_gt2max). Then I call the function first thing in the
> > while loop: IMG_thr_gt2max(capFrameBuf, disFrameBuf, cols, rows,
> > threshold);
> >
> > I understand that the type of capFrameBuf/disFrameBuf is different
> > than that required by the function IMG_thr_gt2max. But I'm not
> > exactly sure what type FVID_Frame is, and how to solve this
> problem.
> > Thanks.
> > Hanief
------- End of Original Message -------
Dear R. Williams,
I had actually found that application report the after I posted the
question. Even though it does explain about FVID function calls, it
doesn't really say what type FVID_Frame is. What does it mean when
you declare something as FVID_Frame? I spent close to a fortnight
trying to understand the document to no avail. Thus the repost.
Thanks.
Hanief

--- In c..., "Richard Williams" wrote:
>
> hanief,
>
> The fvid_frame data structure is fully defined in the TI document:
> spra918a.pdf
> This is application report:
> "The TMS320DM642 Video Port Mini-Driver"
>
> BTW:
> That information took me less than 5 minutes to find, by searching
the TI web
> site and looking for keyword: FVID_Frame.
>
> R. Williams
>
> ---------- Original Message -----------
> From: "H"
> To: c...
> Sent: Tue, 07 Oct 2008 04:02:16 -0000
> Subject: [c6x] Re: Thresholding on EVMDM642
>
> Anyone can help?
> Hanief
> > --- In c..., "H" wrote:
> > Hi everyone,
> > I have a working code (see
> > http://www.dsprelated.com/groups/c6x/show/9400.php) that enables
> > my EVMDM642 to display live video from a camera. I'm trying to
> > modify the code to do simple thresholding, IMG_thr_gt2max using
> > IMGLIB. However, I received the errors:
> > 1. argument of type "FVID_Frame *" is incompatible with parameter
> > of type "const unsigned char *"
> > 2. argument of type "FVID_Frame *" is incompatible with parameter
> > of type "unsigned char *restrict"
> >
> > What I did was, first I defined cols, rows and threshold (needed
> > by IMG_thr_gt2max). Then I call the function first thing in the
> > while loop: IMG_thr_gt2max(capFrameBuf, disFrameBuf, cols, rows,
> > threshold);
> >
> > I understand that the type of capFrameBuf/disFrameBuf is
different
> > than that required by the function IMG_thr_gt2max. But I'm not
> > exactly sure what type FVID_Frame is, and how to solve this
> problem.
> > Thanks.
> > Hanief
> ------- End of Original Message -------
Hanief,

On Tue, Oct 7, 2008 at 11:45 PM, H wrote:
> Dear R. Williams,
> I had actually found that application report the after I posted the
> question. Even though it does explain about FVID function calls, it
> doesn't really say what type FVID_Frame is.
Really??
1. Search the doc for 'FVID_Frame'. One of the matches defines it.
2. As mentioned earlier, it is a data structure that is defined in 'C'.
3. Locate someone who is familiar with C to explain it OR lookup the
keywords that you do not understand.
4. Take it a piece at a time, starting with the 'top level' and 'drill down'.

mikedunn
> What does it mean when
> you declare something as FVID_Frame? I spent close to a fortnight
> trying to understand the document to no avail. Thus the repost.
> Thanks.
> Hanief
>
> --- In c..., "Richard Williams" wrote:
>>
>> hanief,
>>
>> The fvid_frame data structure is fully defined in the TI document:
>> spra918a.pdf
>> This is application report:
>> "The TMS320DM642 Video Port Mini-Driver"
>>
>> BTW:
>> That information took me less than 5 minutes to find, by searching
> the TI web
>> site and looking for keyword: FVID_Frame.
>>
>> R. Williams
>>
>> ---------- Original Message -----------
>> From: "H"
>> To: c...
>> Sent: Tue, 07 Oct 2008 04:02:16 -0000
>> Subject: [c6x] Re: Thresholding on EVMDM642
>>
>> Anyone can help?
>> Hanief
>> > --- In c..., "H" wrote:
>> > Hi everyone,
>> > I have a working code (see
>> > http://www.dsprelated.com/groups/c6x/show/9400.php) that enables
>> > my EVMDM642 to display live video from a camera. I'm trying to
>> > modify the code to do simple thresholding, IMG_thr_gt2max using
>> > IMGLIB. However, I received the errors:
>> > 1. argument of type "FVID_Frame *" is incompatible with parameter
>> > of type "const unsigned char *"
>> > 2. argument of type "FVID_Frame *" is incompatible with parameter
>> > of type "unsigned char *restrict"
>> >
>> > What I did was, first I defined cols, rows and threshold (needed
>> > by IMG_thr_gt2max). Then I call the function first thing in the
>> > while loop: IMG_thr_gt2max(capFrameBuf, disFrameBuf, cols, rows,
>> > threshold);
>> >
>> > I understand that the type of capFrameBuf/disFrameBuf is
> different
>> > than that required by the function IMG_thr_gt2max. But I'm not
>> > exactly sure what type FVID_Frame is, and how to solve this
>> problem.
>> > Thanks.
>> > Hanief
>> ------- End of Original Message -------

--
www.dsprelated.com/blogs-1/nf/Mike_Dunn.php
hanief,

The FVID_Frame is the name of a struct.

That struct is fully defined in the previously referenced document.

R. Williams

Following is the relevant section(s) of the document.

/* definition of interlaced frame */
typedef struct FVID_IFrame{
unsigned char* y1;
unsigned char* cb1;
unsigned char* cr1;
unsigned char* y2;
unsigned char* cb2;
unsigned char* cr2;
}FVID_IFrame;
/* progressive frame */
typedef struct FVID_PFrame {
unsigned char* y;
unsigned char* cb;
unsigned char* cr;
} FVID_PFrame;
/* Raw frame, could be RGB, monochrome or just any data*/
/* interleaved Y/C frame etc. */
typedef struct FVID_RawIFrame{
unsigned char* buf1;
unsigned char* buf2;
} FVID_RawIFrame;
typedef struct FVID_RawPFrame{
unsigned char* buf;
} FVID_RawPFrame;
/* definition of interlaced frame */
typedef struct FVID_IFrame{
unsigned char* y1;
unsigned char* cb1;
unsigned char* cr1;
unsigned char* y2;
unsigned char* cb2;
unsigned char* cr2;
}FVID_IFrame;
/* progressive frame */ /* definition of interlaced frame */
typedef struct FVID_IFrame{
unsigned char* y1;
unsigned char* cb1;
unsigned char* cr1;
unsigned char* y2;
unsigned char* cb2;
unsigned char* cr2;
}FVID_IFrame;
/* progressive frame */
typedef struct FVID_PFrame {
unsigned char* y;
unsigned char* cb;
unsigned char* cr;
} FVID_PFrame;
/* Raw frame, could be RGB, monochrome or just any data*/
/* interleaved Y/C frame etc. */
typedef struct FVID_RawIFrame{
unsigned char* buf1;
unsigned char* buf2;
} FVID_RawIFrame;
typedef struct FVID_RawPFrame{
unsigned char* buf;
} FVID_RawPFrame;
/* definition of interlaced frame */
typedef struct FVID_IFrame{
unsigned char* y1;
unsigned char* cb1;
unsigned char* cr1;
unsigned char* y2;
unsigned char* cb2;
unsigned char* cr2;
}FVID_IFrame;
/* progressive frame */
typedef struct FVID_PFrame {
unsigned char* y;
unsigned char* cb;
unsigned char* cr;
} FVID_PFrame;
/* Raw frame, could be RGB, monochrome or just any data*/
/* interleaved Y/C frame etc. */
typedef struct FVID_RawIFrame{
28 The TMS320DM642 Video Port MiniDriver
SPRA918A
unsigned char* buf1;
unsigned char* buf2;
} FVID_RawIFrame;
typedef struct FVID_RawPFrame{
unsigned char* buf;
} FVID_RawPFrame;
/* FVID frame buffer descriptor */
typedef struct FVID_Frame {
QUE_Elem queElement; /* the first two words are for queuing
union {
FVID_IFrame iFrm; /* y/c frame buffer */
FVID_PFrame pFrm; /* y/c frame buffer */
FVID_RawIFrame riFrm; /* raw frame buffer */
FVID_RawPFrame rpFrm; /* raw frame buffer */
} frame;
} FVID_Frame;

typedef struct FVID_PFrame {
unsigned char* y;
unsigned char* cb;
unsigned char* cr;
} FVID_PFrame;
/* Raw frame, could be RGB, monochrome or just any data*/
/* interleaved Y/C frame etc. */
typedef struct FVID_RawIFrame{
28 The TMS320DM642 Video Port MiniDriver
SPRA918A
unsigned char* buf1;
unsigned char* buf2;
} FVID_RawIFrame;
typedef struct FVID_RawPFrame{
unsigned char* buf;
} FVID_RawPFrame;
/* FVID frame buffer descriptor */
typedef struct FVID_Frame {
QUE_Elem queElement; /* the first two words are for queuing
union {
FVID_IFrame iFrm; /* y/c frame buffer */
FVID_PFrame pFrm; /* y/c frame buffer */
FVID_RawIFrame riFrm; /* raw frame buffer */
FVID_RawPFrame rpFrm; /* raw frame buffer */
} frame;
} FVID_Frame;
---------- Original Message -----------
From: "H"
To: c...
Sent: Wed, 08 Oct 2008 04:45:13 -0000
Subject: [c6x] Re: Thresholding on EVMDM642

> Dear R. Williams,
> I had actually found that application report the after I posted the
> question. Even though it does explain about FVID function calls, it
> doesn't really say what type FVID_Frame is. What does it mean when
> you declare something as FVID_Frame? I spent close to a fortnight
> trying to understand the document to no avail. Thus the repost.
> Thanks.
> Hanief
>
> --- In c..., "Richard Williams" wrote:
> >
> > hanief,
> >
> > The fvid_frame data structure is fully defined in the TI document:
> > spra918a.pdf
> > This is application report:
> > "The TMS320DM642 Video Port Mini-Driver"
> >
> > BTW:
> > That information took me less than 5 minutes to find, by searching
> the TI web
> > site and looking for keyword: FVID_Frame.
> >
> > R. Williams
> >
> > ---------- Original Message -----------
> > From: "H"
> > To: c...
> > Sent: Tue, 07 Oct 2008 04:02:16 -0000
> > Subject: [c6x] Re: Thresholding on EVMDM642
> >
> > Anyone can help?
> > Hanief
> > > --- In c..., "H" wrote:
> > > Hi everyone,
> > > I have a working code (see
> > > http://www.dsprelated.com/groups/c6x/show/9400.php) that enables
> > > my EVMDM642 to display live video from a camera. I'm trying to
> > > modify the code to do simple thresholding, IMG_thr_gt2max using
> > > IMGLIB. However, I received the errors:
> > > 1. argument of type "FVID_Frame *" is incompatible with parameter
> > > of type "const unsigned char *"
> > > 2. argument of type "FVID_Frame *" is incompatible with parameter
> > > of type "unsigned char *restrict"
> > >
> > > What I did was, first I defined cols, rows and threshold (needed
> > > by IMG_thr_gt2max). Then I call the function first thing in the
> > > while loop: IMG_thr_gt2max(capFrameBuf, disFrameBuf, cols, rows,
> > > threshold);
> > >
> > > I understand that the type of capFrameBuf/disFrameBuf is
> different
> > > than that required by the function IMG_thr_gt2max. But I'm not
> > > exactly sure what type FVID_Frame is, and how to solve this
> > problem.
> > > Thanks.
> > > Hanief
> > ------- End of Original Message -------
------- End of Original Message -------