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

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Watershed

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
Arash Posted - Jun 14 2021 : 12:11:47
I'm trying to use watershed with polyline instead of drawing ellipse(like demo project)
after drawing two polyline layers, they will merge with each other and convert to "TIEImageLayer" and then everything is the same as the watershed demo
but it selects something like this
anybody knows why?!

9   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Jun 25 2021 : 22:24:21
Hi Arash

Here is the completed polyline Watershed demo:

attach/xequte/202162522239_WatershedSelection_Polyline.zip
837.94 KB

Nigel
Xequte Software
www.imageen.com
xequte Posted - Jun 24 2021 : 23:57:54
Hi Arash

We'll have a fix for the selection issue in the upcoming release of ImageEn and IEVision (July).

You can free the memory held by the watershed object with:
Watershed := nil;

Nigel
Xequte Software
www.imageen.com
Arash Posted - Jun 24 2021 : 10:00:26
Hi dear Nigel

Watershed := IEVisionLib.createWatershed;
Watershed.setInputImage(ImageEnView1.Layers[0].Bitmap.GetIEVisionImage());
Watershed.setMarkers(0);

I'm trying to remove the background of an image and these three lines use about 300MB of memory for a special image
how can I free up the memory after finishing my work?
xequte Posted - Jun 17 2021 : 17:50:08
Thank you. We're investigating this...

Nigel
Xequte Software
www.imageen.com
Arash Posted - Jun 17 2021 : 04:26:54
Also, I think there is another problem
After:

ImageEnView1.Deselect;
Watershed.getSelectionMask(ImageEnView1.SelectionMask, integer(clRed));
ImageEnView1.SelectCustom;

there is a border around the image that is not selected:


xequte Posted - Jun 15 2021 : 18:25:29
Hmm. I created a demo to allow polyline selection:

attach/xequte/2021615182231_WatershedSelection.zip
1601.62 KB

(importantly setting the polyline AntiAlias to false).

But I had the same difficutly as you. I will pass the demo onto my partner who does the IEVision development.

Nigel
Xequte Software
www.imageen.com
Arash Posted - Jun 15 2021 : 05:49:29
Watershed := IEVisionLib.createWatershed;
imageEnView1.LayersCurrent := 0;
Watershed.setInputImage(imageEnView1.Layers[0].Bitmap.GetIEVisionImage());
Watershed.setMarkers(0);
imageEnView1.MouseInteractGeneral :=[];
imageEnView1.MouseInteractLayers := [mlClickCreatePolylineLayers, mlEditLayerPoints];



---- After creating two polyline layers, they will merge with each other:



imageEnView1.LayersDeselectAll;
if imageEnView1.LayersCount = 3 then imageEnView1.LayersMerge([1, 2]);
imageEnView1.LayersCurrent := 0;
imageEnView1.Layers[1].Bitmap.Write('D:\a.png');
Watershed.setMarkers(0);
Watershed.setMarkers(imageEnView1.Layers[1].Bitmap.GetIEVisionImage());
imageEnView1.Layers[1].Bitmap.Origin := ieboBOTTOMLEFT;
Watershed.run;
imageEnView1.Deselect;
Watershed.getSelectionMask(imageEnView1.SelectionMask, integer(clRed));
imageEnView1.SelectCustom;
Arash Posted - Jun 15 2021 : 05:36:36
this is a transparent image

xequte Posted - Jun 15 2021 : 00:19:49
Hi

Try adding a button to output the watershed bitmap to a file:

ImageEnView1.Layers[1].Bitmap.write('d:\out.png');

Ensure that it looks like this:



Note the black background.

You'd need to show me your code for more detail.

Nigel
Xequte Software
www.imageen.com