473,513 Members | 2,693 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

tracing a line in a bitmap?

Hi,

I have by reading thru the bytes of a bitmap and added an edge detection
filter, created an image with more distinct edges. From this I would like to
find a recangle shaped object. How can I determine where in the picture this
recangle shape is and how big it is?

best regards
/Lars
Sep 15 '06 #1
3 2095
Hello Lars,

If you can identify the corners it should be trivial from there.

-Boo
Hi,

I have by reading thru the bytes of a bitmap and added an edge
detection filter, created an image with more distinct edges. From this
I would like to find a recangle shaped object. How can I determine
where in the picture this recangle shape is and how big it is?

best regards
/Lars

Sep 16 '06 #2
Yes, that would be easy but what if I just want to find a line starting from
one pixel. I guess it would have to be some kind of convultion matrix thingy
but at the same time saving the coordinates?

/Lars

"GhostInAK" <gh*******@gmail.comwrote in message
news:c7**************************@news.microsoft.c om...
Hello Lars,

If you can identify the corners it should be trivial from there.

-Boo
>Hi,

I have by reading thru the bytes of a bitmap and added an edge
detection filter, created an image with more distinct edges. From this
I would like to find a recangle shaped object. How can I determine
where in the picture this recangle shape is and how big it is?

best regards
/Lars


Sep 18 '06 #3
I helped do this in graduate school a long time ago, so I don't have
any code for an example. But...........

There are edge detection algorithms that you can use to trace the
outline of an object. The algorithm we used was a recursive algorithm
that used the fact that the edge must trace in one of eight ways.
These correspond to the eight directions; ie. N, NE, E, SE, S, SW, W,
and NW.

So you first find an edge. Then you trace around the edge using the
recursive algoithm. This give you a map of the edge.

Then you calculate the first, second, and (if I remember right) third
moments of inertia of this edge map. Again, there are equations to do
this, but I don't have them handy anymore. You can determine shapes by
comparing the ratios of the various moments with the ratios of known
objects.

If you do all this correct, it will not matter if the rectangle is
aligned ordinally or not. That is, the rectangle does not have to be
north-south and east-west. It can be identified however it is placed
on the map.

The big problem was overlapping objects. A circle overlapping a
rectangle gives you an object with unknown moments.

Good luck,
Brian

Sep 18 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
2392
by: Steve Long | last post by:
Hello, (total GDI newbie) I'm having trouble drawing just a simple line to display in a picturebox. I just want a straight, dotdash line. I have two methods, one works and one doesn't (it cause...
3
9500
by: Daniel Billingsley | last post by:
The documentation on this subject seems to give you 98% of what you need to know. From various sources, I have compiled an understanding that this should work: <configuration>...
2
11250
by: Anand Ganesh | last post by:
Hi All, In my application I am allowing the user to draw a line. But when the user clicks the start point and starts moving the mouse there is a series of line generated. When the mouse is up...
7
3213
by: news | last post by:
This may be a stupid question, but if I don't ask I'll never know ;) Ok, here it goes.... I am writing an application that renders an image in one picturebox and a graph in another. The image...
2
1246
by: Dmitry Bond. | last post by:
Hello All. Could you plase help me to configure tracing in Asp.Net application. I use Win2ksp4, .Net 1.1 (+ all latest patches for .Net 1.1 an for Windows). I faced with stable error. On first...
2
1749
by: deepukutty | last post by:
Hi all, I know tht we can do tracing in two ways.one in application level and the other is at Page level. I am able to see the details of trace either on the page itself or .../trace.axd page....
4
1228
by: Corno | last post by:
Hi all, My collegue finds tracing very important and therefore we have agreed that we will do quite a lot of it. The first and last line of every function will contain a trace stating which...
0
1347
by: cnys | last post by:
We have an ASP.NET 2.0 (C#) app and we're trying to add tracing into it. The tracing functionality within .NET is great, but when we output this to a file, it's kind of sparse. So, we're looking...
1
2551
by: Alejandro | last post by:
Hi, I Have a form with Collection of 52 picturebox. Public cl As New Collection Private m_Bitmap As Bitmap Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs)...
0
7157
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7379
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7521
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5682
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3232
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3221
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1591
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
798
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
455
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.