- // 缩小图像.cpp : Defines the entry point for the console application.
- //
- #include "stdafx.h"
- #include <cv.h>
- #include <highgui.h>
- const double scale = 0.5;
- IplImage* ResizeImage(IplImage *src)
- {
- // allocate memory for the dsc
- IplImage* dsc = cvCreateImage(cvSize(src->width*scale, src->height*scale),
- src->depth, src->nChannels);
opencv--用鼠标动态改变显示图像窗口大小
最新推荐文章于 2024-06-18 11:22:48 发布
本文介绍了一个使用OpenCV库的C++程序,该程序能够加载图像并创建两个显示窗口——"src"和"dsc"。通过缩放函数`ResizeImage`,可以将图像按比例缩小,然后在窗口中显示。用户可以使用鼠标改变窗口大小,程序会实时调整图像的显示尺寸。最后,程序等待键盘输入并释放内存。
摘要由CSDN通过智能技术生成