![](/img/trans.png)
[英]Removing a black part of image after stitching 2 images in OpenCV C++
[英]Crop image after stitching
我一直在使用DJI開發指南中的這段代碼(搜索“裁剪全景圖”部分)。 https://dji-dev.gitbooks.io/mobile-sdk-tutorials/content/en/iOS/PanoDemo/PanoDemo_en.html#stitching-photos
乍看之下,該算法似乎並不十分健壯,但是到目前為止,對於我的拼接用例來說,它已經被證明足夠好。 但是,我相信代碼在這兩行中有一些錯誤
bool isBottomNotBlack=checkBlackRow(gray, roiRect.y+roiRect.height,roiRect);
bool isRightNotBlack=checkBlackColumn(gray, roiRect.x+roiRect.width,roiRect);
應更改為
bool isBottomNotBlack=checkBlackRow(gray, roiRect.y+roiRect.height-1,roiRect);
bool isRightNotBlack=checkBlackColumn(gray, roiRect.x+roiRect.width-1,roiRect);
否則,您可能會遇到非系統性的C嚴重錯誤。 希望有幫助!
裁剪現在集成在opencv_stitching_tool<\/a>中
"
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.