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
 Remove Isolated Area
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

graph_man

328 Posts

Posted - Dec 25 2018 :  13:54:53  Show Profile  Reply
Hello,

Could you add new feature which can work as "Remove Isolated Pixels" but automatically select and delete areas that contain MORE than a certain number of pixels.

My task is to clear black areas in attached file (file-1) to get result (file-2).





xequte

38615 Posts

Posted - Dec 25 2018 :  20:43:57  Show Profile  Reply
Hi

I'll look into this when we are back in the office.

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

graph_man

328 Posts

Posted - Dec 26 2018 :  03:31:58  Show Profile  Reply
Thanks
Go to Top of Page

xequte

38615 Posts

Posted - Jan 07 2019 :  20:16:06  Show Profile  Reply
Sorry, there does not seem an easy way to do this. Would it work for you to perform a floodfill from each of the image corners?

https://www.imageen.com/help/TImageEnProc.CastColor.html

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

graph_man

328 Posts

Posted - Jan 08 2019 :  07:06:23  Show Profile  Reply
I need to do that automatically (for all big areas).
Go to Top of Page

graph_man

328 Posts

Posted - Jan 08 2019 :  07:08:38  Show Profile  Reply
I should work like "Remove Isolated Pixels" but
remove "if number of pixels more" instead of "if number of pixels less".
Go to Top of Page

spetric

Croatia
308 Posts

Posted - Jan 08 2019 :  07:48:02  Show Profile  Reply
You can apply morphological filter (dilate or close) with window size 3 or 4.
on some grayscale or binary copy of your image. It will remove everything inside that white "paper". Then, use that new image as a mask to copy data from original image, covered by the mask, to some new white image.
Go to Top of Page

graph_man

328 Posts

Posted - Jan 08 2019 :  07:54:56  Show Profile  Reply
> It will remove everything inside that white "paper".

I need to remove big black areas only and stay text without changes.
Go to Top of Page

graph_man

328 Posts

Posted - Jan 08 2019 :  07:57:09  Show Profile  Reply
> You can apply morphological filter

What command I need to use for that?
Go to Top of Page

spetric

Croatia
308 Posts

Posted - Jan 08 2019 :  08:06:14  Show Profile  Reply
Yes, I know, but you can use that image as a mask
Here is an output of close operation with window 3:



Now, you can use that image as a mask, to copy a part of original image, covered by the mask, to some new white image. The algorithm should look like this:

1) make a copy of original image (origImg -> maskImg)
2) perform closing operation on maskImg.
3) create a new image and fill it with white (destImg).
4) copy origImage using maskImg to destImg.

For the last step, you can use origImg->CopyWithMask2(destImg, SelectionMask);
SelectionMask can be created from maskImg.

You can find close filter in TImageEnProc.Closing.
Go to Top of Page

graph_man

328 Posts

Posted - Jan 08 2019 :  08:54:04  Show Profile  Reply
Thank you.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: