Does anyone know of a simple implementation for detecting straight line
..So something like if we have a 2D arary of pixel elements representing
a particular Image. How can we identify lines in this Image.
for example:
ary =
{{1,1,1,1,1},
{1,1,0,0,0},
{1,0,1,0,0},
{1,0,0,1,0},
{1,0,0,0,1}}
So if 'ary' represents pxl of an image which has a horizontal line(row
0),a vertical line(col 0) and a diagonal line(diagonal of ary). then
basically I want identify any horizontal or vertical or diagonal line
anywhere in the pxl array and return true if its composed of only lines
else false... 6 1275
"PyPK" <su*******@gmail.com> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com... Does anyone know of a simple implementation for detecting straight line .So something like if we have a 2D arary of pixel elements representing a particular Image. How can we identify lines in this Image. for example:
ary = {{1,1,1,1,1}, {1,1,0,0,0}, {1,0,1,0,0}, {1,0,0,1,0}, {1,0,0,0,1}} So if 'ary' represents pxl of an image which has a horizontal line(row 0),a vertical line(col 0) and a diagonal line(diagonal of ary). then basically I want identify any horizontal or vertical or diagonal line anywhere in the pxl array and return true if its composed of only lines else false...
Not really a c++ language question, but...
Loop through that row or column (or diagonal), and if any cell is 0, return
false. Otherwise, return true if the loop completes.
Implement that in c++ code, and if you have trouble, show us your attempt at
the code, let us know exactly which part is the problem, and what that
problem is (i.e., you get a compiler error, a run-time error, or simply
incorrect behavior).
-Howrd
PyPK wrote: Does anyone know of a simple implementation for detecting straight line .So something like if we have a 2D arary of pixel elements representing a particular Image. How can we identify lines in this Image. for example:
ary = {{1,1,1,1,1}, {1,1,0,0,0}, {1,0,1,0,0}, {1,0,0,1,0}, {1,0,0,0,1}} So if 'ary' represents pxl of an image which has a horizontal line(row 0),a vertical line(col 0) and a diagonal line(diagonal of ary). then basically I want identify any horizontal or vertical or diagonal line anywhere in the pxl array and return true if its composed of only lines else false...
Do you have a C++ _language_ question?
V
Hi:
Look up the "Hough transform"
was trying to understand it..is there any demo code that could
demonstrate its behaviour
PyPK wrote: was trying to understand it..is there any demo code that could demonstrate its behaviour
There probably is. Try googling for it.
Again, any particular algorithms for doing something particular are
not really on topic here. Try a different newsgroup.
V
PyPK wrote: was trying to understand it..is there any demo code that could demonstrate its behaviour
The key word for this concept is "edge detection". Any book on image
processing will cover it, and I'm sure you can find some code online.
If you have a C++ question, post it here. Otherwise, you should
probably post to sci.image.processing or comp.dsp.
Cheers! --M This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: grogerteal |
last post by:
Hello,
I am pretty new to programming and would like someone to help me get
started on the program that I need to make.
I hope it is not hard to do, but what I would like is a simple app that...
|
by: PyPK |
last post by:
Does anyone know of a simple implementation for detecting straight line
..So something like if we have a 2D arary of pixel elements representing
a particular Image. How can we identify lines in...
|
by: unknown |
last post by:
some one can give me a portable source codes that color a pixel?
(env *nix)
--
unknown
|
by: walter.alex |
last post by:
November 16 2005 -- The recent launch of the new 5 year advertising
solution from MillionPixelClick.com means the pixel advertising craze
will continue unabated. Selling advertising space by the...
|
by: Martijn Mulder |
last post by:
I try to define a line with the length of 1 unit (1 pixel) that is, in fact,
just a point on the screen. But when I draw it with a wide pen with the
appropriate StartCap and EndCap (Round), it will...
|
by: Dave (DreamIsle) |
last post by:
Hello. I'm working on a layout that I need to be pixel specific. How
can I get the font to stay precisely the height I need? Specifying
line-height or font-size in px doesn't yield the results I...
|
by: Chaos |
last post by:
As my first attempt to loop through every pixel of an image, I used
for thisY in range(0, thisHeight):
for thisX in range(0, thisWidth):
#Actions here for Pixel thisX, thisY
But it takes...
|
by: ofiras |
last post by:
Hi,
I made a "Paint" program, but I couldn't find a method to paint 1
pixel using graphic state ("Graphics g =
Graphics.FromHwnd(this.Handle);")
How can I paint 1 pixel?
I guess I can make a...
|
by: ofiras |
last post by:
In bitmap, how can I find the nearest pixel (pixel
1) to a specific pixel (pixel 2) that has different color from pixel
2? Or how can I find a pixel in a specific distance from pixel 2 (like
a...
|
by: raylopez99 |
last post by:
After refering to the below thread, I take it for C# Forms 2.0, there
a way to draw a 1 pixel by 1 pixel rectangle, which I was able to do
just now successfully.
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
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...
| |