 |
C++Talk.NET C++ language newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
PyPK Guest
|
Posted: Wed Sep 28, 2005 8:38 pm Post subject: Pixel Manipulations |
|
|
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...
|
|
| Back to top |
|
 |
Howard Guest
|
Posted: Wed Sep 28, 2005 8:45 pm Post subject: Re: Pixel Manipulations |
|
|
"PyPK" <superprad (AT) gmail (DOT) com> wrote
| Quote: | 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
|
|
| Back to top |
|
 |
Victor Bazarov Guest
|
Posted: Wed Sep 28, 2005 8:47 pm Post subject: Re: Pixel Manipulations |
|
|
PyPK wrote:
| Quote: | 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
|
|
| Back to top |
|
 |
ajitho Guest
|
Posted: Thu Sep 29, 2005 2:25 am Post subject: Re: Pixel Manipulations |
|
|
Hi:
Look up the "Hough transform"
|
|
| Back to top |
|
 |
PyPK Guest
|
Posted: Thu Sep 29, 2005 3:38 pm Post subject: Re: Pixel Manipulations |
|
|
was trying to understand it..is there any demo code that could
demonstrate its behaviour
|
|
| Back to top |
|
 |
Victor Bazarov Guest
|
Posted: Thu Sep 29, 2005 3:51 pm Post subject: Re: Pixel Manipulations |
|
|
PyPK wrote:
| Quote: | 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
|
|
| Back to top |
|
 |
mlimber Guest
|
Posted: Thu Sep 29, 2005 4:00 pm Post subject: Re: Pixel Manipulations |
|
|
PyPK wrote:
| Quote: | 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
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|