//opencv读取图片
cv::Mat image;
//const char *fileName = "HeadImage-UI/Photo-001.bmp";
const char *fileName = "HeadImage-UI/53d253192be47412.jpg!200x200.jpg"; image = cv::imread(fileName); //bitmap冲回image
Graphics::TBitmap *bitmap = new Graphics::TBitmap;
bitmap->PixelFormat = pf24bit;
bitmap->Height = image.rows;
bitmap->Width = image.cols;
for(int y=;y<bitmap->Height;y++)
{
uchar *ptr = image.ptr<uchar>(y);
Byte *p=(Byte*)bitmap->ScanLine[y];
for(int x=;x<bitmap->Width;x++)
{
p[] = ptr[];
p[] = ptr[];
p[] = ptr[];
p+=;
ptr+=;
}
}
Image1->Picture->Bitmap = bitmap;

Opencv读取各种格式图片,在TBitmap上面重绘的更多相关文章

  1. python中用opencv读取并显示图片

    一.读取并显示图片: import matplotlib.pyplot as plt # plt 用于显示图片 import matplotlib.image as mpimg # mpimg 用于读 ...

  2. Opencv读取与显示图片

    #include "stdafx.h"#include "cv.h"#include "cxcore.h"#include "hi ...

  3. tensorflow读取jpg格式图片报错 ValueError: Only know how to handle extensions: ['png']; with Pillow installed matplotlib can handle more images

    当运行mpimg.imread("img.jpg")时,spyder 出现如下错误: ValueError: Only know how to handle extensions: ...

  4. python base64 编解码,转换成Opencv,PIL.Image图片格式

    二进制打开图片文件,base64编解码,转成Opencv格式: # coding: utf-8 import base64 import numpy as np import cv2 img_file ...

  5. opencv 读取视频内容写入图片帧

    现在主要把自己平时用到的opencv功能记录到博客,一方面方便自己有时间来回顾,另一方便提供给大家一个参考. opencv 读取视频内容,把视频帧每一帧写成图片,存入电脑中.这个步骤是许多数据处理的基 ...

  6. 使用QT显示OpenCV读取的图片

    目录 1. 概述 2. 实现 2.1. 代码 2.2. 解析 3. 结果 1. 概述 OpenCV自带了一部分常用的GUI功能,但是更多的图像处理功能需要其他GUI框架来辅助实现,这里通过QT来显示O ...

  7. VS中OpenCV用imread读取不到图片

    转自:https://blog.csdn.net/u012423865/article/details/78116059 在VS中OpenCV用imread读取不到图片 今天在Visual Studi ...

  8. 用 opencv和numpy进行图片和字符串互转,并保存至 json

    用 opencv和numpy进行图片和字符串互转,并保存至 json 转至 https://zhuanlan.zhihu.com/p/27349847 受 用 base64 进行图片和字符串互转,并保 ...

  9. opencv读取并播放avi视屏

    视屏的本质是一些静态的图像的集合,opencv可以不断读取视屏中的图片,显示,就产生了类似电影的效果. 这样也就可以通过opencv对实时的视屏流进行处理了. #include "stdaf ...

随机推荐

  1. General protection fault Exceptions in Linux/IA32 Systems

    Computer Systems A Programmer's Perspective Second Edition Exception number Description Exception cl ...

  2. 设置MyEclipse开发项目时使用的JDK

    安装好MyEclipse之后,在MyEclipse中开发项目时,默认使用的是MyEclipse是自带的JDK,如下图所示: 如果我们需要使用自己安装好的JDK,那么就需要在MyEclipse中重新设置 ...

  3. 用正则验证字符串格式,形如:A)XXX B)XXXX C)XXX

    今天遇到个小功能,要验证某个英文选项是否正确,例如:A)accumulate B)circling C)communities  D)competition  E)domestic F)financi ...

  4. pro7

    1.本次课学习到的知识点: 函数的作用 确定函数的功能 定义函数 调用函数 2.实验过程中遇到的问题及解决方法: 定义函数时 变量的定义会出现混乱 通过看例题 多练习 逐渐熟悉 需从数学角度解决问题时 ...

  5. Gradle 修改 Maven 仓库地址

    gradle install--- http://www.itnose.net/detail/6500082.html http://stackoverflow.com/questions/51025 ...

  6. [LeetCode]题解(python):043-Multiply Strings

    题目来源 https://leetcode.com/problems/multiply-strings/ Given two numbers represented as strings, retur ...

  7. 12 Tips for Accurate Project Estimating

    Projects typically involve many dynamic aspects, yet they're often constrained by finite conditions. ...

  8. php-001-win7 环境下 wamp 的至简部署

    此文主要记录学习 PHP 开发环境 wamp 的至简部署.敬请各位小主参阅,若有不足之处,敬请大神指正,不胜感激! 首先依据自身的操作系统选择,进入 wamp 的网站 :http://www.wamp ...

  9. qt QMessageBox QInputDialog

    最近用到了QMessgaeBox和QInputDialog,QMessageBox用于提示,警告等消息,QInputDialog给用户弹出输入对话框. 参考链接 http://chenboqiang. ...

  10. cname和CDN

    http://blog.csdn.net/crazw/article/details/8986504 先说一下DNS的几个基本概念: 一. 根域 就是所谓的“.”,其实我们的网址www.baidu.c ...