Barcodes not being detected using SetRoi()
Barcodes not being detected using SetRoi()
Hi, I have a number of documents with barcodes located in the same region (give or take a few pixels) on each page and am using SetRoi() to narrow down the barcode search...On the first 2 instances the barcodes are found without any problems but on the third and fourth instances (as well as others) the barcodes are only detected if I use a ResetRoi() instead of a SetRoi() even though they are in the same location as the first 2. Any ideas why this might be happening?
Thanks,
Iain
Thanks,
Iain
Re: Barcodes not being detected using SetRoi()
Hi,
I don't get you dude. Could you explain what you mean by "if I use a ResetRoi() instead of a SetRoi() even though they are in the same location as the first 2. "
Also if you can attach image for investigation it should be helpful.
Kind regards,
Loïc
I don't get you dude. Could you explain what you mean by "if I use a ResetRoi() instead of a SetRoi() even though they are in the same location as the first 2. "
Also if you can attach image for investigation it should be helpful.
Kind regards,
Loïc
Re: Barcodes not being detected using SetRoi()
Hi.
I think I must have the same problem. I'm trying to read a barcode selecting a region in a GdViewer, and works fine the first time, but if I select the same , or a similar zone containing the barcode, doesnt not read anythig. The code I'm using on the gdViewer1_MouseUp event of a GdViewer control is:
There is also a tif file for testing purpouses.
Best regards.
I think I must have the same problem. I'm trying to read a barcode selecting a region in a GdViewer, and works fine the first time, but if I select the same , or a similar zone containing the barcode, doesnt not read anythig. The code I'm using on the gdViewer1_MouseUp event of a GdViewer control is:
Code: Select all
private void gdViewer1_MouseUp(object sender, MouseEventArgs e)
{
try
{
if (this.gdViewer1.IsRect())
{
int LeftArea = 0;
int TopArea = 0;
int WidthArea = 0;
int HeightArea = 0;
this.gdViewer1.GetRectCoordinatesOnDocument(ref LeftArea, ref TopArea, ref WidthArea, ref HeightArea);
oGdPictureImaging.SetROI(LeftArea, TopArea, WidthArea, HeightArea);
if (oGdPictureImaging.Barcode1DReaderDoScan(ImageID, GdPicture.Barcode1DReaderScanMode.BestSpeed) == GdPicture.GdPictureStatus.OK)
{
int BarcodeCount = oGdPictureImaging.Barcode1DReaderGetBarcodeCount();
if (BarcodeCount > 0)
{
for (int i = 1; i <= BarcodeCount; i++)
{
if (oGdPictureImaging.Barcode1DReaderGetBarcodeType(i) == GdPicture.Barcode1DReaderType.Barcode1DReaderCode39)
MessageBox.Show("Value: " + oGdPictureImaging.Barcode1DReaderGetBarcodeValue(i));
}
}
else
{
MessageBox.Show("No Barcode");
}
oGdPictureImaging.Barcode1DReaderClear();
}
oGdPictureImaging.ReleaseGdPictureImage(ImageID);
}
}
catch (Exception ex)
{
this.Cursor = Cursors.Default;
MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
finally
{
oGdPictureImaging.ResetROI();
gdViewer1.ClearRect();
}
}
Best regards.
- Attachments
-
- testbarcode.tif (2.92 KiB) Viewed 7619 times
Re: Barcodes not being detected using SetRoi()
Hi,
This problem will be fixed for the next release.
Kind regards,
Loïc
This problem will be fixed for the next release.
Kind regards,
Loïc
Who is online
Users browsing this forum: No registered users and 2 guests