iplimage

4 channel IplImage javacv to android bitmap

旧街凉风 提交于 2019-12-13 04:06:10
问题 I'm trying to record video by checking each frame of camera preview to bitmap with quality ARGB_8888. As it required 4 channel, Created IplImage with channel 4 too. Now the output have two major problems : 1) Bitmap that created from IplImage have grayscale. even if I have converted it from BGR2RGBA. 2) 4 channel IplImage gave me bitmap (divided in 4 parts) with same screen. Let me put my code over here. @Override public void onPreviewFrame(byte[] data, Camera camera) { if (yuvIplimage !=

Converting to Floating Point Image from .tif

流过昼夜 提交于 2019-12-12 01:06:39
问题 I am relatively new to C++ and coding in general and have run into a problem when attempting to convert an image to a floating point image. I am attempting to do this to eliminate round off errors with calculating the mean and standard deviation of pixel intensity for images as it starts to effect data quite substantially. My code is below. Mat img = imread("Cells2.tif"); cv::namedWindow("stuff", CV_WINDOW_NORMAL); cv::imshow("stuff",img); CvMat cvmat = img; Mat dst = cvCreateImage(cvGetSize(

converting Mat to iplimage* in opencv

≯℡__Kan透↙ 提交于 2019-12-11 16:22:29
问题 I am new in opencv and c++. what is the difference between iplimage and iplimage*? I used cvHaarDetectObjects that need iplimage* in arg[1]. I have a frame in the format of Mat. how could I convert Mt to iplimage*? (I found a way to convert mat to iplimage but not to iplimage*). the true one is : iplimage* frame=cvLoadImage("1.jpg"); objects = cvHaarDetectObjects( frame, face_cascade, storage, scale_factor, 1 ); but I want to use: Mat frame; //some functions are performed on frame objects =

Can't open socket C++

北慕城南 提交于 2019-12-11 15:59:17
问题 I'm trying to send images (using IlpImage library) to VLan (media player) through the network so it can play streaming images and "make" a video. I'm trying to open a socket but the value of "serversock" gives me always -1 and I don't understand why. I'm trying to search for this error but can't find a solution. Can someone help me? Here's the code: #include <stdio.h> #include <stdlib.h> #include <direct.h> #include <iostream> #include <WinSock2.h> #include <Windows.h> #include <iostream>

How to convert Ipl image to Mat image in java

一世执手 提交于 2019-12-11 07:59:39
问题 I am trying to make a mood detection app in opencv , java . But there is a lag in processing the image and then displaying the emoticon. So I want to directly use the image captured , instead of copying the image to the hard disk. For that I need convert iplimage to matimage . 回答1: Try IplImage *ipl_img; Mat mat_img(ipl_img); 回答2: Try this IplImage img; bmp = Bitmap.createBitmap(img.width(), img.height(), Bitmap.Config.ARGB_8888); bmp.copyPixelsFromBuffer(img.getByteBuffer()); Mat mROI = new

opencv 录制avi视频

浪子不回头ぞ 提交于 2019-12-11 05:03:12
第一步,定义OpenCV自带的写视频指针。 CvVideoWriter *frame_writer 第二步,初始化视频参数。 frame_writer = cvCreateVideoWriter("origin.avi", CV_FOURCC('M','J','P','G'), 20.0, cvSize(320, 240), false); 参数意义分别为 文件名、压缩格式、帧率、分辨率、是否彩色视频( false 代表灰度图). 第三步, Mat 格式要转成IpIImage格式: IplImage img = IplImage(pic) 第四步,将采集回来的Mat格式的input_frame数据写到video里面。 cvWriteFrame(frame_writer, &img); 第五步,释放指针, cvReleaseVideoWriter(&frame_writer); 来源: CSDN 作者: DSZS123 链接: https://blog.csdn.net/dongshizhishui/article/details/103456452

Unhandled exception - OpenCV - cvReleaseCapture and cvReleaseImage - C++

谁说胖子不能爱 提交于 2019-12-11 04:57:37
问题 I have a program that uses the OpenCV library (version 2.4.1) to capture video from my laptop's webcam (or any other connected camera) and save it to an .avi file. When I debug in Visual Studio 2010, I get an unhandled exception at the very end of the program, when either the CvCapture or the IplImage are being released. Here is the code: // WriteRealTimeCapturedVideo.cpp : Defines the entry point for the console application. #include "stdafx.h" #include "cv.h" #include "highgui.h" #include

Boost asio: Send OpenCV IplImage from Ubuntu-Server to Win7-Client

筅森魡賤 提交于 2019-12-10 10:55:16
问题 I try to transmit an OpenCV IplImage from a Server (Ubuntu x64) to a Client (Win7 x64) using the boost asio library. The following code works fine if both (Client and Server) are on the same operating system. But when the server is on Ubuntu and the client on Win7 it doesn't work. The image header is correct, but something with the image data is wrong. I think this is because of the different bit-order between the two OS. Is it? How can I resolve this problem? And second: The transmission

Boost asio: Send OpenCV IplImage from Ubuntu-Server to Win7-Client

浪尽此生 提交于 2019-12-06 05:54:27
I try to transmit an OpenCV IplImage from a Server (Ubuntu x64) to a Client (Win7 x64) using the boost asio library. The following code works fine if both (Client and Server) are on the same operating system. But when the server is on Ubuntu and the client on Win7 it doesn't work. The image header is correct, but something with the image data is wrong. I think this is because of the different bit-order between the two OS. Is it? How can I resolve this problem? And second: The transmission with this code is very slow. How can I improve the speed? Client: #define _WIN32_WINNT 0x0601 #include

Opencv copy 3 channel IplImage to 4 channel IplImage

吃可爱长大的小学妹 提交于 2019-12-06 05:35:24
问题 When I try to use cvCopy a IplImage consisting of 3 channels to a IplImage with 4 channels (I need the extra channel later) all I get is an error message. Is there another way to increase the channel count of an IplImage without loosing the data that it already holds? Thanks! 回答1: Use cvMixChannels, like this: CvMat * src; // your source image CvMat * dst // your destination image CvMat * zeros = cvCreateMat(src->cols, src->rows, CV_8UC1); cvSet(zeros, cvScalar(0, 0, 0, 0)); CvArr * input[] =