Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Wednesday, April 1, 2009 4:01:13 AM(UTC)

papyrum  
papyrum

Groups: Registered
Posts: 32







Hello,

I am using LeadTools v16. and the .NET class library.

I would like to know how to do thresholding in black&white images. I tryied with the AutoBinarizeCommand but I have just read that it is only for color images.
Is there any way to do that without using scanner capabilities? if not, what cappability should I use?

Thanks very much,

Pablo L.G.
 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Wednesday, April 1, 2009 11:49:51 PM(UTC)

Adnan Ismail  
Guest

Groups: Guests
Posts: 3,028

Was thanked: 2 time(s) in 2 post(s)

The AutoBinarizeCommand Class supports Black and White images. Did you try the example in the help file and it failed with one of your images? If yes, can you send me a sample Black and White image that failed in a ZIP or RAR file?
 
#3 Posted : Thursday, April 2, 2009 12:57:34 AM(UTC)

papyrum  
papyrum

Groups: Registered
Posts: 32


Hello,

I send you the tif files that I tried to autobinarize usind the VbMain.exe example. It worked with the color tif I send, not with the brinay one.

I wait for your response.

Thanks very much,

Pablo L.G.
File Attachment(s):
SinUmbral.rar (656kb) downloaded 19 time(s).
 
#4 Posted : Thursday, April 2, 2009 1:02:27 AM(UTC)

papyrum  
papyrum

Groups: Registered
Posts: 32


I tried to send you the color tif file also, but I could not upload it. Sorry
 
#5 Posted : Thursday, April 2, 2009 6:40:53 AM(UTC)

Adnan Ismail  
Guest

Groups: Guests
Posts: 3,028

Was thanked: 2 time(s) in 2 post(s)

The purpose of the AutoBinarizeCommand is to convert the images into pure black and white images. However, if the image is already black and white, you will not see any effect on it.
 
#6 Posted : Thursday, April 2, 2009 10:47:29 PM(UTC)

papyrum  
papyrum

Groups: Registered
Posts: 32


Ok. Now I understand the Autobinarize function.

I attach two images.
Then, I would like yo to suggest me the way I could get something similar to the tif file ConUmbral.tif from the SinUmbral.tif if  it is possible. My purpose is to remove the background of the images if it is dark. I think this is called "threshold" in English.
I have read that I could do it with the ICAP_AUTOBRIGHT capability but I would like to know if there is any function to do it with leadtools.

I hope you could understand me :)

Thanks very much,

Pablo L.G.
File Attachment(s):
Pruebas Umbral2.rar (821kb) downloaded 21 time(s).
 
#7 Posted : Sunday, April 5, 2009 4:31:28 AM(UTC)

Adnan Ismail  
Guest

Groups: Guests
Posts: 3,028

Was thanked: 2 time(s) in 2 post(s)

Pablo,

Did you scan both images using the same scanner on the same machine? Can you tell me how exactly did you create the ConUmbral.tif image? If you used a scanner, can you send me details about the settings you applied to the scanner to generate this image and I will try to assist you more.

 
#8 Posted : Sunday, April 5, 2009 11:37:37 PM(UTC)

papyrum  
papyrum

Groups: Registered
Posts: 32



Good morning,

I scanned both images usign the scanner Panasonic KV-S2045C. I attach you the way I get the image ConUmbral.tif.

Thanks for yout assist.

Pablo L.G.
File Attachment(s):
Getting thresholded images.rar (78kb) downloaded 21 time(s).
 
#9 Posted : Monday, April 6, 2009 4:01:00 AM(UTC)

Adnan Ismail  
Guest

Groups: Guests
Posts: 3,028

Was thanked: 2 time(s) in 2 post(s)

If your twain driver supports the ICAP_THRESHOLD capability, use the Leadtools.Twain.SetCapability Method to set it in your application
 
#10 Posted : Monday, April 6, 2009 5:10:16 AM(UTC)

papyrum  
papyrum

Groups: Registered
Posts: 32


Hello Adnan,

Thanks very much. :) Now I am sure I can do it using capabilities but what I really want to know is If we can get almost same results in a scanner without this capability using any leadtools function.

Thanks again :)

Pablo L.G.


 
#11 Posted : Monday, April 6, 2009 6:55:30 AM(UTC)

Adnan Ismail  
Guest

Groups: Guests
Posts: 3,028

Was thanked: 2 time(s) in 2 post(s)


Some parts of the image are impossible to make like ConUmbral.tif, because when you scanned SinUmbral.tif with a different threshold setting, those parts because full black.

For example look in the image at the laptop screen at the upper left corner. There's large text with the number 15,4" and below it there is some text that reads like "MPARATIVA DE PRESSTACIONES..."

Most of that text is fully black in the darker image and there's no way to convert it.

However, I managed to get partial success using the following image processing steps in our Main C# demo:
1- Load ConUmbral.tif in C# Main demo.
2- From Color Menu -> Gray Scale, choose Gray Scale 8.
3- From Effects menu, Choose Blur-> Average and set the dimention value to 4.
4- From Color Menu -> Intensity Detect. Set the Low value to 40 and the High to 255.
5- Save the file in 1-bit Tiff with CCITT group 4.

The functions used in this process are:
1- GrayscaleCommand Class
2- AverageCommand Class
3- IntensityDetectCommand Class
 
#12 Posted : Tuesday, April 7, 2009 10:58:42 PM(UTC)

papyrum  
papyrum

Groups: Registered
Posts: 32


Thanks very much Adnan!
 
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.

Powered by YAF.NET | YAF.NET © 2003-2020, Yet Another Forum.NET
This page was generated in 0.216 seconds.