tf-faster-rcnn icon indicating copy to clipboard operation
tf-faster-rcnn copied to clipboard

wonder about generate_anchor(anchor)

Open Emma-uestc opened this issue 6 years ago • 1 comments

the function `def _whctrs(anchor): """ Return width, height, x center, and y center for an anchor (window). """

w = anchor[2] - anchor[0] + 1 h = anchor[3] - anchor[1] + 1 x_ctr = anchor[0] + 0.5 * (w - 1) y_ctr = anchor[1] + 0.5 * (h - 1) return w, h, x_ctr, y_ctr` I misunstand the meaning of anchor,anchor = [left_top_x,left_top_y,right_bottom_x,right_bottom_y],if it does,then
w = right_bottom_x - left_top_x
h = right_bottom_y - left_top_y
x_center = left_top_x + 0.5 * w
y_center = right_bottom_y + 0.5 * h
however,the w,h,x_center,y_center are defined like above,then w,h is not right

Emma-uestc avatar Nov 27 '18 08:11 Emma-uestc

@Emma-uestc if you lost "+1", you will miss one row and one column pixels

zyuerugou avatar May 02 '19 13:05 zyuerugou