This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Thursday, August 16, 2007 12:51:10 PM(UTC)
Groups: Registered
Posts: 4
Hi,
I'm tring to use LineRemove with very poor images and as a result I have also very poor results... :)
So I have an idea but I don't find the way to do it. Please help me.
What I want to do is copy the original image, dilate some times, then erode, and apply delete lines to this awfull image with very good lines, and then with the region built by the lineRemove method, apply some combine to the original image to delete the lines by pixel XOR over the poor image.
Is this possible, could it be done?, what is the way to extract an image from the region.
here is some code.
L_INT nRet;
LBitmapBase LeadBitmap; /* Bitmap handle to hold the loaded image */
nRet =LeadBitmap.Load (.....);
if(nRet !=SUCCESS)
return nRet;
LBitmap workbench;
workbench.copy( &LeadBitmap );
workbench.BinaryFilter( BFLT_DILATION_OMNI );
workbench.BinaryFilter( BFLT_DILATION_OMNI );
BITMAPHANDLE bitmapRegion;
memset( &bitmapRegion, 0, sizeof(BITMAPHANDLE));
LINEREMOVE lr;
memset ( &lr, 0, sizeof ( LINEREMOVE ) ) ;
lr.uFlags = flags;
lr.uStructSize = sizeof(LINEREMOVE);
lr.uBitmapStructSize = sizeof(BITMAPHANDLE);
lr.iMaxLineWidth = lineWidth;
lr.iMinLineLength = lineLength;
lr.iWall = wallHeight;
lr.iMaxWallPercent = maxWallPercent;
lr.uRemoveFlags = directionEnum;
lr.iGapLength = gapLength;
lr.iVariance = lineVariance;
lr.hRgn = NULL;
lr.pBitmapRegion = &bitmapRegion;
workbench.LineRemove( &lr );
....
Now is supposed that bitmapRegion contains the deleted lines, but I don't know how to build an image with this region in order to combine it with te original image..
please help me!.
Best regards.
#2
Posted
:
Friday, August 17, 2007 11:31:32 AM(UTC)
Groups: Registered, Tech Support, Administrators
Posts: 764
To combine only a portion of an image, use the LBitmapBase::Combine method. If you have a region selected in the source image, the Combine method will only combine that portion of the image. For a flat copy/paste, use the flags CB_DST_0 | CB_OP_ADD.
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.