本文整理汇总了C++中image_type::resize方法的典型用法代码示例。如果您正苦于以下问题:C++ image_type::resize方法的具体用法?C++ image_type::resize怎么用?C++ image_type::resize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类image_type
的用法示例。
在下文中一共展示了image_type::resize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RSS_MultiSensor_Fleet_Region
void RSS_MultiSensor_Fleet_Region(const image_type &VLImage, const image_type &IRImage, image_type &result1, image_type &result2, float regions[61])
{
using namespace rss;
rss::FleetEdgeDetector detector;
detector(IRImage, result1);
// result1 holds the fution image
RSS_MultiSensor_Wavelet_Fusion(VLImage,IRImage,result1);
// put the image of result into the Memeory dc
HDC m_hDC = CreateCompatibleDC(::GetDC(NULL));
HBITMAP m_hBitmap = CreateCompatibleBitmap(::GetDC(NULL),result1.width(),result1.height());
HPEN m_hPen = CreatePen(PS_SOLID,1,RGB(255,255,255));
HBRUSH m_hBrush = (HBRUSH)GetStockObject(NULL_BRUSH);
SelectObject(m_hDC,m_hBitmap);
SelectObject(m_hDC,m_hPen);
SelectObject(m_hDC,m_hBrush);
SetBkMode(m_hDC,TRANSPARENT);
SetTextColor(m_hDC,RGB(255,255,255));
for (int x = 0; x < result1.width(); x ++) {
for (int y = 0; y < result1.height(); y ++) {
int gray = rss::pixel_cast<rss::GrayPixel>(result1(x,y));
COLORREF color = RGB(gray,gray,gray);
SetPixel(m_hDC,x,y,color);
}
}
ObjectiveRegions r = detector.objective_region();
regions[0] = min(20u, static_cast<float>(r.size()));
for(size_t i = 0; i < min(20U, r.size()); i++) {
regions[i*3 + 1] = r[i].center.x();
regions[i*3 + 2] = r[i].center.y();
regions[i*3 + 3] = r[i].reliability;
}
// fill the background
result2.resize(result1.size());
for (int x = 0; x < result2.width(); x ++)
for (int y = 0; y < result2.height(); y ++)
result2(x,y) = 0;
// file the sensitive region
for (int i = 0; i < min(20U,r.size()); i ++) {
::Rectangle(m_hDC,r[i].region.left(),r[i].region.top(),r[i].region.right(),r[i].region.bottom());
int dx = (r[i].region.right() - r[i].region.left()) / 2;
int dy = (r[i].region.bottom() - r[i].region.top()) / 2;
char* str = RSS_MultiSensor_Get_String(i+1);
TextOut(m_hDC,r[i].region.left()+dx,r[i].region.top()+dy,str,strlen(str));
image_type region;
region.resize(r[i].region.size());
for (int x = r[i].region.left(); x < r[i].region.right(); x ++) {
for (int y = r[i].region.top(); y < r[i].region.bottom(); y ++) {
region(x-r[i].region.left(),y-r[i].region.top()) = VLImage(x,y);
}
}
RegionGrow<image_type> regionGrow(1.0/5.0,10);
image_type region_result;
regionGrow(region,region_result);
for (int x = r[i].region.left(); x < r[i].region.right(); x ++) {
for (int y = r[i].region.top(); y < r[i].region.bottom(); y ++) {
result2(x,y) = region_result(x-r[i].region.left(),y-r[i].region.top());
}
}
}
// put the image of Memory dc back to result1
for (int x = 0; x < VLImage.width(); x ++) {
for (int y = 0; y < VLImage.height(); y ++) {
result1(x,y) = rss::pixel_cast<rss::RealPixel>GetRValue(GetPixel(m_hDC,x,y));
}
}
DeleteObject(m_hDC);
DeleteObject(m_hBitmap);
DeleteObject(m_hPen);
DeleteObject(m_hBrush);
}