endernewton / tf-faster-rcnn

Tensorflow Faster RCNN for Object Detection
https://arxiv.org/pdf/1702.02138.pdf
MIT License
3.65k stars 1.58k forks source link

wonder about generate_anchor(anchor) #401

Open Emma-uestc opened 5 years ago

Emma-uestc commented 5 years ago

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

zyuerugou commented 5 years ago

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