Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Valued Contributor III
683 Views

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 

.
0 Kudos