Gradient along a path [closed] - gradient

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
Is it possible to create something like this in inkscape? I have been searching and trying for quite some time, but so far no results...
So what I am looking for is a gradient which follows the direction of the path it is applied to.
Gradient along a path http://coreldraw.com/cfs-filesystemfile.ashx/__key/CommunityServer.Components.PostAttachments/00.00.02.07.23/GradientBlend2.jpg

I am not aware of a solution that perfectly satisfies your needs however here is one approach to get close:
Draw a line, open the Fill and Stroke dialog and set the width of the stroke (Stroke style tab) to 50. Transform the stroke to a path (Path > Stroke to Path).
Fill the path with a linear gradient (Fill and Stroke dialog > Fill > Linear gradient) and choose any colours you like.
Select the node tool (F2) and a line will appear stretching the area of your shape (marked with an exclamation mark on the picture below). Adjusting this line may help you to fine tune the gradient (however, strictly speaking it will not follow the path but a rectangle defined by the start and end marker of the marked line)
This should work for simple shapes that do not reverse. Let me know if this is good enough or if you need more detailed instructions.

Related

How do you make a shape move along a Bezier Curve SFML? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I'm making this game wherein the object should move along a Bezier Curve, I've already computed and successfully drawn the tangent and normal line, but I can't seem to make the Box move along the direction of the tangent. I'm really new in SFML, hope someone could give an advice and direction.
Edited: Like for example, I want to move the object from (0,0) coordinate to (3, 7) when I press only the right arrow key. I know that I should use the concept of vector and normalization but I don't understand the tutorial videos that I watched about it.
There are two parts to this problem, detecting input and then actually moving your object. Presuming you've got the input covered (please say if not) then I'll focus on moving the object:
If an object inherits from sf::Transformable, you will be able to use many transform functions such as setPosition(x,y) and move(x,y) (they do different things!)
A basic example based on yours, using sf::RectangleShape which inherits from sf::Transformable:
sf::RectangleShape shape({5.f,5.f}); // A square, 5 pixels wide
sf::Vector2f movementThisFrame(3.f,7.f); //this would be the value from your curve
if(sf::Keyboard::isKeyPressed(sf::Keyboard::Right))
shape.move(movementThisFrame);
A few things to mention:
You may find using events for input works better, especially if you only want one action per press (isKeyPressed directly queries the key's state, whereas events send you pressed/released events once
move() is relative to the current position, whereas setPosition() is absolute, don't forget that!

OpenCV - Leaf Petiole Removal [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I would like to know how can I approach my given problem: removing petiole from a leaf, with very little to none effects to the leaf.
From research, people tried using morphological operations like top-hat to enhance and remove the petiole afterwards, but in some cases this doesn't work so well, detecting in addition peaks from the leaf (example below).
I will try also segmentation based on HSV color space, but i will very much appreciate an idea for BGR space.
From left to right (input image, contour found, morphological applied with a kernel size structuring element which depends for every leaf species)
I am using OpenCV with C++.
example problem petiole detection
As mentioned in the comments I was curious to try this out myself.
And this is what I got:
I used the distance transform, but the final solution does not appear so perfect. I have the code in python if you would like.
CODE:
dist_transform = cv2.distanceTransform(thresh1,cv2.DIST_L2,5)
ret, stalk = cv2.threshold(dist_transform,0.095*dist_transform.max(),255,0)
stalk = np.uint8(stalk)
cv2.imshow('stalk_removed.jpg',stalk)
Where thresh1 is the binary image of the leaf.

How does following image processing functions work? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I have been assigned to project of making custom photo/image editor for one company and when looking at the list of desired functionality I've found out I'm at loss how some of them work. Can anyone please explain how some of it is done/what functions are they?
Can you please explain it for idiot like me?(practically no prior knowledge of photo editing)
(Also if you know about libraries that has those functions I'd be very grateful if you could recommend some, but not necessarily)
Here's the list:
White balance editation of RAW (As shot/Auto/Presets/Manual-numerical/Grey card)
Exposure
Recovery
Fill Light
Blacks ("making black pixels more black")
Clarity/Microcontrast
Saturation
Vibrance
Curves
Levels
Sharpening
Color Balance
Avoiding color clipping
Avoiding highlight clipping
editing brightness but not colors (not sure about how to call this one - in LAB lightness channel)
Selective color corrections
Freemasking
Chromatic abberation
P.S.:If there is a stackexchange page more suitable for this question please tell me where to ask!
White blance: you can find more adequate explanations here and
this question treat it nicely (on wikipedia it says that white
and color balance are similar)
Exposure: OpenCV info; It is how many light it is entering through the diaphragm of the device: Wiki
Recovery: Wiki says this, but it could be something like deblurring
Fill light: I think it is something like shadow remover
Blacks: I do not know what it may be, but it makes me think of inverse of exposure (multiply by negative values)
Clarity/Microcontrast: This is a good explanation
Saturation: is about color saturation
Vibrance: A nice explanation
Curves: I am not sure what it is about: detecting or correcting?
Levels: I do not know what it is about
Sharpening: See this It is about accentuating the edges in an image
Color Balance: see white balance
Avoiding color clipping: I think it is base on this idea
Avoiding highlight clipping: It should be the same as the above, but linked of luminance, instead of color. See the clipping theory.
editing brightness but not colors: I think it is about gamma correction
Selective color corrections: It should be like white balance, but on RGB levels; see this
Freemasking: is based on replacing the "green panel" with what you want, as in television
Chromatic abberation: is because of the lens of the device: see this

Detect U Shaped Edges in an Image [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I'm trying to detect the location of a fingertip from an image. I've been able to crop out a region in the image where it must have a fingertip, and extract the edges using Canny Edge Detector. However I'm stuck. Since my project description says I can't use the skin color for detection, I cannot find the exact contour of the finger, and will have to try to separate the fingertip with edges alone. Right now I'm thinking since the finger has a curved arch shape/letter U shape, maybe that could be used for detection. But since it has to be rotation/scale invariant, most algorithms I found so far are not up to it. Does anyone have an idea of how to do this? Thanks for anyone that responds!
This is the result I have now. I want to put a bounding box around the index fingertip, or the highest fingertip, whichever is the easiest.
You may view the tip of U as a corner, and try corner detection method such as the Foerstner Algorithm that will position of a corner with sub-pixel accuracy, and Haris corner detector which has implementation included in the feature2D class in opencv.
There is a very clear and straighforward lecture on Haris corner detector that I would like to share with you.

Blender: Impossible Cube [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I'm working on a graphics project trying to create an impossible cube in 3D. An impossible cube looks like that:
The trick behind this is two of the edges which are 'cut' and a picture taken from a specific angle to give the illusion of the impossibility.
Well I'm trying to make this but instead of a static image, I want to be able to animate it (rotate around) maintaining the impossible properties.
I have managed to make a cube in blender as you can see in the screenshot below:
I would like to hear your suggestions as to how I can achieve the desired effect. An idea would be to make transparent the portion of the edge that has an edge(or more) behind it, so that every time the camera angle changes, the transparent patch moves along.
It doesn't have to be done in Blender exclusively so any solutions in OpenGL etc are welcome.
To give you an idea of what the end result should be, this is a link to such an illustration:
3D Impossible Cube Illusion Animation
It's impossible (heh). Try to imagine rotating the cube so that the impossibly-in-front bit moves to the left. As soon as it would "cross" the current leftmost edge, the two properties of "it's in front" and "it's in the back" will not be possible to fulfill simultaneously.
If you have edge culling enabled, but clipping (depth-testing) disabled, and draw primitives in the right order, you should get the Escher cube without any need for cuts. This should be relatively easy to animate.