Welcome Guest ( Log In | Register )


Important

The forums will be closing permanently the weekend of March 15th. Please see the notice in the announcements forum for details.

 
Need Help With Parallel Lines Bag.
« Next Oldest | Next Newest » Track this topic | Email this topic | Print this topic
MaxKhar
Posted: Feb 27 2011, 03:16 PM


Newbie


Group: Members
Posts: 1
Member No.: 30045
Joined: 27-February 11



Hello.
I have just started creating my first filter. I'm using the SDK sample from this site.
I've got a grayscale depth video (from Kinnect) and I need to make the front layer objects white (paint them 0xffffff).
So I planned on comparing pixels with a treshold and painting it white.

Processing video frames:

void VerticalBlurFilter::DepthFunction(void *dst0, ptrdiff_t dstpitch, const void *src0, ptrdiff_t srcpitch, uint32 w, uint32 h)
{

uint32 *dst = (uint32 *)dst0;
const uint32 *src = (const uint32 *)src0;
uint32 threshold = (0xbbbbbb);

// loop over all rows
for(int y=0; y<h; ++y) {
// loop over all pixels in current row
for(int x=0; x<w; ++x) {
uint32 pixelValue = src[x];

//this is my comparing
if (pixelValue>threshold) dst[x] = pixelValue;
else dst[x] = 0xffffff;
}

// advance to next row in destination and source pixmaps
dst = (uint32 *)((char *)dst + dstpitch);
src = (const uint32 *)((const char *)src + srcpitch);
}
}



But when I start this filter in VirtualDub I'm getting white parallel lines across objects instedd of solid white objects:

user posted image

I'm guessing that it's a newbie question, but if somebody knows or has any suggestions about the nature of these lines it would be very helpful.

 
     Top
phaeron
Posted: Feb 27 2011, 09:17 PM


Virtualdub Developer


Group: Administrator
Posts: 7773
Member No.: 61
Joined: 30-July 02



You need to ignore the dummy alpha channel in the upper 8 bits.
 
    Top
0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)
0 Members:
1 replies since Feb 27 2011, 03:16 PM Track this topic | Email this topic | Print this topic

<< Back to VirtualDub Development Forum