如何找到与任何像素相切的……? [英] how to finde tangent to any pixel…?

查看:87
本文介绍了如何找到与任何像素相切的……?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

让我向您解释我的项目............
假设我的图像中有圆形,矩形或椭圆形或其他形状,我想通过保持特定的距离在其中绘制相同的形状.

例如,我有一个半径为200像素的圆,现在我想通过保持10像素的距离在其中绘制另一个圆,则半径将为190.
假设我有其他形状,而我们没有方程,假设我绘制的是草书字母".

所以我的计划是在所有形状的点上都找到切线.从此我可以在保持内部距离的情况下再次绘制相同的形状..
我有和你见面吗?

如果您有最好的解决方案,那么请与我分享...


我想在图像中的每个像素处找到切线.注意:图像背景为白色,形状边框的颜色为块状.

我所做的是Algo

While(true)
取像素
如果像素颜色是黑色
使3 X 3矩阵=>通过周围的像素颜色填充矩阵
...意味着假设白色= 0,黑色= 1,然后保持所选像素
在3 X 3矩阵的中心并找到所有其他值;
----------------------------在这里我想找到与所选像素相切的线;
如果
结束 移至下一个像素.

结束

我想实现这个,,,,,,,,
https://picasaweb.google.com/108589415049574473159/November12012?authuser= 0& authkey = Gv1sRgCKLg3P-qvcDt2QE& feat = directlink [ ^ ]

Let me explain you my project ............
Suppose i have circle or rectangle or eclipse or any shape in my image, i want to draw same shape inside it by keep specific distance.

Ex.i am having circle with 200pixel radius , now i want to draw another circle inside it by keeping 10pixel distance then the radius will be 190..Circle is regular shape and we have equation for it.

Suppose i am getting any other shape , and we don''t have equation for it, Assume I am having "Cursive Letter" is drawn.

So what is my plan is to find tangent at all point of shape. from that i can draw same shape again with keeping inner distance..
Did i make seance to you.

If you have best solution then my then please share with me...


I want to find tangent at each pixel in image. NOTE: image is having white background and shape border color is block.

What i did is, Algo

While(true)
take pixel
if pixel color is black
make 3 X 3 matrix => fill the matrix by surrounding pixel color
...means assume white =0 and black=1 then keeping selected pixel
at center for 3 X 3 matrix and finding all other value;
----------------------------here i want to find tangent line to selected pixel;
end if
Move to next pixel.
End while


i want to achieve this,,,,,,,,,
https://picasaweb.google.com/108589415049574473159/November12012?authuser=0&authkey=Gv1sRgCKLg3P-qvcDt2QE&feat=directlink[^]

推荐答案

切线"是为行定义的,如果行"是由具有导数的函数定义的:
http://en.wikipedia.org/wiki/Tangent_line#Tangent_line_to_a_curve [ http://en.wikipedia.org/wiki /Tangent [ ^ ].

最初,该词源自拉丁语"touch".例如,有一种奇妙的乐器叫做切线钢琴".

我不知道这一切与您要计算的内容有何关系,因为当您说切线"时,您需要解释这条线的定义方式,什么与什么之间的线等.由于像素不完全是一条曲线,像素的切线似乎不是一个明确定义的概念.切线可以定义为接触"另一条线的线,而不是像几何点这样的对象.至于像素,从概念上讲,它的形状被认为是不确定的. :-)

我准备相信您要执行的操作是有意义的,但是您需要正确定义事物.我怀疑当您意识到这一点并阅读上面引用的文章时,将能够自行解决问题.如果没有,请适当地配制并重新开始.



请参阅对此帖子的评论中的讨论.问题不是那么简单.我知道只有一个项目明确执行了这样的操作:
http://en.wikipedia.org/wiki/InkScape [ http://inkscape.org/ [ ^ ].

这是源代码:
http://inkscape.org/bzr.php?lang=zh_CN [ http://en.wikipedia.org/wiki/Bazaar_%28software%29 [ ^ ],
http://bazaar.canonical.com/en/ [
"Tangent line" is something defined for a line, in case if the "line" is something defined by a function which has a derivative:
http://en.wikipedia.org/wiki/Tangent_line#Tangent_line_to_a_curve[^].

Your "find tangent" is even more confusing, as the primary meaning of tangent is this: http://en.wikipedia.org/wiki/Tangent[^].

Originally, the word is derived from Latin "touch". For example, there is a wonderful musical instrument called "tangent piano".

I have no idea how all this is related to what you want to calculate, because when you say "tangent line", you need to explain how this line is defined, line between what and what, etc. As pixel is not exactly a curve, the tangent line to a pixel does not seem to be a well-defined concept. A tangent line can be defined as a line "touching" another line, not an object like a geometrical point. As to the pixel, it''s shape is considered to be undefined, conceptually. :-)

I am ready to believe that the operation you want to perform makes sense, but you need to define things properly. I suspect that when you realize it and read the articles referenced above, you will be able to solve your problem by yourself. If not, formulate it properly and start over.



Please see the discussion in the comments to this post. The problem is not so simple. I know just one project where such operation is implemented explicitly:
http://en.wikipedia.org/wiki/InkScape[^],
http://inkscape.org/[^].

This is the source code:
http://inkscape.org/bzr.php?lang=en[^].

To download it, you will need Bazaar:
http://en.wikipedia.org/wiki/Bazaar_%28software%29[^],
http://bazaar.canonical.com/en/[^].

The product itself is just wonderful, and is practically a must-have anyway, in particular, for everyone who develops the UI. As you have the source code, you can see how the operation you need is done. In this editor, it''s done very well. Just look at it, anyway.

Good luck,
—SA


这篇关于如何找到与任何像素相切的……?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆