Ask Your Question

st5000's profile - activity

2015-08-26 20:59:35 -0500 commented question How to find brightness of given area

OK, but I only want to look at a specific area in a frame of say 100dots.

2015-08-19 17:50:30 -0500 commented question calling findcontours throws an exception...

Sorry @matman, my forum notification settings must be wrong as I didn't get email about your post. I believe I used precompiled OpenCV libraries. I don't recall renaming a debug OpenCV library file as a released OpenCV library file. I'll have to go back and check the wording of the exception and post what I find later.

2015-08-19 17:41:29 -0500 asked a question How to find brightness of given area

There are (combinations of) OpenCV functions/methods to find the difference between two frames of a video. After finding such areas I would then like to know the rate of change of brightness for those locations (between different frames). But I have yet to find an OpenCV function/method that given an area would return a value in proportion to the (average) brightness of that area. Did I miss something? Is there a set of OpenCV calls that might do this?

-thanks

2015-07-26 11:06:04 -0500 commented question calling findcontours throws an exception...

This thread concludes that the debug version of OpenCV contains a bug and to try the release version of OpenCV: http://answers.opencv.org/question/56... ...this worked for me. After switching to release and compiling the project, the call to the "findContours" method did not throw an exception and worked as expected. Is this a bug then?
How should be proceed?

2015-07-26 11:03:24 -0500 asked a question calling findcontours throws an exception...

Hi,

I'm new to opencv, trying my hand at image tracking using OpenCV 3.0 and Visual Studio version 12.0.31101.00 Update 4 (2013). I am using code from this tutorial:

https://youtu.be/X6rPdRZzgjg (I'd link directly to the code in dropbox but youtube is playing games w/the URLs.)

...which is (likely) intended for an older version of OpenCV & Visual Studio. But, after altering the project's variables and the program's include and using lines, the code compiles and successfully calls many OpenCV methods. Including "cvtColor", "absdiff", "threshold" and "blur".

Unfortunately, the program throws an exception when "findContours" is called. When checking the "findContours" arguments, I see where the 3rd variable (usually referred to as "hierarchy") is abnormally large (19 decimal digits long) in size.

After reading some posts, I tried switching from calling the "threshold" method to calling the "Canny" method when preparing the image for the "findContours" method. But the program still threw the exception. I have even tried completely different videos. The calls to the other methods worked (pressing "d" while the program runs displays the intermediate images verifying this). But the "findContours" method (pressing "t" while the program runs allows calls to the "findContours" method) still threw the exception.

It is not a very long program. I'll try and insert my version of code here:

(Wow, including code using this web/interface/editor is really difficult! The editor keeps breaking it up with (kind-of) normal text.)

(Sorry, it doesn't appear I can drop in all the code w/o this editor chopping it up. I'll try to drop in only the important bits then.)

This is the bit of code that prepare the image for the call to the "findContours" method. The calls to "imshow" verify these methods are working as expected. Notice I tried to replace a call to the "threshold" method with a call to the "Canny" method as an attempt to avoid the exception when calling the "findContours" method. The call to the "findContours" method is inside the "searchForMovement" method called at the end of this section of code:

        while (capture.get(CV_CAP_PROP_POS_FRAMES)<capture.get(CV_CAP_PROP_FRAME_COUNT) - 1){

        //read first frame
        capture.read(frame1);
        //convert frame1 to gray scale for frame differencing
        cv::cvtColor(frame1, grayImage1, COLOR_BGR2GRAY);
        //copy second frame
        capture.read(frame2);
        //convert frame2 to gray scale for frame differencing
        cv::cvtColor(frame2, grayImage2, COLOR_BGR2GRAY);
        //perform frame differencing with the sequential images. This will output an "intensity image"
        //do not confuse this with a threshold image, we will need to perform thresholding afterwards.
        cv::absdiff(grayImage1, grayImage2, differenceImage);
        //threshold intensity image at a given sensitivity value
        cv::threshold(differenceImage, thresholdImage, SENSITIVITY_VALUE, 255, THRESH_BINARY);
        if (debugMode == true){
            //show the difference image and threshold image
            cv::imshow("Difference Image", differenceImage);
            cv::imshow("Threshold Image", thresholdImage);
        }
        else{
            //if not in debug mode, destroy the windows so we don't see them anymore
            cv::destroyWindow("Difference Image");
            cv::destroyWindow("Threshold Image");
        }
        //blur the image to get rid ...
(more)
2014-10-22 06:51:56 -0500 received badge  Student (source)
2014-10-20 21:33:16 -0500 received badge  Supporter (source)
2014-10-20 21:31:54 -0500 commented question VideoWriter failure: "Gstreamer Opencv backend does not support this codec actually"

Wow (bump), this question has sooo many hits yet no one has come up with an answer. I'm having this same error trying to write a video to a file in fedora 20. I'm going to switch to Ubuntu as soon as that system is up - but do not expect it to work there either. Does anyone have ideas that we could try to fix this problem?

2014-10-20 14:55:19 -0500 commented question Does waitKey() work correctly in Linux?

Yeah, the web interface appears to be buggy (for me at least). I couldn't get rid of the suggested posts which obscured the entire TEXT window. So it left me with posting a blank question (where did "strong text" come from) and editing it afterwards.

2014-10-20 14:52:00 -0500 received badge  Editor (source)
2014-10-20 14:47:43 -0500 asked a question Does waitKey() work correctly in Linux?

Porting a OpenCV program from Windows to Linux and found that the value returned from waitKey() had to be "%256"'ed. Looked at the docs and OpenCV is of type integer: http://docs.opencv.org/modules/highgui/doc/user_interface.html?highlight=waitkey#int%20waitKey%28int%20delay%29 So, is the waitKey() method broken in Linux. Or is there a reasonable explanation as to why this method works differently between Windows and Linux.

-thanks