Active-Contour-Loss icon indicating copy to clipboard operation
Active-Contour-Loss copied to clipboard

Question about the implementation of coutour extraction

Open liuquande opened this issue 4 years ago • 4 comments

Hi @xuuuuuuchen ,

I get some trouble to understand the implementation to compute the coutour length.

	x = y_pred[:,:,1:,:] - y_pred[:,:,:-1,:] # horizontal and vertical directions 
	y = y_pred[:,:,:,1:] - y_pred[:,:,:,:-1]

	delta_x = x[:,:,1:,:-2]**2
	delta_y = y[:,:,:-2,1:]**2
	delta_u = K.abs(delta_x + delta_y) 

According to implementation above, I draw an illustration to visualize the y_pred, delta_x and delta_y: image

As you can see, the delta_x and delta_y are not well aligned in the coordinate. In that case, the extracted coutour might be be incorrect.

Could you help me figure out what's wrong with my understanding?

Many thanks!

liuquande avatar Jun 15 '20 05:06 liuquande

Do you understand it now? I also can't figure it out at this moment.

xsola avatar Jul 06 '20 14:07 xsola

Do you understanding it now? I also can't figure it out at this moment.

Hi, I also cannot figure it out, and am waiting for the reply.

Hi @xuuuuuuchen, could you clarify this point?

liuquande avatar Jul 07 '20 04:07 liuquande

Hi, Quande In my understanding, the AC loss calculate the length term by a finite-difference in different axis, this term just was used as a regularization term to preserve the edge is closed and remove some noise prediction pixels (maybe, I am not sure). As for coordinate alignment, I think it not very important for the AC loss, but if you want to use an aligned length term, you can find an example from our lab github, maybe two or three days later. Best Wish, Xiangde Luo.

Luoxd1996 avatar Nov 01 '20 13:11 Luoxd1996

Do you understanding it now? I also can't figure it out at this moment.

Hi, I also cannot figure it out and am waiting for the reply.

Hi @xuuuuuuchen, could you clarify this point?

Hi,Dr. Liu, the aligned length term can be found at https://github.com/HiLab-git/ACELoss. Best wish, Xiangde Luo.

Luoxd1996 avatar Nov 02 '20 03:11 Luoxd1996