• 大小: 59.04MB
    文件类型: .zip
    金币: 2
    下载: 0 次
    发布日期: 2023-05-13
  • 语言: 其他
  • 标签: 畸变校正  

资源简介

最近在整理自己以前做过的一些东西,这是基于opencv的鱼眼摄像头畸变校正程序的github地址(https://github.com/WordZzzz/fisheye_calibration)(不知道怎么设置免积分下载,所以只能贴上github了)。 其中: normal_calibrate:基于OPENCV2与OPENCV3通用的函数实现,可实现USB摄像头实时畸变校正; fishey_calibrate:基于OPENCV3独有的fishyey结构体实现,可实现USB摄像头实时畸变校正; fishey_calibrate_img:基于OPENCV3独有的fishyey结构体实现,可实现单张图片畸变校正;

资源截图

代码片段和文件信息

//THE SOFTWARE IS PROVIDED “AS IS“ WITHOUT WARRANTY OF ANY KIND EXPRESS OR
//IMPLIED INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY
//FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
//AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM DAMAGES OR OTHER
//LIABILITY WHETHER IN AN ACTION OF CONTRACT TORT OR OTHERWISE ARISING FROM
//OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
//THE SOFTWARE.
#include  

#include “videoInput.h“
#include 

//Include Directshow stuff here so we don‘t worry about needing all the h files.
#include 
//#include “streams.h“
#pragma include_alias( “dxtrans.h“ “qedit.h“ )
#define __IDxtCompositor_INTERFACE_DEFINED__
#define __IDxtAlphaSetter_INTERFACE_DEFINED__
#define __IDxtJpeg_INTERFACE_DEFINED__
#define __IDxtKey_INTERFACE_DEFINED__
#include 
#include 
#include 

//for threading
#include 

#ifndef HEADER
#define HEADER(pVideoInfo) (&(((VIDEOINFOHEADER *) (pVideoInfo))->bmiHeader))
#endif

// Due to a missing qedit.h in recent Platform SDKs we‘ve replicated the relevant contents here
// #include 
MIDL_INTERFACE(“0579154A-2B53-4994-B0D0-E773148EFF85“)
ISampleGrabberCB : public IUnknown
{
  public:
    virtual HRESULT STDMETHODCALLTYPE SampleCB( 
        double SampleTime
        IMediaSample *pSample) = 0;
    
    virtual HRESULT STDMETHODCALLTYPE BufferCB( 
        double SampleTime
        BYTE *pBuffer
        long BufferLen) = 0;
    
};

MIDL_INTERFACE(“6B652FFF-11FE-4fce-92AD-0266B5D7C78F“)
ISampleGrabber : public IUnknown
{
  public:
    virtual HRESULT STDMETHODCALLTYPE SetOneShot( 
        BOOL OneShot) = 0;
    
    virtual HRESULT STDMETHODCALLTYPE SetMediaType( 
        const AM_MEDIA_TYPE *pType) = 0;
    
    virtual HRESULT STDMETHODCALLTYPE GetConnectedMediaType( 
        AM_MEDIA_TYPE *pType) = 0;
    
    virtual HRESULT STDMETHODCALLTYPE SetBufferSamples( 
        BOOL BufferThem) = 0;
    
    virtual HRESULT STDMETHODCALLTYPE GetCurrentBuffer( 
        /* [out][in] */ long *pBufferSize
        /* [out] */ long *pBuffer) = 0;
    
    virtual HRESULT STDMETHODCALLTYPE GetCurrentSample( 
        /* [retval][out] */ IMediaSample **ppSample) = 0;
    
    virtual HRESULT STDMETHODCALLTYPE SetCallback( 
        ISampleGrabberCB *pCallback
        long WhichMethodToCallback) = 0;
    
};
EXTERN_C const CLSID CLSID_SampleGrabber;
EXTERN_C const IID IID_ISampleGrabber;
EXTERN_C const CLSID CLSID_NullRenderer;

//use videoInput::setVerbose to change 
static bool verbose = true;

//use videoInput::setComMultiThreaded to change 
static bool VI_COM_MULTI_THREADED = false; 

///////////////////////////  HANDY FUNCTIONS  /////////////////////////////

void MyFreeMediaType(AM_MEDIA_TYPE& mt){
    if (mt.cbFormat != 0)
    {
        CoTaskMemFree((PVOID)mt.pbFormat);
        mt.cbFormat = 0;
        mt.pbFormat = NULL;
    }
    if (mt.pUnk != NULL)
  

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-01-28 06:05  fisheye_calibration-master\
     文件          66  2018-01-28 06:05  fisheye_calibration-master\.gitattributes
     文件       15506  2018-01-28 06:05  fisheye_calibration-master\README.md
     目录           0  2018-01-28 06:05  fisheye_calibration-master\calibrate\
     目录           0  2018-01-28 06:05  fisheye_calibration-master\calibrate\Debug\
     文件      184832  2018-01-28 06:05  fisheye_calibration-master\calibrate\Debug\calibrate.exe
     文件     1039196  2018-01-28 06:05  fisheye_calibration-master\calibrate\Debug\calibrate.ilk
     文件     2199552  2018-01-28 06:05  fisheye_calibration-master\calibrate\Debug\calibrate.pdb
     文件    46465024  2018-01-28 06:05  fisheye_calibration-master\calibrate\calibrate.sdf
     文件         951  2018-01-28 06:05  fisheye_calibration-master\calibrate\calibrate.sln
     文件       22528  2018-01-28 06:05  fisheye_calibration-master\calibrate\calibrate.v12.suo
     目录           0  2018-01-28 06:05  fisheye_calibration-master\calibrate\calibrate\
     目录           0  2018-01-28 06:05  fisheye_calibration-master\calibrate\calibrate\Debug\
     文件        2115  2018-01-28 06:05  fisheye_calibration-master\calibrate\calibrate\Debug\calibrate.log
     目录           0  2018-01-28 06:05  fisheye_calibration-master\calibrate\calibrate\Debug\calibrate.tlog\
     文件       66822  2018-01-28 06:05  fisheye_calibration-master\calibrate\calibrate\Debug\calibrate.tlog\CL.read.1.tlog
     文件        1228  2018-01-28 06:05  fisheye_calibration-master\calibrate\calibrate\Debug\calibrate.tlog\CL.write.1.tlog
     文件         161  2018-01-28 06:05  fisheye_calibration-master\calibrate\calibrate\Debug\calibrate.tlog\calibrate.lastbuildstate
     文件        1350  2018-01-28 06:05  fisheye_calibration-master\calibrate\calibrate\Debug\calibrate.tlog\cl.command.1.tlog
     文件        1306  2018-01-28 06:05  fisheye_calibration-master\calibrate\calibrate\Debug\calibrate.tlog\link.command.1.tlog
     文件        3162  2018-01-28 06:05  fisheye_calibration-master\calibrate\calibrate\Debug\calibrate.tlog\link.read.1.tlog
     文件         498  2018-01-28 06:05  fisheye_calibration-master\calibrate\calibrate\Debug\calibrate.tlog\link.write.1.tlog
     文件     1190912  2018-01-28 06:05  fisheye_calibration-master\calibrate\calibrate\Debug\vc120.idb
     文件     1175552  2018-01-28 06:05  fisheye_calibration-master\calibrate\calibrate\Debug\vc120.pdb
     文件      400340  2018-01-28 06:05  fisheye_calibration-master\calibrate\calibrate\Debug\videoInput.obj
     文件      246137  2018-01-28 06:05  fisheye_calibration-master\calibrate\calibrate\Debug\源.obj
     文件         260  2018-01-28 06:05  fisheye_calibration-master\calibrate\calibrate\Distortion.xml
     文件      166354  2018-01-28 06:05  fisheye_calibration-master\calibrate\calibrate\Image1.jpg
     文件      169283  2018-01-28 06:05  fisheye_calibration-master\calibrate\calibrate\Image10.jpg
     文件      166837  2018-01-28 06:05  fisheye_calibration-master\calibrate\calibrate\Image2.jpg
     文件      168060  2018-01-28 06:05  fisheye_calibration-master\calibrate\calibrate\Image3.jpg
............此处省略176个文件信息

评论

共有 条评论