Author |
Topic |
|
graph_man
328 Posts |
Posted - Dec 25 2018 : 13:54:53
|
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
|
Hi
I'll look into this when we are back in the office.
Nigel Xequte Software www.imageen.com
|
|
|
graph_man
328 Posts |
Posted - Dec 26 2018 : 03:31:58
|
Thanks |
|
|
xequte
38615 Posts |
|
graph_man
328 Posts |
Posted - Jan 08 2019 : 07:06:23
|
I need to do that automatically (for all big areas). |
|
|
graph_man
328 Posts |
Posted - Jan 08 2019 : 07:08:38
|
I should work like "Remove Isolated Pixels" but remove "if number of pixels more" instead of "if number of pixels less". |
|
|
spetric
Croatia
308 Posts |
Posted - Jan 08 2019 : 07:48:02
|
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. |
|
|
graph_man
328 Posts |
Posted - Jan 08 2019 : 07:54:56
|
> It will remove everything inside that white "paper".
I need to remove big black areas only and stay text without changes. |
|
|
graph_man
328 Posts |
Posted - Jan 08 2019 : 07:57:09
|
> You can apply morphological filter
What command I need to use for that? |
|
|
spetric
Croatia
308 Posts |
Posted - Jan 08 2019 : 08:06:14
|
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. |
|
|
graph_man
328 Posts |
Posted - Jan 08 2019 : 08:54:04
|
Thank you. |
|
|
|
Topic |
|