ImageJ how to set stiky angles for line tool? - imagej

When using Line tool if I hold shift key it will "stick" line angle to 45 degrees. Is there a way to make it 15 degrees? I checked out all the options but I'm not finding it.
For my theses I'm measuring capabilities of some printer. I want to check how much printed lines bleed in the paper and deform in relationship to angle of those lines. Lines are positioned in the circle pattern with 15 degree distance.
What I would like to do is to measure width of those lines. The easiest way would be if I could do it with line tool only if I could set those "sticky" angles.
If you see better solution to my problem please feel free to tell. Please bear in mind that I'm basic user, and I don't have much experience with this program, and I don't know how to program.
Thanks in advance!

Related

Most 'fitting' placement of shape in silhouette

I apologize in advance for the lack of code, but I have been looking at this problem for some days now and couldn't proceed much.
I am trying to find a method that, given a template shape and a figure, finds the most fitting (edges-wise) placement of such shape in the (binarized) figure.
For example, in the picture above, I've highlighted 2 placement for the triangle on the right (I show 2, but there are probably 5). The blue one covers more "perimeter" and thus should be preferred.
The rotations are limited to steps of 45 degrees and no scaling is involved, so I don't think I need some particularly rotation/size invariant methods.
For now, I have obtained some results using opencv template matching, by first extracting the edges with canny and matching the resulting contour, but it is far from precise and I am afraid this would not work for more complex figures. Also by using canny I lose information about the binarized foreground and background, while the placement must be only inside the figure.
Any idea would be appreciated because I really could not find much in the literature (also I am quite inexpert in the field and probably lacking the proper terminology for effective searches), thank you in advance

Detect and dtermine the width of a human hand in opencv

I want to detect a human hand and determin its width. Is there a way to it in openCV, or any technique to do that.
I've tried searching google but couldn't find any solution.
My segmentation result:
As your question is too broad to be answered without writing a 10 page essay I'll give you a few ideas at least.
Option 1:
Detect the finger tips and fit a hand model (there should be plenty of papers, open source code and other resources available online that do hand and gesture detection). you can then position your line using that hand model.
Option 2:
The dimension you are looking for should be the shortest cross section of any hand. Place a scan line over your hand, rotate it around it's centroid and measure the distance between the transition hand - background on both ends. Then pick the minimum. Make sure you have the right rotation center. Maybe cut the fingers of using morphological operations to move the centroid a bit further down so you don't get a wrong measurement.
Option 3: Estimate the width of the hand by its total size. Human proportions usually follow some rules. See if you can find some correlation between that measure and other hand features. If you don't need too exact measures (your image resoltion suggests this) this should be the quickest and easiest solution.
There are many other options. Take a ruler and your hand and start thinking. Or do more research on gesture recognition in general. I'm sure you can apply may things they use to get your width.

What time the line turn? Image processing

I'm using LeapMotion with Processing.
I want to draw a triangle with my hands , and make these line straight .
and my data is all 2D point(x,y) per frame
The triangle what I draw absolutly not straight.
So first I use "linear Regression" to draw a straight line.
and my question is
What time the user turn when they draw a triangle?
(my opinion is to us "angle extremes" to detect what time its turn.)
Is there some image processing technology to use?
If you have the parametrized model of all 3 lines, what you need to do is find for each pair of lines the point that is the least distance from the two lines.
That is your corner.
For the lines, one linear regression would probably not do. Perhaps do some ransac to find the lines and K-means to cluster the points to their lines.

How to detect PizzaMarker

did somebody tried to find a pizzamarker like this one with "only" OpenCV so far?
I was trying to detect this one but couldn't get good results so far. I do not know where this marker is in picture (no ROI is possible), the marker will be somewhere in the room (different ligthning effects) and not faceing orthoonal towards us. What I want - the corners and later the orientation of this marker extracted with the corners but first of all only the 5Corners. (up, down, left, right, center)
I was trying so far: threshold, noiseclearing, find contours but nothing realy helped for a good result. Chessboards or square markers are normaly found because of their (parallel) lines- i guess this can't help me here...
What is an easy way to find those markers?
How would you start?
Use other colorformat like HSV?
A step-by-step idea or tutorial would be realy helpfull. Cause i couldn't find tuts at the net. Maybe this marker isn't called pizzamarker -> does somebody knows the real name?
thx for help
First - thank you for all of your help.
It seems that several methods are usefull. Some more or less time expansive.
For me it was the easiest with a template matching but not with the same marker.
I used only a small part of it...
this can be found 5 times(4 times negative and one positive) in this new marker:
now I use only the 4 most negatives Points and the most positive and got my 5 points that I finaly wanted. To make this more sure, I check if they are close to each other and will do a cornerSubPix().
If you need something which can operate in real-time I'd go down the edge detection route and look for intersecting lines like these guys did. Seems fast and robust to lighting changes.
Read up on the Hough Line Transform in openCV to get started.
Addendum:
Black to White is the strongest edge you can have. If you create a gradient image and use the strongest edges found in the scene (via histogram or other) you will be able to limit the detection to only the black/white edges. Look for intersections. This should give you a small number of center points to apply Hough ellipse detection (or alternate) to. You could rotate in a template as a further check if you wish.
BTW.. OpenCV has Edge Detection, Hough transform and FitEllipse if you do go down this route.
actually this 'pizza' pattern is one of the building blocks of the haar featured used in the
Viola–Jones object detection framework.
So what I would do is compute the summed area table, or integral image using cv::integral(img) and then run exhaustive search for this pattern, on various scales (size dependant).
In each window you are using only 9 points (top-left, top-center, ..., bottom left).
You can train and use cvHaarDetectObjects to detect the marker using VJ.
Probably not the fastest method but it should work.
You can find more info on object detection methods using OpenCV here: http://opencv.willowgarage.com/documentation/object_detection.html

How to recognize a real square in an image

I am using OpenCV for square detection in an image. The squares.c example is a really great help, but my problem is that it recognizes pretty much everything that has 4 corners that are close to 90 degrees.
My goal is it however to only recognize the real squares in an image from a video feed. This means the objects themselves have 4 edges with the same length and 4, 90 degree angles. This sounds rather easy at first, but since an object might be tilted in the image, the angles can vary between something like 45 and 135 degrees and the edges have a different length. If I check these attributes though I am still recognizing rectangles that are no squares.
I've been thinking for a good solution to only recognize real squares for a few days now, but everything I come up with is still flawed. I wonder if any of you knows what the exact relation between the angles of the corners and the edge length is. With my guessing so far I have come pretty far, but sometimes random squares pop up that I don't want to recognize. I really think there is some mathematical relation, but I can't really find a formula for squares in a perspective view.
Any help would really be appreciated!
Without any reference coordinate system, how is this even possible? If you are doing the recognition based on a video feed, can your be "taught" what a square looks like by keeping a square in the field of view at all times? Maybe then you can use this to figure out what the rotations are in 3 space, which you'd then have to apply to everything else in the feed.

Resources