iplimage

_IplImage

久未见 提交于 2019-12-06 03:04:41
IplImage结构 由于OpenCV主要针对的是计算机视觉方面的处理,因此在函数库中,最重要的结构体是IplImage结构。从本质上讲,他是一个CvMat对象,但它还有一些其他成员变量将矩阵解释为图像。IplImage结构来源于Intel的另外一个函数库Intel Image Processing Library (IPL),该函数库主要是针对 图像处理 。IplImage结构具体定义如下: typedef struct _IplImage { int nSize; /* IplImage大小 */ int ID; /* 版本 (=0)*/ int nChannels; /* 大多数OPENCV函数支持1,2,3 或 4 个通道 */ int alphaChannel; /* 被OpenCV忽略 */ int depth; /* 像素的位深度,主要有以下支持格式: IPL_DEPTH_8U, IPL_DEPTH_8S, IPL_DEPTH_16U,IPL_DEPTH_16S, IPL_DEPTH_32S, IPL_DEPTH_32F 和IPL_DEPTH_64F */ char colorModel[4]; /* 被OpenCV忽略 */ char channelSeq[4]; /* 同上 */ int dataOrder; /* 0 - 交叉存取 颜色通道 , 1 -

How to convert an OpenCV IplImage to an SDL_Surface?

陌路散爱 提交于 2019-12-06 01:48:30
问题 I'm trying to write a program which takes an SDL_Surface , converts it to an IplImage , uses the cvBlobsLib to find blobs, paints the blobs as spots back over the image, then converts the output IplImage back to an SDL_Surface . I'm almost done: only converting the IplImage back to an SDL_Surface hasn't been done yet. This IplImage has 3 image channels and is 8 bits per pixel. I think I have two calls I can use: SDL_Surface *SDL_CreateRGBSurface(Uint32 flags, int width, int height, int depth,

windows的c++源代码移植到linux

岁酱吖の 提交于 2019-12-05 16:55:58
1.将windows代码移植到linux时,对字符串的定义:string a ="yes",要加L,改为:string a =L"yes"。 2.在windows上面的汇编代码不能在linux上面使用。 3.在windows上面通过记事本打开后看到的保存代码文件编码形式为:ANSI,移植到linux上面时编码形式应保存为UTF-8 4.临时变量赋值: Mat rawImg,cloneRawImg; IplImage* rawIplImage; rawImg.copyTo(cloneRawImg); rawIplImage = &IplImage(cloneRawImg); 应改为: Mat rawImg,cloneRawImg; IplImage* rawIplImage; rawImg.copyTo(cloneRawImg); IplImage rawIplImage 2 ; rawIplImage 2 = IplImage(cloneRawImg); rawIplImage = & rawIplImage 2 ; 来源: CSDN 作者: lien0906 链接: https://blog.csdn.net/lien0906/article/details/40181447

Compressing IplImage to JPEG using libjpeg in OpenCV

落花浮王杯 提交于 2019-12-04 21:48:09
So I have this problem. I have an IplImage that i want to compress to JPEG and do something with it. I use libjpeg8b.The code exit when it goes the function of jpeg_start_compress() with an error of "Bogus input colorspace" .Here are my code. #include "highgui.h" #include <stdio.h> #include "jpeglib.h" #include "cv.h" #include <iostream> #include <fstream> using namespace std; using namespace cv; #pragma comment(lib, "jpeglib.lib") bool ipl2jpeg(IplImage *frame, unsigned char **outbuffer, unsigned long*outlen) { IplImage *img = new IplImage; memcpy(img,frame,frame->nSize); unsigned char

IplImage Pixel Access JavaCV

≡放荡痞女 提交于 2019-12-04 12:22:34
问题 I'm trying to access Pixel by Pixel of an IplImage. Im using Java and Processing, and sometimes I need to access pixel by pixel. I've done this so far, but I don't know what's wrong: public IplImage PImageToIplImage(PImage imageSrc) { IplImage imageDst; if(imageSrc.format==RGB) { imageDst = IplImage.create(imageSrc.width, imageSrc.height, IPL_DEPTH_8U, 3); ByteBuffer imagePixels=imageDst.getByteBuffer(); int locPImage, locIplImage, x, y; for(y=0; y<imageSrc.height; y++) for(x=0; x<imageSrc

How to convert an OpenCV IplImage to an SDL_Surface?

只谈情不闲聊 提交于 2019-12-04 05:35:35
I'm trying to write a program which takes an SDL_Surface , converts it to an IplImage , uses the cvBlobsLib to find blobs, paints the blobs as spots back over the image, then converts the output IplImage back to an SDL_Surface . I'm almost done: only converting the IplImage back to an SDL_Surface hasn't been done yet. This IplImage has 3 image channels and is 8 bits per pixel. I think I have two calls I can use: SDL_Surface *SDL_CreateRGBSurface(Uint32 flags, int width, int height, int depth, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask); SDL_Surface *SDL_CreateRGBSurfaceFrom(void

Saving as Flash in C++

浪子不回头ぞ 提交于 2019-12-03 15:17:48
How to save an IPLImage of OpenCV as a Flash file? Maybe there is a library that does that? If you mean storing your output as a flash video (.flv) just use ffmpeg (libavcodec/libavformat). It is cross platform and supports the .flv format (besides a massive amout of others) and should be quite easy to do. You can embed audio too. As a note: ffmpeg is partially included in opencv (depending on your build) as a video coder/decoder, i don't know though if you can force it to write as .flv (by choosing the right codec string) from within opencv. Anyways it's not too hard to convert IplImage to a

IplImage Pixel Access JavaCV

怎甘沉沦 提交于 2019-12-03 07:42:42
I'm trying to access Pixel by Pixel of an IplImage. Im using Java and Processing, and sometimes I need to access pixel by pixel. I've done this so far, but I don't know what's wrong: public IplImage PImageToIplImage(PImage imageSrc) { IplImage imageDst; if(imageSrc.format==RGB) { imageDst = IplImage.create(imageSrc.width, imageSrc.height, IPL_DEPTH_8U, 3); ByteBuffer imagePixels=imageDst.getByteBuffer(); int locPImage, locIplImage, x, y; for(y=0; y<imageSrc.height; y++) for(x=0; x<imageSrc.width; x++) { locPImage = x + y * width; locIplImage=y*imageDst.widthStep()+3*x; imagePixels.put

IplImage Pixel Access JavaCV

匿名 (未验证) 提交于 2019-12-03 02:52:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm trying to access Pixel by Pixel of an IplImage. Im using Java and Processing, and sometimes I need to access pixel by pixel. I've done this so far, but I don't know what's wrong: public IplImage PImageToIplImage(PImage imageSrc) { IplImage imageDst; if(imageSrc.format==RGB) { imageDst = IplImage.create(imageSrc.width, imageSrc.height, IPL_DEPTH_8U, 3); ByteBuffer imagePixels=imageDst.getByteBuffer(); int locPImage, locIplImage, x, y; for(y=0; y<imageSrc.height; y++) for(x=0; x<imageSrc.width; x++) { locPImage = x + y * width; locIplImage

Get size of a UIImage (bytes length) not height and width

匿名 (未验证) 提交于 2019-12-03 02:22:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm trying to get the length of a UIImage . Not the width or height of the image, but the size of the data. 回答1: The underlying data of a UIImage can vary, so for the same "image" one can have varying sizes of data. One thing you can do is use UIImagePNGRepresentation or UIImageJPEGRepresentation to get the equivalent NSData constructs for either, then check the size of that. 回答2: UIImage *img = [UIImage imageNamed:@"sample.png"]; NSData *imgData = UIImageJPEGRepresentation(img, 1.0); NSLog(@"Size of Image(bytes):%d",[imgData length]); 回答3: