Science topic

OpenCV - Science topic

Explore the latest questions and answers in OpenCV, and find OpenCV experts.
Questions related to OpenCV
  • asked a question related to OpenCV
Question
1 answer
Hi, I am working on domain adaptation for emotional detection on Hollywood Actor/Actress data and I want its adaptation for Pakistani Actor/Actress picture. Is there any data available online or anyone have, please share... It's urgent I have a research project to do.
Relevant answer
Answer
Maybe emontion detection would quicken if you expanded to cartoons like Mulan: https://www.researchgate.net/publication/380540439_Mulan's_Critical_Whiteness
  • asked a question related to OpenCV
Question
1 answer
"Dear ResearchGate Community,
I am currently working on a project that involves camera calibration using OpenCV. My goal is to achieve precise calibration by incorporating physical measurements from a ruler or another measuring tool. Can anyone provide insights, tips, or a step-by-step guide on how to perform camera calibration in OpenCV while incorporating real-world measurements? Your expertise and guidance would be greatly appreciated.
Thank you in advance for your assistance.
Relevant answer
Answer
OpenCV offers standard camera calibration functions. You will need a target of a 2D grid of dots or a checker board on a flat substrate, take some images, process the images using opencv functions, and then run them through the camera calibration function.
The target needs to be measured by some precision measurement tools to establish the ground truth.
The process is not difficult, if your accuracy/precision requirement is low.
  • asked a question related to OpenCV
Question
6 answers
I want to overlay a processed image onto an elevation view of a ETABS model using openCV and ETABS API in c# !
Relevant answer
Answer
Professionally nobody is teaching these tools yet in our industry... but if you are willing to do that, you must learn any programming language like Python, VBA, or MATLA. Then, you can start writing the API code for the specific task you want to do. OAPI changed my life since I implemented that in my research studies. I hope this is useful.
  • asked a question related to OpenCV
Question
4 answers
I am using python and capturing video using OpenCV. I want to find coordinates position and orientation of object and some coordinates of edge, so I can find the equation of curve of edge.
Relevant answer
Answer
Thank you
  • asked a question related to OpenCV
Question
2 answers
I have been reading about the geometry of image formation and getting to the conclusion that knowing the exact position of a point in the real world, you can calculate the coordinates of that point in the camera coordinate system and lately the pixel image coordinates using the extrinsic and intrinsic parameters. All the information can be found in the next link: https://learnopencv.com/geometry-of-image-formation/
My doubts arrive when trying to work on the backward, trying to estimate the real world coordinates from the pixel coordinates, knowing the rest of the parameters using OpenCV camera calibration process I
Relevant answer
Answer
When an image of a scene is captured by a camera, we lose depth information as objects and points in 3D space are mapped onto a 2D image plane. This is also known as a projective transformation, in which points in the world are converted to pixels on a 2d plane.
Regards,
Shafagat
  • asked a question related to OpenCV
Question
4 answers
Here is my CV. Could you please review it and mention my mistakes. Your effort makes my CV impressive. Please review it and suggest me some suggestions.
Please!
Thank you for your precious time and suggestions in advance.
Relevant answer
Answer
Change the format of the CV.
and your CV is suitable for academics not for the Industrial Job.
Since most of your articles are under review you have to wait for a little bit.
  • asked a question related to OpenCV
  • asked a question related to OpenCV
Question
3 answers
Which object tracking algorithms are highly accurate and also have high processing speed?
Opencv algorithms themselves do not work well at high speeds
Thank you for your help
Relevant answer
Answer
Dear Shahrzad,
The selection of algorithms is based on the nature of the study. We will help you in a better way if you kindly share some details about your research. Meanwhile, I will suggest YOLOv2 and YOLOv3 for your learning.
  • asked a question related to OpenCV
Question
3 answers
Hi..
I have a set of videos and I want to extract natural scene statistic (NSS) features from it by using OpenCv with python language. I need a source code to extract NSS features.
Please, anyone can help me?
  • asked a question related to OpenCV
Question
5 answers
I've been using yolov3 with OpenCV and now I want to change to yolov5 and I saw it has .pt files instead of .weights files and it is in PyTorch.
Is there any way to use yolov5 model in OpenCV?
When I try to use the .pt file in OpenCV with this command:
net = cv2.dnn.readNetFromTorch('./model_6/best.pt')
It gives me this error:
cv2.error: OpenCV(4.4.0) D:\Build\OpenCV\opencv-4.4.0\modules\dnn\src\torch\torch_importer.cpp:1017: error: (-213:The function/feature is not implemented) Unsupported Lua type in function 'cv::dnn::dnn4_v20200609::TorchImporter::readObject'
Relevant answer
Answer
  • asked a question related to OpenCV
Question
4 answers
Hi Everyone, I'm currently converting video into images where I noticed 85% of the images doesn't contain the object. Is there any algorithm to check whether an image contains an object or not using the objectness score?
Thanks in advance :)
Relevant answer
Answer
If it is a video and you want to detect objects coming into the field of view, you could simply use 'foreground detection' - refer to <<https://au.mathworks.com/help/vision/ref/vision.foregrounddetector-system-object.html>>.
  • asked a question related to OpenCV
Question
6 answers
Hi Everyone,
I'm currently practising an object detection model which should detect a car, person, truck, etc. in both day and night time. Now, I have started gathering data for both day and night time. I'm not sure whether to train a separate model for daylight and another model for the night-light or to combine together and train it?
can anyone suggest to me the data distribution for each class at day and night light? I presume it should be a uniform distribution. Please correct me if I'm wrong.
Eg: for person: 700 images at daylight and another 700 images for nightlight
Any suggestion would be helpful.
Thanks in Advance.
Relevant answer
Answer
Ben Harper, thanks very much for your recommendation.
  • asked a question related to OpenCV
Question
9 answers
Hi all,
I have a computer vision task in hand. Much as it's quite simple in my opinion, I'm very naive in this area thus looking for the simplest and fastest methods.
There's a laser pointer projected on a screen that keeps bouncing around. I need to capture the location and the velocity of the projected dot with respect to some reference point. I would really appreciate it if someone elaborates on the procedure in simple terms.
Regards,
Armin
Relevant answer
Answer
Hi
If you are familiar with Python programming this problem can be solved easily. For doing this you need to use OpenCV and numpy libraries. There is many example in GitHub regarding to object detection, But I think your problem is even simpler and a simple threshold detection code can obtain dot position in each frame in real time and this is what you want to know. below link can help you :
  • asked a question related to OpenCV
Question
5 answers
I have been trying to track feature points in the video using opencv. However, use of Shi Tomasi Corner Detection along with optical flow algorithm like Lucas Kanade Optical Flow doesn't seem to be able to track objects with faster motion accurately. Any insights on robust feature tracking in videos?
Relevant answer
  • asked a question related to OpenCV
Question
3 answers
A monocular camera is to be calibrated, which is located in the area of the vehicle and looks in front of the direction of travel. During the calibration, the extrinsic parameters (position and rotation between the camera coordinate system and the origin of the vehicle coordinate system: Center of the rear axle of the vehicle) should be calculated. The camera parameters are calculated online, i.e. while the camera is taking pictures. The algorithm should automatically calculate the extrinsic parameters from driving scene images while driving.
I am looking forward to your feedback !
Relevant answer
Answer
you can take a video stream on a straight line and then use motion vectors
  • asked a question related to OpenCV
Question
6 answers
I'm having trouble installing OpenCV with Conda. I tried running numerous commands, none of which worked
For example, when I ran conda install -c anaconda opencv I get this error:
Note: you may need to restart the kernel to use updated packages.
ERROR: Could not find a version that satisfies the requirement opencv (from versions: none)
ERROR: No matching distribution found for opencv
Why is this happening and how can I install OpenCV in Spyder?
Relevant answer
Answer
Try downloading using this command:
pip install opencv-python
For a proper guide, refer https://pypi.org/project/opencv-python/
  • asked a question related to OpenCV
Question
3 answers
Lately, I was doing tasks on image and PDF parsing. And I figured out that a lot of users are using modules like Camelot, OpenCV, or Tesseract OCR for that. The only problem is that modules require installation and they are not that flexible.
But I was somehow sure that for that reason neural-networks are used.
So basically I'm just wondering what do you use for solving such a task. Do you use modules or functions maybe?
  • asked a question related to OpenCV
Question
3 answers
I am working with python programming language, my field is image processing, and I did FFT2 via Scipy, numpy, and OpenCV.
I need to code PSF and MTF to an image would you tell me how to code them in python?
Relevant answer
Answer
The PSF is specific to the optical instrument you are working with and depends on its aperture shape. You can use the numpy.fft library to compute the PSF from the aperture assuming the Fraunhofer propagation for instance. If you have an image from which you want to estimate the PSF, deconvolution (blind, myopic or marginal) techniques are needed. The MTF is then obtained from the absolute value of the Fourier transform of the PSF.
  • asked a question related to OpenCV
Question
5 answers
I am working on a CV project where I am trying to extract key frames from videos. The videos are of bottles containing text labels, now the criteria for key frame in my case, is "to extract those frames such that the frames cover all the text on the bottle". So as you can see the criteria for choosing key frames is more text driven here.
I know that we generally either use frame clustering , shot detection or compare histograms of frames to extract the key frames but I am not sure if that is the best approach for this particular use case, given that the colour intensity may not vary much from frame to frame(Black/White text written on white label)
So have anyone of you worked on such a problem before or any pointers as to what could be a better way to approach this
Relevant answer
Answer
Video is a collection of frames. Texture techniques can be used to achieve this objective.
  • asked a question related to OpenCV
Question
11 answers
I'd like to see the output of every layer of DNN under OpenCV Python. So, I am asking you here to help me. If anyone knows a blog or something else explain how to show us outputs of layers, please, put its link in an answer.
Relevant answer
Answer
Thanks Harsh Panwar
  • asked a question related to OpenCV
Question
8 answers
Have implement neural network based mask detection algorithm with different colors of masks and that is working with 99% accuracy (around 2 fails in 850 tests) but the CNN based algorithm is too slow on boards like Raspberry Pi around 1-2 FPS at 720p. Shall I try PCA /ICA based techniques?
  • asked a question related to OpenCV
Question
7 answers
I am testing several methods for finding region of interest in hand gesture. in opencv for example I found some methods like camshift (for tracking a interest object), some background extraction methods (MoG, MoG2, ..) which specially are used in video to subtract background from foreground, which can also be used when we have hand as an object in a video with a complex background. and also GrabCut and backproject methods which can be used for hands posture in a static state. Contours, edge detection or skin methods are some other approaches for detecting hand in an image or video. And lastly I found that haar cascade can be used as well. I want to know that for passing from this stage, which algorithm is the best choice, considering that I use images with complex background. some algorithms like Grabcut or backproject were good but the most important problem was that I should manually specify some regions as foreground or background and this is not what it should be. After choosing a method for roi, generally what are the most important features in hand gesture recognition? for extracting features which method is your suggestion? that can work well with one of the general classifiers like svm, knn, etc to classify an specified image.
Thank you all for taking your time
Relevant answer
Answer
how to follow hand gestures with the WebCam camera  using image processing
  • asked a question related to OpenCV
Question
3 answers
Can convolutional neural network recognize small targets with very few pixels? How is the processing speed compared with the traditional opencv algorithm? I need some information for help.
Relevant answer
Answer
you need a fine tune the pre-trained model’s using the training data (small targets)
  • asked a question related to OpenCV
Question
10 answers
Hello, I have a binary edge detected picture(used Canny edge detection method), now I would like to filter out small or not required edges ( by length or shape or number of pixels) in python, does anyone have any suggestions ?
thanks in advance
Relevant answer
Answer
Hi Payam,
To remove small features, you can use "connectedComponentsWithStats" from OpenCV. It allows you to calculate stats over pixels, like component size (cf. https://stackoverflow.com/questions/47055771/how-to-extract-the-largest-connected-component-using-opencv-and-python).
Best regards,
Rémi DM
  • asked a question related to OpenCV
Question
5 answers
I am working on image segmentation using python open cv package but couldn't able to work with it because of error indicating "ModuleNotFoundError: No module named 'cv2'" and the same error is shown in the image
Can anyone suggest me how to fix this issue for proper working of open cv package.
Relevant answer
Answer
Actually the open cv package was missing in the inbuilt python library. Now i fixed the issue by manually adding the package into the python as per the suggestion given by Pavlo Pavliuchenko and its working well. Thank you very much for your response Cao Zhiwei, Hejar Shahabi
  • asked a question related to OpenCV
Question
6 answers
  • I'm currently working on a project to extract text from document- images (like passport and license) and storing the passport number and driving license number along with the name of the person in a database.
  • I have used Pytesseract for the same.
  • Does Pytesseract use any of the Neural Network Algorithms?
  • The code with the sample image and output IS ATTACHTED BELOW.
from PIL import Image import pytesseract pytesseract.pytesseract.tesseract_cmd = r'C:\Program Files (x86)\Tesseract-OCR\tesseract.exe' im = Image.open('C:/Users/Kiran Lalwani/Desktop/dss/56db21ec-8d4d-4128-889a-948e81eb7127.jpg') text = pytesseract.image_to_string(im, lang='eng')
  • Is there any other more efficient method?
  • What about Tesseract-OCR or OpenCV or CNN or MATLAB for text extraction?
Relevant answer
Answer
Hi Oscar, good day! i would like to confirm if this is feasible. I will use the user-assisted method thru ABBYY finereader 12 to extract only useful table in the purchase order. Or, there is other algorithm to only capture important and useful data from purchase order like item code and order qty?
  • asked a question related to OpenCV
Question
10 answers
I try to install open cv using anaconda prompt with below commends but its not install, can any one help to solve this problem.
1. Type conda install -c condo-forge opencv.
2. conda install -c condo-forge/label/broken open cv
Relevant answer
  • asked a question related to OpenCV
Question
6 answers
Hello,
I am using Python and openCV to find the centroid of the blobs in a binary image. I use cv2.Moments() function to identify the centroid if there is only one blob. However, I do not have a system to loop through the blobs when there are multiple objects in the frame. I have tried using a contour based loop, however there are too many identified contours. I have also tried Canny Edge detection paired with a Gaussian Blur to help reduce the amount of edges picked up. Attaches is one of the binary images I am sending the python script.
Relevant answer
Answer
Which CV version are you using ? have a look here:
Maybe it helps
  • asked a question related to OpenCV
Question
3 answers
I am doing my final year research project about this.
Relevant answer
Answer
Could you share some examples and what precisely would be the regions to segment?
  • asked a question related to OpenCV
Question
1 answer
I am calibrating my camera and took 5 images on it. I used OpenCV for the calibration and i end up having 1 Set of Camera Intrinsic Matrix , 5 Rvecs and 5 Tvecs . I would like to know how to solve a common Rotation (3x1) and Translation vector (3x1) that would represent my camera out from the 5 images.
Can someoone help me with any explanation or a, opencv code greatly help too.
Thank you.
Relevant answer
Answer
Hello Varie John Camingawan Orozco , You can do get it by function calibratecamera from OpenCV. Kindly follow this link to understand and how to use the code.
I would suggest you that if you use 8-12 images, then you will get the good calibration. Also mind that less than 0.5 re-projection error considered as a good calibration.
  • asked a question related to OpenCV
Question
3 answers
Instead of writing the code in matlab for this, is there any open source software which I can use for this purpose (apart from OpenCV)? I found a software for this purpose http://www.opensourcephysics.org/items/detail.cfm?ID=7365. But it does not keep track of the shape? Can anyone recommend any software for this?
Relevant answer
Answer
Please have a look on this software;
Good luck
  • asked a question related to OpenCV
Question
3 answers
I am working on a project where I take images of the crops & need to analyzed it. For the same, I have designed a simple spectral camera with different filters that narrow the range of wavelengths. I plan on using ImageJ to analyze these images taken with this camera. I want to look at the different images, on each plant's unique spectral reflectance. Can ImageJ be used to pickout these differences, is ImageJ capable of that? Are there plug-ins already available for something like this? What are the capabilities of ImageJ in regard to UV/Visible/NIR?
Can OpenCV be the savior? If so, how the images taken be used to measure the reflectance?
Relevant answer
Answer
if you want it in Matlab either by using DFT,
fft2(imagematrix)
or using DCT
dct2(imagematrix)
or using Discrete wavelet transform
dwt2(imagematrix)
  • asked a question related to OpenCV
Question
4 answers
[image processing]: Convert line 58 to Scilab coding from Matlab coding?
My original Matlab program wrote many images {after entering 8 rows and 8 columns) to the specified location.
I'm struggling to do the same thing with Scilab coding, as i'm not a natural programmer - how about you, can you help? File attached: all c​o​l​o​u​r​. My operating system is macOS Mojave running on an iMac, the Scilab version being used is 6.0.1 [@ the time of writing]
Aside: Using, only, the image processing Module as specified on the first line of the program which works very well in other image processing programs both on this and the Microsoft W10 platform and some, but not all Linux distributions {where the included openCV 'bits' don't incorporate without too much experimentation}.
Relevant answer
Answer
  • asked a question related to OpenCV
Question
12 answers
In the very first frame of the video, I define a ROI by drawing a close line on the image. The goals is to recognize that ROI in a later frame, but that ROI is not a salient object. It is just a part of an object, and it can deform, rotate, translate and even not be fully in the frame.
Essentially, this algorithm should be used to reinitialize trackers once they are lost.
I have used a histogram based algorithm which works somewhat well, but it doesn't "catch" the ROI entirely.
The object is a soft and deformable object, soft tissue in a way, meaning you can expect deformations and also visual changes due to lightning.
  • asked a question related to OpenCV
Question
8 answers
Hello everybody, i hope you're doing fine, i'm working on a project about vehicles dete'ction and counting, and i used HAAR cascade classifier provided by opencv library on python and i did an algorithm to estimate the speed, i'm working on Sublime text 3, now the next step is to build an api to stock informations about the detected vehicles, maybe the real time number of the detected vehicles, a dashboard to visualize this data, do you have any ideas about how can i do that ? thank you so much.
Relevant answer
Answer
Python web frameworks like flask,bottle,etc. are definitely appropriate for working with python libraries and building RESP API's, but can be quite time-consuming. Remember that API's are accessing points and have no notification system. It is up to the API consumer application to fetch API resources at an appropriate time. And also, you'll have to store everything to a database so it can be recovered. If you're sure this covers your needs go for it.
Another good option is Firebase, and better if you want to make a real time application. It is a database, but as soon as you push to it from your application (your opencv detector), it notifies the consumer applications automatically. It has extensive language support, including python and it's very easy to use.
Firebase Ref:
  • asked a question related to OpenCV
Question
20 answers
I am trying to implement a depth computation algorithm on a low cost single board computer (ARM ODROID XU4), I'm using c++ with opencv for this purpose(opencv for simple operations such as reading and displaying images). the algorithm is executed and tested on CPU. In my implementation I'm using STL deque to mimic the behaviour of a shift register; each time I'm done processing one pixel I pop out the front of the deque and push a new elements at the back, hower the cost of executing this operation is very high. am I right in choosing the deque ? Note that the its size is predefined to be only 8.
Relevant answer
Answer
I implemented the moving average-style SAD on some AMD K10 CPU (x64) as a proof of concept, so performance was some seconds for a 2MPix image as far as I can remember for 64 disparities or so. I didn't do pointer arithmetics nor multithreading though.
Nowadays at DLR we do semi-global matching with disparity gating at ~1MPix/s on an i7 w/ 8 cores which provides a much better quality :-) I also own an 1.8 Ghz Odroid-U3 privately, but can't remember the performance on this quadcore board anymore. It was far below the i7 values since I didn't use SSE4/AVX/AVX2 intrinsics but pure C++ (~50 kilopixel disparities per second?).
If you have a contiguous image array you can do SAD-MA with pointer arithmetics instead of getPixel()-like functions. You don't have to construct the window explicitly since you just need to compute and update the SAD value for each x;y;disparity using the moving average scheme.
  • asked a question related to OpenCV
Question
6 answers
Please, how can I resolve this error :
OpenCV(3.4.1) Error: Insufficient memory (Failed to allocate 63489024 bytes) in cv::OutOfMemoryError, file C:\build\master_winpack-bindings-win64-vc14-static\opencv\modules\core\src\alloc.cpp, line 55 OpenCV(3.4.1) Error: Assertion failed (u != 0) in cv::Mat::create, file C:\build\master_winpack-bindings-win64-vc14-static\opencv\modules\core\src\matrix.cpp, line 362 Error: OpenCV(3.4.1) C:\build\master_winpack-bindings-win64-vc14-static\opencv\modules\core\src\matrix.cpp:362: error: (-215) u != 0 in function cv::Mat::create
here is the code :
  1. def extract_features(image_path, vector_size=32): image = imread(image_path, mode="RGB") try: alg = cv2.KAZE_create() kps = alg.detect(image) kps = sorted(kps, key=lambda x: -x.response)[:vector_size] kps, dsc = alg.compute(image, kps) dsc = dsc.flatten() needed_size = (vector_size * 64) if dsc.size < needed_size: dsc = np.concatenate([dsc, np.zeros(needed_size - dsc.size)]) except cv2.error as e: print 'Error: ', e return None print(dsc) def batch_extractor(images_path, pickled_db_path="features.pck"): files = [os.path.join(images_path, p) for p in sorted(os.listdir(images_path))] result = {} for f in files: print 'Extracting features from image %s' % f name = f.split('/')[-1].lower() result[name] = extract_features(f) with open(pickled_db_path, 'w') as fp: pickle.dump(result, fp) extract_features('HR.jpg', vector_size=32)
Relevant answer
Answer
The insufficient memory occurs in all softwares when we dealing with mathematical operation on big matrices. The cache allotted is fixed. May be some software allowed to you extend the memory some what. Better u reduce the size of the data by using any one of techniques such as downsampling, interpolation etc. and use it for ur work.
  • asked a question related to OpenCV
Question
3 answers
I am working on eye gaze. currently i have reached till eye gaze projection using OpenCV and using web camera. Now i want to project these onto the screen(can consider imaginary) to justify where the user is looking at exactly. Any leads to move forward on this?? Thank you.
Relevant answer
Answer
Sayeed Shafayet Chowdhury Thanks for the link. but my concern of area is just to use a normal webcam and without raspberry pi but yes it seemed relevant if i had considered to go with raspberry pi, thank you for the suggestion.
  • asked a question related to OpenCV
Question
2 answers
File "C:/Users/asus/Desktop/Mar1.py", line 30, in <module>
net = cv2.dnn.readNetFromTensorflow(weightsPath, configPath)
error: OpenCV(3.4.1) C:\Miniconda3\conda-bld\opencv-suite_1533128839831\work\modules\dnn\src\tensorflow\tf_importer.cpp:1582: error: (-2) Unknown layer type Sub in op Preprocessor/sub in function cv::dnn::experimental_dnn_v4::`anonymous-namespace'::TFImporter::populateNet
Relevant answer
Answer
Spyder
  • asked a question related to OpenCV
Question
13 answers
Hello all,
I am new to research gate but feel this will be a good place to discuss project Ideas. I am a senior computer science student with a passion for computer vision. I have taken some image processing classes and have some experience using opencv for previous projects(face detection). My project has to be research based. I want to do something computer vision based but want to extend on it with machine learning(neural networks svm etc). My advisor suggested LPR(license plate recognition) and implementing my own solution with my own data and training my own networks. However after doing some research I see that this technology is already in place and have seen that extensive work has already been done in this field. What are some research topics I can pursue that I could possibly contribute new data or a new approach? I understand I am just an undergrad and won’t be changing the world with my project but I would like a topic that is challenging and that has maybe less data contributed. something I could write a technical paper for. I understand it will be challlenging, am not looking for a light project. I want to do a project that will expose me to some crucial machine learning concepts and make me a good candidate for higher once I graduate, any ideas ???
Relevant answer
Answer
Pattern recognition, Machine learning, Deep learning these are topics are recently have more works. Further these three topics one to one related to each other
  • asked a question related to OpenCV
Question
5 answers
In previous versions of opencv , there was an option to extract specific number of keypoints according to desire like  
kp, desc = cv2.sift(150).detectAndCompute(gray_img, None)
But as in opencv 3.1 SIFT and other "non free" algorithms are moved to xfeatures2d ,so the function is giving error . Kindly tell me how can i set limit on the number of keypoints to be extracted using opencv 3.1. Thanks !
Relevant answer
Answer
n_kp = 5
cv2.xfeatures2d.SIFT_create(n_kp)
  • asked a question related to OpenCV
Question
6 answers
I use openCv 2.4.9. I put .dll files beside the exe and run my programs. I find these .dll files in openCv directory :  "opencv\build\x64\vc10\bin".
but for using functions without this method, must be compile open CV with Cmake tools. this method has many bug. Would I be wrong? please help me to compile this library
Relevant answer
Answer
The simple answer is No
  • asked a question related to OpenCV
Question
3 answers
I have researched about the same, unfortunately couldn't be able to find a right approach.
All I have got to see is to use OpenCV, but how would I able to integrate OpenCV with NAO?
Any suggestions would be much appreciated.
Relevant answer
Answer
What level of integration are you aiming for? It can go from merely analyzing the images to integration in that the images are analyzed and then actions are taken by NAO.
Usually when you are integrating two disparate programs the best way to do so is with a pipeline architecture. What you need to decide is where in the NAO program do you want to insert OpenCV. It can be from getting access to the files of images or video stream to integration at the code level.
  • asked a question related to OpenCV
Question
6 answers
Hello,
I am building a CBIR system with Corel Database (100 classes of 100 pictures). I have implemented some "current" (non deep learning) descriptors (Sift, Surf, HOG, Color Histogram, HSV histogram, LBP histogram, ORB, Hu Moments of the image, GLCM descriptors (contrast, homogeneity,...)). Also, I implemented FlannMatcher and BFMatcher for Sift, Surf and ORB ; `compareHist` function of OpenCV and its four distances for all the histograms and NORM1,2,INF pour vectors (Hu & GLCM).
However, I get really poor results and bad R/P curve. More precisely, it seems to really depend on the query. For example, for the bear, the best results (Top 50) are reached with GLCM where I get this :
[![results with GLCM][1]][1]
On the other hand, when the query is a playing card (which is rather simple), that gives rather good results, at least with some algorithms such as Sift.
[![results with Sift][2]][2]
I was wondering if it was normal to have so bad and variable results ? Actually, I just used OpenCV functions so I don't see where I could have been wrong...
Could it be relevant to make a weighted sum of some descriptors ? Just by normalizing the distances, weight them add sort the global sum ?
Is there another way to improve "simply" the results ?
Thank you in advance for your help
Relevant answer
Answer
Pierre De Handschutter FLAN or BF matchers with SIFT, SURF or ORB like key point descriptors would work reasonably only when the same or part of the query image is appeared (in different scale, orientation, illumination and with other variations) in the matching images. But that is not the case in Corel dataset hence those method would not work as expected. If you really need to use them, try using Bag-of-Feature models of SIFT, SURF and ORB with SVM like classifier. You may refer the following code.
Color histograms (including all the color spaces such as RGB, HSV and Lab etc) have their limits and its obvious they do not hold the necessary information about the shapes of the objects appeared in the image. Therefore no wonder about the poor results in color histograms based CBIR.
LBP is better at discriminating objects in a particular domain (like faces, vehicles etc) and it is vulnerable in general image retrieval applications where the images having highly cluttered background.
GLCM along has the same problem where it only characterizes the texture details which may not be the discriminating feature for a pair of images. Hu in the other hand should not use for natural image classification where it performs reasonably with single object having a well defined shape.
The best non deep learning based approach I found so far is the Fused Color Gabor Pyramidal Histogram of Oriented Gradients (FC-GPHOG) descriptor classified with nearest neighbor on Enhanced Fisher Model (EFM). You can find my implementation of FC-GPHOG from:
The code related to the work mentioned in the paper :
Sinha, Atreyee, Sugata Banerji, and Chengjun Liu. "New color GPHOG descriptors for object and scene image classification." Machine vision and applications 25, no. 2 (2014): 361-375.
EFM is nothing but the applying LDA on truncated PCA projection of the FC-GPHOG descriptor.
  • asked a question related to OpenCV
Question
2 answers
ToxTrac is a free Windows program optimized for tracking animals. It uses a Computer Vision tracking algorithm that is robust; very fast; and that can handle one or several animals in one or several environments. The program provides useful statistics as output. ToxTrac can be used for fish, insects, rodents, etc.
ToxTrac is currently being used in dozens of institutions and is one of the best available tracking software for animal studies.
The Project is currently being developed by only one person, but there is a large amount of work to be done. So a call for collaboration is open.
What I need, is people with knowledge in C++ with expertise in some of the following areas:
• Computer Vision and programming in OpenCV
• Machine Learning (with knowledge of TensorFlow)
• User interface design with QT
Authorship in all related scientific contributions will be shared.
Thank you for your support and patience.
Instruction video: https://youtu.be/RaVTsQ1JwfM
Citations:
• Rodriguez, A., Zhang, H., Klaminder, J., Brodin, T., Andersson, P. L. and Andersson, M. (2018). ToxTrac: a fast and robust software for tracking organisms. Methods in Ecology and Evolution. 9(3):460–464.
• Rodriguez, A., Zhang, H., Klaminder, J., Brodin, T., and Andersson, M. (2017). ToxId: an algorithm to track the identity of multiple animals. Scientific Reports. 7(1):14774.
ToxTrac is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.
Relevant answer
Answer
Thank you for making this software freely available! At TalTech Centre for Biorobotics we will give it a try for underwater video of fish.
  • asked a question related to OpenCV
Question
6 answers
I want to tract cars and determine speed from videos using Open CV. Which algorithm you think will provided better results?
Relevant answer
Answer
KLT
  • asked a question related to OpenCV
Question
1 answer
I'm currently using an app called IP camera that send the live stream through a localhost link if the mobile and pc are connected to the same network. I would like to build a similar application because I want to add some functionalities to that
Relevant answer
Answer
I recommend to use DroidCam. It is app for Andoid transmitting image to client in PC where the client emulates camera device. Thus in OpenCV you open the camera source just by VideoCap camera(id); Mat frame; camera >> frame; where id is 0,1,2,... if you have no camera on PC it is zero, usually you have one, so id is 1.
  • asked a question related to OpenCV
Question
7 answers
To calculate "pixel/mm", principal point (in mm) and focal length (in mm) using openCV's "calibrationMatrixValues" function. The aperture width and aperture height are required as input. Aperture width and aperture height are not provided by manufacturer also. How to find those values?
Thank You :D
Relevant answer
Answer
Thank You ..For reply
I also got the correct method.
If we have the Field of View(FOV) of camera in physical space (mm or microns) and sensor resolution (in pixels). Then mm/pixel is FOV /Resolution
(in same direction). The FOV is not dependent on monitor pixels, window pixels, Thus its better to use this method.
  • asked a question related to OpenCV
Question
10 answers
I wrote a program for processing three video whit C++ and OpenCV for my Master's thesis, But I didn't design and implement a graphical user interface for it. Program received several videos and did process on them and saved the resulting video in the given directory.
Now, my question is, if i want to write a program that shows videos of 6 to 8 cameras on a system whit maximum 5-core and I can process them at the same time. Firstly, what language can I use that Be quick its process and be suitable for real time requirements?
Secondly, i can design and create strong GUI whit language.
and thirdly, a language that can to communicate whit hardware of the cameras or can receive videos from cameras directly.
Which of java, linux, c#, c++, python is the best?
What language and what library?
What language use for create processing video program and its GUI in big companies?
Are this two subjects depended and Related or Unrelated؟
thanks a lot.
Relevant answer
Answer
Dear hoda,
You can use C++ as well. I just answered your question about the possible options ☺️.
Abdullatife suggested a good tool that could be used with the C++ code and no need for a new programming language.
Good luck,
Ola
  • asked a question related to OpenCV
Question
11 answers
Hi everyone, I want to automatically analyse video with beetle movement. Output should be matrix with x/y coordinates (pixels) of beetle position in time. I have a problem, because I am beginner in computer vision, so can you give me some advice how to solve this task?
Analyse for 1 object. More than 400 hours of video/camera, 8 cameras.
Is openCV/Python OK for this task?
Screenshot from video is in appendix.
Thanks in advance.
Relevant answer
Answer
@ Sang-Il Oh : In the computer vision field, object(s) tracking can be applied to solve your problem.
Yes, definitely. By triangulating (or tessellating) the frames in a video and applying shape detection, analysis and classification techniques, it is possible to organized video frames into clusters containing objects (e.g., ground beetles) with similar behavior. For more about this, see
Foundations of Computer Vision
  • March 2017
  • Intelligent Systems Reference Library 124
  • DOI:
  • 10.1007/978-3-319-52483-2
  • Edition: 1st
  • Publisher: Springer International Publishing Switzerland
  • Editor: Janusz Kacprzyk and Lakhmi C. Jain
  • ISBN: ISBN 978-3-319-30260-7, ISBN 978-3-319-30262-1 (eBook)
  • Projects:
  • Computer Vision and Image Analysis, Understanding and Processing
  • Shapes in Visual Scenes, Digital images and Videos
  • asked a question related to OpenCV
Question
3 answers
After installing tensorflow and necessary package when I install openCV and want to run spyder then the following error happening. It will be very much helpful if anyone suggest about the solution. Thanks in advance
Relevant answer
Answer
Why would you recommend a 4 years old version of OpenCV over a more recent one?
  • asked a question related to OpenCV
Question
6 answers
EigenFaces Face Recognizer Recognizer
FisherFaces Face Recognizer Recognizer -
Local Binary Patterns Histograms (LBPH) Face Recognizer
Relevant answer
Answer
Dear Suheel,
the face recognizers implemented by OpenCV are discussed and demonstrated, with code examples, in Satya Mallick's tutorials, here:
Mallick also briefly discusses the papers which presented each of the three methods in the first post above.
I think, however, that employing these feature-based approaches is not state-of-the-art anymore. They are all very sensitive to variations in the image conditions and work only satisfactorily when image acquisition conditions are optimal.
The research in this area has long turned to Deep Learning/Convolutional Neural Networks - CNNs.
If you want to get acquainted with this field, look here for a simple-to-run example that works astonishingly well:
Back in August 2017, OpenCV 3.3 was officially released, bringing it with it a highly improved “deep neural networks” ( dnn ) module. This module supports a number of deep learning frameworks, including Caffe, TensorFlow, and Torch/PyTorch. The primary contributor to the dnn module, Aleksandr Rybnikov, has put a huge amount of work into making this module possible. However, what most OpenCV users do not know is that Rybnikov has included a more accurate, deep learning-based face detector included in the official release of OpenCV (although it can be a bit hard to find if you don’t know where to look). The tutorial from pyimagesearch will show you this detector.
A gentle introduction to Deep Learning/Convolutional Neural Networks you'll find here:
Good luck!
Aldo
  • asked a question related to OpenCV
Question
4 answers
I have applied traincascadedetector , KNN ,featurematching, estimategeomatric transform in Matlab, opencv & Python.
Can anyone suggest me some another method to detect the symbol?
Relevant answer
Answer
Thank you mam @ Veronica Biga
  • asked a question related to OpenCV
Question
6 answers
I am interested in segmenting an image using conditional random fields and would like to do it in OpenCV. Is there any inbuilt tool for that, or anything compatible with OpenCV?
Relevant answer
Answer
There is an add-on to the OpenCV library, implementing everything needed for the CRFs: DGM C++ library: http://research.project-10.de/dgm/
  • asked a question related to OpenCV
Question
2 answers
I want to know about face detection. I used Vision API Framework for face detection. Is it good or not. Please tell me the difference
Relevant answer
Answer
Thanks
  • asked a question related to OpenCV
Question
3 answers
Hi, everyone,
I built an CNN-LSTM model with Keras to classify videos, the model is already trained and all is working well, but i need to know how to show the predicted class of the video in the video itself.
I searched a lot on the internet, but nothing... I don't know if i can do this by using the OpenCV library, or any other one.
Here is the example of what i want, in this youtube video:
Thanks for the attention!
Relevant answer
Answer
Hi yes you can do it with opencv.
  • asked a question related to OpenCV
Question
9 answers
I am working on techniques to obtain high resolution reconstructed images of license plates. The source of these images are from CCTV video footage.
Relevant answer
  • asked a question related to OpenCV
Question
2 answers
Hello, I am trying to use 2d wavelet transform for image processing task in opencv c++. I found this library on http://wavelet2d.sourceforge.net/ which looks really awesome. I am using visual studio 2017 and I followed every single word of their instructions on their website. First, I followed this menu and added the header file of wavelet2d.h:
Project| Properties| VC++ Directories| Include Directories
And then I added the same path to
Project| Properties| C/C++ | General| Additional Include Directories. Afterward I add the folders containing “wavelet2d.dll” and “libfftw3-3.dll” to the following menus:
Project| Properties| VC++ Directories| Library Directories
Project| Properties| C/C++ | Linker| Additional Library Directories Finally, I add “wavelet2d.lib” to the following menu:
Project| Properties| C/C++ | Linker| Input| Additional Dependencies. Well, it seems that it should work, but it doesn´t and I get the following error messages when I try to compile the project: LNK2019: unresolved external symbol "__declspec(dllimport) void * __cdecl swt_2d(class std::vector<class std::allocator<double="" std::vector<double,class=""> >,class std::allocator<class std::allocator<double="" std::vector<double,class=""> > > > &,int,class std::basic_string<char,struct std::char_traits<char="">,class std::allocator<char> >,class std::vector<double,class std::allocator<double=""> > &)" (__imp_?swt_2d@@YAPEAXAEAV?$vector@V?$vector@NV?$allocator@N@std@@@std@@V?$allocator@V?$vector@NV?$allocator@N@std@@@std@@@2@@std@@HV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@AEAV?$vector@NV?$allocator@N@std@@@2@@Z) referenced in function main and also this one: LNK1120: 1 unresolved externals Can anyone help me with solving these errors? What´s wrong? Thank you so much
Relevant answer
Answer
Thank you for your answer. Yes I did, but the problem still pertains.
  • asked a question related to OpenCV
Question
3 answers
I have a stack of brain MRI with tumor present in some slices. I wanted to remove the tumor from that slices and fill these pixels with relevant values, such that it will be like non-tumor or normal brain MRI.
I tried with opencv's image inpainiting function for this, but the results are not that good enough. Please suggest the direction that I shall follow.
Relevant answer
Answer
Hi Jonathan Mason, I wanted to create a template from non-tumor brain MRI based on shape and texture, such that, it will be used to find variation with a test image with tumor present. I have thought on mirroring, but I wanted to make the method generic, such that it can be used for unsymmetrical medical images also. So, that's why I am looking for other methods.
  • asked a question related to OpenCV
Question
3 answers
Suppose I have a stucture file in MATLAB workspace that contains several parameter and matrices of different data type (e.g. int or double, etc.). It is required to save this struct file as single .dat file (i.e. an array of size equal to over all memory space filled by all the variables) such that it can be accessed in a C++ program to read the contents using *fid and *fread instructions.
Useful advices are anticipated.
Regards.
Helal
Relevant answer
Answer
The simplest way to write data in simple format is,
dlmwrite(filename,M,delimiter)
You can choose any data and file format (i.e. txt, dat, etc.) and seperator; the generated file can be easily parsed by C or other language.
Hope this will help.
  • asked a question related to OpenCV
Question
5 answers
I want to find the total number of distinct colors in an image. for example an image have red,green,blue,yellow colors so my answer should be 4.
please guide me through this problem.
any help will be appreciated.
Relevant answer
Answer
I would go for a histogram. OpenCV histograms are quite versatile https://docs.opencv.org/2.4/doc/tutorials/imgproc/histograms/histogram_calculation/histogram_calculation.html. Then you can count the number of non-zero entries. This is equivalent to some of the solutions that has been proposed, but OpenCV would do all the heavy lifting for you.
  • asked a question related to OpenCV
Question
5 answers
Actually I got header file in my Open CV release (<opencv2/dnn.hpp>) but not implemented.
Relevant answer
Answer
Actually, not directly implemented, but Caffe interact better, so I think you need to install Caffe - one of its requirement is OpenCV - check Caffe website. But if you installed OpenCV, then you can opencv_dnn module to work with Caffe.
  • asked a question related to OpenCV
Question
5 answers
I have a raspberry pi 3 with camera module and i want send picture captured by using OpenCV, to ubuntu server with TCP or UDP
Any idea ??
Relevant answer
Answer
You can use TCP as well.
If you don't want to miss a image on either end.
Are you trying to just send the images? Or you want to play it like a video or some thing?
If doing so, then i will suggest to make a queue kind of structure, Take some image (~30) compress and send via socket.
on other side uncompress it.
Hope it helps
  • asked a question related to OpenCV
Question
5 answers
I want to use RGB and depth video generated from Kinect (not version v2) and extract real coordinates so to map them on point cloud. I do not possess Kinect device but only the data. I am primarily relying upon OpenCV for this but can use some other open source tool. I have extracted frames from both videos and frames from both videos are numpy nd arrays 640X480X3. Can anyone provide some pointers or suggestions or existing solutions please? Thanks a ton!
Relevant answer
Answer
If I understand correctly, you have an RGB video and a IR depth video generated and saved from a Kinect, right?
the RGB video is only necessary if you are going to be colourizing the depth cloud.
As for openCV... I'm not sure why you will be using this. openCV is very useful for modifying images (contrast, threshold, etc) to get contours and such. I would ignore that until you know how to get the depth information from a still image.
You may want to visit this page, and skip down to where Shiffman discusses pointclouds: http://shiffman.net/p5/kinect/
He discusses how to build a depth lookup table (depends on which version of the Kinect your data is from) and then generate real-world coordinates from that.
The reason I suggest that part of the page is because it doesn't access the Kinect for anything.
This will, of course, depend on how the depth video was saved, whether it is just grayscale or if it has the actual depth information in it (ie: the image 'looks' like a grayscale, but the values of pixels go beyond 255)
good luck.
  • asked a question related to OpenCV
Question
2 answers
I'm estimating the distance using a chessboard and solvePnP function from openCV.
I heard that to have the more accurate distance, I shouldn't have the chessboard parallel to the image plan because the real change of distance in front of the camera doesn't have the same scale in the image because of the perspective.
For example if I move the chessboard 1cm away from the camera probably the size of the chessboard (in the image) won't be very noticeable to the camera hence the distance won't be very accurate in that situation.
Is that true and is there any books or references about this fact?
Relevant answer
Answer
Theoretically, a parallel chessboard should not introduce any error to the distance measurement. If you are using openCV then rvec will give some clue about any perspective shift. However there is one thing which affect the result, that is how far the chessboard is from the camera. Far the distance means less the accuracy. Reason is the discrete nature of any image sensor (The accuracy of the measurement is always bounded by the resolution).
Another fact is, if the chessboard is far away, then camera will not notice any non-significant rotational deviation relative to the image plane and ultimately results in highly-inaccurate distance measurement.
  • asked a question related to OpenCV
Question
5 answers
I have finished a simple demo for 2d-rigid image registration in python just only using opencv, numpy and scipy, I found it is very fast. But when i used the python to preform the 2d-norigid image registration algorithm like FFD using B-spline, it is so slow. I decided to turn to the C++ and using a parallel way to complete this algorithm. But I find that there is no a tool or lib in c++ like numpy in python which is so convenient for me to operate the multidimensional matrix or tensor, also I find that I can not install the TBB in my computer(windows10,vs2015) although I tried it many times.So I use the PPL(only be used in windows) and take a intuitional way to construct a multidimensional tensor(combine the vector<T> one by one in STL),But I did not think it will work very well and quickly.
I google some papers and find many algorithms in them preform very well, but there are no details about which tool, language,tec they used to achieve the high performance.
I wonder that which libs or tools in C++ could help me to construct a multidimensional tensor and to speed up the image registration.Also I had tried to install the ITK, but it failed.I don't know why,I used to send some emails to some specialist to ask for help,but I find it did't work, the issue is not fixed today.I guess maybe some wrong happened when using the vc++ compiler to build the source code of ITK. So I hope someone can give me some advice or give me a source code about image registration.
Thanks a lot!!!
Relevant answer
Answer
Hello Wu,
If your goal is to use some algorithm for non rigid registration, I suggest you look at existing libraries. Some are listed at the following page
Of course, installing ITK correctly might require some work but if you are working in medical imaging, it would be time well spent!
Good luck,
Bruno
  • asked a question related to OpenCV
Question
9 answers
I have a bunch of depth images (see attachement). I want to perform skeletal tracking on them. This data is captured though ASUS Xtion sensor but I only have access to the depth images and not to the videos. Is there a way to perform skeletal tracking in MATLAB/OpenCV or something else on these depth images?
Relevant answer
Answer
I would like to ask the similar questions. I want to extract skeleton joint positions in video frames.
How can MATLAB save these continuous frames, perform skeleton tracking and returns the skeleton joint position values?
  • asked a question related to OpenCV
Question
3 answers
Hello everyone, i'm beginner .I'm reading a paper where after segmentation for more accurate result graph cut is used.. please guid me i have no idea about it after segmentation how it is used and and about graphcut..please give few references...my work platform is opencv + visual studio 2010 + c++. Thanks
Relevant answer
Answer
The simple graph cut algorithm to be used is using in grid neighborhood i.e. (up, down, left, and right). First, you calculate unary potentials for your image which usually comes from your classifier, it can also come from your image features information.
Second, you calculate pairwise potentials which you calculate by looking at neighbor image pixels. If you have a grid neighborhood, you will only be looking for pixels in up, down, left and right direction.
Once you calculate your unary and binary (pairwise) potentials, you could use GCMEX (http://vision.ucla.edu/~brian/gcmex.html) code publicly available at UCLA website to optimize your energy potentials, and improve your segmentations.
for details how you can calculate unary and pairwise potentials.
All this code is in matlab, and you can write your own code to calculate energy potentials which should be given as an input to GCMex.
Please note, that this is a basic graph cut algorithm in grid neighborhood. Recent work has focused on DenseCRF settings where you consider a neighborhood where every pixel is connected to all other nodes. But, if you want to understand the concept and get some hands on, this energy optimization using GCMex can be a good start.
  • asked a question related to OpenCV
Question
3 answers
I applied butterworth low-pass filter but it didn't work well. The noises in the image seems horizontal periodic noises in the center of the image.
Relevant answer
Answer
Fourier transformation based filering. Do some FFT for similar bands - do the same for the image given and decide what kind of bands you want to remove from the real samples (with some margins)...
  • asked a question related to OpenCV
Question
7 answers
Dear OpenCV Users, 
Does anyone have practical results of how much speed improvements can be achieved using OpenCV CascadeClassifier::detectMultiScale with TBB library? 
Thanks in advance. 
Relevant answer
Answer
Any new development on your optimization of OpenCV using the GPU?
  • asked a question related to OpenCV
Question
6 answers
Hi,
I am working on a project that needs to track multiple objects in real time... using the minimum time and processing cost. The goal of the tracking process is to extract object location, speed,  type, and direction. 
I'm using OpenCV and Android OS in my implementation. Could anyone help me to decide which tracker can give the best performance for this case?
Thanks
Relevant answer
Answer
MMPF Multiple Models Particle Filter. You can check the book:
Beyond the Kalman Filter: Particle Filters for Tracking Applications.
  • asked a question related to OpenCV
Question
4 answers
i have downloaded train station data set from following source
they have provided images in raw format. i never used openCV so how can i convert these raw files into RGB images using matlab?
Relevant answer
Answer
Dear Shafina Shah,
look the link, may be useful.
fin=fopen('b1.raw','r');
I=fread(fin,row*col,'uint8=>uint8');
Z=reshape(I,row,col);
Z=Z';
k=imshow(Z)
Best regards
Faisal Hawlader
  • asked a question related to OpenCV
Question
4 answers
Hi. I am currently working on a medical image processing project that segments the coronary artery blobs from the axial CT slices of the human heart and converts the segmented coronary blob slices to a 3D coronary artery model. I wish to extend my project by mapping the 3D model to the 2D axial input slices, ie, by clicking on a point in the 3D model, it must display the appropriate CT slice and also the point to the position in that slice. Are there any methods ( techniques ) or softwares available to do this? If so, how?
I am using OpenCV to implement this project.
Relevant answer
Answer
Suggest using OpenGL
1. set your camera so screen projection plane is parallel to the slice...
2. clear screen buffer as usual with glClearColor set to background color
3. Clear your depth buffer with glClearDepth set to Z-coordinate of the slice in camera space
4. set glDepthFunc(GL_EQUAL)
5. render mesh
glClearColor( 0.0,0.0,0.0,0.0 ); // <0.0,1.0> r,g,b,a
glClearDepth( 0.5 ); // <0.0,1.0> ... 0.0 = z_near, 1.0 = z_far
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glDepthFunc(GL_EQUAL);
This will render only the slice for which fragments have Z==Slice coordinate. This can be also done by GLSL by throwing away all fragments with different Z. The DirectX should have something similar (I do not use it so I do not know for sure).
As most meshes are BR models (hollow) then you will obtain circumference of your slice so you most likely need to fill it afterwards to suite your needs...
  • asked a question related to OpenCV
Question
6 answers
I am trying to find the angle of a line detected through HoughLinesP in Open CV w.r.t a horizontal line. I have the starting and end points of the line through HoughLinesP. 
However, I am getting strange results when I use atan2.
Basically, I have multiple lines, all not starting at the same position and I want to find their orientation/ angle w.r.t to a horizontal line.
Here is the code snippet-
Point p1, p2;
p1 = Point(l[0], l[1]);
p2 = Point(l[2], l[3]);
//calculate angle in radian, if you need it in degrees just do angle * 180 / PI
double angle = atan2(p1.y - p2.y, p1.x - p2.x);
double angles = angle * 180 / 3.14159265358979323846;
cout << "line coordinates are " << l << endl;
cout << "Angles are " << angles << endl;
These are the images and angles obtained are attached. I want to find the angles of the blade lines with respect to a horizontal line through the hub. 
Should I use acos(vec2d(p2.x,p2.y)(cv::vec2d(1,0)) ?? Any help is appreciated. Thank you in advance!
Relevant answer
Answer
check in the website maybe you found dolution
  • asked a question related to OpenCV
Question
1 answer
I need help in OpenCV. I have six 1200x1 Mat objects/variables. I want to make a single Mat variable which is 1200x6. How to do this? For example, i have six mat objects a,b,c,d,e,f of 1200x1 size and now i want to make A = [a,b,c,d,e,f] , which is 1200x6 size. Please help
Relevant answer
Answer
  • asked a question related to OpenCV
Question
2 answers
I have to add structured/block noise in image. So,How can change amplitude value in image using opencv?
Relevant answer
Answer
  • asked a question related to OpenCV
Question
4 answers
I need to have the size of blob fixed and not affected much by illumination..
Relevant answer
Because of the continuous change in illumination. 
  • asked a question related to OpenCV
Question
3 answers
Hi every, I want to research for OpenCV C++ with MFC using car counting. I try working but it very hard. I want every help for me. Thanks all. Contact gmail: doducchien3795@gmail.com
Relevant answer
Answer
Dear Do Duc Chien
Check this link: 
Good Luck,
  • asked a question related to OpenCV
Question
13 answers
I have to continuously monitor the angle formed by the blade of a wind turbine w.r.t an imaginary horizontal axis. I have looked at Kinovea and Tracker as possible options. With Kinovea, I need some sort of marker on the blade and hub to track the angle, which is not possible. Besides this, we cannot export the tracked data into a spreadsheet. And with Tracker (OSP), it isn't possible to get a stream from a webcam.
Can someone please suggest another software that will be helpful for the same? 
- should be able to get a feed from a webcam.
-should provide tracking of multiple angles of different turbines and export to a spreadsheet.
- should have some sort of perspective filter to correct distortions due to the angled position of the web camera.
- preferably open source, but other options can be looked into.
The final option is using OpenCV and coding using C++. However, in this, I face a problem of how to find the angle with respect to an imaginary horizontal axis, how to code when the camera is angled, and when there are multiple turbines to be detected.
Any help/ suggestions would be greatly appreciated. Thank you.
Update-
Here is a more defined version of my question-
An ideal Wind Energy Farm will have all the turbines rotating with the same Blade Angle*, in a similar fashion. The blades of different turbines spin at variable speeds. As a result of this, the Blade Angle for every Wind Turbine is different. Considering a case of 4 Wind Turbines, each placed a 100 meter apart and forming a Blade Angle of ө1, ө2, ө3 and ө4, we can use OpenCV to monitor the Blade angles of each turbine by using suitable computer vision algorithms and by taking into account the distance, location and other such factors of the WebCam used to monitor the same. Computer vision comes into play when the camera is not located directly in front of the turbine, but at an angle and certain distance to it. The idea is to get an accurate value of the Blade Angles formed.
*Blade Angle(here)- the angle formed between the first blade and an imaginary horizontal axis, measured in an anti-clockwise direction.
I hope this provides better clarity.
In OpenCV, I have the following methodology planned- 
Get image/ frame- use canny edge detection- use Hough lines transform to find lines-recognise blade lines-find blade angles- go to next frame.
My problem here is- I don't know how to recognize only the blade lines after finding Hough lines. Another problem I face is how exactly I should make an imaginary horizontal line through the hub to measure the blade angle.
Do you have any thoughts on this? Thanks a lot. Any help is appreciated.
Relevant answer
Answer
Using Hough Transform you can fit any shape. 
https://www.youtube.com/watch?v=hYcugbbf9ug watch this lecture you will understand fitting arbitrary shape using hough transform. Once you know how to fit a Blade shape in the image, you can detect the blades in the image and then also find the Orientation of the object in the image. i.e 0-360 degrees. then you can calculate the difference in the object angle to your reference axis. This should work for one wind turbine. Then you should approximate the distance of the wind turbine and can adopt the algorithm for the other wind. 
If you have a good dataset of the images marked with blades of the turbines, you can use HOG and train an SVM detector to detect the blades in the image.
My approach would be to start with object detection. And Orientation of the object.
  • asked a question related to OpenCV
Question
8 answers
In case of circle pattern:
How I can determine the size and distant between circle items pattern?
What are the criterions should be consider that will allow to better calibration results using c++/opencv ?
Relevant answer
Answer
Regarding accuracy both checkerboard and circular patterns can be used with subpixel methods and be accurate.
Circular patterns can be potentially more accurate (up to 0.1 or 0.01 pixel in some controlled cases) but only if there is proper subpixel determination of the center of mass or center of the circles (detected as ellipses). That's why they are used in industrial photogrammetry mostly. However the math involved is also more complex regarding corrections, and is sensitive to a proper choice of circle sizes, which it is not always easy to apply fully.  In practice subpixel determination of edges in a checkerboard pattern is also possible and you can get a great improvement there with simple math.
However this are really fine issues to dig into the subpixel accuracy. It is normally way more important to choose the right camera model and an adequate pattern for the application. In my experience image coverage is typically more overlooked and the most important aspect than anything else and calibration errors there are in the range of several pixels.
For instance if the pattern is designed to be shown fully in the images it will not allow easily to match points close to the edge of the images in oblique shots. You will be extrapolating the model there more often than not with a lot of empty space.
A pattern which is large enough to cover all or most of the image in every shot is ahuge advantage, but it will require to have some identifiable points in the middle such as:
It is easy to achieve low residuals with lower coverage but that does not mean directly better calibration. This really depends on the scenario and use case.
Regarding spacing of circles or edges, this a practical question. A 20x20 grid should be enough in most cases since the camera models are typically simple. However highly distorted lenses may require higher density. Denser grids are normally better with high resolution images, but it is a trade-off with computation time and detection capabilities (smaller features are normally harder to find).
Regarding the size of the dots, this is and advantage and disadvantage with respect to checkerboard. You need to decide, of course smaller than the spacing to avoid overlap. Larger allow for finer subpixel accuracy determination of center of mass, but require more complex corrections (projections are no longer ellipses and aberrations become very relevant). Smaller are simpler and less biased, but sometimes harder to find and detect.
There is no easy general answer. Everything is based on practical decisions depending on the specific case and don't forget that automatic and fast detection and matching are often an important issue, not just accuracy.
  • asked a question related to OpenCV
Question
4 answers
I am working with OpenCV in Java to build a ALPR system and I need to separate the "X" from the actual plate's frame so I can then take the letter to read it, but I haven't been able to figure out what else to do. This is what I've tried:
1) Ostu threshold.
2) Watershed.
You can see that also in the distance transform the "X" is still merged and after thresholding this image I can't find any value to actually separate the "X" without damage in the other letters.
Hope somebody can help me with this.
Thanks in advance!
Relevant answer
Answer
Hi Jose,
Thanks very much for posting your interesting problem.
I'd like to introduce you to MIPAR: a powerful, flexible, and intuitive image analysis software we have released which is built perfectly to solve problems like this.
I have used MIPAR to build a recipe (its core technology) which successfully extracted the features.
I have attached screenshots of each recipe step which hopefully reveals the workflow. I have also attached the recipe file itself which you can load right into MIPAR's Image Processor and the steps will get automatically applied (and can be adjusted since the entire sequence is not destructive). You may download a trial of MIPAR if you wish at http://mipar.us/trial.
Please contact me with any questions. Happy to help!
Cheers,
John
  • asked a question related to OpenCV
Question
19 answers
Hello,
I am working with C++(OpenCv) and I want to compute the runtime of my method to compare it with other methods. I use clock_t tStart = clock(); and printf("Time taken: %.4fs\n", (double)(clock() - tStart)/CLOCKS_PER_SEC);
The problem is that i don't know where to put the clock start? Is it after image reading and image preprocessing or after them? also the same for clock end.
Thank you
Relevant answer
Answer
in mat lab : put tic at processing start and toc at the end
tic
imshow(a)
toc
  • asked a question related to OpenCV
Question
1 answer
Hello,
I want to decompose of homography matrix in opencv?
In opencv3.0 and 3.1, decomposeHomographyMat() function is used for decomposition of homography matrix, but it handled unhanded exception.; 
Can anybody help me for how to use this function?
Thank you,
  • asked a question related to OpenCV
Question
11 answers
Hello,
Please, i am using opencv 2.4.9 on ubuntu 14.04 and i try to read/write an uncopressed video but it gives me a segfaults on cvQueryFrame(capture) when i try to open a rawvideo. Can help me?
Thank you
Relevant answer
Answer
Thank you Dear M.B.Coteli for your reply
  • asked a question related to OpenCV
Question
6 answers
it is possible to implement watermarking algorithms with open CV. 
Relevant answer
Answer
Yes, it's easy to program your watermarking algorithms in OpenCV especially with C++. But you must code them because in my knowing it doesn't exist yet a predefined openCV function for this purpose.
  • asked a question related to OpenCV
Question
2 answers
I have converted my MATLAB code for background subtraction to C++ code using MATLAB coder. The integration of C++ code with OpenCV library is done in Visual Studio 2015.
I am getting error "Exception thrown at 0x00007FF61EB25260 in myProject.exe: 0xC0000005: Access violation reading location 0xFFFFFFFFFFFFFFFF."
If there is a handler for this exception, the program may be safely continued.
Relevant answer
Answer
As stated above, it is almost surely a bad pointer. Without seeing any code, it is impossible to provide a resolution to this problem.  Look for temporary objects that have gone out of scope and then accessed, or objects that have been otherwise "free'd" then referenced, etc.
  • asked a question related to OpenCV
Question
3 answers
Dear all,
I would like to extract all dI/dV curves of a CITS (series of dI/dV curves) measured by WSXM program for further analysis with Matlab and other program. I try with the fopen of Matlab to read the binary file, but it does not work. Do you have any trick to overcome this problem? If yes, please share with me. Thank you in advance.
Regards
Relevant answer
Answer
Thank you for your reply. I attached here the file.
  • asked a question related to OpenCV
Question
3 answers
I'm new to the field of computer vision and I want to solve the following task (preferrably with OpenCV and C#, but other solutions like with Scilab? are also gratefully welcome)
Relevant answer
Answer
Dear  Dr Shahid
 To detect objects you can use various object detection algorithms. After that, you can just get the object from most upper coordinates from your image. Will you please give some images as examples, then I can give you specific solution regarding that. You can visit the link that I have provided. It will help you.
Regards
Ehtesham Chowdhury
  • asked a question related to OpenCV
Question
4 answers
I got the following error:-
OpenCV Error: The function/feature is not implemented (HOG cascade is not supported in 3.0) in read, file /tmp/opencv3-20160822-4825-e1u8p8/opencv-3.1.0/modules/objdetect/src/cascadedetect.cpp
Relevant answer
Answer
Their words
We decided to drop the current HOG cascades in OpenCV 3.x. The implemented HOG features are quite weird - different from Dalal's interpretation of HOG, different from P. Dollar integral channel features. In xobjdetect we slowly grow superior ICF/ACF+WaldBoost-based detector, which is there already and will be improved during 2015.
  • asked a question related to OpenCV
Question
4 answers
I successfully could find hand contour thanks to findContour function in openCV and by setting some arguments. But I do not understand how mathematically openCV can find outer contour of hand? I know that it saves points in an array, but how it uses the hand's points to join them? My question is obviously about the concept behind this function and hierarchy settings. Note that in the case of hand, we do not need to find all the contours, so the first hierarchy will actually work. I also found the idea of reference paper something similar to freeman chain code, but more advanced. I don't know what is the concept behind finding connected components in this method. The download link of paper is provided. 
I really appreciate you answering this question. Thank you all
  • asked a question related to OpenCV
Question
5 answers
OpenCV is normally used for face recognition applications. I want to embed an emotion recognition algorithm on openCV. How to do? Also which version of openCV is suitable for windows 7?
Relevant answer
Answer
Dear Geetha Venkat,
Whenever you hear the term face recognition, you instantly think of surveillance in videos. So performing face recognition in videos (e.g. webcam) is one of the most requested features I have got. I have heard your cries, so here it is. An application, that shows you how to do face recognition in videos! For the face detection part we’ll use the awesome CascadeClassifier and we’ll use FaceRecognizer for face recognition. This example uses the Fisherfaces method for face recognition, because it is robust against large changes in illumination.
Regards, Shafagat
  • asked a question related to OpenCV
Question
2 answers
How to calculate Haralick Texture Features in openCV?
I calculated the same in MATLAB but unable to find any code in openCV.
Relevant answer
Answer
hi check the following link
GLCM in opencv2 (Gray-Level Co-occurrence Matrices)
The legacy function GLCM does not perform yet in opencv2. I use the following code:
#import <opencv2/legacy.hpp>
cv::Mat inputIm = [in_image CVMat];
cv::Mat grayIm = [in_image CVGrayscaleMat];
// cv::cvtColor(inputIm, grayIm, cv::COLOR_RGB2GRAY);
// here I get an error: "no matching function..." !!!
CvGLCM* glcm = cvCreateGLCM(grayIm, 1, NULL, 4, CV_GLCM_OPTIMIZATION_LUT);
cvCreateGLCMDescriptors(glcm, CV_GLCMDESC_OPTIMIZATION_ALLOWDOUBLENEST);
double d = cvGetGLCMDescriptor(glcm, 0, CV_GLCMDESC_HOMOGENITY );
double a = 1; double *ave = &a;
double s = 1; double *sd = &s;
cvGetGLCMDescriptorStatistics(glcm, CV_GLCMDESC_ENERGY, ave, sd);
NSLog(@"ave = %f sd = %f", *ave, *sd);
The legacy function cvCreateGLCM takes the older IplImage* as its input, so you need to convert your cv::Mat image first.
Try this:
// your input image
cv::Mat grayIm = [in_image CVGrayscaleMat];
// create a legacy image
IplImage pGray = grayIm;
// call function
CvGLCM* glcm = cvCreateGLCM(&pGray, 1, NULL, 4, CV_GLCM_OPTIMIZATION_LUT);
  • asked a question related to OpenCV
Question
2 answers
Hi,
I have OpenCV, OpenMPI compiler and linker flags set for using cmake. I want to include OpenACC compiler flags too in order to compile an OpenMPI enabled C++ OpenCV code with OpenACC. Thanks in advance.
Relevant answer
Answer
To use the OpenACC compiler with MPI, you need to tell MPI to use the PGI/OpenACC compiler when you install MPI.  If/when you install MPI from source, you use the traditional {configure, make, make install} sequence.  You can tell configure to use the PGI compiler in the first step of that sequence:
  ./configure CC=pgcc CXX=pgc++ F77=pgf77 FC=pgfortran ...
Then when you 'make' and 'make install' MPI, mpicc will be configured to use pgcc, mpicxx will be configured to use pgc++, etc.  So the PGI compiler needs to be installed, in your path, and working to compile programs prior to building MPI.
Here is the relevant page for OpenMPI:
You can do the same thing using MPICH:
The upshot is that you need to rebuild MPI from source.
How can you compile MPI with OpenACC? - ResearchGate. Available from: https://www.researchgate.net/post/How_can_you_compile_MPI_with_OpenACC#579b62485b495247c20e7309 [accessed Jul 29, 2016].
  • asked a question related to OpenCV
Question
3 answers
I have implemented a program to convert an image from ADTF framework to Opencv and back to ADTF. I have passed this image to a video display plugin.
The program runs without error. But I see only a black screen as image.
Please let me know what could be the issue and how to rectify it.
Thanks in advance   
Relevant answer
I figured out that the converting the image to raw image and then using appropriate mat.type to hold the image in opencv works without giving type mismatch errors.
For reverse process, just give it back to buffer/vector using memcpy of appropriate size and accordingly provide the bitmap format in ADTF.
  • asked a question related to OpenCV
Question
2 answers
I have an image transmitted to the input (pin type: cVideoPin ) of my ADTF plugin. I have also created a buffer that can hold the input image. I need to make the image available in this buffer be available to Opencv computation preferably through a Mat container. 
I need suggestions on how to make the image in ADTF buffer compatible with opencv Mat.
Thanks in advance.
Relevant answer
Answer
how is the data stored? in a byte array?
if yes look at
byte *data;
cv::Mat imageWithData = cv::Mat(sizeOfData, 1, CV_8U, data).clone();
After you have created this matrix, call the reshape function with the number of rows in the image.
Mat reshapedImage = imageWithData.reshape(0, numberOfRows);
  • asked a question related to OpenCV
Question
4 answers
I have a raspberry 3 with Raspbian system image installed includes opencv and OpenNI.
Is there any possible way to install the MATLAB 2016a and Simulink Support Packages for Raspberry Pi 3 *without deleting* the content of my SD card?
B.S. I already tried to install Support Packages on an SD card and it worked fine (i.e., I was able to run the sample program of user green light).. Sure all the information contained in the *SD card was deleted*.
Again, I need to install the MATLAB 2016a and Simulink Support Packages for Raspberry Pi 3 *without deleting the previous content of my SD card*?
Relevant answer
Answer
Dear Somar,
Applications for the Raspberry Pi to be used in standalone operation, please see the Raspberry Pi Support from Simulink. See links:
-Raspberry Pi Support from MATLAB - MathWorks
-Install the Support Packages of Raspberry Pi 3 for MATLAB 2016a and ...
Best regards