Ask Your Question

Pranav Lal's profile - activity

2019-03-16 00:43:31 -0600 received badge  Enthusiast
2018-09-23 11:16:47 -0600 asked a question I am building a program that uses openCV on a raspberry pi. I am gettng during linking relating to missing symbols. How do I fix them?

I am building a program that uses openCV on a raspberry pi. I am gettng during linking relating to missing symbols. How

2017-07-24 21:49:35 -0600 received badge  Taxonomist
2014-10-24 23:36:40 -0600 commented answer Getting g++ to find all libraries in opencv install on windows 7 ultimate 64bit

Hi Peter and Berak,

Many thanks for the answers and the tip about the precompiled binaries not working with g++. Peter, your visual studio project helped tremendously because I was able to see what libraries you had specified as well as how you had specified the adtional includes.

The project compiles and links successfully. Noyte: Another error I was making was that I was trying to link using 64bit libraries. I had a stack of unresolved linker errors inspite of including all the libraries in the additional dependencies edit box. I changed to using 32bit libraries and was able to link successfully.

2014-10-24 09:56:40 -0600 asked a question Getting g++ to find all libraries in opencv install on windows 7 ultimate 64bit

Hi all,

I am trying to compile a C++ program that uses opencv on a computer running windows 7 ultimate 64bit. I have mingw installed. My g++ commandline is as follows. g++ -I C:\devkit\mingw\include -I C:\opencv\build\include\opencv2\highgui -I C:\opencv\build\include\opencv2\imgproc -I C:\opencv\build\include\opencv2\core -O3 BatchvOICe.cpp -o vl01.exe -l C:\opencv\build\x64\vc12\lib\opencv_core -l C:\opencv\build\x64\vc12\lib\opencv_imgproc -l C:\opencv\build\x64\vc12\lib\opencv_highgui In file included from BatchvOICe.cpp:8:0: C:\opencv\build\include\opencv2\highgui/highgui.hpp:46:33: fatal error: opencv2/ core/core.hpp: No such file or directory compilation terminated.

How do I solve this? I do not want to change include paths in the opencv source.

In addition, I have downloaded visual studio express 2013. I am happy to set build paths etc but what do I set? I see instructions only for visual studio 2012. I suspect they will be the same for 2013 and I did try them but I encounter the same errors.

Note: I have installed opencv-2_4_10.exe.

I see references to opencv 3.0. My program is basic therefore I am willing to switch to opencv 3 if compiling is easier. Pranav

2014-01-16 19:48:47 -0600 asked a question updating open cv to version 3

Hi all,

I have opencv version 2.3 installed on my raspberry pi running raspbian. I looked at http://docs.opencv.org/trunk/doc/tutorials/introduction/linux_install/linux_install.html the tutorial talks about opencv 3.0.0. Is this still under development? If not, how do I upgrade to it? Please see below for installed version details pi@piprime ~ $ dpkg -l | grep libopencv
ii libopencv-calib3d2.3 2.3.1-11 armhf
computer vision Camera Calibration library
ii libopencv-core2.3 2.3.1-11 armhf
computer vision core library
ii libopencv-features2d2.3 2.3.1-11 armhf
computer vision Feature Detection and Descriptor Extraction library
ii libopencv-flann2.3 2.3.1-11 armhf
computer vision Clustering and Search in Multi-Dimensional spaces library
ii libopencv-highgui2.3 2.3.1-11 armhf
computer vision High-level GUI and Media I/O library
ii libopencv-imgproc2.3 2.3.1-11 armhf
computer vision Image Processing library
ii libopencv-legacy2.3 2.3.1-11 armhf
computer vision legacy library
ii libopencv-ml2.3 2.3.1-11 armhf
computer vision Machine Learning library
ii libopencv-objdetect2.3 2.3.1-11 armhf
computer vision Object Detection library
ii libopencv-video2.3 2.3.1-11 armhf
computer vision Video analysis library
pi@piprime ~ $

I want to upgrade because I want to run feature detection code. Please see the below python program as an example of what I want to run. Note: This program may have errors because I have been unable to test it.

import cv2
import time
#test program for monocular obstacle detection
vc = cv2.VideoCapture(-1)
if vc.isOpened(): # try to get the first frame
    print 'fetching first frame'
    rval, frame = vc.read()
else:
    rval = False
    print 'unable to fetch frame'
while rval:
    rval, frame = vc.read()
    time.sleep(100)
    frame=vc.read()
    print 'images read.'
    #we now have two images one second apart
    orb = cv2.ORB()
    kp1, des1 = orb.detectAndCompute(rval,None)
    kp2, des2 = orb.detectAndCompute(frame,None)
    print 'detection  done'
    bf = cv2.BFMatcher(cv2.NORM_HAMMING, crossCheck=True)
    matches = bf.match(des1,des2)
    print 'matches done.'
    matches = sorted(matches, key = lambda x:x.distance)
    print matches[0].distance
print 'end.'
2014-01-16 19:47:53 -0600 asked a question updating open cv to version 3

Hi all,

I have opencv version 2.3 installed on my raspberry pi running raspbian. I looked at http://docs.opencv.org/trunk/doc/tutorials/introduction/linux_install/linux_install.html the tutorial talks about opencv 3.0.0. Is this still under development? If not, how do I upgrade to it? Please see below for installed version details pi@piprime ~ $ dpkg -l | grep libopencv
ii libopencv-calib3d2.3 2.3.1-11 armhf
computer vision Camera Calibration library
ii libopencv-core2.3 2.3.1-11 armhf
computer vision core library
ii libopencv-features2d2.3 2.3.1-11 armhf
computer vision Feature Detection and Descriptor Extraction library
ii libopencv-flann2.3 2.3.1-11 armhf
computer vision Clustering and Search in Multi-Dimensional spaces library
ii libopencv-highgui2.3 2.3.1-11 armhf
computer vision High-level GUI and Media I/O library
ii libopencv-imgproc2.3 2.3.1-11 armhf
computer vision Image Processing library
ii libopencv-legacy2.3 2.3.1-11 armhf
computer vision legacy library
ii libopencv-ml2.3 2.3.1-11 armhf
computer vision Machine Learning library
ii libopencv-objdetect2.3 2.3.1-11 armhf
computer vision Object Detection library
ii libopencv-video2.3 2.3.1-11 armhf
computer vision Video analysis library
pi@piprime ~ $

I want to upgrade because I want to run feature detection code. Please see the below python program as an example of what I want to run. Note: This program may have errors because I have been unable to test it.

import cv2 import time

test program for monocular obstacle detection

vc = cv2.VideoCapture(-1) if vc.isOpened(): # try to get the first frame print 'fetching first frame' rval, frame = vc.read() else: rval = False print 'unable to fetch frame' while rval: rval, frame = vc.read() time.sleep(100) frame=vc.read() print 'images read.' #we now have two images one second apart orb = cv2.ORB() kp1, des1 = orb.detectAndCompute(rval,None) kp2, des2 = orb.detectAndCompute(frame,None) print 'detection done' bf = cv2.BFMatcher(cv2.NORM_HAMMING, crossCheck=True) matches = bf.match(des1,des2) print 'matches done.' matches = sorted(matches, key = lambda x:x.distance) print matches[0].distance print 'end.'

2013-09-22 11:16:00 -0600 asked a question Unable to build opencv on the raspberry pi running raspbian

Hi all, I am trying to build opencv version 2.4.6.1 on Raspbian (Linux raspberrypi 3.6.11+ #538 PREEMPT Fri Aug 30 20:42:08 BST 2013 armv6l) running on a raspberry pi B. I am following the instructions at the following link; http://denis.doublebuffer.net/lablog/2012/08/10/setting-everything-up-for-opencv-raspberry-pi/ Make stops around 61%. See the following error dump.

[ 67%] Building CXX object modules/gpu/CMakeFiles/opencv_gpu.dir/src/denoising.cpp.o
[ 67%] Building CXX object modules/gpu/CMakeFiles/opencv_gpu.dir/src/bilateral_filter.cpp. o
Linking CXX shared library ../../lib/libopencv_gpu.so
[ 67%] Built target opencv_gpu
[ 67%] Generating opencv_perf_gpu_pch_dephelp.cxx
[ 68%] Building CXX object modules/gpu/CMakeFiles/opencv_perf_gpu_pch_dephelp.dir/opencv_p erf_gpu_pch_dephelp.cxx.o
Linking CXX static library ../../lib/libopencv_perf_gpu_pch_dephelp.a
[ 68%] Built target opencv_perf_gpu_pch_dephelp
[ 68%] Generating perf_precomp.hpp
[ 68%] Generating perf_precomp.hpp.gch/opencv_perf_gpu_RELEASE.gch
[ 68%] Built target pch_Generate_opencv_perf_gpu
[ 68%] Building CXX object modules/gpu/CMakeFiles/opencv_perf_gpu.dir/perf/perf_precomp.cp p.o
[ 68%] Building CXX object modules/gpu/CMakeFiles/opencv_perf_gpu.dir/perf/perf_video.cpp. o
[ 69%] Building CXX object modules/gpu/CMakeFiles/opencv_perf_gpu.dir/perf/perf_features2d .cpp.o
[ 69%] Building CXX object modules/gpu/CMakeFiles/opencv_perf_gpu.dir/perf/perf_calib3d.cp p.o
[ 69%] Building CXX object modules/gpu/CMakeFiles/opencv_perf_gpu.dir/perf/perf_labeling.c pp.o
[ 69%] Building CXX object modules/gpu/CMakeFiles/opencv_perf_gpu.dir/perf/perf_denoising. cpp.o
[ 69%] Building CXX object modules/gpu/CMakeFiles/opencv_perf_gpu.dir/perf/perf_main.cpp.o [ 69%] Building CXX object modules/gpu/CMakeFiles/opencv_perf_gpu.dir/perf/perf_core.cpp.o c++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file: usr="" share="" doc="" gcc-4.6="" readme.bugs=""> for instructions.
make[2]: * [modules/gpu/CMakeFiles/opencv_perf_gpu.dir/perf/perf_core.cpp.o] Error 4
make[1]:
[modules/gpu/CMakeFiles/opencv_perf_gpu.dir/all] Error 2
make: *
* [all] Error 2

How do I see what the problem is and correct it?

Pranav

2013-06-16 11:08:13 -0600 commented question OpenCV Webcam

Just a hunch but could you be specifying the wrong camera id? I see it is a -1. I am new to opencv and am using it on Linux but my camera id is not negative.

2013-06-16 01:57:30 -0600 commented question Seeking help with converting opencv webcam output to pixel coordinates for integrating with sensory substitution program

Hi all again, I am trying to attach the code with this comment. Dropbox did not like my posting the link to the forum. The significant portion of the code giving me grief is below. I am trying to copy the pixel coordinates from the variable gray which is of type Mat to a 2d array of type int. code: for(int lc=0;lc<N;lc++) {//start of matrix population for loop int mVal=gray.at<uchar>(lc,lc);

A[lc][lc]=double(mVal); }//end of matrix population for loop

2013-06-12 12:19:46 -0600 commented question Seeking help with converting opencv webcam output to pixel coordinates for integrating with sensory substitution program

Hi all,

I have had to change the program radically since I had started with soundscape code that was not generating stereo sound. Please see the code below. I am trying to run the program continuously which is not happening. I am not sure of the way the keyboard is handled and that could be the problem but I could be wrong.

I am unable to paste the entire code so am forced to give a link to it. https://dl.dropboxusercontent.com/u/3688386/vl.cpp Pranav

2013-06-04 09:21:15 -0600 commented question Seeking help with converting opencv webcam output to pixel coordinates for integrating with sensory substitution program

Hi,

Got it compiled and built!! Its running and tells me that it cannot find camera 0 but that is something with my setup. I am going to doublecheck if I have webcam support installed. Note: I am referring to simple.cpp here.

Many thanks!! Pranav

2013-06-03 20:33:10 -0600 commented question Seeking help with converting opencv webcam output to pixel coordinates for integrating with sensory substitution program

Hi Berak, Many thanks for your efforts. I updated the ghitub repository. g++ -I /usr/include -I /home/noddy/vOICe/s eeingwithsound/RtAudio simple.cpp -lopencv_core -lopencv_imgproc -lopencv_highgui
simple.cpp: In function ‘int main(int, char*)’:
simple.cpp:58:59: error: cannot convert ‘_IO_FILE
’ to ‘const char’ for argument ‘1’ to ‘int printf(const char, ...)’

Are we using different versions of opencv by any chance?

I agree irc could be a faster way to communicate however, we run into the issue of timezones. I am 5.5 hours ahead of UTC. Do you have a website or e-mail address where I can reach you?

2013-06-01 18:26:47 -0600 commented question Seeking help with converting opencv webcam output to pixel coordinates for integrating with sensory substitution program

Hi all,

I have found the problem. I was misinterpreting what g++ was telling me. The problem was with the path in the #include directive. highgui etc have their own directories in the /usr/include/opencv2 directory. I have now got past that problem but am getting scope related errors. I am still continuing to do something incorrectly since from what I understand from Berak's documentation, the code runs on his setup.

main.cpp: In function ‘int main(int, char**)’:
main.cpp:143:18: error: ‘CAP_PROP_FRAME_HEIGHT’ was not declared in this scope
main.cpp:144:18: error: ‘CAP_PROP_FRAME_WIDTH’ was not declared in this scope

2013-06-01 08:16:21 -0600 commented question Seeking help with converting opencv webcam output to pixel coordinates for integrating with sensory substitution program

Hi all, I am trying to compile the program. I have opencv installed on Ubuntu 12.04 LTS. I am using the following commandline.

g++ -i /usr/include/opencv2 -lopencv_core -lopencv_imgproc -lopencv_highgui -lopencv_ml -lopencv_video -lopencv_features2d -lopencv_calib3d -lopencv_objdetect -lopencv_contrib -lopencv_legacy -lopencv_flann ./main.cpp

I am getting the following error. cc1plus: error: unrecognized command line option ‘-i’

I am not sure what is happening. I suspect I am making an error in including the libraries. I do not know which ones to include.

Pranav

2013-05-31 00:17:26 -0600 commented question Seeking help with converting opencv webcam output to pixel coordinates for integrating with sensory substitution program

Many many thanks Berak. I'll give it a go over the weekend!

2013-05-28 00:03:01 -0600 commented question Seeking help with converting opencv webcam output to pixel coordinates for integrating with sensory substitution program

Hi berak and all, Some of your questions have already been answered in previous comments.

I do not plan to write the wave files to disk. <smile The idea is to write to the Linux audio device. If I understand things correctly, all devices in Linux are files. The vOICe sounds one frame per second so, I plan to capture one frame and then render that as a soundscape.

Pranav

2013-05-27 23:58:10 -0600 received badge  Editor (source)
2013-05-27 04:14:18 -0600 received badge  Student (source)
2013-05-26 19:20:12 -0600 asked a question Seeking help with converting opencv webcam output to pixel coordinates for integrating with sensory substitution program

strong textHi all,

I am trying to create a basic version of the vOICe (http://www.seeingwithsound.com) to run on Linux and devices similar to the raspberry pi. This involves writing C code. The last time I did anything in C was 1994 or perhaps 1996. Any how, I have most of the stuff worked out. There is basic soundscape generation code at http://www.seeingwithsound.com. That code works on Linux.

I am using the opencv library to capture images from a webcam on Linux. I am unable to integrate opencv's output with the code of the vOICe. The vOICe expects pixel coordinates as numbers. I need to replace the hard coded image coordinates with the output from a webcam. I am not sure how openccv gives said coordinates. Yes, I did search and found the answer but I cannot understand the data type conversions involved. The answer is at the opencv faq. http://opencv.willowgarage.com/wiki/faq#Howtoaccessimagepixels

I am pasting the opencv code and then the code of the vOICe. Note: If extracting the code from this message becomes a problem, I have the 2 files in dropbox. Openn cv code: https://dl.dropboxusercontent.com/u/3688386/ot.c the link to the code for the vOICe https://dl.dropboxusercontent.com/u/3688386/i2s.c

//text of opencv code


#include <stdio.h> #include <stdlib.h> #include "stdafx.h" #include <math.h> #include <cv.h> #include <highgui.h>

void main(int argc,char *argv[])
{
int c;
IplImage* color_img;
CvCapture* cv_cap = cvCaptureFromCAM(0);
color_img = cvQueryFrame(cv_cap); // get frame

    int nl= color_img->height;
    int nc= color_img->width * color_img->nChannels;

    unsigned char *data= reinterpret_cast<unsigned char *>(color_img->imageData);



cvNamedWindow("Video",0); // create window
for(;;) {
if(color_img != 0)
cvShowImage("Video", color_img); // show frame
c = cvWaitKey(10); // wait 10 ms or for key stroke
if(c == 27)
break; // if ESC, break and quit
}
/* clean up */
cvReleaseCapture( &cv_cap );
cvDestroyWindow("Video");
}
</code>

//The code of the vOICe
/* Simple C program for .wav soundscape generation. (C) P.B.L. Meijer 1996 */
<code>
#define FNAME "arti1.wav"
#define N     64   /* Resolution, i.e., # rows and columns   */
#define FL   500   /* Lowest  frequency (Hz) in visual sound */
#define FH  5000   /* Highest frequency (Hz)                 */
#define FS 20000   /* Sample  frequency (Hz)                 */
#define T   1.05   /* Image to sound conversion time (s)     */
#define D      1   /* Linear|Exponential=0|1 distribution    */

#include <stdio.h>
#include <stdlib.h>
#include <math.h>

#define C_ALLOC(number, type) ((type *) calloc((number),sizeof(type)) )
#define TwoPi 6.283185307179586476925287
#define WHITE 1.00
#define DGREY 0.25
#define BLACK 0.00

FILE *fp; unsigned long ir=0L, ia=9301L, ic=49297L, im=233280L;
void wi(unsigned int i) { int b1,b0; b0=i%256; b1=(i-b0)/256; putc(b0,fp); putc(b1,fp); }
void wl(long l) { unsigned int i1,i0; i0=l%65536L; i1=(l-i0)/65536L; wi(i0); wi(i1); }
double rnd(void){ ir = (ir*ia+ic) % im; return ir / (1.0*im); }

int main(int argc, char *argv[])
{
   int    i, j, b, d ...
(more)