<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-5276401353476406299</id><updated>2011-11-27T15:35:04.953-08:00</updated><category term='object detection'/><category term='round object'/><category term='image procecssing'/><category term='pixel'/><category term='manupulating image'/><title type='text'>Image Processing Example Using SCILAB</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://scilab-imageprocessing.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5276401353476406299/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://scilab-imageprocessing.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>tcl</name><uri>http://www.blogger.com/profile/00129522875781410013</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>12</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5276401353476406299.post-2857904091204317445</id><published>2011-01-01T18:16:00.000-08:00</published><updated>2011-01-01T18:29:43.098-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='image procecssing'/><category scheme='http://www.blogger.com/atom/ns#' term='object detection'/><category scheme='http://www.blogger.com/atom/ns#' term='round object'/><title type='text'>Detecting Objects' Shape(I) : Round Object</title><content type='html'>&lt;div&gt;With the powerful technical computing language, the job of detection an object's shape no longer require lengthy codes. What important is the fundamental of mathematic that define the properties of the shape of objects. Let's look into the detection of round object in this section.&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_VpjiJfC4dGQ/TR_iNkp4YrI/AAAAAAAAAJo/P7nkXkKRsNk/s1600/p6-in1.jpg"&gt;&lt;img style="WIDTH: 216px; HEIGHT: 167px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5557409188003996338" border="0" alt="" src="http://4.bp.blogspot.com/_VpjiJfC4dGQ/TR_iNkp4YrI/AAAAAAAAAJo/P7nkXkKRsNk/s400/p6-in1.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;1. Original image and the negative image (value 0 represent background while 1 represents object).&lt;/strong&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;S = imread('p6-in1.jpg');&lt;br /&gt;ShowColorImage(S,'Original Image'); &lt;/span&gt;&lt;/div&gt;&lt;span style="color:#3333ff;"&gt;&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_VpjiJfC4dGQ/TR_iNmG5j4I/AAAAAAAAAJw/QkdB_9blyhM/s1600/p6-out1.jpg"&gt;&lt;img style="WIDTH: 234px; HEIGHT: 301px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5557409188394143618" border="0" alt="" src="http://1.bp.blogspot.com/_VpjiJfC4dGQ/TR_iNmG5j4I/AAAAAAAAAJw/QkdB_9blyhM/s400/p6-out1.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;p&gt;S2 = im2bw(S,0.5);&lt;br /&gt;ShowImage(S2,'Binary Image');&lt;br /&gt;&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_VpjiJfC4dGQ/TR_iN2K87cI/AAAAAAAAAJ4/XQb6P3G6tzI/s1600/p6-out2.jpg"&gt;&lt;img style="WIDTH: 234px; HEIGHT: 301px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5557409192706108866" border="0" alt="" src="http://1.bp.blogspot.com/_VpjiJfC4dGQ/TR_iN2K87cI/AAAAAAAAAJ4/XQb6P3G6tzI/s400/p6-out2.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;p&gt;&lt;strong&gt;2. Labeling the objects in the image. The advance programming language will support this function and label the objects automatically.&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;&lt;span style="color:#33ff33;"&gt;&lt;span style="color:#33cc00;"&gt;// Labeled the component(s), and plot the centroid on the original image &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;S3 = SearchBlobs(S2);&lt;br /&gt;ShowImage(S3,'Labeled Image');&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_VpjiJfC4dGQ/TR_iOPMoZPI/AAAAAAAAAKA/u-Lq3syjUgQ/s1600/p6-out3.jpg"&gt;&lt;img style="WIDTH: 234px; HEIGHT: 301px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5557409199424038130" border="0" alt="" src="http://2.bp.blogspot.com/_VpjiJfC4dGQ/TR_iOPMoZPI/AAAAAAAAAKA/u-Lq3syjUgQ/s400/p6-out3.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;3. Getting the properties of the objects that require for calculation, which are: the width and height for the object, the area of the object, and the centroid of the object. &lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;ToBeCalculated = CreateFeatureStruct(%t); &lt;span style="color:#33cc00;"&gt;// Feature struct is generated.&lt;br /&gt;&lt;/span&gt;S4 = AnalyzeBlobs(S3,ToBeCalculated);&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;strong&gt;4. Now, evaluate the "roundness" of the objects. this is evaluated by 2 criteria:&lt;br /&gt;a. Comparing the width and the height diameter for the object,&lt;br /&gt;b. Comparing the Area with the formula pi*r^2.&lt;br /&gt;The "scores" are normalized so that 1 represent "best fit"&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;for cnt = 1:length(S4)&lt;br /&gt;score1(cnt) = 1-abs(S4(cnt).BoundingBox(3)-S4(cnt).BoundingBox(4))/max([S4(cnt).BoundingBox(3),S4(cnt).BoundingBox(4)]);&lt;br /&gt;&lt;br /&gt;score2(cnt) = 1 - abs(%pi*((mean([S4(cnt).BoundingBox(3),S4(cnt).BoundingBox(4)]))/2)^2-length(S4(cnt).PixelIndexList))/length(S4(cnt).PixelIndexList);&lt;br /&gt;&lt;br /&gt;end&lt;br /&gt;score = mean([score1 score2],'c');&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;strong&gt;5. Display the result visually&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;ShowImage(S2,'0');&lt;br /&gt;[m,n] = size(S2);&lt;br /&gt;&lt;br /&gt;for cnt = 1:length(S4)&lt;br /&gt;xnumb(S4(cnt).Centroid(1),m-S4(cnt).Centroid(2),score(cnt));&lt;br /&gt;t = gce();&lt;br /&gt;t.font_foreground = color('red');&lt;br /&gt;end&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_VpjiJfC4dGQ/TR_iOZH-6CI/AAAAAAAAAKI/cvsjjF8UeOg/s1600/p6-out4.jpg"&gt;&lt;img style="WIDTH: 234px; HEIGHT: 301px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5557409202088896546" border="0" alt="" src="http://1.bp.blogspot.com/_VpjiJfC4dGQ/TR_iOZH-6CI/AAAAAAAAAKI/cvsjjF8UeOg/s400/p6-out4.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;&lt;span style="color:#000000;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:#3366ff;"&gt;&lt;span style="color:#000000;"&gt;So now, can you tell which one is the round object by just looking at the "roundness index"?&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:#3366ff;"&gt;&lt;span style="color:#000000;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:#3366ff;"&gt;&lt;span style="color:#000000;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;/span&gt;&lt;p&gt;&lt;span style="color:#3366ff;"&gt;&lt;/p&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5276401353476406299-2857904091204317445?l=scilab-imageprocessing.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scilab-imageprocessing.blogspot.com/feeds/2857904091204317445/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scilab-imageprocessing.blogspot.com/2011/01/detecting-objects-shapei-round-object.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5276401353476406299/posts/default/2857904091204317445'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5276401353476406299/posts/default/2857904091204317445'/><link rel='alternate' type='text/html' href='http://scilab-imageprocessing.blogspot.com/2011/01/detecting-objects-shapei-round-object.html' title='Detecting Objects&apos; Shape(I) : Round Object'/><author><name>tcl</name><uri>http://www.blogger.com/profile/00129522875781410013</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_VpjiJfC4dGQ/TR_iNkp4YrI/AAAAAAAAAJo/P7nkXkKRsNk/s72-c/p6-in1.jpg' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5276401353476406299.post-4731288110142170507</id><published>2010-12-03T05:07:00.000-08:00</published><updated>2010-12-03T05:26:41.089-08:00</updated><title type='text'>Playing with “Edge Detection”</title><content type='html'>A lot of articles explain what is edge detection, how to apply it, and the usage of it. Different edge detection techniques such as sobel, prewitt, and canny are easily found from any image processing software.&lt;br /&gt;&lt;br /&gt;However, when we really want to perform edge detection for certain purpose, the problems arise. Look at the following example:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_VpjiJfC4dGQ/TPjth2MqqPI/AAAAAAAAAIc/D92xG0Wo3IU/s1600/p5-in1.jpg"&gt;&lt;img style="WIDTH: 128px; HEIGHT: 128px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5546444106846873842" border="0" alt="" src="http://4.bp.blogspot.com/_VpjiJfC4dGQ/TPjth2MqqPI/AAAAAAAAAIc/D92xG0Wo3IU/s400/p5-in1.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;1. Original image &lt;/strong&gt;&lt;strong&gt;&lt;br /&gt;&lt;/strong&gt;&lt;span style="color:#3333ff;"&gt;S = imread('p5-in1.jpg');&lt;br /&gt;ShowColorImage(S,'0');&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_VpjiJfC4dGQ/TPjtiaBLntI/AAAAAAAAAIk/wuNockaHocg/s1600/p5-out1.jpg"&gt;&lt;img style="WIDTH: 165px; HEIGHT: 283px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5546444116462378706" border="0" alt="" src="http://3.bp.blogspot.com/_VpjiJfC4dGQ/TPjtiaBLntI/AAAAAAAAAIk/wuNockaHocg/s400/p5-out1.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;2. Edge detection using different methods&lt;br /&gt;&lt;/strong&gt;&lt;span style="color:#3333ff;"&gt;S2 = RGB2Gray(S);&lt;br /&gt;S3 = edge(S2,'sobel');&lt;br /&gt;ShowImage(S3,'0');&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;a href="http://1.bp.blogspot.com/_VpjiJfC4dGQ/TPjtimAcjCI/AAAAAAAAAIs/9V8l6R32P80/s1600/p5-out2.jpg"&gt;&lt;img style="WIDTH: 146px; HEIGHT: 262px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5546444119680519202" border="0" alt="" src="http://1.bp.blogspot.com/_VpjiJfC4dGQ/TPjtimAcjCI/AAAAAAAAAIs/9V8l6R32P80/s400/p5-out2.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;S4 = edge(S2,'prewitt');&lt;br /&gt;ShowImage(S4,'0');&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;a href="http://4.bp.blogspot.com/_VpjiJfC4dGQ/TPjtjIK1trI/AAAAAAAAAI0/zdXyhG0QNHM/s1600/p5-out3.jpg"&gt;&lt;img style="WIDTH: 146px; HEIGHT: 262px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5546444128850917042" border="0" alt="" src="http://4.bp.blogspot.com/_VpjiJfC4dGQ/TPjtjIK1trI/AAAAAAAAAI0/zdXyhG0QNHM/s400/p5-out3.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;S5 = edge(S2,'canny');&lt;br /&gt;ShowImage(S5,'0'); &lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;a href="http://3.bp.blogspot.com/_VpjiJfC4dGQ/TPjtjcAPchI/AAAAAAAAAI8/DJgFbMItjLI/s1600/p5-out4.jpg"&gt;&lt;img style="WIDTH: 146px; HEIGHT: 262px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5546444134175175186" border="0" alt="" src="http://3.bp.blogspot.com/_VpjiJfC4dGQ/TPjtjcAPchI/AAAAAAAAAI8/DJgFbMItjLI/s400/p5-out4.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;It seems like great but the usage of these output are useless until we really know what we want to do. For exmaple, we want to find the white rabbit, we need to perform some pre-processing before the edge detection so that we can fully utilize the function to suite to our needs.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;3. Edge detection for the white rabbit&lt;br /&gt;&lt;/strong&gt;Since we know the RGB value for white color is [255,255,255], we can pre-process the image to extract the white color region from the image.&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;Sw = S(:,:,1)&gt;200 &amp;amp; S(:,:,2)&gt;200 &amp;amp; S(:,:,3)&gt;200;&lt;br /&gt;Sw2 = edge(double(Sw),'prewitt');&lt;br /&gt;ShowImage(Sw2,'0'); &lt;/span&gt;&lt;span style="color:#3333ff;"&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;a href="http://3.bp.blogspot.com/_VpjiJfC4dGQ/TPjtprU6vKI/AAAAAAAAAJE/CUfGmSlGQ08/s1600/p5-out5.jpg"&gt;&lt;img style="WIDTH: 146px; HEIGHT: 262px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5546444241367645346" border="0" alt="" src="http://3.bp.blogspot.com/_VpjiJfC4dGQ/TPjtprU6vKI/AAAAAAAAAJE/CUfGmSlGQ08/s400/p5-out5.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Well, it seems like make more sense. Let's have a look on how to perform edge detection on the black rabbit:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;4. Edge detection for the black rabbit&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;&lt;div&gt;&lt;span style="color:#000099;"&gt;Sb = S(:,:,1)&lt;40&gt;&lt;/div&gt;&lt;/span&gt;&lt;div&gt;&lt;span style="color:#000099;"&gt;Sb2 = edge(double(Sb),'prewitt'); &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="color:#000099;"&gt;ShowImage(Sb2,'0'); &lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;a href="http://2.bp.blogspot.com/_VpjiJfC4dGQ/TPjvl7FQ4KI/AAAAAAAAAJc/aHphSEkaBcQ/s1600/p5-out6.jpg"&gt;&lt;img style="WIDTH: 146px; HEIGHT: 262px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5546446375900733602" border="0" alt="" src="http://2.bp.blogspot.com/_VpjiJfC4dGQ/TPjvl7FQ4KI/AAAAAAAAAJc/aHphSEkaBcQ/s400/p5-out6.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style="color:#000000;"&gt;The post processing can be used to remove unwanted noise. &lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style="color:#000099;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5276401353476406299-4731288110142170507?l=scilab-imageprocessing.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scilab-imageprocessing.blogspot.com/feeds/4731288110142170507/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scilab-imageprocessing.blogspot.com/2010/12/playing-with-edge-detection.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5276401353476406299/posts/default/4731288110142170507'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5276401353476406299/posts/default/4731288110142170507'/><link rel='alternate' type='text/html' href='http://scilab-imageprocessing.blogspot.com/2010/12/playing-with-edge-detection.html' title='Playing with “Edge Detection”'/><author><name>tcl</name><uri>http://www.blogger.com/profile/00129522875781410013</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_VpjiJfC4dGQ/TPjth2MqqPI/AAAAAAAAAIc/D92xG0Wo3IU/s72-c/p5-in1.jpg' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5276401353476406299.post-7844630109408138069</id><published>2010-11-20T17:51:00.000-08:00</published><updated>2010-11-20T18:03:01.416-08:00</updated><title type='text'>Panoramic Picture Creation</title><content type='html'>&lt;div&gt;This example illustrates simple method of panoramic picture creation using sum of absolute differences. It assumes no zooming, rotational variation in 2 images.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;1. Reading Images for processing &lt;/strong&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="color:#3333ff;"&gt;&lt;/span&gt; &lt;/div&gt;&lt;div&gt;&lt;span style="color:#3333ff;"&gt;S1 = imread('p4-in1.jpg');&lt;br /&gt;S2 = imread('p4-in2.jpg');&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;strong&gt;2. Showing Images&lt;br /&gt;&lt;/strong&gt;1st Image&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="color:#3333ff;"&gt;ShowColorImage(S1,'0');&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;a href="http://1.bp.blogspot.com/_VpjiJfC4dGQ/TOh8gaBtj9I/AAAAAAAAAH0/02gF8aHPEyw/s1600/p4-in1.jpg"&gt;&lt;img style="WIDTH: 230px; HEIGHT: 180px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5541816237663555538" border="0" alt="" src="http://1.bp.blogspot.com/_VpjiJfC4dGQ/TOh8gaBtj9I/AAAAAAAAAH0/02gF8aHPEyw/s400/p4-in1.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;2nd Image&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;ShowColorImage(S2,'0');&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div&gt;&lt;a href="http://4.bp.blogspot.com/_VpjiJfC4dGQ/TOh8gTR8MOI/AAAAAAAAAH8/cbkatGL0Luk/s1600/p4-in2.jpg"&gt;&lt;img style="WIDTH: 230px; HEIGHT: 180px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5541816235852574946" border="0" alt="" src="http://4.bp.blogspot.com/_VpjiJfC4dGQ/TOh8gTR8MOI/AAAAAAAAAH8/cbkatGL0Luk/s400/p4-in2.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;3. Extract red layer of the image for processing using Sum of Absolute Differences (SAD) &lt;/strong&gt;&lt;/div&gt;&lt;strong&gt;&lt;div&gt;&lt;br /&gt;&lt;/strong&gt;&lt;span style="color:#3333ff;"&gt;S1r = S1(:,:,1);&lt;br /&gt;S2r = S2(:,:,1);&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;strong&gt;4. Sum of Absolute Differences (SAD) of a selected block is from each image are computed. &lt;/strong&gt;&lt;/div&gt;&lt;strong&gt;&lt;div&gt;&lt;br /&gt;&lt;/strong&gt;&lt;span style="color:#3333ff;"&gt;sz = 50;&lt;br /&gt;roi2 = S2r(1:sz,1:sz);&lt;br /&gt;[x,y]=size(S2r);&lt;br /&gt;for cnt = y:-1:x/2&lt;br /&gt;roi1 = S1r(1:sz,cnt-sz+1:cnt);&lt;br /&gt;data(y-cnt+1)=sum(sum(abs(double(roi2)-double(roi1))));&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;strong&gt;5. Finding minimum error among all comparison &lt;/strong&gt;&lt;/div&gt;&lt;strong&gt;&lt;div&gt;&lt;br /&gt;&lt;/strong&gt;&lt;span style="color:#3333ff;"&gt;plot(data);&lt;br /&gt;[minval,ind] = min(data);&lt;br /&gt;plot(ind,minval,'r*');&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_VpjiJfC4dGQ/TOh8-YOE6TI/AAAAAAAAAIU/cSgdfbNaIpQ/s1600/p4-out1.jpg"&gt;&lt;img style="WIDTH: 400px; HEIGHT: 375px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5541816752574622002" border="0" alt="" src="http://4.bp.blogspot.com/_VpjiJfC4dGQ/TOh8-YOE6TI/AAAAAAAAAIU/cSgdfbNaIpQ/s400/p4-out1.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;6. Combine the images at the minimum error region. &lt;/strong&gt;&lt;/div&gt;&lt;div&gt;&lt;strong&gt;&lt;br /&gt;&lt;/strong&gt;&lt;span style="color:#3333ff;"&gt;Sc = S1(1:$,1:y-sz-ind+1,:);&lt;br /&gt;Sfinal = [Sc S2];&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;strong&gt;7. Final Result&lt;br /&gt;&lt;br /&gt;&lt;/strong&gt;&lt;span style="color:#3333ff;"&gt;ShowColorImage(Sfinal,'0');&lt;br /&gt;&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_VpjiJfC4dGQ/TOh8g3jybcI/AAAAAAAAAIM/90mAtTjnkPA/s1600/p4-out2.jpg"&gt;&lt;img style="WIDTH: 378px; HEIGHT: 314px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5541816245591109058" border="0" alt="" src="http://4.bp.blogspot.com/_VpjiJfC4dGQ/TOh8g3jybcI/AAAAAAAAAIM/90mAtTjnkPA/s400/p4-out2.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5276401353476406299-7844630109408138069?l=scilab-imageprocessing.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scilab-imageprocessing.blogspot.com/feeds/7844630109408138069/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scilab-imageprocessing.blogspot.com/2010/11/panoramic-picture-creation.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5276401353476406299/posts/default/7844630109408138069'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5276401353476406299/posts/default/7844630109408138069'/><link rel='alternate' type='text/html' href='http://scilab-imageprocessing.blogspot.com/2010/11/panoramic-picture-creation.html' title='Panoramic Picture Creation'/><author><name>tcl</name><uri>http://www.blogger.com/profile/00129522875781410013</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_VpjiJfC4dGQ/TOh8gaBtj9I/AAAAAAAAAH0/02gF8aHPEyw/s72-c/p4-in1.jpg' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5276401353476406299.post-3633886498652432155</id><published>2010-11-15T17:21:00.000-08:00</published><updated>2010-11-15T17:35:45.911-08:00</updated><title type='text'>Detecting Object in an Image</title><content type='html'>&lt;div&gt;&lt;strong&gt;1. How to detect an object in an image?&lt;br /&gt;&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;Determining the features from the object that you want to detect is the key. The feature in this case is something that differentiates the object from others, such as color, shape, size, etc…&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;2. What are the techniques for object detection? &lt;/strong&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;The image processing techniques such as morphology or color processing usually did this job. A simple example in Scilab of detecting ‘white rabbit’ is shown as follow, in this case, ‘color’ is the feature used to distinguish the white rabbit from other:&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;a href="http://2.bp.blogspot.com/_VpjiJfC4dGQ/TOHfhgNA1xI/AAAAAAAAAHs/R4bXu_i8Y5g/s1600/p3-in1.jpg"&gt;&lt;img style="WIDTH: 128px; HEIGHT: 128px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5539954783315613458" border="0" alt="" src="http://2.bp.blogspot.com/_VpjiJfC4dGQ/TOHfhgNA1xI/AAAAAAAAAHs/R4bXu_i8Y5g/s400/p3-in1.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;// Original Image&lt;br /&gt;S = imread('p3-in1.jpg');&lt;br /&gt;ShowColorImage(S,'0'); &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="color:#3366ff;"&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_VpjiJfC4dGQ/TOHeZgHhyeI/AAAAAAAAAHE/2psMkhnsnDg/s1600/p3-out1.jpg"&gt;&lt;img style="WIDTH: 146px; HEIGHT: 262px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5539953546342025698" border="0" alt="" src="http://3.bp.blogspot.com/_VpjiJfC4dGQ/TOHeZgHhyeI/AAAAAAAAAHE/2psMkhnsnDg/s400/p3-out1.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;// Gray scale image&lt;br /&gt;S2 = rgb2gray(S);&lt;br /&gt;ShowImage(S2,'0');&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;a href="http://4.bp.blogspot.com/_VpjiJfC4dGQ/TOHeZ7f59sI/AAAAAAAAAHM/TKeyPpkO5nk/s1600/p3-out2.jpg"&gt;&lt;img style="WIDTH: 146px; HEIGHT: 262px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5539953553692030658" border="0" alt="" src="http://4.bp.blogspot.com/_VpjiJfC4dGQ/TOHeZ7f59sI/AAAAAAAAAHM/TKeyPpkO5nk/s400/p3-out2.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;// Find the white color&lt;br /&gt;S3 = S2&gt;180;&lt;br /&gt;ShowImage(S3,'0'); &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_VpjiJfC4dGQ/TOHeaAhHaRI/AAAAAAAAAHU/_mpy3PDpRlY/s1600/p3-out3.jpg"&gt;&lt;img style="WIDTH: 146px; HEIGHT: 262px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5539953555039283474" border="0" alt="" src="http://3.bp.blogspot.com/_VpjiJfC4dGQ/TOHeaAhHaRI/AAAAAAAAAHU/_mpy3PDpRlY/s400/p3-out3.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;// Morphology technique, image erosion to erase the unwanted components&lt;br /&gt;se = CreateStructureElement('vertical_line', 10);&lt;br /&gt;S4 = ErodeImage(S3, se);&lt;br /&gt;se = CreateStructureElement('horizontal_line', 10);&lt;br /&gt;S4 = ErodeImage(S4, se);&lt;br /&gt;ShowImage(S4,'0');&lt;br /&gt;&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_VpjiJfC4dGQ/TOHeaAydueI/AAAAAAAAAHc/JQUKWdN7qAI/s1600/p3-out4.jpg"&gt;&lt;img style="WIDTH: 146px; HEIGHT: 262px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5539953555112049122" border="0" alt="" src="http://1.bp.blogspot.com/_VpjiJfC4dGQ/TOHeaAydueI/AAAAAAAAAHc/JQUKWdN7qAI/s400/p3-out4.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;// Labeled the component(s), and plot the centroid on the original image &lt;/div&gt;&lt;div&gt;S5 = S4.*1;&lt;br /&gt;IsCalculated = CreateFeatureStruct(%f); // Feature struct is generated.&lt;br /&gt;IsCalculated.Centroid = %t; // The bounding box shall be calculated for each blob.&lt;br /&gt;S6 = AnalyzeBlobs(S5, IsCalculated);&lt;br /&gt;ShowColorImage(S,'0');&lt;br /&gt;plot(S6(1).Centroid(1),S6(1).Centroid(2),'r*');&lt;/span&gt;&lt;span style="color:#3366ff;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_VpjiJfC4dGQ/TOHeaWqtzyI/AAAAAAAAAHk/MxYWO6NydKg/s1600/p3-out5.jpg"&gt;&lt;img style="WIDTH: 146px; HEIGHT: 262px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5539953560985128738" border="0" alt="" src="http://2.bp.blogspot.com/_VpjiJfC4dGQ/TOHeaWqtzyI/AAAAAAAAAHk/MxYWO6NydKg/s400/p3-out5.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5276401353476406299-3633886498652432155?l=scilab-imageprocessing.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scilab-imageprocessing.blogspot.com/feeds/3633886498652432155/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scilab-imageprocessing.blogspot.com/2010/11/detecting-object-in-image.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5276401353476406299/posts/default/3633886498652432155'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5276401353476406299/posts/default/3633886498652432155'/><link rel='alternate' type='text/html' href='http://scilab-imageprocessing.blogspot.com/2010/11/detecting-object-in-image.html' title='Detecting Object in an Image'/><author><name>tcl</name><uri>http://www.blogger.com/profile/00129522875781410013</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_VpjiJfC4dGQ/TOHfhgNA1xI/AAAAAAAAAHs/R4bXu_i8Y5g/s72-c/p3-in1.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5276401353476406299.post-1325346595929251537</id><published>2010-11-10T18:28:00.000-08:00</published><updated>2010-11-10T21:56:09.320-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='pixel'/><category scheme='http://www.blogger.com/atom/ns#' term='image procecssing'/><category scheme='http://www.blogger.com/atom/ns#' term='manupulating image'/><title type='text'>Drawing Shapes by Overwriting Pixel Value</title><content type='html'>&lt;strong&gt;1. How to highlight certain portion on an image? &lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;The basic concept of highlighting part of an image is “Overwriting Pixel Value” on the image. We start from the basic idea on how to mask portion of image with blank sub-image (black color sub-image). Figure below shows the image with the size of 128x128x3 in which 3 represents RGB. (In grayscale image 3 layers are the same). The second image at the right hand site shows a black sub-image is placed at the upper left of the original image. The Scilab code to perform the operation are as follow:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_VpjiJfC4dGQ/TNtZVjGb02I/AAAAAAAAAGU/pMN5sRwPygM/s1600/p2-in1.jpg"&gt;&lt;img style="WIDTH: 128px; HEIGHT: 128px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5538118393516512098" border="0" alt="" src="http://3.bp.blogspot.com/_VpjiJfC4dGQ/TNtZVjGb02I/AAAAAAAAAGU/pMN5sRwPygM/s400/p2-in1.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;S = imread('p2-in1.jpg');&lt;br /&gt;S2 = S;&lt;br /&gt;S2(:,:,2) = S;&lt;br /&gt;S2(:,:,3) = S; // Create a gray-scale RGB Image&lt;br /&gt;S = S2; // Save a copy of image&lt;br /&gt;ShowColorImage(S2,'0');&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_VpjiJfC4dGQ/TNtZV_DAxZI/AAAAAAAAAGc/o1YtOJdyjpE/s1600/p2-out1.jpg"&gt;&lt;img style="WIDTH: 146px; HEIGHT: 262px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5538118401018348946" border="0" alt="" src="http://1.bp.blogspot.com/_VpjiJfC4dGQ/TNtZV_DAxZI/AAAAAAAAAGc/o1YtOJdyjpE/s400/p2-out1.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;Sblack = uint8(zeros(20,20,3));&lt;br /&gt;S2 = S;&lt;br /&gt;S2(1:20,1:20,:) = Sblack;&lt;br /&gt;ShowColorImage(S2,'0');&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;a href="http://3.bp.blogspot.com/_VpjiJfC4dGQ/TNtZVybW2yI/AAAAAAAAAGk/YYFljQWJ29U/s1600/p2-out2.jpg"&gt;&lt;img style="WIDTH: 146px; HEIGHT: 262px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5538118397630798626" border="0" alt="" src="http://3.bp.blogspot.com/_VpjiJfC4dGQ/TNtZVybW2yI/AAAAAAAAAGk/YYFljQWJ29U/s400/p2-out2.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;strong&gt;2. How to create a color mask rather than black color mask? &lt;/strong&gt;&lt;/div&gt;&lt;strong&gt;&lt;div&gt;&lt;br /&gt;&lt;/strong&gt;&lt;/div&gt;Since the 3 layers of image matrix represent RGB layers of the image, we can create the red color mask using following command, and the results are shown as shown.&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;Sred = Sblack;&lt;br /&gt;Sred(:,:,1)=255;&lt;br /&gt;S2 = S;&lt;br /&gt;S2(1:20,1:20,:) = Sred;&lt;br /&gt;ShowColorImage(S2,'0');&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_VpjiJfC4dGQ/TNtZWFU_tBI/AAAAAAAAAGs/0tLNkW3wjqQ/s1600/p2-out3.jpg"&gt;&lt;img style="WIDTH: 146px; HEIGHT: 262px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5538118402704389138" border="0" alt="" src="http://1.bp.blogspot.com/_VpjiJfC4dGQ/TNtZWFU_tBI/AAAAAAAAAGs/0tLNkW3wjqQ/s400/p2-out3.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;strong&gt;3. How to create a transparent mask? &lt;/strong&gt;&lt;br /&gt;&lt;/div&gt;&lt;strong&gt;&lt;div&gt;&lt;br /&gt;&lt;/strong&gt;&lt;/div&gt;Simple enough, just play with the values R value, and perform the image addition rather than overwriting the value as follow:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;Sred = Sblack;&lt;br /&gt;S2 = S;&lt;br /&gt;S2(1:20,1:20,1) = 255;&lt;br /&gt;ShowColorImage(S2,'0');&lt;/span&gt; &lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_VpjiJfC4dGQ/TNtZWGcXciI/AAAAAAAAAG0/M1u66Rcyvrc/s1600/p2-out4.jpg"&gt;&lt;img style="WIDTH: 146px; HEIGHT: 262px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5538118403003740706" border="0" alt="" src="http://1.bp.blogspot.com/_VpjiJfC4dGQ/TNtZWGcXciI/AAAAAAAAAG0/M1u66Rcyvrc/s400/p2-out4.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;strong&gt;4. Finally, how to create an outline for the image?&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;linelength = 10;&lt;br /&gt;Sblack = uint8(zeros(128+linelength*2,128+linelength*2,3));&lt;br /&gt;S2 = Sblack;&lt;br /&gt;S2((1+linelength):($-linelength),(1+linelength):($-linelength),:)=S;&lt;br /&gt;ShowColorImage(S2,'0'); &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_VpjiJfC4dGQ/TNtbMuQTM4I/AAAAAAAAAG8/FaqlmeVgL_I/s1600/p2-out5.jpg"&gt;&lt;img style="WIDTH: 166px; HEIGHT: 282px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5538120440915112834" border="0" alt="" src="http://3.bp.blogspot.com/_VpjiJfC4dGQ/TNtbMuQTM4I/AAAAAAAAAG8/FaqlmeVgL_I/s400/p2-out5.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Note: To run example in this article, please follow the installation of Scilab and toolboxes at previous post.&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;a href="http://scilab-imageprocessing.blogspot.com/2010/11/back-in-scilab-image-processing.html"&gt;http://scilab-imageprocessing.blogspot.com/2010/11/back-in-scilab-image-processing.html&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5276401353476406299-1325346595929251537?l=scilab-imageprocessing.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scilab-imageprocessing.blogspot.com/feeds/1325346595929251537/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scilab-imageprocessing.blogspot.com/2010/11/drawing-shapes-by-overwriting-pixel.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5276401353476406299/posts/default/1325346595929251537'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5276401353476406299/posts/default/1325346595929251537'/><link rel='alternate' type='text/html' href='http://scilab-imageprocessing.blogspot.com/2010/11/drawing-shapes-by-overwriting-pixel.html' title='Drawing Shapes by Overwriting Pixel Value'/><author><name>tcl</name><uri>http://www.blogger.com/profile/00129522875781410013</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_VpjiJfC4dGQ/TNtZVjGb02I/AAAAAAAAAGU/pMN5sRwPygM/s72-c/p2-in1.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5276401353476406299.post-1406687538792382024</id><published>2010-11-09T17:19:00.000-08:00</published><updated>2010-11-09T17:56:09.769-08:00</updated><title type='text'>Back in Scilab Image Processing!</title><content type='html'>After so long, finally I am back to this blog!&lt;br /&gt;&lt;br /&gt;Some changes of the components I am going to use for my blog:&lt;br /&gt;1. Scilab 5.3 beta-4 (Download this from &lt;a href="http://www.scilab.org/"&gt;http://www.scilab.org/&lt;/a&gt;)&lt;br /&gt;2. SIVP Toolbox (After Installing Scilab, you could either install this via atom module manager or using command "atomsInstall(['SIVP','0.5.3']" , without the quote)&lt;br /&gt;3. IPD Toolbox (install using atom module manager or using command "atomsInstall(['IPD','7.0'])", without the quote)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Thanks to the contribitors of the SIVP and IPD toolbox, you could find the name of the generous contribitors from the Module manager page.&lt;br /&gt;&lt;br /&gt;There are some overlapping functions between these 2 toolboxes, but as they have their own advantages, I would just install and use them both!&lt;br /&gt;&lt;br /&gt;A simple quick example:&lt;br /&gt;&lt;br /&gt;Original Image from Scilab page.&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_VpjiJfC4dGQ/TNn3waWUceI/AAAAAAAAAF8/qj1d1ZFupz4/s1600/puffin.png"&gt;&lt;img style="WIDTH: 161px; HEIGHT: 192px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5537729627907453410" border="0" alt="" src="http://1.bp.blogspot.com/_VpjiJfC4dGQ/TNn3waWUceI/AAAAAAAAAF8/qj1d1ZFupz4/s400/puffin.png" /&gt;&lt;/a&gt;&lt;br /&gt;--&gt; S = imread('puffin.png');&lt;br /&gt;--&gt; imshow(S);&lt;br /&gt;&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_VpjiJfC4dGQ/TNn4fby5ptI/AAAAAAAAAGE/kETrfG586OI/s1600/p1-img1.png"&gt;&lt;img style="WIDTH: 266px; HEIGHT: 305px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5537730435749619410" border="0" alt="" src="http://2.bp.blogspot.com/_VpjiJfC4dGQ/TNn4fby5ptI/AAAAAAAAAGE/kETrfG586OI/s400/p1-img1.png" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;The above imshow function is the function from SIVP toolbox, which use the tk window for showing image.&lt;br /&gt;&lt;br /&gt;--&gt; ShowColorImage(S,'Puffin.png');&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_VpjiJfC4dGQ/TNn4fl92-rI/AAAAAAAAAGM/CofKMFVMgWU/s1600/p1-img2.png"&gt;&lt;img style="WIDTH: 179px; HEIGHT: 326px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5537730438479936178" border="0" alt="" src="http://4.bp.blogspot.com/_VpjiJfC4dGQ/TNn4fl92-rI/AAAAAAAAAGM/CofKMFVMgWU/s400/p1-img2.png" /&gt;&lt;/a&gt; &lt;/p&gt;&lt;p&gt;The above ShowColorImage is the function from IPD toolbox which uses the standard Scilab figure to show the image.&lt;/p&gt;&lt;p&gt;In this blog, I am going to convert all (if not all, most) of my old posts done in Matlab (&lt;a href="http://basic-eng.blogspot.com/"&gt;http://basic-eng.blogspot.com/&lt;/a&gt;).&lt;/p&gt;&lt;p&gt;There are some old posts on hough transform in this blog, which is using older version of Scilab, and different version of toolboxes, if you're adventurous enough, you might want to try it! Other wise, I would updates them soon, over the weekend.&lt;/p&gt;&lt;p&gt;Have a nice day! &lt;/p&gt;&lt;p&gt;&lt;br /&gt; &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5276401353476406299-1406687538792382024?l=scilab-imageprocessing.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scilab-imageprocessing.blogspot.com/feeds/1406687538792382024/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scilab-imageprocessing.blogspot.com/2010/11/back-in-scilab-image-processing.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5276401353476406299/posts/default/1406687538792382024'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5276401353476406299/posts/default/1406687538792382024'/><link rel='alternate' type='text/html' href='http://scilab-imageprocessing.blogspot.com/2010/11/back-in-scilab-image-processing.html' title='Back in Scilab Image Processing!'/><author><name>tcl</name><uri>http://www.blogger.com/profile/00129522875781410013</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_VpjiJfC4dGQ/TNn3waWUceI/AAAAAAAAAF8/qj1d1ZFupz4/s72-c/puffin.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5276401353476406299.post-5601701097755609922</id><published>2009-04-13T07:47:00.000-07:00</published><updated>2009-04-13T07:54:08.977-07:00</updated><title type='text'>Hough Transform For Circle Detection - with unknown radius (II)</title><content type='html'>The detection of circle with unknown radius has been shown in previous post - &lt;a href="http://scilab-imageprocessing.blogspot.com/2009/04/hough-transform-for-circle-detection_5899.html"&gt;Hough Transform For Circle Detection - with unknown radius (I)&lt;/a&gt; , by using a lot of "for" loops.This example shows the same function with "vectorized" code, which run 25% faster than the previous code, in a Pentium M 1.5 GHz computer with 512 M RAM.Let's see how to perform this:&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_VpjiJfC4dGQ/SeNRt4YhylI/AAAAAAAAAFU/06RqULwgs50/s1600-h/aaa.png"&gt;&lt;img id="BLOGGER_PHOTO_ID_5324189033153284690" style="WIDTH: 168px; CURSOR: hand; HEIGHT: 176px" alt="" src="http://2.bp.blogspot.com/_VpjiJfC4dGQ/SeNRt4YhylI/AAAAAAAAAFU/06RqULwgs50/s400/aaa.png" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;1. Reading image and the convert to binary image.&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;I = imread('aaa.png');&lt;br /&gt;I =im2bw(double(I),0.5);&lt;br /&gt;[y,x]=find(I);&lt;br /&gt;[sy,sx]=size(I);&lt;br /&gt;imshow(I);&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_VpjiJfC4dGQ/SeNRuF7tm0I/AAAAAAAAAFc/6qUDit4hXtk/s1600-h/1.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5324189036790520642" style="WIDTH: 186px; CURSOR: hand; HEIGHT: 308px" alt="" src="http://3.bp.blogspot.com/_VpjiJfC4dGQ/SeNRuF7tm0I/AAAAAAAAAFc/6qUDit4hXtk/s400/1.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;2. Find all the require information for the transformatin. the 'totalpix' is the numbers of '1' in the image.&lt;/strong&gt;&lt;br /&gt;totalpix = length(x);&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;3. Preallocate memory for the Hough Matrix. Try to play around with the R, or the radius to see the different results.&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;stacksize('max');&lt;br /&gt;HM = zeros(sy*sx*50,1);&lt;br /&gt;R = 1:50;&lt;br /&gt;R2 = zeros(1,1,length(R)); // Extra line for scilab&lt;br /&gt;R2(1,1,:) = R.^2;&lt;br /&gt;//R2 = repmat(R2,[sy,totalpix,1]);&lt;br /&gt;R2 = ones(sy,totalpix,1).*.R2;&lt;br /&gt;//y = repmat(y',[sy,1,50]);&lt;br /&gt;y = ones(sy,1,50).*.y;&lt;br /&gt;//x = repmat(x',[sy,1,50]);&lt;br /&gt;x = ones(sy,1,50).*.x;&lt;br /&gt;&lt;br /&gt;b = 1:sy;&lt;br /&gt;//b = repmat(b',[1,totalpix,50]);&lt;br /&gt;b = ones(1,totalpix,50).*.b';&lt;br /&gt;&lt;br /&gt;a = zeros(sy,totalpix);&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;4. Performing Hough Transform. Notice the accumulator is located in the inner for loop. This portion of codes will map the original image to the a-b domain.&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;a. Find the a parameter&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;a = (round(x - sqrt(R2 - (y - b).^2)));&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;b. Find the location of ‘a’ and ‘b’, as well as the valid value both.&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;[xx,yy,zz]=find((imag(a)==0 &amp;amp; real(a)&gt;0));&lt;br /&gt;b = b(imag(a)==0 &amp;amp; real(a)&gt;0);&lt;br /&gt;a = a(imag(a)==0 &amp;amp; real(a)&gt;0);&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;c. Find the indices and remap it to different layers&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;ind = sub2ind([sy,sx],b,a);&lt;br /&gt;ind = ind + ((ceil(zz)-1)*sx*sy)'; // interesting&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;d. Construct the Hough Matrix of 50 layers&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;val = ones(length(ind),1);&lt;br /&gt;&lt;br /&gt;data = zeros(max(real(ind)),1);&lt;br /&gt;ind = real(ind);&lt;br /&gt;for cnt = 1:length(ind)&lt;br /&gt;data(ind(cnt)) = data(ind(cnt)) + 1;&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;HM(1:length(data)) = data;&lt;br /&gt;HM2 = matrix(HM,[sy,sx,50]);&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;5. Find for the maximum value for each layer, or in other words, the layer with maximum value will indicate the correspond R for the circle.&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;for cnt = 1:50&lt;br /&gt;H(cnt) = (max(HM2(:,:,cnt)));&lt;br /&gt;end&lt;br /&gt;plot(H,'*-');&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_VpjiJfC4dGQ/SeNRuDnIPzI/AAAAAAAAAFk/J_xUYZ8UtU0/s1600-h/2.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5324189036167315250" style="WIDTH: 343px; CURSOR: hand; HEIGHT: 384px" alt="" src="http://2.bp.blogspot.com/_VpjiJfC4dGQ/SeNRuDnIPzI/AAAAAAAAAFk/J_xUYZ8UtU0/s400/2.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;strong&gt;6. Extract the information from the layer with maximum value, and overlap with the original image.&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;[maxval, maxind] = max(H);&lt;br /&gt;[B,A] = find(HM2(:,:,maxind)==maxval);&lt;br /&gt;imshow(double(I));&lt;br /&gt;plot(mean(A),sy-mean(B),'xr')&lt;br /&gt;xnumb(mean(A),sy-mean(B),maxind,100)&lt;br /&gt;h = gce();&lt;br /&gt;h.font_foreground = 255; &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_VpjiJfC4dGQ/SeNRuODpkuI/AAAAAAAAAFs/9BvbJRQ_eks/s1600-h/3.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5324189038971294434" style="WIDTH: 186px; CURSOR: hand; HEIGHT: 308px" alt="" src="http://3.bp.blogspot.com/_VpjiJfC4dGQ/SeNRuODpkuI/AAAAAAAAAFs/9BvbJRQ_eks/s400/3.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5276401353476406299-5601701097755609922?l=scilab-imageprocessing.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scilab-imageprocessing.blogspot.com/feeds/5601701097755609922/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scilab-imageprocessing.blogspot.com/2009/04/hough-transform-for-circle-detection_5591.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5276401353476406299/posts/default/5601701097755609922'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5276401353476406299/posts/default/5601701097755609922'/><link rel='alternate' type='text/html' href='http://scilab-imageprocessing.blogspot.com/2009/04/hough-transform-for-circle-detection_5591.html' title='Hough Transform For Circle Detection - with unknown radius (II)'/><author><name>tcl</name><uri>http://www.blogger.com/profile/00129522875781410013</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_VpjiJfC4dGQ/SeNRt4YhylI/AAAAAAAAAFU/06RqULwgs50/s72-c/aaa.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5276401353476406299.post-2594040773147285661</id><published>2009-04-13T07:36:00.000-07:00</published><updated>2009-04-13T07:44:55.433-07:00</updated><title type='text'>Hough Transform For Circle Detection - with unknown radius (I)</title><content type='html'>In previous 2 examples, the generalized Hough Transform has been applied to find for the circle with known radius. We were using the circle equation --&gt; (x-a)^2 + (y-b)^2 = R^2 to map the pixel to a-b domain.For detection circle with unknown radius, another parameter need to be make as variable, which is, the radius R.Let's see how to perform this:&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_VpjiJfC4dGQ/SeNPXSr6esI/AAAAAAAAAE0/oi6PvK-cwzU/s1600-h/aaa.png"&gt;&lt;img id="BLOGGER_PHOTO_ID_5324186446053669570" style="WIDTH: 168px; CURSOR: hand; HEIGHT: 176px" alt="" src="http://1.bp.blogspot.com/_VpjiJfC4dGQ/SeNPXSr6esI/AAAAAAAAAE0/oi6PvK-cwzU/s400/aaa.png" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;1. Reading image and the convert to binary image.&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;I = imread('aaa.png');&lt;br /&gt;I =im2bw(double(I),0.5);&lt;br /&gt;[y,x]=find(I);&lt;br /&gt;[sy,sx]=size(I);&lt;br /&gt;imshow(I);&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;a href="http://1.bp.blogspot.com/_VpjiJfC4dGQ/SeNPX0nIJeI/AAAAAAAAAFE/1FrHlU9ZdmA/s1600-h/1.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5324186455160399330" style="WIDTH: 186px; CURSOR: hand; HEIGHT: 308px" alt="" src="http://1.bp.blogspot.com/_VpjiJfC4dGQ/SeNPX0nIJeI/AAAAAAAAAFE/1FrHlU9ZdmA/s400/1.jpg" border="0" /&gt;&lt;/a&gt; &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;strong&gt;2. Find all the require information for the transformatin. the 'totalpix' is the numbers of '1' in the image.&lt;/strong&gt;&lt;br /&gt;totalpix = length(x);&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;3. Preallocate memory for the Hough Matrix. Try to play around with the R, or the radius to see the different results.&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;HM = zeros(sy,sx,50);&lt;br /&gt;R = 1:50;&lt;br /&gt;R2 = R.^2;&lt;br /&gt;sz = sy*sx;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;4. Performing Hough Transform. Notice the accumulator is located in the inner for loop. This portion of codes will map the original image to the a-b domain.&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;for cnt = 1:totalpix&lt;br /&gt;for cntR = 1:50&lt;br /&gt;b = 1:sy;&lt;br /&gt;a = (round(x(cnt) - sqrt(R2(cntR) - (y(cnt) - [1:sy]).^2)));&lt;br /&gt;b = b(imag(a)==0 &amp;amp; real(a)&gt;0);&lt;br /&gt;a = a(imag(a)==0 &amp;amp; real(a)&gt;0);&lt;br /&gt;ind = sub2ind([sy,sx],b,a);&lt;br /&gt;HM(sz*(cntR-1)+ind) = HM(sz*(cntR-1)+ind) + 1;&lt;br /&gt;end&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;5. Find for the maximum value for each layer, or in other words, the layer with maximum value will indicate the correspond R for the circle.&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;for cnt = 1:50&lt;br /&gt;H(cnt) = max(max(HM(:,:,cnt)));&lt;br /&gt;end&lt;br /&gt;plot(H,'*-');&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;a href="http://3.bp.blogspot.com/_VpjiJfC4dGQ/SeNPXtSbPfI/AAAAAAAAAE8/qmtv9rZHas8/s1600-h/2.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5324186453194522098" style="WIDTH: 343px; CURSOR: hand; HEIGHT: 384px" alt="" src="http://3.bp.blogspot.com/_VpjiJfC4dGQ/SeNPXtSbPfI/AAAAAAAAAE8/qmtv9rZHas8/s400/2.jpg" border="0" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;strong&gt;6. Extract the information from the layer with maximum value, and overlap with the original image.&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;[maxval, maxind] = max(H);&lt;br /&gt;[B,A] = find(HM(:,:,maxind)==maxval);&lt;br /&gt;imshow(double(I));&lt;br /&gt;plot(mean(A),sy-mean(B),'xr')&lt;br /&gt;xnumb(mean(A),sy-mean(B),maxind,100)&lt;br /&gt;h = gce();&lt;br /&gt;h.font_foreground = 255; &lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;&lt;a href="http://2.bp.blogspot.com/_VpjiJfC4dGQ/SeNPX1HRK8I/AAAAAAAAAFM/McrkKkI2A7k/s1600-h/3.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5324186455295208386" style="WIDTH: 186px; CURSOR: hand; HEIGHT: 308px" alt="" src="http://2.bp.blogspot.com/_VpjiJfC4dGQ/SeNPX1HRK8I/AAAAAAAAAFM/McrkKkI2A7k/s400/3.jpg" border="0" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5276401353476406299-2594040773147285661?l=scilab-imageprocessing.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scilab-imageprocessing.blogspot.com/feeds/2594040773147285661/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scilab-imageprocessing.blogspot.com/2009/04/hough-transform-for-circle-detection_5899.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5276401353476406299/posts/default/2594040773147285661'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5276401353476406299/posts/default/2594040773147285661'/><link rel='alternate' type='text/html' href='http://scilab-imageprocessing.blogspot.com/2009/04/hough-transform-for-circle-detection_5899.html' title='Hough Transform For Circle Detection - with unknown radius (I)'/><author><name>tcl</name><uri>http://www.blogger.com/profile/00129522875781410013</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_VpjiJfC4dGQ/SeNPXSr6esI/AAAAAAAAAE0/oi6PvK-cwzU/s72-c/aaa.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5276401353476406299.post-5525037840533526938</id><published>2009-04-13T01:31:00.000-07:00</published><updated>2009-04-13T01:49:35.619-07:00</updated><title type='text'>Hough Transform For Circle Detection - with known radius (II)</title><content type='html'>This example doing the same as the previous example, with the difference that this example does not use any "for loops" in the code. The vectorized code make the algorithm runs faster but with the trade-off of high memory consumtion. Try to compare this with the previous example: &lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;strong&gt;1. Reading image and the convert to binary image. After that, the location of the value '1' is found using 'find' function. (assume the image is already preprocess, if not, the 'edge' function might help)&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_VpjiJfC4dGQ/SeL7xBat5II/AAAAAAAAAEs/kaO6EINi59M/s1600-h/aaa.png"&gt;&lt;img id="BLOGGER_PHOTO_ID_5324094529118004354" style="WIDTH: 168px; CURSOR: hand; HEIGHT: 176px" alt="" src="http://2.bp.blogspot.com/_VpjiJfC4dGQ/SeL7xBat5II/AAAAAAAAAEs/kaO6EINi59M/s400/aaa.png" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;I = imread('aaa.png'); //for this image, simply right click from the image above and save as aaa.png&lt;/div&gt;&lt;div&gt;I =im2bw(double(I),0.5);&lt;/div&gt;&lt;div&gt;[y,x]=find(I);&lt;/div&gt;&lt;div&gt;[sy,sx]=size(I);&lt;/div&gt;&lt;div&gt;imshow(I);&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;br /&gt;&lt;div&gt;&lt;a href="http://1.bp.blogspot.com/_VpjiJfC4dGQ/SeL7wzdlqSI/AAAAAAAAAEM/eCtMvAuUZaM/s1600-h/1.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5324094525371951394" style="WIDTH: 186px; CURSOR: hand; HEIGHT: 308px" alt="" src="http://1.bp.blogspot.com/_VpjiJfC4dGQ/SeL7wzdlqSI/AAAAAAAAAEM/eCtMvAuUZaM/s400/1.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;strong&gt;2. Find all the require information for the transformatin. the 'totalpix' is the numbers of '1' in the image.&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;totalpix = length(x);&lt;/div&gt;&lt;div&gt;&lt;strong&gt;&lt;/strong&gt; &lt;/div&gt;&lt;div&gt;&lt;strong&gt;3. Preallocate memory for the Hough Matrix. Try to play around with the R, or the radius to see the different results.&lt;/strong&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;HM = zeros(sy*sx,1);&lt;/div&gt;&lt;div&gt;R = 36;&lt;/div&gt;&lt;div&gt;R2 = R^2;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;strong&gt;4. Performing Hough Transform. Notice that no "for-loop" in this portion of code.&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;&lt;strong&gt;&lt;em&gt;&lt;/em&gt;&lt;/strong&gt; &lt;/div&gt;&lt;div&gt;&lt;strong&gt;&lt;em&gt;a. Preparing all the matrices for the computation without "for-loop"&lt;/em&gt;&lt;/strong&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;b = 1:sy;&lt;/div&gt;&lt;div&gt;a = zeros(sy,totalpix);&lt;br /&gt;y = ones(sy,1).*.y;&lt;/div&gt;&lt;div&gt;x = ones(sy,1).*.x;&lt;/div&gt;&lt;div&gt;b = ones(1,totalpix).*.b';&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;strong&gt;&lt;em&gt;b. The equation for the circle&lt;/em&gt;&lt;/strong&gt;&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;a = (round(x - sqrt(R2 - (y - b).^2)));&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;strong&gt;&lt;em&gt;c. Removing all the invalid value in matrices a and b&lt;/em&gt;&lt;/strong&gt;&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;b = b(imag(a)==0 &amp;amp; real(a)&gt;0);&lt;/div&gt;&lt;div&gt;a = a(imag(a)==0 &amp;amp; real(a)&gt;0);&lt;/div&gt;&lt;div&gt;ind = sub2ind([sy,sx],b,a);&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;strong&gt;&lt;em&gt;d. Reconstruct the Hough Matrix&lt;/em&gt;&lt;/strong&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;data = zeros(max(real(ind)),1);&lt;/div&gt;&lt;div&gt;ind = real(ind);&lt;/div&gt;&lt;div&gt;for cnt = 1:length(ind) &lt;/div&gt;&lt;div&gt;data(ind(cnt)) = data(ind(cnt)) + 1;&lt;/div&gt;&lt;div&gt;end&lt;br /&gt;HM(1:length(data)) = data;&lt;/div&gt;&lt;div&gt;HM2 = matrix(HM,[sy,sx]);&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;strong&gt;5. Showing the Hough Matrix&lt;/strong&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;imshow(HM2,[]);&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;a href="http://4.bp.blogspot.com/_VpjiJfC4dGQ/SeL7xEEnwUI/AAAAAAAAAEc/fKW_V_fwbjk/s1600-h/3.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5324094529830633794" style="WIDTH: 186px; CURSOR: hand; HEIGHT: 308px" alt="" src="http://4.bp.blogspot.com/_VpjiJfC4dGQ/SeL7xEEnwUI/AAAAAAAAAEc/fKW_V_fwbjk/s400/3.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt; &lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;strong&gt;6. Finding the location of the circle with radius of R&lt;/strong&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;[maxval, maxind] = max(max(HM2));&lt;/div&gt;&lt;div&gt;[B,A] = find(HM2==maxval);&lt;/div&gt;&lt;div&gt;imshow(I); &lt;/div&gt;&lt;div&gt;plot(mean(A),sy-mean(B),'xr');&lt;/div&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_VpjiJfC4dGQ/SeL7xCGWJzI/AAAAAAAAAEk/69mR2FKS-Qc/s1600-h/4.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5324094529300997938" style="WIDTH: 186px; CURSOR: hand; HEIGHT: 308px" alt="" src="http://3.bp.blogspot.com/_VpjiJfC4dGQ/SeL7xCGWJzI/AAAAAAAAAEk/69mR2FKS-Qc/s400/4.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5276401353476406299-5525037840533526938?l=scilab-imageprocessing.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scilab-imageprocessing.blogspot.com/feeds/5525037840533526938/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scilab-imageprocessing.blogspot.com/2009/04/hough-transform-for-circle-detection_13.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5276401353476406299/posts/default/5525037840533526938'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5276401353476406299/posts/default/5525037840533526938'/><link rel='alternate' type='text/html' href='http://scilab-imageprocessing.blogspot.com/2009/04/hough-transform-for-circle-detection_13.html' title='Hough Transform For Circle Detection - with known radius (II)'/><author><name>tcl</name><uri>http://www.blogger.com/profile/00129522875781410013</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_VpjiJfC4dGQ/SeL7xBat5II/AAAAAAAAAEs/kaO6EINi59M/s72-c/aaa.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5276401353476406299.post-3275630683250762749</id><published>2009-04-05T19:55:00.000-07:00</published><updated>2009-04-13T01:30:38.000-07:00</updated><title type='text'>Hough Transform For Circle Detection - with known radius (I)</title><content type='html'>This is a very first example that I choose to convert from my previous blog example: &lt;a href="http://basic-eng.blogspot.com/2006/01/hough-transform-for-circle-detection.html"&gt;http://basic-eng.blogspot.com/2006/01/hough-transform-for-circle-detection.html&lt;/a&gt; &lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;The purpose of this example is to detect a circle of known radius from a binary image as follow:&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_VpjiJfC4dGQ/SdlwwDaRq3I/AAAAAAAAADk/jROBmNZbcuI/s1600-h/aaa.png"&gt;&lt;img id="BLOGGER_PHOTO_ID_5321408405566499698" style="WIDTH: 168px; CURSOR: hand; HEIGHT: 176px" alt="" src="http://1.bp.blogspot.com/_VpjiJfC4dGQ/SdlwwDaRq3I/AAAAAAAAADk/jROBmNZbcuI/s400/aaa.png" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Do note that I am using the latest SCILAB 5.1, and SIVP toolbos 0.5.0. as descripted in my previous post.&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;For image processing functionalities, the sip tooblox &lt;a href="http://siptoolbox.sourceforge.net/"&gt;http://siptoolbox.sourceforge.net/&lt;/a&gt; provides more functions, however, for this moment, I am still waiting for the binary version for latest SCILAB for WINDOWS. (please find the &lt;a href="http://scilab-imageprocessing.blogspot.com/2009/03/requirement-for-examples-scilab-and.html"&gt;http://scilab-imageprocessing.blogspot.com/2009/03/requirement-for-examples-scilab-and.html&lt;/a&gt; for the steps of installation)&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;OK, enought talking, here comes the example:&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;br /&gt;&lt;div&gt;&lt;strong&gt;1. Reading image and the convert to binary image. &lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;I = imread('aaa.png');&lt;/div&gt;&lt;div&gt;I =im2bw(double(I),0.5);&lt;br /&gt;[y,x]=find(I);&lt;/div&gt;&lt;div&gt;[sy,sx]=size(I);&lt;/div&gt;&lt;div&gt;imshow(I);&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_VpjiJfC4dGQ/SeL3ghkWaRI/AAAAAAAAADs/j9bqVAl4TX0/s1600-h/1.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5324089847644055826" style="WIDTH: 186px; CURSOR: hand; HEIGHT: 308px" alt="" src="http://1.bp.blogspot.com/_VpjiJfC4dGQ/SeL3ghkWaRI/AAAAAAAAADs/j9bqVAl4TX0/s400/1.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;strong&gt;2. Find all the require information for the transformatin. the 'totalpix' is the numbers of '1' in the image.&lt;/strong&gt; &lt;/div&gt;&lt;div&gt;&lt;br /&gt;totalpix = length(x);&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;3. Preallocate memory for the Hough Matrix. Try to play around with the R, or the radius to see the different results.&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;HM = zeros(sy,sx);&lt;br /&gt;R = 34;&lt;br /&gt;R2 = R^2;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;4. Performing Hough Transform. Notice the accumulator is located in the inner for loop. This portion of codes will map the original image to the a-b domain.&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;b = 1:sy;&lt;br /&gt;&lt;br /&gt;for cnt = 1:totalpix&lt;br /&gt;a = (round(x(cnt) - sqrt(R2 - (y(cnt) - [1:sy]).^2)));&lt;br /&gt;for cnt2 =1:sy&lt;br /&gt;if isreal(a(cnt2),0) &amp;amp; real(a(cnt2))&gt;0&lt;br /&gt;HM(cnt2,real(a(cnt2))) = HM(cnt2,real(a(cnt2))) + 1;&lt;br /&gt;end&lt;br /&gt;end&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;5. Showing the Hough Matrix&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;imshow(HM); // in binary image&lt;br /&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_VpjiJfC4dGQ/SeL3gzpP7-I/AAAAAAAAAD0/0GeIbyJ30T0/s1600-h/2.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5324089852496441314" style="WIDTH: 186px; CURSOR: hand; HEIGHT: 308px" alt="" src="http://3.bp.blogspot.com/_VpjiJfC4dGQ/SeL3gzpP7-I/AAAAAAAAAD0/0GeIbyJ30T0/s400/2.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;imshow(HM,[]); // in intensity image, so you could notice the max value of Hough Transform&lt;/div&gt;&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_VpjiJfC4dGQ/SeL3hFvr93I/AAAAAAAAAD8/AQrlKaHDpk0/s1600-h/3.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5324089857355282290" style="WIDTH: 186px; CURSOR: hand; HEIGHT: 308px" alt="" src="http://4.bp.blogspot.com/_VpjiJfC4dGQ/SeL3hFvr93I/AAAAAAAAAD8/AQrlKaHDpk0/s400/3.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;strong&gt;6. Finding the location of the circle with radius of R&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;[maxval, maxind] = max(max(HM));&lt;br /&gt;[B,A] = find(HM==maxval);&lt;br /&gt;&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;imshow(double(I));&lt;/div&gt;&lt;div&gt;mtlb_hold on;&lt;/div&gt;&lt;div&gt;plot(mean(A),sy-mean(B),'rx');&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_VpjiJfC4dGQ/SdlwwK8lWOI/AAAAAAAAADc/0nWluTq27S0/s1600-h/4.jpg"&gt;&lt;/a&gt;&lt;a href="http://3.bp.blogspot.com/_VpjiJfC4dGQ/SeL3hBB-WbI/AAAAAAAAAEE/T0XnlMR9k4M/s1600-h/4.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5324089856089807282" style="WIDTH: 186px; CURSOR: hand; HEIGHT: 308px" alt="" src="http://3.bp.blogspot.com/_VpjiJfC4dGQ/SeL3hBB-WbI/AAAAAAAAAEE/T0XnlMR9k4M/s400/4.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5276401353476406299-3275630683250762749?l=scilab-imageprocessing.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scilab-imageprocessing.blogspot.com/feeds/3275630683250762749/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scilab-imageprocessing.blogspot.com/2009/04/hough-transform-for-circle-detection.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5276401353476406299/posts/default/3275630683250762749'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5276401353476406299/posts/default/3275630683250762749'/><link rel='alternate' type='text/html' href='http://scilab-imageprocessing.blogspot.com/2009/04/hough-transform-for-circle-detection.html' title='Hough Transform For Circle Detection - with known radius (I)'/><author><name>tcl</name><uri>http://www.blogger.com/profile/00129522875781410013</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_VpjiJfC4dGQ/SdlwwDaRq3I/AAAAAAAAADk/jROBmNZbcuI/s72-c/aaa.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5276401353476406299.post-6332032257578418599</id><published>2009-03-30T23:28:00.000-07:00</published><updated>2009-04-13T00:32:28.282-07:00</updated><title type='text'>Requirement for the Examples - Scilab and Toolboxes</title><content type='html'>Examples for this blog require the following tools under windows:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;1. Scilab 5.1 which could be downloaded from: http://www.scilab.org/&lt;/strong&gt;&lt;br /&gt;Pre-cautious: After installation, run the 3d plot demo, make sure you see the graph corrently, else, try to update the graphics card driver from:&lt;br /&gt;For ATI cards: http://ati.amd.com/support/driver.html&lt;br /&gt;For Intel cards: http://www.intel.com/support/graphics/&lt;br /&gt;For Matrox cards: http://www.matrox.com/graphics/en/support/drivers/&lt;br /&gt;For NVIDIA cards: http://www.nvidia.com/content/drivers/drivers.asp&lt;br /&gt;For S3 cards: http://www.s3graphics.com/en/resources/drivers/index.jsp&lt;br /&gt;For SiS cards: http://www.sis.com/download/&lt;br /&gt;For VIA cards: http://www.viaarena.com/default.aspx?PageID=2&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;2. SIVP-0.5.0 from http://sivp.sourceforge.net/&lt;/strong&gt;&lt;br /&gt;I am using this package as the core for the image processing as this toolbox supports lastest version of SCILAB in Windows.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;3. SIP Toolbox from http://siptoolbox.sourceforge.net/&lt;/strong&gt;&lt;br /&gt;As this toolbox do not have the binaries for Windows, but it has a lot of useful functions. Hence, I use the macros from this toolbox especially the morphology functions which is very useful!&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;4. ANN Toolbox from &lt;a href="http://www.scilab.org.cn/?q=node/11"&gt;http://www.scilab.org.cn/?q=node/11&lt;/a&gt;&lt;/strong&gt;&lt;br /&gt;This is a toolbox created by students in SCILAB Contest 2006. There is another toolbox which I believe is more powerful, however, more syntax when calling the functions. So I use this for the simplicity.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Installation Steps:&lt;/strong&gt;&lt;br /&gt;1. Download and Install Scilab 5.1 from &lt;a href="http://www.scilab.org/download/index_download.php?page=release#windows"&gt;http://www.scilab.org/download/index_download.php?page=release#windows&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;2. Download and install SIVP-0.5.0 from &lt;a href="http://sivp.sourceforge.net/"&gt;http://sivp.sourceforge.net/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;3. Download ANN Toolbox from &lt;a href="http://www.scilab.org.cn/files/2006scilabcontest/ANN_Toolbox.rar"&gt;http://www.scilab.org.cn/files/2006scilabcontest/ANN_Toolbox.rar&lt;/a&gt;&lt;br /&gt;Install the toolbox by placing the folder under SCILAB\contrib&lt;br /&gt;&lt;br /&gt;4. Download the code from &lt;a href="http://rapidshare.com/files/220713278/siptoolbox.zip"&gt;HERE&lt;/a&gt;, which contains the macro from SIP toolbox, thanks sip developmet team (&lt;a href="http://sivp.sourceforge.net/"&gt;http://sivp.sourceforge.net/&lt;/a&gt; ), and Install the toolbox by placing the folder under SCILAB\contrib&lt;br /&gt;&lt;br /&gt;in which SCILAB is the installation path for the toolbox.&lt;br /&gt;&lt;br /&gt;5. Launch Scilab, on the toolbox menu, click on the installed toolbox in sequence:&lt;br /&gt;a. ANN_Toolbox (a GUI will pop up, just close it)&lt;br /&gt;b. SIVP -0.5.0&lt;br /&gt;c. siptoolbox&lt;br /&gt;&lt;br /&gt;notes: make sure the siptoobox is clicked after SIVP, as there are some functions overlapping between 2, and we are using later.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5276401353476406299-6332032257578418599?l=scilab-imageprocessing.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scilab-imageprocessing.blogspot.com/feeds/6332032257578418599/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scilab-imageprocessing.blogspot.com/2009/03/requirement-for-examples-scilab-and.html#comment-form' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5276401353476406299/posts/default/6332032257578418599'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5276401353476406299/posts/default/6332032257578418599'/><link rel='alternate' type='text/html' href='http://scilab-imageprocessing.blogspot.com/2009/03/requirement-for-examples-scilab-and.html' title='Requirement for the Examples - Scilab and Toolboxes'/><author><name>tcl</name><uri>http://www.blogger.com/profile/00129522875781410013</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5276401353476406299.post-7913597916346191784</id><published>2009-03-30T23:08:00.000-07:00</published><updated>2009-03-30T23:21:20.833-07:00</updated><title type='text'>Switching from MATLAB to SCILAB for Image Processing</title><content type='html'>After leaving school and the company dealing with MATLAB, having MATLAB is a disaster for me! As my previous blog: http://basic-eng.blogspot.com/ which contains examples for image processing using MATLAB and image processing toolbox, it went "dying" since then. &lt;br /&gt;&lt;br /&gt;I was so reluctant to change to other software for image processing, but I have no choice...&lt;br /&gt;&lt;br /&gt;SCILAB came into my PC for so many times, and each time I keep on installing and uninstalling after awhile as I still "addicted" to previous software, as well as the SCILAB with toolboxes are not so complete in functionality. &lt;br /&gt;&lt;br /&gt;However, recently I decided to put my head into SCILAB and some of the toolboxes, and after familiar with the syntax and the ways which will lead to the "Crash", I start loving it!!!&lt;br /&gt;&lt;br /&gt;I would like to share my experience using SCILAB, especially in Image Processing, and I would convert as much examples as possible from my previous blog into SCILBA code.&lt;br /&gt;&lt;br /&gt;My successes in exploring SCILAB so far are:&lt;br /&gt;1. Building GUI, even though it is more difficult to design without GUIDE in MATLAB, however, once the outline is up, I found out that it is easier to program as the handles of the components could be accessed by simply using '.' operator!!!&lt;br /&gt;2. Using the SIVP toolbox, which I will introduce later, make the image processing so convenient, and writing code for image processing algorithms is more fun!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5276401353476406299-7913597916346191784?l=scilab-imageprocessing.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scilab-imageprocessing.blogspot.com/feeds/7913597916346191784/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scilab-imageprocessing.blogspot.com/2009/03/switching-from-matlab-to-scilab-for.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5276401353476406299/posts/default/7913597916346191784'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5276401353476406299/posts/default/7913597916346191784'/><link rel='alternate' type='text/html' href='http://scilab-imageprocessing.blogspot.com/2009/03/switching-from-matlab-to-scilab-for.html' title='Switching from MATLAB to SCILAB for Image Processing'/><author><name>tcl</name><uri>http://www.blogger.com/profile/00129522875781410013</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
