ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 AutoCrop Issue
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

jeffp

USA
66 Posts

Posted - Jan 10 2025 :  16:18:51  Show Profile  Reply
I'm using this procedure to do an AutoCrop of an image

FViewer.Proc.AutoCrop(5, clNone, True);

What I can't understand is why it works on the attached "CropSuccess.tif" and NOT on the "CropFile.tif". They are essentially the same file.

Any help here would be welcome.


attach/jeffp/2025110161755_CropSuccess.tif

attach/jeffp/2025110161810_CropFail.tif

Here they are in zip format

attach/jeffp/2025110162020_Crop.zip
98.39 KB

jp

xequte

38730 Posts

Posted - Jan 10 2025 :  19:05:02  Show Profile  Reply
Hi Jeff

It is failing because there are black pixels at 2488,2748. However in the current beta we have added a threshold parameter to avoid isolated pixels like this. You can email me for it.

Nigel
Xequte Software
www.imageen.com
Go to Top of Page

jeffp

USA
66 Posts

Posted - Jan 11 2025 :  12:34:40  Show Profile  Reply
Yes I would the beta. Where do I email you for it?

jp
Go to Top of Page

xequte

38730 Posts

Posted - Jan 11 2025 :  15:03:34  Show Profile  Reply
Hi Jeff

I've emailed it to you.

Here are some examples


// Remove the black border from a scanned document
ImageEnView1.IO.Acquire();
ImageEnView1.Proc.AutoCrop(10, CreateRGB(0, 0, 0) );


// Remove the black border from a scanned document, but ignore any isolated pixels
ImageEnView1.IO.Acquire();
ImageEnView1.Proc.AutoCrop(10, CreateRGB(0, 0, 0), True, False, 0.001 );


Nigel
Xequte Software
www.imageen.com
Go to Top of Page

jeffp

USA
66 Posts

Posted - Jan 11 2025 :  17:44:25  Show Profile  Reply
I installed the beta code, but the CropFail.tif still does not crop down to how CropSuccess.tif does.

What are you getting when you run both files through your code?

I'm using

FViewer.Proc.AutoCrop(10, clNone, True, False, 0.001);



jp

attach/jeffp/2025111174655_CropResults.zip
167.22 KB
Go to Top of Page

xequte

38730 Posts

Posted - Jan 12 2025 :  19:08:27  Show Profile  Reply
Yes, it works for me. Your code above gives me an image that is 535x923.

Please ensure you are using the beta code, and not your older DCU files.



Nigel
Xequte Software
www.imageen.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: