anchors:
Sort by pyramid level first.
Within each level, sort anchors by feature map processing sequence. Typically, a convolution layer processes a feature map starting from top-left and moving right row by row.
For each feature map cell, pick any sorting order for the anchors of different ratios. Here we match the order of ratios passed to the function.
Anchor Stride:略
RPN中anchor生成机制
相关超参数设置:
base_size=16
ratios=[0.5, 1, 2]
scales== [8 16 32]
第一步:s=1616=256 zero_base的坐标体系里对应的中心点坐标为(7.5,7.5)
第二步:s/ratios =>256/[0.5, 1, 2]=[512,256,128]
第三步:根据第二步得到三种尺寸的anchors
h/w= ratios ①
w.h=s ②
②/①=> w^2= s/ratios =[512,256,128]
w=[512,256,128]的算术平方根四舍五入= [23 16 11]
根据①式有 h=wratios = [12 16 22]
得到三种尺寸的anchors [(23,12),(16,16),(11,22)]
第四步:根据中心点(7.5,7.5)不变原则得到对应尺寸的anchors=(xmin,ymin,xmax,ymax)
固anchor:[[-3.5 2 18.5 13] [0 0 15 15] [2.5 -3 12.5 18]]
第五步:每种anchor对应scales进行扩大,3*3=9种anchors,这里不再依依列出