2019-10-11 03:40:27 -0600 | received badge | ● Popular Question (source) |
2018-07-09 00:47:08 -0600 | received badge | ● Popular Question (source) |
2016-06-15 22:08:09 -0600 | received badge | ● Popular Question (source) |
2014-09-20 17:07:13 -0600 | answered a question | Q: Live Camera feed without preview? If you mean with without a preview, that you don't show the images, then sure! Basically a simple "hello world" type of application for opencv would be :
If you omit the last step, then I suppose you have what you are looking for. |
2014-09-20 11:44:33 -0600 | asked a question | VideoCapture latency Hey! I am using a VideoCapture object to stream images from my webcam built in my macbook. I notice somewhat of a delay though (in the order of 200-400msec I would guess). If I use Photobooth to show the camera output, there is hardly any lag at all. I tried to call VideoCapture::read in a separate thread and have the main thread visualize the image, but this had no effect as far as I could tell. Does anyone have a suggestion? Best regards, Hans |
2014-08-21 08:10:53 -0600 | received badge | ● Nice Answer (source) |
2014-05-27 07:19:12 -0600 | asked a question | Gaussian derivative with orientation Hey all, I am working out an idea from a paper which talks about taking the Gaussian derivative in 8 orientations. In summary, my question is: How can I do this using OpenCV? I assume the Gaussian derivative means a difference of Gaussian in a certain orientation. How can I acquire the Gaussian filter in these orientations to use in a convolution? Or is it easier to rotate the image instead? Best regards, Hans |
2014-05-23 03:27:17 -0600 | commented answer | calcHist on BGR in python Aha I see, very clear answer. Thank you! I didn't realize the histogram was of combinations of the channels. |
2014-05-23 03:26:10 -0600 | received badge | ● Supporter (source) |
2014-05-22 16:13:36 -0600 | asked a question | calcHist on BGR in python Hey, I want to use the calcHist function in python on an BGR, but I get some unexpected results. The code I use to compute the histogram is as follows: However the result of hist is of shape (25, 25, 25). I was expecting to get (25,3), as in 25 bins per channel. What is this result I am getting? The opencv documentation simply states But I don't quite understand what this means exactly. Best regards, Hans |
2014-04-30 02:42:48 -0600 | commented answer | PCA+SVM Explanation I didn't check your code before, but it seems like you use PCA/SVM fine there. That is of course no guarantee that it'll work ;) good luck! |
2014-04-29 09:18:38 -0600 | answered a question | PCA+SVM Explanation Your PCA object basically creates a new coordinate system for your data, such that the first principal component captures the 'most interesting data', the second principal component the second most, etc. With most interesting data I mean that the data in this direction has the highest variation. If you have projected your samples for your SVM classifier using some PCA projection, you need to do that exact same projection if you want to classify a new image. Otherwise you'd be comparing different coordinate systems with eachother, like comparing meters with yards, celsius with fahrenheit, apples with pears. |
2014-04-17 06:35:59 -0600 | commented answer | SVM bias on weights of positives and negatives Yes I tried that. The thing is the code that handles the conversion for CvSVMParams skips class_weights because of a missing flag for that parameter (CV_PROP_RW). If you add that, a linking error occurs that it cannot convert CvMat* to PyObj and vice versa. Same thing for non pointer, cv::Mat or cv::Mat*. |
2014-04-17 05:24:57 -0600 | commented answer | SVM bias on weights of positives and negatives As requested, I added the code. Do note, adding these weights should _in theory_ work, but the python opencv bindings have a bug which causes the weights to not be set (as mentioned earlier, I hardcoded them in the OpenCV source just to test the weights). |
2014-04-17 03:23:29 -0600 | received badge | ● Enlightened (source) |
2014-04-17 03:23:28 -0600 | received badge | ● Good Answer (source) |
2014-04-16 04:54:05 -0600 | commented question | SVM weights parameter not set through Python Thank you, I checked it out. It seems only properties with the CV_PROP_RW flag get exported. If I add that flag to the CvMat attribute I get a linking error. Same thing when I switch it to a cv::Mat object. Are there no other properties with Mat's that can be used in python? |
2014-04-16 03:49:47 -0600 | commented question | SVM weights parameter not set through Python Ah great, some proof ! :) How is this generated though? My knowledge of the opencv python bindings is very limited. |
2014-04-16 00:55:02 -0600 | received badge | ● Nice Answer (source) |
2014-04-15 10:12:26 -0600 | received badge | ● Necromancer (source) |
2014-04-15 10:08:01 -0600 | answered a question | SVM bias on weights of positives and negatives Regarding the weights, I did some small tests to check the influence. Here are my results: No weights: With weights [0.9, 0.1] (0.9 for the largest class, 0.1 for the smallest class): You can see the change of the weights clearly in these pictures. I hope this clears things up a bit. On a side note: I tried to do this in python but the class_weights variable does not appear to get set properly (see this question for more information). To circumvent this I had hardcoded the weights in the opencv source, using c++ would've most likely given the correct results as well, as the weights seem to get properly set for c++. Code used to generate the example: |
2014-04-15 10:03:41 -0600 | asked a question | SVM weights parameter not set through Python Hey, I am using the SVM implementation in OpenCV (python) and I am running into some trouble setting the class weights parameter. The attribute is called However the class_weights variable does not seem to get set inside OpenCV. I added a line to log the value of the If I try a similar thing in c++ it does get set. Any idea what is going wrong or what I can further investigate? The wrapper function for CvSvm::train() is the last step I could identify between Python and c++, is there a function before CvSvm::train() that I can check for faults? Best regards, Hans |
2014-04-01 09:25:59 -0600 | commented question | SVM weights to HOGDescriptor If I come across something like that I will let you know. It does indeed sounds like some bad implementation. It would be one thing if the algorithms came from different packages, but they should both have been adapted for the 'opencv standard'. |
2014-04-01 08:19:11 -0600 | commented question | SVM weights to HOGDescriptor Thank you for your reply! I looked through your topic and noticed that when you convert it to a primal form, you use '-myalpha'. I added a minus sign, and I get much better results now! I had only 24 positive and 36 negative examples, so I didn't expect perfect results , but what I have now seems promising. I will try to increase my dataset now, see how that affects my results. Thanks for your help! |
2014-04-01 07:44:39 -0600 | commented question | SVM weights to HOGDescriptor I updated it twice, to add more detailed information. Sorry about before, I was trying to be brief and precise as to not create an incredibly large post, but I understand it wouldn't help my cause. I would really like to do anything I can to fix this, so let me know if there is anything else I can add and I will do my best to do so. |
2014-04-01 07:29:36 -0600 | commented question | SVM weights to HOGDescriptor This isn't my complete project, I had already taken the effort to size it down to what it is now. I wanted to show at least how I trained the classifier and that it was indeed working using cross validation, but that it failed to work on the multi scale detection. What do you suggest? |
2014-04-01 07:12:40 -0600 | asked a question | SVM weights to HOGDescriptor Hey, I am working on a detection algorithm and I got a working SVM classifier that uses HOG features calculated with a HOGDescriptor object. If I manually test this classifier (ie. feed it with positive and negative examples that have not been used for training), it classifies them fine. The step where I go from my SVM classifier to the HOGDescriptor is where I assume it goes wrong, it doesn't identify a single object correctly. I have no idea where to start how to debug this.. Here is my code: https://dl.dropboxusercontent.com/u/40610835/HOG%20Detection.html Any help is greatly appreciated! Best regards, Hans Update: To make things clearer so you don't have to go through the entire code, this is how I read in data from the stored SVM classifier: There is only one support vector in my classifier, I assumed the SVM weights I need to give to HOGDescriptor.setSVMDetector are these weights with appended the threshold (stored as 'rho' in the yaml file). The HOGDescriptor is initialised as follows : Detection is then simply done using : I didn't quite understand what the parameters in detectMultiScale do exactly and there isn't much documentation regarding their effects. I supplied the SVM with objects of size 64x64 which didn't differ much from the default size of 64x128 so I kept the rest of the parameters the same. I tried 'playing' around with them, but did not achieve much better results. The summary of my issue now is: If I manually cut out unseen positive/negative examples, my SVM classifier of OpenCV correctly classifies its labels (using SVM.predict). However if I use this classifier inside a HOGDescriptor with mostly default parameters and use HOGDescriptor.detectMultiScale, I get unexpected results (ie. only a few detections at false locations). I have two assumptions, either my parameters are incorrect or my process of getting the SVM weights from the SVM classifier to the HOGDescriptor is false. For more information, don't hesitate to ask. Update2: After reading through this question, I noticed I need to take the negative of my weights when going from SVM -> HOGDescriptor. This improved my results a lot. I used a very small training set, so I didn't expect it to be flawless, this seems to be what I had expected. |
2014-02-24 13:03:10 -0600 | received badge | ● Nice Answer (source) |
2014-02-22 17:44:41 -0600 | received badge | ● Necromancer (source) |
2014-02-22 17:44:41 -0600 | received badge | ● Self-Learner (source) |
2014-02-22 07:16:07 -0600 | answered a question | Watershed on gray image I made some small changes to cv::watershed, it works now on grayscale images as well. |
2014-02-19 08:32:47 -0600 | commented question | Watershed on gray image I guess I have something to do in the weekend then.. I really need it :P |
2014-01-20 04:25:20 -0600 | commented question | Canny edge detector without thresholds Aha, I didn't know it uses Sobel to get the initial edge image. Then theres not much use for me as I already have the Sobel image. Thanks! |
2014-01-20 02:58:35 -0600 | commented question | Canny edge detector without thresholds It does, which is the result of the picture above, but I wanted to compare multiple edge detector results for my project. There is no way to disable this thresholding step then? |
2014-01-19 16:49:15 -0600 | asked a question | Canny edge detector without thresholds Hey everyone, I am interesting in getting a edge map with some sort of probability embedded for the edges. This would result in something like this : The Canny edge detector in opencv seems to force thresholds though, resulting in a binary map. Is there something I can do to disable this? Or am I looking at implementing my 'own' Canny method which does not perform this step? Best regards, Hans |
2014-01-18 05:59:10 -0600 | commented question | Watershed on gray image It is, which is why it is giving an error. It expects a 3 channel image. |
2014-01-15 06:38:29 -0600 | asked a question | Watershed on gray image Hello, I am trying to perform the watershed transform on a grayscaled image (edge map, to be precise), but the opencv implementation of watershed gives me the error that my image is not in 3 dimensions. Why would this not be supported? Should I modify the watershed algorithm or implement my own based on grayscale images? Best regards, Hans |