Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
15 years ago

bounding box-image processing

I am doing a project which is image processing. The image ia captured using TRDB_D5M. I need to bound an red color object using bounding box. The VGA controller from the CD does not show oCurrentX and oCurrentY. How do i control the iPosX and iPosY of the pixel. Which module should i connect to if there is not from VGA controller?

This is the sameple code which i find in journal..

Pixel Detection by Threshold

.

.

// value > Threshold => pixel belongs to BLOB

if (( iVGA_R + iVGA_G + iVGA_B ) > threshold )

begin

// check if pixel belongs to current frame

if( currentFrame == countFrames )

begin

// compute coordinates for bounding box

if( iPosX < minX ) minX = iPosX ;

if( iPosX > maxX ) maxX = iPosX ;

if( iPosY < minY ) minY = iPosY ;

if( iPosY > maxY ) maxY = iPosY ;

end

end // end threshold

// compute difference between minX , minY , maxX , maxY

diffX = (( maxX - minX ) > >1); //>>1 == division by 2

diffY = (( maxY - minY ) > >1); //>>1 == division by 2

.

.

// send BLOB attributs to output , if new frame starts

if( currentFrame < countFrames )

begin

othrPosX = ( minX + diffX );

othrPosY = ( minY + diffY );

currentFrame = countFrames ;

maxX = 0;

minX = 1000;

maxY = 0;

minY = 1000;

end

.
No RepliesBe the first to reply