91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 5.34MB
    文件類型: .rar
    金幣: 2
    下載: 0 次
    發(fā)布日期: 2023-11-11
  • 語言: 其他
  • 標簽: 圖像拼??

資源簡介

由于項目需要,其中一部分功能是需要實現(xiàn)360度旋轉相機的圖像拼接顯示功能,于是使用opencv來將其實現(xiàn)。 顯示方式為:接收一幀,顯示一幀 //image1、image2分別為待拼接的左右兩張圖像,index為image1的編號。BIGframe為存放的拼接圖像。每執(zhí)行一次放置一張圖像。 //當輸入index為0時,即為第一張圖像時,僅僅存入當前幀,不拼接;當index不等于0時,執(zhí)行拼接操作。 //該實現(xiàn)功能:讀取第一幀,當下一幀到來時,使用拼接、平滑計算,重新計算上一幀,并去掉上一陣左邊重疊區(qū)域,得到更新的上一幀。 //第一張與最后一張圖像之間不執(zhí)行拼接操作

資源截圖

代碼片段和文件信息

//?ImageStitch.cpp?:?定義控制臺應用程序的入口點。
//

#include?“stdafx.h“
#include?
#include?
#include?
#include?
#include?
#include?

using?namespace?std;
using?namespace?cv;


//image1、image2分別為待拼接的左右兩張圖像,index為image1的編號。BIGframe為存放的拼接圖像。每執(zhí)行一次放置一張圖像。
//當輸入index為0時,即為第一張圖像時,僅僅存入當前幀,不拼接;當index不等于0時,執(zhí)行拼接操作。
//該實現(xiàn)功能:讀取第一幀,當下一幀到來時,使用拼接、平滑計算,重新計算上一幀,并去掉上一陣左邊重疊區(qū)域,得到更新的上一幀。
//第一張與最后一張圖像之間不執(zhí)行拼接操作
void?ImageStitch(int?index?Mat?&image1?Mat?&image2?const?Mat?&Comframe)
{
static?int?image_source_width?=?120;
static?int?image_template_width?=?100;
static?int?image_template_height?=?580;
static?int?deltaY?=?0;
static?Point?PreMaxLoc;
static?const?int?BigCols?=?6;//拼接的圖像每行6張
static?const?int?BigRows?=?2;//拼接的圖像每列2張
static?const?int?Firstframe?=?0;
if?(!index)
{
PreMaxLoc.x?=?5;//偏移量x屬于0-20x取任意位置均可以。保持第一張圖片寬度為800-120+5=685
PreMaxLoc.y?=?10;//偏移量y屬于0-20當y=0時,為理想值,無偏移量(即兩幀圖像無上下偏移)。
deltaY?=?0;//第一張圖像上下無偏移量
}
else
{
Mat?image_source?=?image1(Rect(800?-?image_source_width?0?image_source_width?600));
Mat?image_template?=?image2(Rect(0?10?image_template_width?image_template_height));
cv::Mat?image_matched;
//模板匹配
cv::matchTemplate(image_source?image_template?image_matched?cv::TM_CCORR_NORMED);?//TM_SQDIFF=0?TM_SQDIFF_NORMED=1?TM_CCORR=2?TM_CCORR_NORMED=3?TM_CCOEFF=4?TM_CCOEFF_NORMED=5
double?minVal?maxVal;
cv::Point?minLoc?maxLoc;
//尋找最佳匹配位置
cv::minMaxLoc(image_matched?&minVal?&maxVal?&minLoc?&maxLoc);
Mat?overlay1?=?image1(Rect(800?-?image_source_width?+?maxLoc.x?0?image_source_width?-?maxLoc.x?image1.rows?-?10?+?maxLoc.y));??//左邊區(qū)域
Mat?overlay2?=?image2(Rect(0?10?-?maxLoc.y?image_source_width?-?maxLoc.x?image2.rows?-?10?+?maxLoc.y));?//右邊區(qū)域
Mat?overlay?=?Mat::zeros(overlay2.rows?overlay2.cols?CV_8UC1);
for?(int?i?=?0;?i {
uchar*?dataoverlay1?=?overlay1.ptr(i);
uchar*?dataoverlay2?=?overlay2.ptr(i);
uchar*?dataoverlay?=?overlay.ptr(i);
for?(int?j?=?0;?j {
double?weight;
weight?=?(double)j?/?overlay2.cols;??//隨距離改變而改變的疊加系數(shù)
dataoverlay[j]?=?(1?-?weight)*dataoverlay1[j]?+?weight*dataoverlay2[j];
}
}
overlay.copyTo(image1(Rect(800?-?image_source_width?+?maxLoc.x?0?overlay.cols?overlay.rows)));
deltaY?=?deltaY?+?(10?-?PreMaxLoc.y);
Mat?newframe1?=?image1(Rect(image_source_width?-?PreMaxLoc.x?deltaY?image1.cols?-?image_source_width?+?PreMaxLoc.x?514));//高度給定值514,否則由于下面的resize語句,造成錯位
cv::resize(newframe1?newframe1?Size(640?480)?0?0?INTER_NEAREST);
newframe1.copyTo(Comframe(Rect(((index?-?1)?%?BigCols)*?newframe1.cols?((index?-?1)?/?BigCols)*newframe1.rows?newframe1.cols?newframe1.rows)));
if?(index?==?(BigCols*BigRows?+?Firstframe?-?1))//最后一張圖像不執(zhí)行拼接操作,與上一張圖像同時顯示
{
Mat?newframe2?=?image2(Rect(image_source_width?-?maxLoc.x?deltaY?

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----

?????文件??????77312??2018-11-15?18:55??ImageStitch\Debug\ImageStitch.exe

?????文件?????456352??2018-11-15?18:55??ImageStitch\Debug\ImageStitch.ilk

?????文件????1560576??2018-11-15?18:55??ImageStitch\Debug\ImageStitch.pdb

?????文件?????481078??2018-10-22?14:34??ImageStitch\ImageStitch\0.bmp

?????文件?????481078??2018-10-22?14:34??ImageStitch\ImageStitch\1.bmp

?????文件?????481078??2018-10-22?14:34??ImageStitch\ImageStitch\10.bmp

?????文件?????481078??2018-10-22?14:34??ImageStitch\ImageStitch\11.bmp

?????文件?????481078??2018-10-22?14:34??ImageStitch\ImageStitch\2.bmp

?????文件?????481078??2018-10-22?14:34??ImageStitch\ImageStitch\3.bmp

?????文件?????481078??2018-10-22?14:34??ImageStitch\ImageStitch\4.bmp

?????文件?????481078??2018-10-22?14:34??ImageStitch\ImageStitch\5.bmp

?????文件?????481078??2018-10-22?14:34??ImageStitch\ImageStitch\6.bmp

?????文件?????481078??2018-10-22?14:34??ImageStitch\ImageStitch\7.bmp

?????文件?????481078??2018-10-22?14:34??ImageStitch\ImageStitch\8.bmp

?????文件?????481078??2018-10-22?14:34??ImageStitch\ImageStitch\9.bmp

?????文件????3687478??2018-11-15?19:49??ImageStitch\ImageStitch\Comframe.bmp

?????文件????????315??2018-11-15?18:55??ImageStitch\ImageStitch\Debug\ImageStitch.log

?????文件?????241414??2018-11-15?18:55??ImageStitch\ImageStitch\Debug\ImageStitch.obj

?????文件????1703936??2018-11-15?18:47??ImageStitch\ImageStitch\Debug\ImageStitch.pch

?????文件???????1758??2018-11-15?18:55??ImageStitch\ImageStitch\Debug\ImageStitch.tlog\cl.command.1.tlog

?????文件??????33230??2018-11-15?18:55??ImageStitch\ImageStitch\Debug\ImageStitch.tlog\CL.read.1.tlog

?????文件???????1714??2018-11-15?18:55??ImageStitch\ImageStitch\Debug\ImageStitch.tlog\CL.write.1.tlog

?????文件????????198??2018-11-15?18:55??ImageStitch\ImageStitch\Debug\ImageStitch.tlog\ImageStitch.lastbuildstate

?????文件???????2252??2018-11-15?18:55??ImageStitch\ImageStitch\Debug\ImageStitch.tlog\link.command.1.tlog

?????文件???????3680??2018-11-15?18:55??ImageStitch\ImageStitch\Debug\ImageStitch.tlog\link.read.1.tlog

?????文件????????920??2018-11-15?18:55??ImageStitch\ImageStitch\Debug\ImageStitch.tlog\link.write.1.tlog

?????文件??????12151??2018-11-15?18:47??ImageStitch\ImageStitch\Debug\stdafx.obj

?????文件?????863232??2018-11-15?18:55??ImageStitch\ImageStitch\Debug\vc120.idb

?????文件?????815104??2018-11-15?18:55??ImageStitch\ImageStitch\Debug\vc120.pdb

?????文件???????4384??2018-11-15?18:55??ImageStitch\ImageStitch\ImageStitch.cpp

............此處省略20個文件信息

評論

共有 條評論