Ask Your Question

JCNeves's profile - activity

2017-12-23 08:19:27 -0500 received badge  Famous Question (source)
2016-06-09 16:47:30 -0500 received badge  Notable Question (source)
2016-02-15 06:07:32 -0500 received badge  Popular Question (source)
2015-07-13 09:55:56 -0500 received badge  Student (source)
2014-10-19 12:42:50 -0500 asked a question How to pan and tilt a still image?

Hello guys,

How can know the pan and tilt angle necessary to center a PTZ camera in a specific pixel in the image?

For example, consider that the center of the image provided by the PTZ camera has the coordinates (0,0). My question is how to determine the pan and tilt angle that I have to rotate the camera to center the camera in the pixel (30,40) ( it is an example).

I am almost sure that the mapping forrmula will require the horizontal angle of view and image resolution, in my case 58,9ยบ and 1080x1920

Thank you for your help

2014-10-04 09:45:41 -0500 asked a question Read h264 stream from an IP camera

Currently, I am trying to use opencv to read a video from my Canon VB-H710F camera.

For this purpose I tried two different solutions:

SOLUTION 1: Read the stream from rtsp address

VideoCapture cam ("rtsp://root:camera@"); While(true) cam >> frame;

In this case I am using opencv to directly read from a stream encoded with in H264 (profile1), however this yields the same problem reported here As suggested in the previous question, I tried to disable FFMPEG support in opencv installation, which solved the h264 decoding errors but raised other problem. When accessing the stream with opencv, supported by gstreamer, there is always a large delay associated. With this solution I achieve 15 FPS but I have a delay of 5 seconds, which is not acceptable considering that I need a real time application.

SOLUTION 2: Read the frames from http address

while(true) { startTime=System.currentTimeMillis();
URL url = new URL(""); URLConnection con = url.openConnection(); BufferedImage image =;
showImage(image); estimatedTime=System.currentTimeMillis()-startTime; System.out.println(estimatedTime); Thread.sleep(5); }

This strategy simply grabs the frame from the url that the camera provides. The code is in Java but the results are the same in C++ with the curl library. This solution avoids the delay of the first solution however it takes little more than 100 ms to grab each frame, which means that I can only achieve on average 10 FPS.

I would like to know how can I read the video using c++ or another library developed in c++ ?