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
 Question of cropping Automatically.
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

jocker94

Korea
1 Posts

Posted - Aug 23 2016 :  00:33:21  Show Profile  Reply
Hi, Everyone,

I need to crop some image in Automatically.

The red rectangle is the target.

the red rectangle will large or small as the Yellow rectangle's size.

Attached is the sample.

Is possible with your Imageprocess component in Delphi XE2 ?

And how it can be invoke the code?

Regard.


xequte

38613 Posts

Posted - Aug 23 2016 :  19:51:49  Show Profile  Reply
Hi

There are autocropping methods in ImageEn:

http://www.imageen.com/help/TImageEnProc.AutoCrop.html

But they assume a background of fairly consistent color.


In your situation you are probably going to need to iterate throught the scanlines of your image to find the first top, first left, last bottom and last right red pixels.

Then pass these values to TImageEnProc.Crop():

http://www.imageen.com/help/TImageEnProc.Crop.html

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