Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default sobel filter with visual basic


"Edge extraction algorithms work using a mathematical procedure called
convolution and commonly analyse derivatives (or second derivatives) of
the digital numbers over space. We will implement the Sobel method for
detecting edges, which is based on a 3 by 3 array that is moved over
the main image. This array is given by:
1 2 1
0 0 0
-1 -2 -1


Calculation proceeds as follows:
(1) We move the Sobel window over a particular pixel in the image;
(2) We calculate a new value for this pixel based on the sum of
products of the original image values and the values in the window.
i.e. consider the following section of an image:

90 85 72 71 65
95 87 76 73 69
98 88 80 78 76
100 93 83 80 75
101 96 76 77 72

If we place the Sobel filter at
The cell with a value of 88 we
see that the new digital number
for this cell is derived as follows:

95 × 1 87 × 2 76 × 1
98 × 0 88 × 0 80 × 0
100 × -1 93 × -2 83 × -1

=

95 174 76
0 0 0
-100 -186 -83



95 + 174 + 76 – 100 – 186 – 83 = -24

Therefore the new value for that cell would be -24."


How would I go about writing code in visual basic to do that for me in
a new sheet? I just don't know how to go about it. And how will it work
for the cells on the very edge of the page, where there are no cells
next to them, any ideas?


Sorry for the length, and please help.... I'm very very stuck.

Thanks,
l3xicon


--
l3xicon
------------------------------------------------------------------------
l3xicon's Profile: http://www.excelforum.com/member.php...o&userid=29522
View this thread: http://www.excelforum.com/showthread...hreadid=492209

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default sobel filter with visual basic


bump, no one any ideas?


--
l3xicon
------------------------------------------------------------------------
l3xicon's Profile: http://www.excelforum.com/member.php...o&userid=29522
View this thread: http://www.excelforum.com/showthread...hreadid=492209

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 112
Default sobel filter with visual basic

How would I go about writing code in visual basic to do that for me

Everytime you select a cell on a worksheet, that worksheet's SelectionChange
event will fire. The SelectionChange event provides one argument called
Target, which represents the cell that was selected. You can use the Offset
method to examine the cells adjacent to the target cell.

how will it work for the cells on the very edge of the page, where there are no
cells next to them


There would be insufficient data to complete the calculation.


Regards,
Vic Eldridge



"l3xicon" wrote:


"Edge extraction algorithms work using a mathematical procedure called
convolution and commonly analyse derivatives (or second derivatives) of
the digital numbers over space. We will implement the Sobel method for
detecting edges, which is based on a 3 by 3 array that is moved over
the main image. This array is given by:
1 2 1
0 0 0
-1 -2 -1


Calculation proceeds as follows:
(1) We move the Sobel window over a particular pixel in the image;
(2) We calculate a new value for this pixel based on the sum of
products of the original image values and the values in the window.
i.e. consider the following section of an image:

90 85 72 71 65
95 87 76 73 69
98 88 80 78 76
100 93 83 80 75
101 96 76 77 72

If we place the Sobel filter at
The cell with a value of 88 we
see that the new digital number
for this cell is derived as follows:

95 × 1 87 × 2 76 × 1
98 × 0 88 × 0 80 × 0
100 × -1 93 × -2 83 × -1

=

95 174 76
0 0 0
-100 -186 -83



95 + 174 + 76 €“ 100 €“ 186 €“ 83 = -24

Therefore the new value for that cell would be -24."


How would I go about writing code in visual basic to do that for me in
a new sheet? I just don't know how to go about it. And how will it work
for the cells on the very edge of the page, where there are no cells
next to them, any ideas?


Sorry for the length, and please help.... I'm very very stuck.

Thanks,
l3xicon


--
l3xicon
------------------------------------------------------------------------
l3xicon's Profile: http://www.excelforum.com/member.php...o&userid=29522
View this thread: http://www.excelforum.com/showthread...hreadid=492209


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is Visual Basic the same as Visual Studio 2008? Mike Stewart Excel Worksheet Functions 5 January 11th 09 04:58 PM
Data filter and deleting rows in visual basic Ruben Excel Discussion (Misc queries) 0 August 24th 08 08:38 PM
Visual Basic mcp201 Excel Discussion (Misc queries) 0 June 23rd 08 05:05 PM
Visual Basic osaka78 Excel Discussion (Misc queries) 5 September 17th 07 01:21 PM
changing the visual basic in office 2003 to visual studio net bigdaddy3 Excel Discussion (Misc queries) 1 September 13th 05 10:57 AM


All times are GMT +1. The time now is 02:13 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"