所以,我想了解caffe在调整为300x300时会丢失高分辨率图像的细节吗?
在将图片尺寸调整为我的1200x990图片的300x300时,可能有两种情况: 1)播种 2)压扁
在第一种情况下,即裁剪,这丢失了我实际带有标签的图像的细节
在第二种情况下,即将我原来的高分辨率图像压缩为小尺寸,这也意味着通过高分辨率图像是浪费的
现在,我看到了源代码和 train.prototxt
transform_param {
resize_param {
resize_mode: WARP
height: 300
width: 300
}
}
然后我看到了用于封装和查找的cpp代码
链接到cpp代码here
void UpdateBBoxByResizePolicy(const ResizeParameter& param,
const int old_width, const int old_height,
NormalizedBBox* bbox) {
float new_height = param.height();
float new_width = param.width();
float orig_aspect = static_cast<float>(old_width) / old_height;
float new_aspect = new_width / new_height;
float x_min = bbox->xmin() * old_width;
float y_min = bbox->ymin() * old_height;
float x_max = bbox->xmax() * old_width;
float y_max = bbox->ymax() * old_height;
.....
.....
和实际逻辑
switch (param.resize_mode()) {
case ResizeParameter_Resize_mode_WARP:
x_min = std::max(0.f, x_min * new_width / old_width);
x_max = std::min(new_width, x_max * new_width / old_width);
y_min = std::max(0.f, y_min * new_height / old_height);
y_max = std::min(new_height, y_max * new_height / old_height);
break;
现在我了解Cplusplus,但我不了解的是什么是bbox? WRAP模式的逻辑是什么?
有人可以解释一下我的1200x900图片发生了什么。谢谢