Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3368: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3370: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3371: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3372: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
OrbWorks Community Forum • View topic - video capture and image process
Page 1 of 1

PostPosted: Tue Feb 22, 2005 2:30 am
by otakribut1
is it possible to do video image capture and processing of those acquired images using PocketC?
there are some works related to video acquire and process on pda using Visual C++. but can it be done using pocketC.

Usually development on CF camera(video) on PDa was done using Pretec/Lifeview CF/SD camera. flycam for eg: come with SDK.but there is no demo SDK for download. you need to buy the camera to gain access to this SDK.
http://www.lifeview.com.tw/html/product ... CF_sdk.htm
Another option is to use Microsoft Potrait, demo program for Video acquire. available from Microsoft site. http://research.microsoft.com/~jiangli/ ... ewppc.aspx
http://www.internetvisitation.org/video ... et_pc.html

this is one example PDA with Flycam Cf camera used for robot interface.
http://asl.epfl.ch/research/projects/Ro ... /index.php
and...this website provide downloadable RS API for controlling and RoboSapien models with video capability.
http://www.informatik.uni-freiburg.de/% ... media.html

example header file for Flycam/Pretec camera image acquire and simple manipulation:
"
////////////////////////////////////////////////////
// file: camera.cpp //
// //
// task: implements the camera class that gives //
// access to two different cameras: //
// - Pretec, Compact Flash Camera, //
// 1.3 MPixels //
// - LifeView, FlyCAM-CF Camera, //
// 1.3 MPixels //
// //
// authors: Team NimbRo, //
// Albert-Ludwigs-University of Freiburg //
// Germany //
// http://www.nimbro.net //
// September 2004 //
// //
// compile: the source-code was programmed and //
// compiled with Microsoft's eMbedded //
// Visual C++ 3.0 IDE as a part of the //
// eMbedded Visual Tools 3.0 - 2002 //
// Edition. Can be downloaded and used //
// for free from http://www.microsoft.com //
////////////////////////////////////////////////////



///////////////////
// include files //
///////////////////

// get the definition of this class
#include "camera.h"

// we need this e.g. for the definition of UINT32
#include "windows.h"

// get the FlyCAM-CF camera API
#include "FlyCAM_API/INC/FlyCAMm1.h"
#include "FlyCAM_API/INC/FlyCAMm1_AV.h"

// get the Pretec camera API
#include "PretecCamera_API/INC/compcam.h"

// get camera type constants
#include "camera_types.h"



//////////////////////
// global variables //
//////////////////////

// image or video mode: 0x00=image Mode, 0x01=video mode
int IMAGE_OR_VIDEO_MODE=0x01;



/////////////
// methods //
/////////////


/////////////////////////////////////////
// method: camera //
// task : creates a new camera object //
/////////////////////////////////////////
camera::camera() {
} // end-class constructor


/////////////////////////////////////////
// method: ~camera //
// task : deletes a camera object //
/////////////////////////////////////////
camera::~camera() {
} // end-class destructor


/////////////////////////////////////////
// method: init //
// task : does all the initialization //
// stuff that the selected //
// camera needs before we can //
// capture an image from this //
// camera. //
/////////////////////////////////////////
int camera::init(int _width, int _height) {

// which format shall we capture?
m_CAPTURE_WIDTH = _width;
m_CAPTURE_HEIGHT = _height;

#ifdef LIFEVIEW_FLYCAM
// FlyCAM-Camera - initialization stuff
int returnValue= Initial_FLY_AV();
SetImageVideoMode((unsigned char *) &IMAGE_OR_VIDEO_MODE);
CaptureFormat(m_CAPTURE_WIDTH, m_CAPTURE_HEIGHT, 2);
return 0;
#endif


#ifdef PRETEC_CF_CAMERA
// Pretec-Camera - initialization stuff
m_PretecCamera_Handle = CompCamOpen();
if (!m_PretecCamera_Handle)
return -1;
else
return 0;
#endif

// camera type not supported by this camera-class!
return -1;

} // end-method init


/////////////////////////////////////////
// method: close //
// task : calls the camera-specific //
// methods to close the camera //
// that we used. //
/////////////////////////////////////////
void camera::close() {


#ifdef LIFEVIEW_FLYCAM

// FlyCAM-Camera - deinitialization stuff
Deinitial_FLY_AV();

#endif


#ifdef PRETEC_CF_CAMERA

// Pretec-Camera - deinitialization stuff
CompCamClose(m_PretecCamera_Handle);

#endif

} // end-method close


//////////////////////////////////////////
// method: getPicture //
// task : calls the camera specific //
// method to capture a new //
// frame and stores it into the //
// byte buffer that the //
// pointer _p_buffer points to. //
//////////////////////////////////////////
void camera::getPicture(PBYTE _p_buffer) {

#ifdef LIFEVIEW_FLYCAM

DWORD capturedSize;
Capture_A_Frame(_p_buffer, &capturedSize);
rotatePicture(_p_buffer);

#endif


#ifdef PRETEC_CF_CAMERA

CompCamGetFrame(m_PretecCamera_Handle,_p_buffer);

#endif

} // end-method getPicture


//////////////////////////////////////////
// method: rotatePicture //
// task : the Lifeview FlyCAM capture //
// method returns the pictures //
// rotated to 90?Ǭ? to the right. //
// To get the picture in the //
// alignment we expect, we have //
// to rotate it 90?Ǭ? to the left.//
// note : this is only a first //
// implementation of a //
// rotating method, it works //
// but surely there are faster //
// ones. //
//////////////////////////////////////////
void camera::rotatePicture(PBYTE _p_buffer) {

// create a byte array of the size needed
unsigned char* p_rotatedPic;
p_rotatedPic = new unsigned char[m_CAPTURE_WIDTH * m_CAPTURE_HEIGHT * 3];

// for running through the picture
int x=0;
int y=0;
int R,G,B;


// rotate picture
for (y=0; y<m_CAPTURE_WIDTH; y++) {
for (x=0; x<m_CAPTURE_HEIGHT; x++) {

getPixel(_p_buffer ,m_CAPTURE_WIDTH , y,m_CAPTURE_HEIGHT-1-x, &R,&G,&B);
setPixel(p_rotatedPic,m_CAPTURE_HEIGHT, x,y, R,G,B);

} // end-for (x)
} // end-for (y)


// copy rotated picture into the actual picture buffer
for (y=0; y<m_CAPTURE_WIDTH; y++) {
for (x=0; x<m_CAPTURE_HEIGHT; x++) {

getPixel(p_rotatedPic,m_CAPTURE_HEIGHT, x,y, &R,&G,&B);
setPixel(_p_buffer ,m_CAPTURE_HEIGHT, x,y, R,G,B);

} // end-for (x)
} // end-for (y)

// delete the array
delete[] p_rotatedPic;

} // end-method rotatePicture



//////////////////////////////////////////
// method: getPixel //
// task : returns the R,G,B values of //
// a pixel at position (x,y) //
// within a picture buffer if //
// we interpretate the picture //
// buffer so that it represents //
// a picture with width w. //
//////////////////////////////////////////
void camera::getPixel(PBYTE pic, int w, int x, int y, int* R, int* G, int* B) {

int byteArrayPos = 3 * (x + y * w);
*B = pic[byteArrayPos];
*G = pic[byteArrayPos+1];
*R = pic[byteArrayPos+2];

} // end-method getPixel



//////////////////////////////////////////
// method: setPixel //
// task : sets the R,G,B values of //
// a pixel at position (x,y) //
// within a picture buffer if //
// we interpretate the picture //
// buffer so that it represents //
// a picture with width w. //
//////////////////////////////////////////
void camera::setPixel(PBYTE pic, int w, int x, int y, int R, int G, int B) {

int byteArrayPos = 3 * (x + y * w);
pic[byteArrayPos] = B;
pic[byteArrayPos+1] = G;
pic[byteArrayPos+2] = R;

} // end-method setPixel
"