Ask Your Question

GrumbleLion's profile - activity

2017-06-07 11:11:31 -0600 received badge  Notable Question (source)
2016-12-27 07:30:46 -0600 received badge  Popular Question (source)
2016-11-26 14:27:06 -0600 received badge  Nice Answer (source)
2014-04-29 04:17:25 -0600 received badge  Teacher (source)
2014-04-28 16:03:46 -0600 commented question Multithreading for Image Processing

why would main call pthread_exit ? Also does the code pass a reference to part of the image or actually copy the image data to the vector?

2014-04-28 15:39:19 -0600 commented question Why does this rotate method give the image dead space? OpenCV

FYI: you can also use cv::BORDER_REPLICATE to make the corners white.

2014-04-28 15:36:31 -0600 commented question matchTemplate gives wrong result when object does not exist.

Wrong in what way? Is your template color balanced? what method? is it normalized?

2014-04-28 15:28:45 -0600 commented question template matching with threshold

Do you have code to check to see that both the template and the image are the same format? Also the heat map has to be created just right.

2014-04-28 15:08:01 -0600 commented question Error: ImportError: DLL load failed: %1 is not a valid Win32 application

%1 was used as a file reference name in MSDos batch files. I am not sure what it would have in the python import file.

2014-04-28 15:02:23 -0600 commented question Overlaying edges onto original image in Python

I am using the Region of Interest to copy one smaller image on to another.

cv::Rect roi( cv::Point( 0, 0 ), cv::Size( bla.cols, bla.rows ));

cv::Mat destinationROI = MyImageBuffer( roi ); // make a pointer to this area.

bla.copyTo( destinationROI ); // draw to that pointer

2014-04-28 14:55:44 -0600 answered a question Thread Safe

I've had a few thread glitches while using OpenCV.

The library itself is thread safe in that you can have multiple calls into the library at the same time, however the data is not always thread safe.

This means that if you have to pass a mat image between threads you have to use a mutex and call .CopyTo() to force a copy instead of a reference.

Note: Std::Vector is also not thread safe under all conditions as well.

2014-04-28 14:48:14 -0600 commented question Best matching strategy

I don't know enough to give you all the pros/cons between those two. There are many new articles about newer detectors, however it all depends on what you are trying to detect and what the situation is. In my case the camera is in a fixed place and the target image is provided so I went with match template and used a background scan to try different sizes and rotations. I then added a sub pixel routine to increase the accuracy.

2014-04-28 14:43:20 -0600 commented question Trouble finding a way to differentiate two shapes

Given that fish can be at odd angles I would think looking for color would be a better place to start.

2014-03-22 11:27:37 -0600 commented question fisheye image stitching

You could calibrate the camera and apply correction.

2014-03-22 11:22:17 -0600 commented question Check if a Point is inside a RotatedRect ?

You could convert the rect into two triangles and then check to see if the point is inside the triangles. http://www.blackpawn.com/texts/pointinpoly/

2014-03-22 11:18:08 -0600 commented question “linear” noise in frames captured from analog camera.

NTSC scans odd and then even lines. You could take two frames and average them.

2014-03-22 11:11:12 -0600 answered a question i need help with dealing with wrap affine can sombody help me plz

First you have to create the 2x3 rotation matrix.

cv::Point2f center(((float)imageSize.width * 0.5f), ((float)imageSize.height * 0.5f)); cv::mat RotMap = cv::getRotationMatrix2D( center, Rot, 1.0);

then rotate your image

cv::warpAffine(ImageMatIn, RotatedImageMatOut, RotMap, CameraAvgImage.size(), cv::INTER_LINEAR, cv::BORDER_REPLICATE , cv::Scalar(127,127,127));

2014-03-22 11:00:12 -0600 commented question Improve HoughLine accuracy from edges

I am just playing with this now trying to make a better corner detector and I am guessing you first have to increase the BlockSize, however I don't see a parameter for that.

2014-03-22 10:53:55 -0600 commented question opencv problem with capture

I don't see a cap.open

2014-03-22 10:51:19 -0600 commented question how to build a simple image database in OpenCV?

you could typecast mat into an array.

2014-03-21 20:23:10 -0600 commented question cv::Mat to UIImage making image grayscale

Your second image contains data that does not exist in the first one. This means that either you are displaying the first one as a BW image or your second one is the first one.

2014-03-21 20:20:51 -0600 commented question The function which returns the angle of curvature of the object Opencv C++

ok... then to get the rotation you can create a weighted filter. or for a crude value you could find the points that are farthest from the center.

2014-03-21 20:18:34 -0600 commented question Number detect in video

I don't see it being able to detect any arbitrary whole number, but it can detect each number and then your code would have to string them together.

2014-03-21 20:17:19 -0600 commented question Object detection and classification

See The HighGui examples of how to open a camera.

2014-03-14 13:59:48 -0600 commented question The function which returns the angle of curvature of the object Opencv C++

Does the image change shape or size? The first step is to use one of the object detectors. If you are generating the shape and it's BW you could use an average of the X and Y of all the black pixels to find it's center and then take the average of x and y for all the black pixels that are in the 4 quadrants from the center to get the rotation.

2014-03-14 13:54:29 -0600 commented question cv::Mat to UIImage making image grayscale

why are you using "true color" conversions that then depend on your monitor settings?

2014-03-14 13:33:07 -0600 commented question Motion Tracking using Opencv and Asus Xtion Camera

The Asus Xtion WebCam gives you a point cloud so you might not even have to use OpenCV.

2014-03-14 13:29:22 -0600 commented question highgui.VideoCapture buffer introducing lag

I ended up with a separate thread and a dual buffer system, but since my target is an I7 PC it's got plenty of time and ram for multiple image copies. In a timer based single thread system you need to find a non blocking way to check to see if a new frame has came in. If you do use cv:mat make sure you use Clone or copyTo so that the actual buffer is copied to prevent thread problems.

2014-03-13 12:33:06 -0600 commented question Find the location of the camera from a object using opencv

first you have to calibrate the spherical distortion of the camera. this only has to be done once. See the calib3D examples. Then you would use object recognition to find the triangles. from there you have to use some math and find the camera's location.

2014-03-13 12:28:37 -0600 commented question Perspective Compensation when Measuring Distances on an Image with a known reference distance

you would also have to measure the radial distortion of the camera that was used.

2014-03-13 12:26:32 -0600 commented question Calc an homography with only scale and rotation?

sounds like a SVD function.

2014-03-13 03:04:46 -0600 commented question Find the location of the camera from a object using opencv

if what the camera is looking at has targets and you know where the targets are located it is possible to work backwards and figure out where the camera is located.

2014-03-12 03:13:35 -0600 commented question Does anyone know a suitable algorithm to deal with such a complicated problem?

The crack is not a perfect line but it does have some sections that are less noisy. I would think you would have to start with a Gaussian blur function. Then the hough functions start by measuring local line angles and then tries to stitch them together into a longer line. The noisy bits won't pass this second part of the process.

2014-03-10 10:01:54 -0600 received badge  Necromancer (source)
2014-03-09 18:18:39 -0600 answered a question find max with sub accuracy

I hate to dig up this old question, however he might still have email notification turned on.

check out the new topic. http://answers.opencv.org/question/29665/getting-subpixel-with-matchtemplate/

I have a link to my source code.

2014-03-09 12:57:17 -0600 commented answer Camera Calibration in OpenCv : Camera as the input

that's up to you. I just commented out the code for the XML file and set the settings the way I wanted to test and then I started on my own code.

2014-03-08 20:18:48 -0600 received badge  Editor (source)
2014-03-08 20:16:30 -0600 asked a question getting subpixel with MatchTemplate

I am working on a project that uses matchTemplate and I need sub pixel accuracy and I figure I could share the resulting code.

I've found others asking the same question, but the direction I am going is different since a general curve fit will not work since the values past the top few are not stable. So the plan is to scan out and find the smallest drop and then... edit: I am thinking that a parabola fit will work better.

Another problem is that if the template has a lot of fine detail the result will also not be stable. There are two options; option one: upsize both the template and the source image by two before match template. option two: shift the template by .5 pixel and weave those results into every other row/col of the heat map.

given the different methods I am wondering if something like this would be good.

minMaxLocSubPix(

in Mat = heat map. also gives function size of source.

in point = x,y point from minMaxLoc or any other point you want to explore

    in Polarity = Let this function know if we want large or small values

in Method = what algorithm to use since mine won't be the best for every application.

out Float x,y ) returns float error value if math result is limited to prevent moving more than one pixel.

See also this post I found http://answers.opencv.org/question/5584/find-max-with-sub-accuracy/

Here is my current code. Edit: 4/28/2014 I found a bug and updated it. http://www.longrange.net/Temp/CV_SubPix.h http://www.longrange.net/Temp/CV_SubPix.cpp

In summary: My question is... how do I add it to the library to share with others?

2014-03-08 19:17:45 -0600 commented question displaying 16 bit image with stop byte

Can't you filter it out as you read in the data and load the mat?

2014-03-08 19:11:21 -0600 commented question Does anyone know a suitable algorithm to deal with such a complicated problem?

I wonder if a hough circle function could be modified to allow for variations of arc during the line.

2014-03-08 19:06:03 -0600 commented question Number extraction on metal surface1

first you have good lighting. Metal tends to be reflective so it's good that you have the camera above the number and the light source from the side. Next you need a image of each number. I would then think you could use one of the object detectors.

2014-03-08 19:03:14 -0600 commented question Image compare for LCD 20x4 test.

Can you control the image on the LCD? If so you could have it display the camera calibration patterns.