Changeset 328 in flair-src for branches/sanscv/lib
- Timestamp:
- Sep 4, 2019, 3:11:26 PM (5 years ago)
- Location:
- branches/sanscv/lib
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/sanscv/lib/FlairSensorActuator/src/Camera.cpp
r324 r328 24 24 #include <DataPlot1D.h> 25 25 #include <Picture.h> 26 #include <VisionFilter.h>26 //#include <VisionFilter.h> 27 27 #include <fstream> 28 28 -
branches/sanscv/lib/FlairSensorActuator/src/V4LCamera.cpp
r324 r328 29 29 #include <cstring> 30 30 #include <sys/mman.h> 31 #include <VisionFilter.h> 31 32 32 33 #define DEFAULT_V4L_BUFFERS 4 … … 104 105 QueueBuffer(bufferIndex); 105 106 } 107 108 //alloc img buf 109 Printf("TODO: alloc bufs in cmem and uses it for v4l\n"); 110 output->buffer=AllocFunction(width*height*2); 106 111 107 112 // enable the streaming … … 133 138 134 139 V4LCamera::~V4LCamera() { 140 FreeFunction(output->buffer); 135 141 SafeStop(); 136 142 Join(); … … 139 145 void V4LCamera::Run(void) { 140 146 Time cam_time, new_time, fpsNow, fpsPrev; 141 char* buffer; // raw image142 147 int fpsCounter = 0; 143 148 … … 215 220 hasProblems=true; 216 221 } 217 Printf("todo allocate 1 frame and copy here\n");222 //Printf("todo allocate 1 frame and copy here\n"); 218 223 output->GetMutex(); 219 output->buffer = buffer;224 memcpy(output->buffer,buffers[bufferIndex].start,buffers[bufferIndex].length); 220 225 output->ReleaseMutex(); 221 226 … … 280 285 //Printf("%lld ioctl\n",GetTimeMS()); 281 286 if (xioctl (device, VIDIOC_DQBUF, &buf)==-1) { 282 //Printf("iter %i err %i\n",i,errno);287 //Printf("iter %i err %i\n",i,errno); 283 288 if (errno==EAGAIN) { 284 289 //Printf("exit buf %i\n",buf.index); … … 362 367 MAP_SHARED /* recommended */, 363 368 device, buf.m.offset); 364 Printf("buffer %i start %x length %i\n",n_buffers,buffers[n_buffers].start,buffers[n_buffers].length);369 //Printf("buffer %i start %x length %i\n",n_buffers,buffers[n_buffers].start,buffers[n_buffers].length); 365 370 if (MAP_FAILED == buffers[n_buffers].start) { 366 371 Thread::Err("mmap\n"); … … 369 374 } 370 375 nbBuffers=requestbuffers.count; 371 Printf("allocated %i buffers\n",nbBuffers);376 //Printf("allocated %i buffers\n",nbBuffers); 372 377 return 1; 373 378 }; -
branches/sanscv/lib/FlairVisionFilter/src/CvtColor.cpp
r326 r328 55 55 inIplImage->height=img->GetDataType().GetHeight(); 56 56 inIplImage->imageData=img->buffer; 57 inIplImage->imageSize=img->GetDataType().GetSize(); 57 58 */ 58 59 output->GetMutex();/* … … 60 61 outIplImage->height=output->GetDataType().GetHeight(); 61 62 outIplImage->imageData=output->buffer; 63 outIplImage->imageSize=output->GetDataType().GetSize(); 62 64 */ 63 65 switch(conversion) { -
branches/sanscv/lib/FlairVisionFilter/src/HoughLines.cpp
r326 r328 20 20 #include <GroupBox.h> 21 21 #include <SpinBox.h> 22 #include <DoubleSpinBox.h> >22 #include <DoubleSpinBox.h> 23 23 #include <typeinfo> 24 24 #include <math.h> … … 88 88 gimg->height=img->GetDataType().GetHeight(); 89 89 gimg->imageData=img->buffer; 90 gimg->imageSize=img->GetDataType().GetSize(); 90 91 91 92 size_t nbLines; -
branches/sanscv/lib/FlairVisionFilter/src/ImgThreshold.cpp
r326 r328 61 61 inIplImage->height=img->GetDataType().GetHeight(); 62 62 inIplImage->imageData=img->buffer; 63 inIplImage->imageSize=img->GetDataType().GetSize(); 63 64 64 65 output->GetMutex(); … … 66 67 outIplImage->height=output->GetDataType().GetHeight(); 67 68 outIplImage->imageData=output->buffer; 69 outIplImage->imageSize=output->GetDataType().GetSize(); 68 70 69 71 dspThreshold(inIplImage,outIplImage, threshold->Value(), 255, CV_THRESH_BINARY); -
branches/sanscv/lib/FlairVisionFilter/src/OpticalFlow.cpp
r326 r328 58 58 iplpyr->width=imageType.GetWidth(); 59 59 iplpyr->height=imageType.GetHeight(); 60 iplpyr->imageSize=imageType.GetSize(); 60 61 iplpyr_old->width=imageType.GetWidth(); 61 62 iplpyr_old->height=imageType.GetHeight(); 63 iplpyr_old->imageSize=imageType.GetSize(); 64 65 iplgimg->roi=NULL; 66 iplgimg_old->roi=NULL; 67 iplpyr->roi=NULL; 68 iplpyr_old->roi=NULL; 62 69 */ 63 70 } catch(std::bad_cast& bc) { … … 89 96 iplgimg->height=img->GetDataType().GetHeight(); 90 97 iplgimg->imageData=img->buffer; 98 iplgimg->imageSize=img->GetDataType().GetSize(); 91 99 92 100 iplgimg_old->width=img_old->GetDataType().GetWidth(); 93 101 iplgimg_old->height=img_old->GetDataType().GetHeight(); 94 102 iplgimg_old->imageData=img_old->buffer; 103 iplgimg_old->imageSize=img_old->GetDataType().GetSize(); 95 104 96 105 iplpyr->imageData=pyr->buffer; -
branches/sanscv/lib/FlairVisionFilter/src/Sobel.cpp
r326 r328 62 62 inIplImage->height=image->GetDataType().GetHeight(); 63 63 inIplImage->imageData=image->buffer; 64 inIplImage->imageSize=image->GetDataType().GetSize(); 64 65 65 66 output->GetMutex(); … … 67 68 outIplImage->height=output->GetDataType().GetHeight(); 68 69 outIplImage->imageData=output->buffer; 70 outIplImage->imageSize=output->GetDataType().GetSize(); 69 71 70 72 dspSobel(inIplImage,outIplImage,dx->Value(),dy->Value()); -
branches/sanscv/lib/FlairVisionFilter/src/VisionFilter.cpp
r325 r328 21 21 22 22 } 23 24 char* AllocFunction(ssize_t size) { 25 return (char*)malloc(size); 26 } 27 28 void FreeFunction(char* buffer) { 29 free(buffer); 30 } -
branches/sanscv/lib/FlairVisionFilter/src/VisionFilter.h
r325 r328 26 26 27 27 void saveToJpeg(flair::core::Image* src_img,std::string filename,PictureFormat_t input_format,PictureFormat_t output_format,unsigned char compression_level=95); 28 29 //for amrv7a, these functions use CMEM 30 char* AllocFunction(ssize_t size); 31 void FreeFunction(char* buffer);
Note:
See TracChangeset
for help on using the changeset viewer.