<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>내 맘대로 보는 세상 &#187; Programing</title>
	<atom:link href="http://b.mytears.org/tag/programing/feed" rel="self" type="application/rss+xml" />
	<link>http://b.mytears.org</link>
	<description>평범한 일상 속의 보석찾기..</description>
	<lastBuildDate>Sat, 19 Jun 2010 11:27:24 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>제로보드 XE 관련 약간의 해명…</title>
		<link>http://b.mytears.org/2009/04/1912</link>
		<comments>http://b.mytears.org/2009/04/1912#comments</comments>
		<pubDate>Wed, 08 Apr 2009 18:20:13 +0000</pubDate>
		<dc:creator>정태영</dc:creator>
				<category><![CDATA[Tae-young]]></category>
		<category><![CDATA[c]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[code reuse]]></category>
		<category><![CDATA[diff]]></category>
		<category><![CDATA[offline]]></category>
		<category><![CDATA[oop]]></category>
		<category><![CDATA[OpenSource]]></category>
		<category><![CDATA[patch]]></category>
		<category><![CDATA[policy]]></category>
		<category><![CDATA[Programing]]></category>
		<category><![CDATA[sorry]]></category>
		<category><![CDATA[zerobard xe]]></category>
		<category><![CDATA[zeroboard]]></category>
		<category><![CDATA[zeroboard5]]></category>

		<guid isPermaLink="false">http://b.mytears.org/?p=1912</guid>
		<description><![CDATA[<p>미투데이를 돌아다니다가 성민 장군님의 미투에서 &#8216;전 제로보드 XE를 잘 모릅니다!!! 말할때는 좀 생각을 하고 말해주세요.&#8216;란 포스트을 보게 되었다. 위 포스트에는 Ever™님이 남기신 XE의 단점이 있다면??이란 글에 대한 해명글이었는데, 글 내용들을 읽다보니 내가 했던 얘기들과 약간의 연관이 있을 것 같다.</p>
<p>첫째, 우선 클래스와 관련된 얘기는 내가 했던 얘기와 분명히 연관이 있다.</p>
<p>사실 난 제로보드 XE의 코드를 본적이 없다. ...</p>
<p><a href='http://b.mytears.org/2009/04/1912'>Read the rest of this entry...</a></p>
<p><h3 style="clear:both;">Related Posts</h3><ul class="related_post"><li>3/9/2009 -- <a href="http://b.mytears.org/2009/03/1732" title="NDSL의 재발견!">NDSL의 재발견! (7)</a></li><li>2/8/2009 -- <a href="http://b.mytears.org/2009/02/1414" title="WP-Eolin 플러그인">WP-Eolin 플러그인 (3)</a></li><li>2/8/2009 -- <a href="http://b.mytears.org/2009/02/1409" title="Daum 블로거 뉴스를 위한 Trackback for Korean 패치">Daum 블로거 뉴스를 위한 Trackback for Korean 패치 (0)</a></li><li>2/2/2009 -- <a href="http://b.mytears.org/2009/02/1355" title="워드프레스 2.7을 위한 Trackback for Korean 패치">워드프레스 2.7을 위한 Trackback for Korean 패치 (6)</a></li><li>1/29/2009 -- <a href="http://b.mytears.org/2009/01/1236" title="wp-codebox, wp-openid 버그 패치">wp-codebox, wp-openid 버그 패치 (4)</a></li></ul></p><div style="width: 180px; margin-left: auto; margin-right: auto; margin-bottom: 30px; margin-top: 30px; ">
    <object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0' width='73' height='79' align='left' style="border-bottom: 1px solid #CFD4DA; border-right: 1px solid #CFD4DA;">
    <param name='allowScriptAccess' value='always'/>
    <param name='movie' value='http://www.mixsh.com/widget/mixup/loader.html?muid=52225&guid=http%3A%2F%2Fb.mytears.org%2F%3Fp%3D1912&rdate=2009-04-09+03%3A20%3A13&rawhtml=&skin=1&showhitcnt=1&platform=5'/>
    <param name='quality' value='high'/>
    <param name='wmode' value='window'/>
    <embed src='http://www.mixsh.com/widget/mixup/loader.html?muid=52225&guid=http%3A%2F%2Fb.mytears.org%2F%3Fp%3D1912&rdate=2009-04-09+03%3A20%3A13&rawhtml=&skin=1&showhitcnt=1&platform=5' quality='high' wmode='window' width='73' height='79' allowScriptAccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer'/>
    </object>
		</div>]]></description>
			<content:encoded><![CDATA[<p><a href="http://me2day.net">미투데이</a>를 돌아다니다가 <a href="http://me2day.net/jangkunblog">성민 장군님의 미투</a>에서 &#8216;<a href="http://me2day.net/jangkunblog/2009/04/08#00:14:35">전 제로보드 XE를 잘 모릅니다!!! 말할때는 좀 생각을 하고 말해주세요.</a>&#8216;란 포스트을 보게 되었다. 위 포스트에는 Ever™님이 남기신 <a href="http://www.xpressengine.com/17874105">XE의 단점이 있다면??</a>이란 글에 대한 <a href="http://www.xpressengine.com/17913134">해명글</a>이었는데, 글 내용들을 읽다보니 내가 했던 얘기들과 약간의 연관이 있을 것 같다.</p>
<p>첫째, 우선 클래스와 관련된 얘기는 내가 했던 얘기와 분명히 연관이 있다.</p>
<p><span id="more-1912"></span>사실 난 제로보드 XE의 코드를 본적이 없다. 그 이전의 제로보드5까지는 코드를 어느정도 구경해봤던 기억이 있는데, 그 날 내가 했던 얘기는 XE가 아닌 제로보드5의 코드에 대한 얘기였다. (사실 난 제로보드 XE가 제로보드5에서 이름이 바뀐 정도로 알고 있었다. 뭐 어쨌든!) 당시 제로보드5의 클래스는 다음과 같았다.</p>
<p>1. DB클래스<br />
2. DB클래스를 상속한 ZeroBoard 클래스<br />
3. 이를 상속한 또 하나의 클래스? </p>
<p>오래된 일이라 정확하게 기억나진 않고, 코드를 찾을 수가 없어서 더 자세하게는 얘기를 못하겠다. 어쨌거나 하고 싶은 얘기는 클래스의 사용이 나쁘다는 것이 아니라 필요없이 클래스를 상속하고, 쓸모없는 클래스들을 정의하고 있었다는 것이다.</p>
<p>클래스는 재사용을 위해 사용하는 것이다. 괜히 귀찮게 인터페이스를 만들고 내부 변수에 접근 못하도록 private, friend 같은 키워드를 걸어두는 게 아니란거다. <sup>[1]</sup></p>
<p>당시 제로보드에 사용되어진 클래스들은 재사용 등의 관점하고는 거리가 멀었다. 클래스를 사용하고는 있지만 실제 뭔가를 하려면 클래스를 사용하지 않을때와 별반 다르지 않은 코드를 작성해야하는 상황. 디비 클래스 정도만이 재사용이 가능한 정도였다고 기억한다. (다행히 XE의 코드는 그 때 코드와는 아주 달라보인다.)</p>
<p>뭐 어쨌거나 그 날 오프모임에서 내부 구현이 지저분하다라기보다 당시 제로보드의 클래스는 저랬다. 그 이후로는 안봐서 모르겠다란 얘기를 했었다. 지금와서 생각해보면 최근까지 제로보드를 지켜보고 있었던 것도 아니면서 경솔하게 얘기했었던 걸지도 모르겠다.</p>
<p>그리고 이건 지금도 적용되는 이야기!</p>
<p>그날 제로보드에 대해 비판했던 내용 중 패치 배포 방법에 대한 내용이 있었다. unix에는 diff, patch란 툴이 있다. <sup>[2]</sup> 이 툴들을 이용할 경우 코드의  패치를 배포하려 할 경우 패치가 완료된 파일을 배포하는 것이 아니라 수정된 사항만을 배포할 수 있다. 이 툴들은 매우 똑똑하기 때문에 사용자가 다른 부분을 수정하였더라도 내가 수정을 한 부분과 상관이 없으면 아무 문제 없이 이 변경 사항들을 적용시켜준다. 그렇기 때문에 만약 사용자들이 여기저기 수정을 해서 사용하는 시스템이라면 당연히 이런 툴들을 사용한 패치를 제공해야한다고 생각한다.</p>
<p>unix툴이라고 하니까 다 뭔가 대게 복잡할거 같다고 생각하지만 windiff, filemerge 등의 윈도우 GUI프로그램도 존재하고, 그 중에는 공개 소프트웨어도 있다. 사용하는데 그리 어렵지 않다는 얘기다. SVN 등의 버젼 관리 시스템을 이용한다면 이런 툴들의 존재를 모르진 않을텐데, &#8216;패치 방법: 어떤 파일을 덮어쓰시면 됩니다.&#8217; 이런 공지가 아직까지 보이는 걸 보면 여전히 답답하다.</p>
<p>사실 <a href="http://www.xpressengine.com/17874105">문제가 되었던 글</a>을 읽으면 그 때 뭔가 얘기가 많이 오간 듯한 분위기지만 사실 5분 내외의 아주 짤막한 내용이 전부였던 것 같은데, 하여튼 오프라인에서 술먹으면서 하는 얘기라도 말은 조금 조심해야겠다.</p>
<p>덧: 혹시나 관련 글들을 보고 기분이 상하셨던 분들이 계시다면 사과드리겠습니다. (_ _*) 꾸벅;
<ol class="footnotes">
<li id="footnote_0_1912" class="footnote">다른 클래스를 가져다 쓰고 있는데, 다른 클래스의 내부 구현이 변경되었다고 내 프로그램까지 문제가 생기면 안된다. 최악의 경우라도 새로 컴파일, 링크 하는 것 만으로 적용이 가능해야 한다.</p>
<p>그런 이유로 내부 변수에 직접 접근하도록 하는 것은 좋은 생각이 아니다. 내부에 있는 a라는 변수에 접근하도록 허용하기 보다는 getA(), setA(int var) 식의 인터페이스(자바에서는 &#8216;메쏘드&#8217;라는 이름을 사용한다.)를 제공하고, 내부 변수에는 접근할 수 없도록 private 등의 키워드를 걸어버리는 것이 좋다. 이 개념이 바로 인캡슐레이션이라 불리는 개념이다.</p>
<p>c의 변수에는 생성자(initializer)와 소멸자(destructor) 등이 없기 때문에 c style로 파일 단위 모듈화를 진행하게 되면 실제 그 모듈을 가져다 쓸 때 init_my_module() 같은 생성자를 호출하고, 그 모듈과 관련해서 더 이상 뭔가를 할 게 없으면 destruct_my_module() 같은 코드를 호출해줘야한다. 하지만 c++ 에서는 new 키워드를 통해 클래스를 만들게 되면 생성자가 호출되고 delete 키워드를 사용해서 클래스를 파괴해버리면 소멸자가 자동으로 호출된다. 그렇기 때문에 클래스를 가져다 쓸때는 복잡하게 해줄 일이 없다. 그저 header를 include하고, new 로 클래스를 초기화 시켜주는게 전부. c 로 짜여진 모듈을 가져다 사용할 때처럼 클래스를 사용해야한다면 이는 분명 잘못 설계된(남용된) 클래스다.</p>
<p>물론 인터페이스를 통해서만 접근하는 것은 내부 변수에 직접 접근할 때보다 느리다. 또한 생성자 소멸자, 그리고 함수 오버라이딩, 오버로딩 등을 지원하기 위해 성능을 희생해야할 지도 모른다. 하지만 코드의 재사용이라는 관점에서 클래스를 사용하는 것은 플러스 알파를 가져온다.</li>
<li id="footnote_1_1912" class="footnote">대강 어떤 식인지는 <a href="http://allofsoftware.net/90">요 글</a>을 보라!
<p><a href='http://mytears.org/resources/tmp/zb_patch/'>http://mytears.org/resources/tmp/zb_patch/</a></p>
<p>위 url에 가보면 내 서버를 사용하고 있는 분들의 제로보드를 <em>강제로</em> 최신 버젼으로 올리기 위해 만들어놨던 제로보드 패치들을 볼 수 있다. 하여튼 diff를 이용하면 위와 같은 출력물이 나오고 patch 를 이용하면 구버젼의 제로보드에 패치와 관련된 코드를 아주 간단히 삽입할 수 있다.</li>
</ol><div style="width: 180px; margin-left: auto; margin-right: auto; margin-bottom: 30px; margin-top: 30px; ">
    <object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0' width='73' height='79' align='left' style="border-bottom: 1px solid #CFD4DA; border-right: 1px solid #CFD4DA;">
    <param name='allowScriptAccess' value='always'/>
    <param name='movie' value='http://www.mixsh.com/widget/mixup/loader.html?muid=52225&guid=http%3A%2F%2Fb.mytears.org%2F%3Fp%3D1912&rdate=2009-04-09+03%3A20%3A13&rawhtml=&skin=1&showhitcnt=1&platform=5'/>
    <param name='quality' value='high'/>
    <param name='wmode' value='window'/>
    <embed src='http://www.mixsh.com/widget/mixup/loader.html?muid=52225&guid=http%3A%2F%2Fb.mytears.org%2F%3Fp%3D1912&rdate=2009-04-09+03%3A20%3A13&rawhtml=&skin=1&showhitcnt=1&platform=5' quality='high' wmode='window' width='73' height='79' allowScriptAccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer'/>
    </object>
		</div><h3 style="clear:both;">Related Posts</h3><ul class="related_post"><li>3/9/2009 -- <a href="http://b.mytears.org/2009/03/1732" title="NDSL의 재발견!">NDSL의 재발견! (7)</a></li><li>2/8/2009 -- <a href="http://b.mytears.org/2009/02/1414" title="WP-Eolin 플러그인">WP-Eolin 플러그인 (3)</a></li><li>2/8/2009 -- <a href="http://b.mytears.org/2009/02/1409" title="Daum 블로거 뉴스를 위한 Trackback for Korean 패치">Daum 블로거 뉴스를 위한 Trackback for Korean 패치 (0)</a></li><li>2/2/2009 -- <a href="http://b.mytears.org/2009/02/1355" title="워드프레스 2.7을 위한 Trackback for Korean 패치">워드프레스 2.7을 위한 Trackback for Korean 패치 (6)</a></li><li>1/29/2009 -- <a href="http://b.mytears.org/2009/01/1236" title="wp-codebox, wp-openid 버그 패치">wp-codebox, wp-openid 버그 패치 (4)</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://b.mytears.org/2009/04/1912/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>ajax와 encoding 문제…</title>
		<link>http://b.mytears.org/2009/03/1848</link>
		<comments>http://b.mytears.org/2009/03/1848#comments</comments>
		<pubDate>Tue, 24 Mar 2009 15:44:58 +0000</pubDate>
		<dc:creator>정태영</dc:creator>
				<category><![CDATA[Tae-young]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[annoying]]></category>
		<category><![CDATA[encoding]]></category>
		<category><![CDATA[euc-kr]]></category>
		<category><![CDATA[explorer]]></category>
		<category><![CDATA[GET]]></category>
		<category><![CDATA[http]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[POST]]></category>
		<category><![CDATA[Programing]]></category>
		<category><![CDATA[utf-8]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[wierd]]></category>

		<guid isPermaLink="false">http://b.mytears.org/?p=1848</guid>
		<description><![CDATA[<p>며칠 전 &#8216;이해할 수 없는 Cafe24&#8216;라는 글을 썼었는데, 사실 문제는 cafe24가 아니었습니다. HTTP(Hyper text transfer protocol)로 페이지를 요청하기 위해서는 다음과 같은 방법을 사용합니다. </p>
<p>METHOD URI VERSION</p>
<p>많은 옵션이 붙을 수 있지만 이정도가 페이지를 요청하기 위한 기본 쿼리라고 생각하시면 됩니다. METHOD는 &#8216;GET&#8217;, &#8216;POST&#8217;, &#8216;HEAD&#8217;, &#8216;OPTION&#8217; 정도가 될 수 있겠고, URI는 PATH + QUERY STRING이라고 생각하시면 되겠습니다.</p>
<p>자 그럼 ...</p>
<p><a href='http://b.mytears.org/2009/03/1848'>Read the rest of this entry...</a></p>
<p><h3 style="clear:both;">Related Posts</h3><ul class="related_post"><li>3/16/2009 -- <a href="http://b.mytears.org/2009/03/1819" title="인터넷 뱅킹과 SSL&#8230; 변명은 이제 그만&#8230;">인터넷 뱅킹과 SSL&#8230; 변명은 이제 그만&#8230; (2)</a></li><li>9/5/2008 -- <a href="http://b.mytears.org/2008/09/669" title="매력적인 Internet Explorer 8 Beta2 의 개발툴">매력적인 Internet Explorer 8 Beta2 의 개발툴 (1)</a></li><li>10/25/2007 -- <a href="http://b.mytears.org/2007/10/610" title="오픈웹과 관련해서&#8230;">오픈웹과 관련해서&#8230; (4)</a></li><li>9/4/2006 -- <a href="http://b.mytears.org/2006/09/396" title="wordpress: korean trackback!">wordpress: korean trackback! (22)</a></li><li>1/25/2005 -- <a href="http://b.mytears.org/2005/01/101" title="컴퓨터 속의 한글">컴퓨터 속의 한글 (22)</a></li></ul></p><div style="width: 180px; margin-left: auto; margin-right: auto; margin-bottom: 30px; margin-top: 30px; ">
    <object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0' width='73' height='79' align='left' style="border-bottom: 1px solid #CFD4DA; border-right: 1px solid #CFD4DA;">
    <param name='allowScriptAccess' value='always'/>
    <param name='movie' value='http://www.mixsh.com/widget/mixup/loader.html?muid=52225&guid=http%3A%2F%2Fb.mytears.org%2F%3Fp%3D1848&rdate=2009-03-25+00%3A44%3A58&rawhtml=&skin=1&showhitcnt=1&platform=5'/>
    <param name='quality' value='high'/>
    <param name='wmode' value='window'/>
    <embed src='http://www.mixsh.com/widget/mixup/loader.html?muid=52225&guid=http%3A%2F%2Fb.mytears.org%2F%3Fp%3D1848&rdate=2009-03-25+00%3A44%3A58&rawhtml=&skin=1&showhitcnt=1&platform=5' quality='high' wmode='window' width='73' height='79' allowScriptAccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer'/>
    </object>
		</div>]]></description>
			<content:encoded><![CDATA[<p>며칠 전 &#8216;<a href='http://b.mytears.org/2009/03/1756'>이해할 수 없는 Cafe24</a>&#8216;라는 글을 썼었는데, 사실 문제는 cafe24가 아니었습니다. HTTP(Hyper text transfer protocol)로 페이지를 요청하기 위해서는 다음과 같은 방법을 사용합니다. </p>
<p><code>METHOD URI VERSION</code></p>
<p>많은 옵션이 붙을 수 있지만 이정도가 페이지를 요청하기 위한 기본 쿼리라고 생각하시면 됩니다. METHOD는 &#8216;GET&#8217;, &#8216;POST&#8217;, &#8216;HEAD&#8217;, &#8216;OPTION&#8217; 정도가 될 수 있겠고, URI는 PATH + QUERY STRING이라고 생각하시면 되겠습니다.</p>
<p><span id="more-1848"></span>자 그럼 이걸 응용해 봅시다.</p>
<p><code>GET /index.php HTTP/1.1</code></p>
<p>위 코드는 /index.php 페이지를 HTTP/1.1 프로토콜을 사용해서 호출하겠다는 얘기입니다. 여기에 값을 넘겨주려면 QUERY STRING을 사용하면 됩니다.</p>
<p>아래와 같이 var1이란 변수에 1234, var2란 변수에 2345란 값을 담아서 페이지를 호출해봅시다.</p>
<p><code>GET /index.php?var1=1234&#038;var2=2345 HTTP/1.1</code></p>
<p>간단하죠. 단 URI의 길이에는 제약이 있기 때문에 이런 방식을 사용할 경우 긴 데이터를 넘겨줄 순 없습니다.</p>
<p>긴 데이터를 넘겨줄 때는 POST를 사용하게 되는데요. POST를 사용해서 값을 넘겨줄 때는 아래와 같은 코드를 사용하게 됩니다.</p>
<p><code>POST /index.php HTTP/1.1
Content-type: application/x-www-form-urlencoded
Content-length: 19
var1=1234&#038;var2=2345</code></p>
<p>Content-length는 넘겨줄 값의 길이를 의미합니다. 간단하죠. 뭐하튼 값을 넘겨주는 데는 GET과 POST 방식을 사용할 수 있고, GET 방식에서는 값을 URI에 붙여서 보내준다는 얘기를 하고 싶었습니다.</p>
<p>그런데 브라우져마다 GET 방식으로 값을 넘겨줄 때 사용하는 인코딩이 동일하지가 않네요. 예전에 &#8216;<a href='http://b.mytears.org/2005/03/136'>웹 서비스와 UTF-8</a>&#8216;이란 글에 적어놨듯이 RFC2718에서는 URI를 UTF-8로 인코딩할 것을 권고하고 있습니다. </p>
<p>그렇다면</p>
<ol>
<li>euc-kr로 인코딩된 페이지에서 다른 페이지로 값을 GET 방식을 사용해서 넘겨준다면 어떤 인코딩을 사용해야할까요?</li>
<li>utf-8로 인코딩된 페이지에서 다른 페이지로 값을 GET 방식을 사용해서 넘겨준다면 어떤 인코딩을 사용해야할까요?</li>
<li>만약 url에 직접 query string을 붙여서 페이지를 요청할 경우에는 어떤 인코딩을 사용해야할까요?</li>
</ol>
<p>URL을 정의하고 있는 <a href='http://www.ietf.org/rfc/rfc2396.txt'>RFC2396</a>에서는 URI를 PATH+QUERY 로 정의하고 있고, 이를 확장한 <a href='http://www.ietf.org/rfc/rfc2718.txt'>RFC2718</a>에서 URI를 UTF-8로 인코딩하자고 했으니 위의 모든 경우에서 URI는 utf-8로 인코딩되어야 맞습니다. (단 1번의 경우에는 %인코딩을 사용해서 값을 Escape시켜줘야겠죠.)</p>
<p>하지만 재앙의 근원 Internet explorer에서는 3번과 같은 상황일 때 query string을 로컬 인코딩으로 인코딩해버립니다. <sup>[1]</sup> ajax를 사용할 때 생기는 문제에 비교하면 이 정도는 애교입니다.</p>
<ol>
<li>utf-8 페이지에서 ajax + get으로 값을 전송합니다. 어떤 인코딩으로 값이 전송될까요?</li>
<li>euc-kr 페이지에서 ajax + get으로 값을 전송합니다. 어떤 인코딩으로 값이 전송될까요?</li>
<li>utf-8 페이지에서 ajax + post로 값을 전송합니다. 어떤 인코딩으로 값이 전송될까요?</li>
<li>euc-kr 페이지에서 ajax + post로 값을 전송합니다. 어떤 인코딩으로 값이 전송될까요?</li>
</ol>
<p>3, 4번의 경우 Internet explorer를 쓰건 safari, firefox등을 쓰건 모두 utf-8로 값이 전송됩니다. (이유는 묻지 마세요. 안찾아봤습니다.) 2번의 경우는 모든 경우에 euc-kr로 값이 전송되구요.</p>
<p>하지만 1번의 경우 분명 utf-8로 값이 전송되어야 할 것 같지만 Internet explorer는 euc-kr로 값을 전송합니다. 상식적으로도 이해가 가질 않지만 그렇게 동작하고 있습니다.</p>
<p>덕분에 utf-8로 값이 넘어왔다고 가정한 프로그램은 오동작을 하게 될 수 밖에 없습니다.  전 정말 Internet explorer를 이해할 수가 없습니다.</p>
<p>상식이 통하는 세상에 살고 싶습니다. Internet explorer 노력하세요.
<ol class="footnotes">
<li id="footnote_0_1848" class="footnote">lastmind님이 포스팅하신 &#8216;<a href='http://lastmind.net/blog/2006/12/on-encoding-uri-with-nonascii-characters.html'>On encoding uri with nonascii characters</a>&#8216;에 따르면 Internet explorer에서는 PATH는 utf-8로 (혹은 %인코딩으로) 인코딩하지만 Query string에 대해서는 시스템의 local encoding, 즉 한글 윈도우라면 euc-kr을 사용한다고 하네요.</p>
<p>그렇다면 영문판 윈도우에서는 어떤 결과가 나올지 궁금하네요.</li>
</ol><div style="width: 180px; margin-left: auto; margin-right: auto; margin-bottom: 30px; margin-top: 30px; ">
    <object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0' width='73' height='79' align='left' style="border-bottom: 1px solid #CFD4DA; border-right: 1px solid #CFD4DA;">
    <param name='allowScriptAccess' value='always'/>
    <param name='movie' value='http://www.mixsh.com/widget/mixup/loader.html?muid=52225&guid=http%3A%2F%2Fb.mytears.org%2F%3Fp%3D1848&rdate=2009-03-25+00%3A44%3A58&rawhtml=&skin=1&showhitcnt=1&platform=5'/>
    <param name='quality' value='high'/>
    <param name='wmode' value='window'/>
    <embed src='http://www.mixsh.com/widget/mixup/loader.html?muid=52225&guid=http%3A%2F%2Fb.mytears.org%2F%3Fp%3D1848&rdate=2009-03-25+00%3A44%3A58&rawhtml=&skin=1&showhitcnt=1&platform=5' quality='high' wmode='window' width='73' height='79' allowScriptAccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer'/>
    </object>
		</div><h3 style="clear:both;">Related Posts</h3><ul class="related_post"><li>3/16/2009 -- <a href="http://b.mytears.org/2009/03/1819" title="인터넷 뱅킹과 SSL&#8230; 변명은 이제 그만&#8230;">인터넷 뱅킹과 SSL&#8230; 변명은 이제 그만&#8230; (2)</a></li><li>9/5/2008 -- <a href="http://b.mytears.org/2008/09/669" title="매력적인 Internet Explorer 8 Beta2 의 개발툴">매력적인 Internet Explorer 8 Beta2 의 개발툴 (1)</a></li><li>10/25/2007 -- <a href="http://b.mytears.org/2007/10/610" title="오픈웹과 관련해서&#8230;">오픈웹과 관련해서&#8230; (4)</a></li><li>9/4/2006 -- <a href="http://b.mytears.org/2006/09/396" title="wordpress: korean trackback!">wordpress: korean trackback! (22)</a></li><li>1/25/2005 -- <a href="http://b.mytears.org/2005/01/101" title="컴퓨터 속의 한글">컴퓨터 속의 한글 (22)</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://b.mytears.org/2009/03/1848/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>NDSL의 재발견!</title>
		<link>http://b.mytears.org/2009/03/1732</link>
		<comments>http://b.mytears.org/2009/03/1732#comments</comments>
		<pubDate>Mon, 09 Mar 2009 04:58:45 +0000</pubDate>
		<dc:creator>정태영</dc:creator>
				<category><![CDATA[Tae-young]]></category>
		<category><![CDATA[challenge]]></category>
		<category><![CDATA[Embedded]]></category>
		<category><![CDATA[homebrew]]></category>
		<category><![CDATA[libnds]]></category>
		<category><![CDATA[NDSL]]></category>
		<category><![CDATA[OpenSource]]></category>
		<category><![CDATA[palib]]></category>
		<category><![CDATA[Programing]]></category>

		<guid isPermaLink="false">http://b.mytears.org/?p=1732</guid>
		<description><![CDATA[<p>요 며칠 신나게 웹서핑질을 하다가 새롭게 도전해볼만한 과제를 찾았습니다. NDSL은 ARM7과 ARM9의 듀얼 프로세서로 구성되며 libnds라는 오픈소스 라이브러리가 존재하더라구요. 단순한 API만으로 부족함을 느끼는 사람을 위해 palib 같은 라이브러리들도 나와있구요.</p>
<p>어떻게 보면 ARM 입문용으로 이만큼 좋은 키트가 없다고 생각합니다. 조이패드, 터치패드, 두 개의 LCD 뿐만 아니라 Wi-fi까지 포함되어 있으면서 10만원 중반대로 낮은 가격대를 형성하고 있으니까요. 그 뿐만이 ...</p>
<p><a href='http://b.mytears.org/2009/03/1732'>Read the rest of this entry...</a></p>
<p><h3 style="clear:both;">Related Posts</h3><ul class="related_post"><li>4/9/2009 -- <a href="http://b.mytears.org/2009/04/1912" title="제로보드 XE 관련 약간의 해명&#8230;">제로보드 XE 관련 약간의 해명&#8230; (1)</a></li><li>6/23/2008 -- <a href="http://b.mytears.org/2008/06/650" title="지뢰찾기 프로그램">지뢰찾기 프로그램 (0)</a></li><li>4/4/2010 -- <a href="http://b.mytears.org/2010/04/2192" title="지멋대로의 영어를 더 자주 볼 수 있었음 좋겠습니다.">지멋대로의 영어를 더 자주 볼 수 있었음 좋겠습니다. (5)</a></li><li>12/15/2009 -- <a href="http://b.mytears.org/2009/12/2105" title="MySQL의 라이센스 모델이 가지는 의미는? MySQL은 결국 죽임을 당할 것인가? ">MySQL의 라이센스 모델이 가지는 의미는? MySQL은 결국 죽임을 당할 것인가?  (0)</a></li><li>8/25/2009 -- <a href="http://b.mytears.org/2009/08/2074" title="사라져가는 오픈소스 커뮤니티?">사라져가는 오픈소스 커뮤니티? (7)</a></li></ul></p><div style="width: 180px; margin-left: auto; margin-right: auto; margin-bottom: 30px; margin-top: 30px; ">
    <object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0' width='73' height='79' align='left' style="border-bottom: 1px solid #CFD4DA; border-right: 1px solid #CFD4DA;">
    <param name='allowScriptAccess' value='always'/>
    <param name='movie' value='http://www.mixsh.com/widget/mixup/loader.html?muid=52225&guid=http%3A%2F%2Fb.mytears.org%2F%3Fp%3D1732&rdate=2009-03-09+13%3A58%3A45&rawhtml=&skin=1&showhitcnt=1&platform=5'/>
    <param name='quality' value='high'/>
    <param name='wmode' value='window'/>
    <embed src='http://www.mixsh.com/widget/mixup/loader.html?muid=52225&guid=http%3A%2F%2Fb.mytears.org%2F%3Fp%3D1732&rdate=2009-03-09+13%3A58%3A45&rawhtml=&skin=1&showhitcnt=1&platform=5' quality='high' wmode='window' width='73' height='79' allowScriptAccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer'/>
    </object>
		</div>]]></description>
			<content:encoded><![CDATA[<p>요 며칠 신나게 웹서핑질을 하다가 새롭게 도전해볼만한 과제를 찾았습니다. NDSL은 ARM7과 ARM9의 듀얼 프로세서로 구성되며 <a href='http://devkitpro.org/'>libnds</a>라는 오픈소스 라이브러리가 존재하더라구요. 단순한 API만으로 부족함을 느끼는 사람을 위해 <a href='http://www.palib.info/wiki/doku.php '>palib</a> 같은 라이브러리들도 나와있구요.</p>
<p><span id="more-1732"></span>어떻게 보면 ARM 입문용으로 이만큼 좋은 키트가 없다고 생각합니다. 조이패드, 터치패드, 두 개의 LCD 뿐만 아니라 Wi-fi까지 포함되어 있으면서 10만원 중반대로 낮은 가격대를 형성하고 있으니까요. 그 뿐만이 아닙니다. OpenGL까지 사용이 가능하기 때문에 그래픽 API를 새로 공부할 필요도 없어요. </p>
<p>부가적으로(?) 게임 기능까지 있으니 더 말할 필요가 없겠죠. </p>
<p>사용가능한 메모리가 4메가로 제약되어 있다는 점은 조금 아쉽지만 union질 좀 해주면 어떻게 되겠죠. 후훗!</p>
<p>목표는 SNES9x 포팅인데, 유닉스용은 메모리가 16메가 이상이 필요하다고 나와있는 걸 보고 조금 좌절 중입니다. 화면 크기가 256*192 라서 SNES9x의 저해상도 모드보다 세로로 30픽셀정도 작은 문제도 있는데, openGL을 지원한다고 하니 텍스쳐를 사용해서 리사이즈 되도록 하면 될 것 같아요.</p>
<p>GUI와 코드가 완전히 분리되어 있기 때문에 포팅에 크게 손이 가진 않을 것 같더군요.</p>
<p>만약 다음 학기에 강의를 맡게 되면 이런 걸로 수업을 개설해보면 어떨까 싶어요. 뭐 NDSL이 없더라도 에뮬레이터들이 잘 나와있고, devkitpro를 비쥬얼 스튜디오와 연동시킬 수도 있으니 학생들이 접근하는 데도 어렵지 않을 것 같고&#8230;</p>
<p>저도 학부 때 들었던 수업 중에 openGL로 게임을 만들게 시켰던 과목이 제일 기억에 많이 남더라구요. -_-a </p>
<p>사실 Embedded 개발이라고 해봐야 tftp 나 nfs 를 사용해서 파일을 옮기고 결과를 serial terminal로 확인해야 한다는 점을 제외하면 윈도우에서 개발을 할 때와 크게 차이가 없자나요. 어떻게 보면 이것도 임베디드 실습이라고도 생각해볼 수 있겠네요. tftp, nfs 대신 micro sd를 사용하고, 시리얼 터미널 대신 문쉘을!!</p>
<p>덧: NDSi 나오면 그것도 하나 질러줄까봐요. -_-! 카메라까지 달려있으면 가지고 놀기 정말 좋아질 거 같은데&#8230;</p><div style="width: 180px; margin-left: auto; margin-right: auto; margin-bottom: 30px; margin-top: 30px; ">
    <object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0' width='73' height='79' align='left' style="border-bottom: 1px solid #CFD4DA; border-right: 1px solid #CFD4DA;">
    <param name='allowScriptAccess' value='always'/>
    <param name='movie' value='http://www.mixsh.com/widget/mixup/loader.html?muid=52225&guid=http%3A%2F%2Fb.mytears.org%2F%3Fp%3D1732&rdate=2009-03-09+13%3A58%3A45&rawhtml=&skin=1&showhitcnt=1&platform=5'/>
    <param name='quality' value='high'/>
    <param name='wmode' value='window'/>
    <embed src='http://www.mixsh.com/widget/mixup/loader.html?muid=52225&guid=http%3A%2F%2Fb.mytears.org%2F%3Fp%3D1732&rdate=2009-03-09+13%3A58%3A45&rawhtml=&skin=1&showhitcnt=1&platform=5' quality='high' wmode='window' width='73' height='79' allowScriptAccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer'/>
    </object>
		</div><h3 style="clear:both;">Related Posts</h3><ul class="related_post"><li>4/9/2009 -- <a href="http://b.mytears.org/2009/04/1912" title="제로보드 XE 관련 약간의 해명&#8230;">제로보드 XE 관련 약간의 해명&#8230; (1)</a></li><li>6/23/2008 -- <a href="http://b.mytears.org/2008/06/650" title="지뢰찾기 프로그램">지뢰찾기 프로그램 (0)</a></li><li>4/4/2010 -- <a href="http://b.mytears.org/2010/04/2192" title="지멋대로의 영어를 더 자주 볼 수 있었음 좋겠습니다.">지멋대로의 영어를 더 자주 볼 수 있었음 좋겠습니다. (5)</a></li><li>12/15/2009 -- <a href="http://b.mytears.org/2009/12/2105" title="MySQL의 라이센스 모델이 가지는 의미는? MySQL은 결국 죽임을 당할 것인가? ">MySQL의 라이센스 모델이 가지는 의미는? MySQL은 결국 죽임을 당할 것인가?  (0)</a></li><li>8/25/2009 -- <a href="http://b.mytears.org/2009/08/2074" title="사라져가는 오픈소스 커뮤니티?">사라져가는 오픈소스 커뮤니티? (7)</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://b.mytears.org/2009/03/1732/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>지뢰찾기 프로그램</title>
		<link>http://b.mytears.org/2008/06/650</link>
		<comments>http://b.mytears.org/2008/06/650#comments</comments>
		<pubDate>Sun, 22 Jun 2008 22:19:24 +0000</pubDate>
		<dc:creator>정태영</dc:creator>
				<category><![CDATA[Tae-young]]></category>
		<category><![CDATA[mine]]></category>
		<category><![CDATA[OpenSource]]></category>
		<category><![CDATA[Programing]]></category>
		<category><![CDATA[Project]]></category>
		<category><![CDATA[지뢰]]></category>
		<category><![CDATA[지뢰찾기]]></category>
		<category><![CDATA[프로그래밍]]></category>

		<guid isPermaLink="false">http://b.mytears.org/2008/06/650</guid>
		<description><![CDATA[<p>지난 주에는 SoC 아카데미에 잡혀있어야 했는데, 인터넷도 안되고 깔려있는 프로그램도 몇 가지 없어서 너무너무 심심하더군요. 흑;; 결국 지뢰찾기에 매진하게 되었고, 달인의 경지에 오를려는 찰나! &#8216;이 정도는 나도 만들 수 있겠다!&#8217; 란 생각이 들었습니다.</p>
<p>바로 Visual Studio 를 실행시키고 -_-; 한 두 시간 정도 뚝딱뚝딱 거린 끝에 결국 콘솔용 지뢰찾기를 완성하기에 이르렀습니다. GUI 버젼으로도 만들어볼까 하는 생각이 ...</p>
<p><a href='http://b.mytears.org/2008/06/650'>Read the rest of this entry...</a></p>
<p><h3 style="clear:both;">Related Posts</h3><ul class="related_post"><li>4/9/2009 -- <a href="http://b.mytears.org/2009/04/1912" title="제로보드 XE 관련 약간의 해명&#8230;">제로보드 XE 관련 약간의 해명&#8230; (1)</a></li><li>3/9/2009 -- <a href="http://b.mytears.org/2009/03/1732" title="NDSL의 재발견!">NDSL의 재발견! (7)</a></li><li>8/2/2008 -- <a href="http://b.mytears.org/2008/08/662" title="YUVPlayer 업데이트&#8230;">YUVPlayer 업데이트&#8230; (0)</a></li><li>7/15/2007 -- <a href="http://b.mytears.org/2007/07/560" title="소스 공개: yuvplayer">소스 공개: yuvplayer (4)</a></li><li>6/9/2007 -- <a href="http://b.mytears.org/2007/06/544" title="YUVplayer for MS Windows">YUVplayer for MS Windows (6)</a></li></ul></p><div style="width: 180px; margin-left: auto; margin-right: auto; margin-bottom: 30px; margin-top: 30px; ">
    <object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0' width='73' height='79' align='left' style="border-bottom: 1px solid #CFD4DA; border-right: 1px solid #CFD4DA;">
    <param name='allowScriptAccess' value='always'/>
    <param name='movie' value='http://www.mixsh.com/widget/mixup/loader.html?muid=52225&guid=http%3A%2F%2Fb.mytears.org%2F2008%2F06%2F650&rdate=2008-06-23+07%3A19%3A24&rawhtml=&skin=1&showhitcnt=1&platform=5'/>
    <param name='quality' value='high'/>
    <param name='wmode' value='window'/>
    <embed src='http://www.mixsh.com/widget/mixup/loader.html?muid=52225&guid=http%3A%2F%2Fb.mytears.org%2F2008%2F06%2F650&rdate=2008-06-23+07%3A19%3A24&rawhtml=&skin=1&showhitcnt=1&platform=5' quality='high' wmode='window' width='73' height='79' allowScriptAccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer'/>
    </object>
		</div>]]></description>
			<content:encoded><![CDATA[<p>지난 주에는 SoC 아카데미에 잡혀있어야 했는데, 인터넷도 안되고 깔려있는 프로그램도 몇 가지 없어서 너무너무 심심하더군요. 흑;; 결국 지뢰찾기에 매진하게 되었고, 달인의 경지에 오를려는 찰나! &#8216;이 정도는 나도 만들 수 있겠다!&#8217; 란 생각이 들었습니다.</p>
<p>바로 Visual Studio 를 실행시키고 -_-; 한 두 시간 정도 뚝딱뚝딱 거린 끝에 결국 콘솔용 지뢰찾기를 완성하기에 이르렀습니다. GUI 버젼으로도 만들어볼까 하는 생각이 있어서 게임 코어와 인터렉션 부분을 분리시켜 놓기는 했는데 구차니즘 말기인 요새 상황으로 볼때 GUI 버젼이 정말 나올까 하는 걱정이 조금 &#8211;;;</p>
<p>코드는 아래 url 로 가시면 볼 수 있고, Visual Studio 와 gcc (linux/Windows) 에서 정상적으로 컴파일되는 것을 확인했습니다. :) standard c function 을 제외하곤 별 다르게 사용한 게 없어서 아마 다른 플랫폼에서도 잘 실행될거라 생각합니다. </p>
<p><a href='http://trac.unfix.net/browser/snippet/console_mine'>http://trac.unfix.net/browser/snippet/console_mine</a></p>
<p>p.s) 콘솔에 찍기에는 9&#215;9 사이즈 이상은 너무나도 커져버려서 사이즈를 고정해놨는데 gui 로 옮기게 되면 저 부분에 관련해서 좀 업데이트를 해야겠네요.</p><div style="width: 180px; margin-left: auto; margin-right: auto; margin-bottom: 30px; margin-top: 30px; ">
    <object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0' width='73' height='79' align='left' style="border-bottom: 1px solid #CFD4DA; border-right: 1px solid #CFD4DA;">
    <param name='allowScriptAccess' value='always'/>
    <param name='movie' value='http://www.mixsh.com/widget/mixup/loader.html?muid=52225&guid=http%3A%2F%2Fb.mytears.org%2F2008%2F06%2F650&rdate=2008-06-23+07%3A19%3A24&rawhtml=&skin=1&showhitcnt=1&platform=5'/>
    <param name='quality' value='high'/>
    <param name='wmode' value='window'/>
    <embed src='http://www.mixsh.com/widget/mixup/loader.html?muid=52225&guid=http%3A%2F%2Fb.mytears.org%2F2008%2F06%2F650&rdate=2008-06-23+07%3A19%3A24&rawhtml=&skin=1&showhitcnt=1&platform=5' quality='high' wmode='window' width='73' height='79' allowScriptAccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer'/>
    </object>
		</div><h3 style="clear:both;">Related Posts</h3><ul class="related_post"><li>4/9/2009 -- <a href="http://b.mytears.org/2009/04/1912" title="제로보드 XE 관련 약간의 해명&#8230;">제로보드 XE 관련 약간의 해명&#8230; (1)</a></li><li>3/9/2009 -- <a href="http://b.mytears.org/2009/03/1732" title="NDSL의 재발견!">NDSL의 재발견! (7)</a></li><li>8/2/2008 -- <a href="http://b.mytears.org/2008/08/662" title="YUVPlayer 업데이트&#8230;">YUVPlayer 업데이트&#8230; (0)</a></li><li>7/15/2007 -- <a href="http://b.mytears.org/2007/07/560" title="소스 공개: yuvplayer">소스 공개: yuvplayer (4)</a></li><li>6/9/2007 -- <a href="http://b.mytears.org/2007/06/544" title="YUVplayer for MS Windows">YUVplayer for MS Windows (6)</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://b.mytears.org/2008/06/650/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>sql injection 을 피하기위한 간단한 방법…</title>
		<link>http://b.mytears.org/2007/10/609</link>
		<comments>http://b.mytears.org/2007/10/609#comments</comments>
		<pubDate>Wed, 24 Oct 2007 13:48:43 +0000</pubDate>
		<dc:creator>정태영</dc:creator>
				<category><![CDATA[Computer]]></category>
		<category><![CDATA[OpenSource]]></category>
		<category><![CDATA[array_map]]></category>
		<category><![CDATA[avoid]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[mysql_real_escape_string]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Programing]]></category>
		<category><![CDATA[secure]]></category>
		<category><![CDATA[sql injection]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://b.mytears.org/2007/10/609</guid>
		<description><![CDATA[<p>sql injection 을 피하기 위해 single quote 를 escape 시켜주는 코드를 작성해야할 필요가 있었는데, 매번 하나하나에 대해 mysql_real_escape_string 을 호출해주는 건 너무나도 번거로웠다. 뭔가 간단하게 처리할 방법이 없을까 하고 찾아봤더니 왠걸! array_map 이라는 마법의 함수를 발견할 수 있었다.</p>
<p></p>
<p>?View Code PHPfunction stripslashes_deep&#40;$var&#41;&#123;</p>
<p>    $var = is_array&#40;$var&#41;?</p>
<p>         ...</p>
<p><a href='http://b.mytears.org/2007/10/609'>Read the rest of this entry...</a></p>
<p><h3 style="clear:both;">Related Posts</h3><ul class="related_post"><li>11/15/2005 -- <a href="http://b.mytears.org/2005/11/293" title="나는 제로보드가 싫어요!!">나는 제로보드가 싫어요!! (5)</a></li><li>1/28/2009 -- <a href="http://b.mytears.org/2009/01/1228" title="번역: 한국의 홈브류 인터넷">번역: 한국의 홈브류 인터넷 (0)</a></li><li>1/28/2009 -- <a href="http://b.mytears.org/2009/01/1224" title="인터넷 뱅킹과 크로스 브라우징">인터넷 뱅킹과 크로스 브라우징 (2)</a></li><li>1/23/2009 -- <a href="http://b.mytears.org/2009/01/1192" title="Punbb update">Punbb update (0)</a></li><li>1/31/2008 -- <a href="http://b.mytears.org/2008/01/623" title="problem in fastcgi with apache">problem in fastcgi with apache (2)</a></li></ul></p><div style="width: 180px; margin-left: auto; margin-right: auto; margin-bottom: 30px; margin-top: 30px; ">
    <object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0' width='73' height='79' align='left' style="border-bottom: 1px solid #CFD4DA; border-right: 1px solid #CFD4DA;">
    <param name='allowScriptAccess' value='always'/>
    <param name='movie' value='http://www.mixsh.com/widget/mixup/loader.html?muid=52225&guid=http%3A%2F%2Fb.mytears.org%2F2007%2F10%2F609&rdate=2007-10-24+22%3A48%3A43&rawhtml=&skin=1&showhitcnt=1&platform=5'/>
    <param name='quality' value='high'/>
    <param name='wmode' value='window'/>
    <embed src='http://www.mixsh.com/widget/mixup/loader.html?muid=52225&guid=http%3A%2F%2Fb.mytears.org%2F2007%2F10%2F609&rdate=2007-10-24+22%3A48%3A43&rawhtml=&skin=1&showhitcnt=1&platform=5' quality='high' wmode='window' width='73' height='79' allowScriptAccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer'/>
    </object>
		</div>]]></description>
			<content:encoded><![CDATA[<p>sql injection 을 피하기 위해 single quote 를 escape 시켜주는 코드를 작성해야할 필요가 있었는데, 매번 하나하나에 대해 mysql_real_escape_string 을 호출해주는 건 너무나도 번거로웠다. 뭔가 간단하게 처리할 방법이 없을까 하고 찾아봤더니 왠걸! array_map 이라는 마법의 함수를 발견할 수 있었다.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p609code2'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p6092"><td class="code" id="p609code2"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> stripslashes_deep<span style="color: #009900;">&#40;</span><span style="color: #000088;">$var</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$var</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/is_array"><span style="color: #990000;">is_array</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$var</span><span style="color: #009900;">&#41;</span>?
                  <a href="http://www.php.net/array_map"><span style="color: #990000;">array_map</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'stripslashes_deep'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$var</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span>
                  <a href="http://www.php.net/stripslashes"><span style="color: #990000;">stripslashes</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$var</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #b1b100;">return</span> <span style="color: #000088;">$var</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> mysql_real_escape_string_deep<span style="color: #009900;">&#40;</span><span style="color: #000088;">$var</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$var</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/is_array"><span style="color: #990000;">is_array</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$var</span><span style="color: #009900;">&#41;</span>?
                  <a href="http://www.php.net/array_map"><span style="color: #990000;">array_map</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'mysql_real_escape_string_deep'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$var</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span>
                  <a href="http://www.php.net/mysql_real_escape_string"><span style="color: #990000;">mysql_real_escape_string</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$var</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #b1b100;">return</span> <span style="color: #000088;">$var</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <a href="http://www.php.net/get_magic_quotes_gpc"><span style="color: #990000;">get_magic_quotes_gpc</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <a href="http://www.php.net/is_array"><span style="color: #990000;">is_array</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>
        <span style="color: #000088;">$_POST</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/array_map"><span style="color: #990000;">array_map</span></a><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'stripslashes_deep'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$_POST</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <a href="http://www.php.net/is_array"><span style="color: #990000;">is_array</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_GET</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>
        <span style="color: #000088;">$_GET</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/array_map"><span style="color: #990000;">array_map</span></a><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'stripslashes_deep'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$_GET</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <a href="http://www.php.net/is_array"><span style="color: #990000;">is_array</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>
    <span style="color: #000088;">$_POST</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/array_map"><span style="color: #990000;">array_map</span></a><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'mysql_real_escape_string_deep'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$_POST</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <a href="http://www.php.net/is_array"><span style="color: #990000;">is_array</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_GET</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>
    <span style="color: #000088;">$_GET</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/array_map"><span style="color: #990000;">array_map</span></a><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'mysql_real_escape_string_deep'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$_GET</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>common function 들을 정의해놓은 파일 맨 아래 저 코드를 삽입해버리니 sql injection 따위 이제 두려워할 필요가 없어졌다. 움하하핫!!</p>
<p>p.s) 그냥 array_map 에 stripslashes 나 mysql_real_escape_string 을 사용하게 되면 array 가 넘어온 경우 문제가 생길 수 있어서 약간 수정을 했습니다.</p><div style="width: 180px; margin-left: auto; margin-right: auto; margin-bottom: 30px; margin-top: 30px; ">
    <object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0' width='73' height='79' align='left' style="border-bottom: 1px solid #CFD4DA; border-right: 1px solid #CFD4DA;">
    <param name='allowScriptAccess' value='always'/>
    <param name='movie' value='http://www.mixsh.com/widget/mixup/loader.html?muid=52225&guid=http%3A%2F%2Fb.mytears.org%2F2007%2F10%2F609&rdate=2007-10-24+22%3A48%3A43&rawhtml=&skin=1&showhitcnt=1&platform=5'/>
    <param name='quality' value='high'/>
    <param name='wmode' value='window'/>
    <embed src='http://www.mixsh.com/widget/mixup/loader.html?muid=52225&guid=http%3A%2F%2Fb.mytears.org%2F2007%2F10%2F609&rdate=2007-10-24+22%3A48%3A43&rawhtml=&skin=1&showhitcnt=1&platform=5' quality='high' wmode='window' width='73' height='79' allowScriptAccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer'/>
    </object>
		</div><h3 style="clear:both;">Related Posts</h3><ul class="related_post"><li>11/15/2005 -- <a href="http://b.mytears.org/2005/11/293" title="나는 제로보드가 싫어요!!">나는 제로보드가 싫어요!! (5)</a></li><li>1/28/2009 -- <a href="http://b.mytears.org/2009/01/1228" title="번역: 한국의 홈브류 인터넷">번역: 한국의 홈브류 인터넷 (0)</a></li><li>1/28/2009 -- <a href="http://b.mytears.org/2009/01/1224" title="인터넷 뱅킹과 크로스 브라우징">인터넷 뱅킹과 크로스 브라우징 (2)</a></li><li>1/23/2009 -- <a href="http://b.mytears.org/2009/01/1192" title="Punbb update">Punbb update (0)</a></li><li>1/31/2008 -- <a href="http://b.mytears.org/2008/01/623" title="problem in fastcgi with apache">problem in fastcgi with apache (2)</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://b.mytears.org/2007/10/609/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>CG: Perspective Projection</title>
		<link>http://b.mytears.org/2007/10/599</link>
		<comments>http://b.mytears.org/2007/10/599#comments</comments>
		<pubDate>Sat, 13 Oct 2007 17:40:06 +0000</pubDate>
		<dc:creator>정태영</dc:creator>
				<category><![CDATA[Computer]]></category>
		<category><![CDATA[School]]></category>
		<category><![CDATA[Tae-young]]></category>
		<category><![CDATA[3D]]></category>
		<category><![CDATA[cg]]></category>
		<category><![CDATA[coordinate]]></category>
		<category><![CDATA[gauss elimination]]></category>
		<category><![CDATA[graphic]]></category>
		<category><![CDATA[HCI]]></category>
		<category><![CDATA[hw]]></category>
		<category><![CDATA[matrix]]></category>
		<category><![CDATA[perspective]]></category>
		<category><![CDATA[Programing]]></category>
		<category><![CDATA[projection]]></category>
		<category><![CDATA[theory]]></category>
		<category><![CDATA[warping]]></category>

		<guid isPermaLink="false">http://b.mytears.org/2007/10/599</guid>
		<description><![CDATA[<p>HCI 과제 덕에 심심찮게 프로그래밍을 하게 되네요. 첫 과제 였던 3D rotation 관련을 구현하는 것도 상당히 흥미로웠지만, 두번째 과제인 Perspective Projection 를 구현하는 것은 정말 멋진 경험이었다고 생각합니다.</p>
<p>지난 며칠간 꽤나 재밌게 프로그래밍을 했던 관계로 블로그에도 살짝 정리해보는게 어떨까 하는 생각이 들었는데, 막상 쓸려니 내용이 잘 전해질지 의문이네요.</p>
<p>What is the Perspective Projection?</p>
<p>Perspective Projection 이란 아래의 왼쪽 ...</p>
<p><a href='http://b.mytears.org/2007/10/599'>Read the rest of this entry...</a></p>
<p><h3 style="clear:both;">Related Posts</h3><ul class="related_post"><li>10/16/2007 -- <a href="http://b.mytears.org/2007/10/600" title="CG: 3D Image Rotation">CG: 3D Image Rotation (2)</a></li><li>1/24/2009 -- <a href="http://b.mytears.org/2009/01/1211" title="Cairo test&#8230;">Cairo test&#8230; (0)</a></li><li>11/21/2008 -- <a href="http://b.mytears.org/2008/11/731" title="CG: dithering">CG: dithering (2)</a></li><li>11/13/2007 -- <a href="http://b.mytears.org/2007/11/615" title="CG: auto stitch">CG: auto stitch (1)</a></li><li>10/29/2007 -- <a href="http://b.mytears.org/2007/10/612" title="CG: gaussian blur">CG: gaussian blur (0)</a></li></ul></p><div style="width: 180px; margin-left: auto; margin-right: auto; margin-bottom: 30px; margin-top: 30px; ">
    <object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0' width='73' height='79' align='left' style="border-bottom: 1px solid #CFD4DA; border-right: 1px solid #CFD4DA;">
    <param name='allowScriptAccess' value='always'/>
    <param name='movie' value='http://www.mixsh.com/widget/mixup/loader.html?muid=52225&guid=http%3A%2F%2Fb.mytears.org%2F2007%2F10%2F599&rdate=2007-10-14+02%3A40%3A06&rawhtml=&skin=1&showhitcnt=1&platform=5'/>
    <param name='quality' value='high'/>
    <param name='wmode' value='window'/>
    <embed src='http://www.mixsh.com/widget/mixup/loader.html?muid=52225&guid=http%3A%2F%2Fb.mytears.org%2F2007%2F10%2F599&rdate=2007-10-14+02%3A40%3A06&rawhtml=&skin=1&showhitcnt=1&platform=5' quality='high' wmode='window' width='73' height='79' allowScriptAccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer'/>
    </object>
		</div>]]></description>
			<content:encoded><![CDATA[<p>HCI 과제 덕에 심심찮게 프로그래밍을 하게 되네요. 첫 과제 였던 3D rotation 관련을 구현하는 것도 상당히 흥미로웠지만, 두번째 과제인 Perspective Projection 를 구현하는 것은 정말 멋진 경험이었다고 생각합니다.</p>
<p>지난 며칠간 꽤나 재밌게 프로그래밍을 했던 관계로 블로그에도 살짝 정리해보는게 어떨까 하는 생각이 들었는데, 막상 쓸려니 내용이 잘 전해질지 의문이네요.</p>
<h3 id="toc-what-is-the-perspective-projection">What is the Perspective Projection?</h3>
<p>Perspective Projection 이란 아래의 왼쪽 이미지를 오른쪽 이미지 처럼 변화시키는 것을 얘기합니다. 꼭 저렇게 비뚜러진 이미지를 바로잡는것은 아니고, 이미지가 투영되는 면을 변화시키는 것이라고 생각하시면 됩니다.</p>
<p><img src='/wp-content/upload/perspective_ex.png' /></p>
<p>이해를 돕기 위해 wikipedia 에서 이미지를 하나 가져왔습니다. 아래 이미지의 연보라색 면이 상이 맺히는 곳이라고 할 때, perspective transform 은 그 보라색 면을 이동시킨 것 같은 효과를 주기 위해 사용합니다.</p>
<div style='width: 300px;' class='calign'><img src='/wp-content/upload/perspective_ex.jpg' /></div>
<h3 id="toc-how-to-get-a-projection-matrix">How to get a projection matrix.</h3>
<p>기본 적으로 Perspective Transform 을 위한 식은 다음과 같습니다.</p>
<div style='width: 193px;' class='calign'><img src='/wp-content/upload/perspective_mtx1.gif'  class='calign'/></div>
<p>homogenious coordinate 를 사용하고 있으니 x&#8217; 와 y&#8217; 에 관한 식은 아래와 같이 바꿔쓸 수 있습니다.</p>
<div style='width: 281px;' class='calign'><img src='/wp-content/upload/perspective_mtx2.gif' /></div>
<p>이를 정리하면 다음과 같은 꼴로 만들 수 있고,</p>
<div style='width: 233px;' class='calign'><img src='/wp-content/upload/perspective_mtx3.gif'  /></div>
<p>우리가 값을 알고 싶은 변수들은 a, b, c, d, e, f, g, h 이렇게 8 개이므로, (x, y) 와 그에 대응되는 (x&#8217;, y&#8217;) 쌍을 4개만 알고 있으면 projection matrix 를 구할 수 있습니다. 이를 구하기 위한 매트릭스는 아래와 같습니다.</p>
<div style='width: 428px;' class='calign'><img src='/wp-content/upload/perspective_mtx4.gif'  /></div>
<p>남은 건 8&#215;8 matrix 의 inverse matrix 를 구한 뒤 뒤 쪽의 매트릭스에 곱해주는 것 뿐이군요.</p>
<h3 id="toc-implementation-of-perspective-projection">Implementation of Perspective projection</h3>
<p>이제까지 Perspective Transform 을 위한 매트릭스에 대해 알아봤습니다. 이제는 실제 구현을 해보는 것만 남았네요. 위에서 알아봤듯이 Perspective matrix 를 구하려면 matrix multiplication 과 inverse 를 위한 인터페이스가 필요합니다.</p>
<p>matrix multiplication 의 경우 서로 곱할 수 있는 형식인지를 체크한 뒤 단순한 계산을 하면 되고, inverse 는 gauss elimination 을 이용 reduced row echelon form 으로 만들어주는 것을 통해 쉽게(?) 구해낼 수 있습니다.</p>
<p>위의 두 가지까지 구현했다면, 이제 warping 만을 구현하면 되겠습니다. 이 warping 은 크게 두가지 방법을 통해 구현할 수 있습니다.</p>
<h4 id="toc-forward-mapping">forward mapping</h4>
<p>forward mapping 은 말 그대로 src 의 x, y 좌표에 대하 dst 의 x&#8217;, y&#8217; 를 계산 한 뒤 값을 채워주는 방식입니다. 간단히 pseudo code 로 표현하면 다음과 같이 표현할 수 있겠네요.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p599code5'); return false;">View Code</a> C</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p5995"><td class="code" id="p599code5"><pre class="c" style="font-family:monospace;"><span style="color: #b1b100;">for</span><span style="color: #009900;">&#40;</span> y <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span> <span style="color: #339933;">;</span> y <span style="color: #339933;">&lt;</span> height <span style="color: #339933;">;</span> y<span style="color: #339933;">++</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">for</span><span style="color: #009900;">&#40;</span> x <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span> <span style="color: #339933;">;</span> x <span style="color: #339933;">&lt;</span> width <span style="color: #339933;">;</span> x<span style="color: #339933;">++</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        x<span style="color: #ff0000;">' = (ax+by+c) / (gx+hy+1);
        y'</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>dx<span style="color: #339933;">+</span>ey<span style="color: #339933;">+</span>f<span style="color: #009900;">&#41;</span> <span style="color: #339933;">/</span> <span style="color: #009900;">&#40;</span>gx<span style="color: #339933;">+</span>hy<span style="color: #339933;">+</span><span style="color: #0000dd;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        dst<span style="color: #009900;">&#91;</span>y<span style="color: #ff0000;">'][x'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> src<span style="color: #009900;">&#91;</span>y<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span>x<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>근데 막상 구현을 해놓고 보면 pixel 이 정수단위이기 때문에 아래와 같이 hole 이 발생하는 것을 확인할 수 있습니다.</p>
<p><img src='/wp-content/upload/test1_fwarping.png' /></p>
<h4 id="toc-backward-mapping">backward mapping</h4>
<p>위에서 얘기한 hole 을 방지하기 위한 방법 중 하나로 backward warping 이란 것이 있습니다. forward warping 에서 src 의 좌표를 기준으로 dst 의 좌표를 계산했다면, backward warping 에서는 dst 의 좌표를 기준으로 src 의 좌표를 계산하게 됩니다. </p>
<p>간단하게 pseudo code 로 표현하면 아래와 같이 되겠습니다.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p599code6'); return false;">View Code</a> C</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p5996"><td class="code" id="p599code6"><pre class="c" style="font-family:monospace;"><span style="color: #b1b100;">for</span><span style="color: #009900;">&#40;</span> y<span style="color: #ff0000;">' = 0 ; y'</span> <span style="color: #339933;">&lt;</span> height <span style="color: #339933;">;</span> y<span style="color: #ff0000;">'++ ){
    for( x'</span> <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span> <span style="color: #339933;">;</span> x<span style="color: #ff0000;">' &lt; width ; x'</span><span style="color: #339933;">++</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        x <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>ax<span style="color: #ff0000;">'+by'</span><span style="color: #339933;">+</span>c<span style="color: #009900;">&#41;</span> <span style="color: #339933;">/</span> <span style="color: #009900;">&#40;</span>gx<span style="color: #ff0000;">'+hy'</span><span style="color: #339933;">+</span><span style="color: #0000dd;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        y <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>dx<span style="color: #ff0000;">'+ey'</span><span style="color: #339933;">+</span>f<span style="color: #009900;">&#41;</span> <span style="color: #339933;">/</span> <span style="color: #009900;">&#40;</span>gx<span style="color: #ff0000;">'+hy'</span><span style="color: #339933;">+</span><span style="color: #0000dd;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        dst<span style="color: #009900;">&#91;</span>y<span style="color: #ff0000;">'][x'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> src<span style="color: #009900;">&#91;</span>y<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span>x<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>간단히 코드만 봐도 예상할 수 있겠지만 backward_warping 을 해주게 되면 hole 은 확실하게 없앨 수 있습니다. 결과 이미지는 아래와 같은데, 아주 깔끔한 결과가 나오지는 않았습니다.</p>
<p><img src='/wp-content/upload/test1_bwarping.png' /></p>
<h4 id="toc-forward-or-backward-warping-with-interpolation">forward (or backward) warping with interpolation</h4>
<p>forward warping 을 하게 되면 hole 이 생기게 되고, 단순한 backward warping 을 하게 되면 이미지의 화질 저하가 발생하게 되는데, interpolation 을 사용하게 되면 이를 조금 더 개선할 수 있습니다.</p>
<p>전 linear-interpolation 을 사용해보았는데, 설명하기는 복잡하니 관심있으신 분은 저 아래 첨부할 소스를 참고해보시면 좋겠습니다. 결과는 아래와 같이 나옵니다.</p>
<p>우선 interpolation 을 이용한 forward warping 입니다. 복잡하게 하기는 귀찮고 해서 대강 구현했더니, hole 이 줄기는 했지만 여전히 존재하고 있습니다.</p>
<p><img src='/wp-content/upload/test1_fwarping_i.png' /></p>
<p>다음은 backward warping 에 linear interpolation 을 적용한 결과입니다. hole 도 없고, 보기에 상당히 괜찮아진 것을 확인할 수 있습니다.</p>
<p><img src='/wp-content/upload/test1_bwarping_i.png' /></p>
<p>소스코드:</p>
<p><a href='http://trac.unfix.net/browser/snippet/image_projection/'>http://trac.unfix.net/bro...snippet/image_projection/</a></p>
<p>참고자료:</p>
<p><a href='http://en.wikipedia.org/wiki/Perspective_%28graphical%29'>http://en.wikipedia.org/w...rspective_%28graphical%29</a></p>
<p><a href='http://en.wikipedia.org/wiki/Gaussian_elimination'>http://en.wikipedia.org/wiki/Gaussian_elimination</a></p>
<p>p.s) 부동 소숫점 연산에서 x &#8211; x/x*x = 0 이라는 것이 보장되질 않더군요. 코드 한 줄 줄일려다가 디버깅을 30분동안 해야했습니다. -_ㅜ</code></p><div style="width: 180px; margin-left: auto; margin-right: auto; margin-bottom: 30px; margin-top: 30px; ">
    <object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0' width='73' height='79' align='left' style="border-bottom: 1px solid #CFD4DA; border-right: 1px solid #CFD4DA;">
    <param name='allowScriptAccess' value='always'/>
    <param name='movie' value='http://www.mixsh.com/widget/mixup/loader.html?muid=52225&guid=http%3A%2F%2Fb.mytears.org%2F2007%2F10%2F599&rdate=2007-10-14+02%3A40%3A06&rawhtml=&skin=1&showhitcnt=1&platform=5'/>
    <param name='quality' value='high'/>
    <param name='wmode' value='window'/>
    <embed src='http://www.mixsh.com/widget/mixup/loader.html?muid=52225&guid=http%3A%2F%2Fb.mytears.org%2F2007%2F10%2F599&rdate=2007-10-14+02%3A40%3A06&rawhtml=&skin=1&showhitcnt=1&platform=5' quality='high' wmode='window' width='73' height='79' allowScriptAccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer'/>
    </object>
		</div><h3 style="clear:both;">Related Posts</h3><ul class="related_post"><li>10/16/2007 -- <a href="http://b.mytears.org/2007/10/600" title="CG: 3D Image Rotation">CG: 3D Image Rotation (2)</a></li><li>1/24/2009 -- <a href="http://b.mytears.org/2009/01/1211" title="Cairo test&#8230;">Cairo test&#8230; (0)</a></li><li>11/21/2008 -- <a href="http://b.mytears.org/2008/11/731" title="CG: dithering">CG: dithering (2)</a></li><li>11/13/2007 -- <a href="http://b.mytears.org/2007/11/615" title="CG: auto stitch">CG: auto stitch (1)</a></li><li>10/29/2007 -- <a href="http://b.mytears.org/2007/10/612" title="CG: gaussian blur">CG: gaussian blur (0)</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://b.mytears.org/2007/10/599/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>OpenGL: texture vs glDrawPixels</title>
		<link>http://b.mytears.org/2007/06/542</link>
		<comments>http://b.mytears.org/2007/06/542#comments</comments>
		<pubDate>Mon, 04 Jun 2007 12:53:19 +0000</pubDate>
		<dc:creator>정태영</dc:creator>
				<category><![CDATA[Computer]]></category>
		<category><![CDATA[glDrawPixels]]></category>
		<category><![CDATA[glPixelZoom]]></category>
		<category><![CDATA[OpenGL]]></category>
		<category><![CDATA[Programing]]></category>
		<category><![CDATA[texture]]></category>

		<guid isPermaLink="false">http://b.mytears.org/2007/06/542</guid>
		<description><![CDATA[<p>openGL 을 사용해서 2D 이미지 데이타를 화면에 뿌려주는 방법은 대강 다음과 같이 세가지로 분류할 수 있는 것 같다.</p>
<p></p>
<p>glBegin(GL_POINTS); glColor3i(&#8230;);glVertex3d(x0,y0,0); &#8230;반복; glEnd();</p>
<p>texture 로 올려주고, 해당 texture 가 입혀진 quad 을 그려줌</p>
<p>glDrawPixels 를 이용</p>
<p></p>
<p>첫번째 방법이야 그냥 저렇게도 가능하다는거지 실제 저렇게 사용할 일은 없다고 생각되고, 실제 빠르게 화면에 2D 이미지를 그려주기 위해서는 2번째 방법이나 3번째 방법을 사용해야할텐데, 저 ...</p>
<p><a href='http://b.mytears.org/2007/06/542'>Read the rest of this entry...</a></p>
<p><h3 style="clear:both;">Related Posts</h3><ul class="related_post"><li>8/2/2008 -- <a href="http://b.mytears.org/2008/08/662" title="YUVPlayer 업데이트&#8230;">YUVPlayer 업데이트&#8230; (0)</a></li><li>6/4/2007 -- <a href="http://b.mytears.org/2007/06/541" title="내 첫 cocoa application: yuv player">내 첫 cocoa application: yuv player (5)</a></li><li>10/24/2007 -- <a href="http://b.mytears.org/2007/10/609" title="sql injection 을 피하기위한 간단한 방법&#8230;">sql injection 을 피하기위한 간단한 방법&#8230; (2)</a></li><li>10/16/2007 -- <a href="http://b.mytears.org/2007/10/600" title="CG: 3D Image Rotation">CG: 3D Image Rotation (2)</a></li><li>10/14/2007 -- <a href="http://b.mytears.org/2007/10/599" title="CG: Perspective Projection">CG: Perspective Projection (6)</a></li></ul></p><div style="width: 180px; margin-left: auto; margin-right: auto; margin-bottom: 30px; margin-top: 30px; ">
    <object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0' width='73' height='79' align='left' style="border-bottom: 1px solid #CFD4DA; border-right: 1px solid #CFD4DA;">
    <param name='allowScriptAccess' value='always'/>
    <param name='movie' value='http://www.mixsh.com/widget/mixup/loader.html?muid=52225&guid=http%3A%2F%2Fb.mytears.org%2F2007%2F06%2F542&rdate=2007-06-04+21%3A53%3A19&rawhtml=&skin=1&showhitcnt=1&platform=5'/>
    <param name='quality' value='high'/>
    <param name='wmode' value='window'/>
    <embed src='http://www.mixsh.com/widget/mixup/loader.html?muid=52225&guid=http%3A%2F%2Fb.mytears.org%2F2007%2F06%2F542&rdate=2007-06-04+21%3A53%3A19&rawhtml=&skin=1&showhitcnt=1&platform=5' quality='high' wmode='window' width='73' height='79' allowScriptAccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer'/>
    </object>
		</div>]]></description>
			<content:encoded><![CDATA[<p>openGL 을 사용해서 2D 이미지 데이타를 화면에 뿌려주는 방법은 대강 다음과 같이 세가지로 분류할 수 있는 것 같다.</p>
<ol>
<li>glBegin(GL_POINTS); glColor3i(&#8230;);glVertex3d(x0,y0,0); &#8230;반복; glEnd();</li>
<li>texture 로 올려주고, 해당 texture 가 입혀진 quad 을 그려줌</li>
<li>glDrawPixels 를 이용</li>
</ol>
<p>첫번째 방법이야 그냥 저렇게도 가능하다는거지 실제 저렇게 사용할 일은 없다고 생각되고, 실제 빠르게 화면에 2D 이미지를 그려주기 위해서는 2번째 방법이나 3번째 방법을 사용해야할텐데, 저 중에 어떤 걸 사용하는게 더 좋은 방법인지 확신이 들질 않는다.</p>
<p>우선 화면이 확대되었을 때 texture 를 사용할 경우 GL_LINEAR 등의 기본으로 제공되는 interpolation method 들이 있기 때문에 (약간 Blur 된 결과일지는 모르지만) 더 좋은 품질의 이미지를 얻을 수 있겠고, 화면이 다시 그려질 일이 있을 때 texture 데이타가 다시 전송될 필요가 없다는 장점이 있는 듯 싶지만, (texture 로 등록할 때 이미지 데이타는 비디오 메모리로 옮겨진다.) width 나 height 가 2^x 형태로 표현되어야 한다는 제약이 있다. 이게 만약 이미지가 크지 않다면 큰 문제가 되지 않겠지만 만약 HD Sequence 라면? 1920&#215;1080 을 표현하기 위해 2048&#215;2048 = 4MB 를 사용해야 하므로 반 정도의 공간이  낭비될 수밖에 없다. </p>
<p>glDrawPixels 는 다시 화면을 그려줘야할 때마다 이미지 데이타를 메인메모리->비디오메모리 로 복사해줘야 하는 문제가 있지만 만약 동영상 플레이어등을 만들 때 처럼 빠르게 화면이 전환되는 경우라면 이는 큰 문제가 되지 않을 듯 싶기는 하다. 물론 화면이 멈춰있는 상태라면 얘기가 다를 지 모르겠다. 또 이미지를 실제 크기보다 더 크게 표현할 경우 glPixelZoom 을 이용해 간단히 구현할 수 있지만 실제로는 픽셀 크기만 커지는 효과이지 interpolation 은 일어나지 않으므로 화질은 texture 를 사용할 때에 비해 떨어진다고 할 수 있을 듯&#8230; </p>
<p>뭐 하튼 뭘 사용하는게 더 좋은건지 인터넷을 열심히 찾아봤지만 뭐가 더 좋은지에 대한 정확한 답은 찾을 수가 없다. -_-!</p>
<p>p.s) yuv2rgb 변환 같은 것은 cg 를 이용해서 처리할 수 있는 것 같은데&#8230; 이 경우 texture 를 사용해야지만 가능 한 듯&#8230; </p>
<p>openGL 에 이미 4&#215;4 matrix multiplication 은 구현되어 있으므로 color_matrix 를 사용해서 yuv2rgb 변환을 빨리할 수 있지 않을까 하는 생각도 해봤지만 실제 결과는 참담&#8230;</p><div style="width: 180px; margin-left: auto; margin-right: auto; margin-bottom: 30px; margin-top: 30px; ">
    <object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0' width='73' height='79' align='left' style="border-bottom: 1px solid #CFD4DA; border-right: 1px solid #CFD4DA;">
    <param name='allowScriptAccess' value='always'/>
    <param name='movie' value='http://www.mixsh.com/widget/mixup/loader.html?muid=52225&guid=http%3A%2F%2Fb.mytears.org%2F2007%2F06%2F542&rdate=2007-06-04+21%3A53%3A19&rawhtml=&skin=1&showhitcnt=1&platform=5'/>
    <param name='quality' value='high'/>
    <param name='wmode' value='window'/>
    <embed src='http://www.mixsh.com/widget/mixup/loader.html?muid=52225&guid=http%3A%2F%2Fb.mytears.org%2F2007%2F06%2F542&rdate=2007-06-04+21%3A53%3A19&rawhtml=&skin=1&showhitcnt=1&platform=5' quality='high' wmode='window' width='73' height='79' allowScriptAccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer'/>
    </object>
		</div><h3 style="clear:both;">Related Posts</h3><ul class="related_post"><li>8/2/2008 -- <a href="http://b.mytears.org/2008/08/662" title="YUVPlayer 업데이트&#8230;">YUVPlayer 업데이트&#8230; (0)</a></li><li>6/4/2007 -- <a href="http://b.mytears.org/2007/06/541" title="내 첫 cocoa application: yuv player">내 첫 cocoa application: yuv player (5)</a></li><li>10/24/2007 -- <a href="http://b.mytears.org/2007/10/609" title="sql injection 을 피하기위한 간단한 방법&#8230;">sql injection 을 피하기위한 간단한 방법&#8230; (2)</a></li><li>10/16/2007 -- <a href="http://b.mytears.org/2007/10/600" title="CG: 3D Image Rotation">CG: 3D Image Rotation (2)</a></li><li>10/14/2007 -- <a href="http://b.mytears.org/2007/10/599" title="CG: Perspective Projection">CG: Perspective Projection (6)</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://b.mytears.org/2007/06/542/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>내 첫 cocoa application: yuv player</title>
		<link>http://b.mytears.org/2007/06/541</link>
		<comments>http://b.mytears.org/2007/06/541#comments</comments>
		<pubDate>Mon, 04 Jun 2007 11:13:27 +0000</pubDate>
		<dc:creator>정태영</dc:creator>
				<category><![CDATA[Computer]]></category>
		<category><![CDATA[Project]]></category>
		<category><![CDATA[macintosh]]></category>
		<category><![CDATA[c]]></category>
		<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[mac os x]]></category>
		<category><![CDATA[OpenGL]]></category>
		<category><![CDATA[Programing]]></category>
		<category><![CDATA[XCode]]></category>
		<category><![CDATA[yuv]]></category>
		<category><![CDATA[yuvplayer]]></category>

		<guid isPermaLink="false">http://b.mytears.org/2007/06/541</guid>
		<description><![CDATA[<p>저번 주에 개인적으로 de-interlacing 관련된 발표를 준비하느라 논문에 있는 de-interlacing 기법들을 구현해서 실험을 했었는데, 맥에서 돌아가는 yuv player 를 못찾는 바람에 결과는 윈도우로 옮겨서 확인해야하는 불편이 있었다.</p>
<p>랩에 이미 충분히 쓸만한 yuvplayer 가 있기는 하지만 윈도우 전용이고, 내가 예전 신입생 과제를 하면서 만들었던 플레이어 역시 윈도우용;; 뭐 하튼 플레이어를 구현하는데 필요한 기반 테크닉은 다 갖추고 있었기 ...</p>
<p><a href='http://b.mytears.org/2007/06/541'>Read the rest of this entry...</a></p>
<p><h3 style="clear:both;">Related Posts</h3><ul class="related_post"><li>8/2/2008 -- <a href="http://b.mytears.org/2008/08/662" title="YUVPlayer 업데이트&#8230;">YUVPlayer 업데이트&#8230; (0)</a></li><li>6/9/2007 -- <a href="http://b.mytears.org/2007/06/544" title="YUVplayer for MS Windows">YUVplayer for MS Windows (6)</a></li><li>7/15/2007 -- <a href="http://b.mytears.org/2007/07/560" title="소스 공개: yuvplayer">소스 공개: yuvplayer (4)</a></li><li>6/4/2007 -- <a href="http://b.mytears.org/2007/06/542" title="OpenGL: texture vs glDrawPixels">OpenGL: texture vs glDrawPixels (2)</a></li><li>4/9/2009 -- <a href="http://b.mytears.org/2009/04/1912" title="제로보드 XE 관련 약간의 해명&#8230;">제로보드 XE 관련 약간의 해명&#8230; (1)</a></li></ul></p><div style="width: 180px; margin-left: auto; margin-right: auto; margin-bottom: 30px; margin-top: 30px; ">
    <object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0' width='73' height='79' align='left' style="border-bottom: 1px solid #CFD4DA; border-right: 1px solid #CFD4DA;">
    <param name='allowScriptAccess' value='always'/>
    <param name='movie' value='http://www.mixsh.com/widget/mixup/loader.html?muid=52225&guid=http%3A%2F%2Fb.mytears.org%2F2007%2F06%2F541&rdate=2007-06-04+20%3A13%3A27&rawhtml=&skin=1&showhitcnt=1&platform=5'/>
    <param name='quality' value='high'/>
    <param name='wmode' value='window'/>
    <embed src='http://www.mixsh.com/widget/mixup/loader.html?muid=52225&guid=http%3A%2F%2Fb.mytears.org%2F2007%2F06%2F541&rdate=2007-06-04+20%3A13%3A27&rawhtml=&skin=1&showhitcnt=1&platform=5' quality='high' wmode='window' width='73' height='79' allowScriptAccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer'/>
    </object>
		</div>]]></description>
			<content:encoded><![CDATA[<p>저번 주에 개인적으로 de-interlacing 관련된 발표를 준비하느라 논문에 있는 de-interlacing 기법들을 구현해서 실험을 했었는데, 맥에서 돌아가는 yuv player 를 못찾는 바람에 결과는 윈도우로 옮겨서 확인해야하는 불편이 있었다.</p>
<p>랩에 이미 충분히 쓸만한 yuvplayer 가 있기는 하지만 윈도우 전용이고, 내가 예전 신입생 과제를 하면서 만들었던 플레이어 역시 윈도우용;; 뭐 하튼 플레이어를 구현하는데 필요한 기반 테크닉은 다 갖추고 있었기 때문에 MFC + OpenGL 로 구현해봤던 것을 똑같이 Cocoa+OpenGL 로 구현해봤다.</p>
<p><img src='/wp-content/upload/yuvplayer_mac.png' /></p>
<p>메뉴를 이용해서 size 와 color format, frame rate 등을 준비할 수 있도록 만들었는데, size 와 frame rate 를 사용자가 직접 입력하는 것은 귀찮은 관계로 나중에 -_-;;</p>
<p>뭐 하튼 Zoom 하고 Drag And Drop 과 관련된 코드만 추가하고 나면 내가 구현하고 싶었던 모든 기능이 다 들어가는 거 같다. (Zoom 이야 glPixelZoom 을 사용하면 한방에 오케이니 흐흣)</p>
<p>XCode + Interface Builder 를 이용한 첫 결과물인데, 굉장히 오래전에 이미 나와있던 프로그래밍 인터페이스인데도 불구하고 굉장히 편리하게 프로그래밍이 가능해서 감탄을 해버렸다. 물론 MS 진영도 Visual Studio 2005 로 오면서 편리한 기능들이 꽤 많이 추가되긴 했지만, GUI Application 을 만들기 위한 IDE 로는 XCode + 인터페이스 빌더 쪽이 한 수 위인 듯&#8230; </p>
<p>MFC 나 Cocoa 나 진입 장벽이 꽤 높지만&#8230; 기본적인 테크닉을 익히고 나면 굉장히 강력하게 사용이 가능한 것 같다. 그리고 C 에 능숙하다면 다른 언어를 접하는 데도 그리 큰 어려움을 느끼지 않는 것 같다. 학부 시절 C++, Java 등에 눈길을 뺐기지 않고 주력 언어로 C 를 선택했던 게 탁월한 선택이었던 듯&#8230;</p>
<p>p.s) 코드를 좀 정리하고 sourceforge 등에 자리를 틀어볼까 싶네요. :)</p><div style="width: 180px; margin-left: auto; margin-right: auto; margin-bottom: 30px; margin-top: 30px; ">
    <object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0' width='73' height='79' align='left' style="border-bottom: 1px solid #CFD4DA; border-right: 1px solid #CFD4DA;">
    <param name='allowScriptAccess' value='always'/>
    <param name='movie' value='http://www.mixsh.com/widget/mixup/loader.html?muid=52225&guid=http%3A%2F%2Fb.mytears.org%2F2007%2F06%2F541&rdate=2007-06-04+20%3A13%3A27&rawhtml=&skin=1&showhitcnt=1&platform=5'/>
    <param name='quality' value='high'/>
    <param name='wmode' value='window'/>
    <embed src='http://www.mixsh.com/widget/mixup/loader.html?muid=52225&guid=http%3A%2F%2Fb.mytears.org%2F2007%2F06%2F541&rdate=2007-06-04+20%3A13%3A27&rawhtml=&skin=1&showhitcnt=1&platform=5' quality='high' wmode='window' width='73' height='79' allowScriptAccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer'/>
    </object>
		</div><h3 style="clear:both;">Related Posts</h3><ul class="related_post"><li>8/2/2008 -- <a href="http://b.mytears.org/2008/08/662" title="YUVPlayer 업데이트&#8230;">YUVPlayer 업데이트&#8230; (0)</a></li><li>6/9/2007 -- <a href="http://b.mytears.org/2007/06/544" title="YUVplayer for MS Windows">YUVplayer for MS Windows (6)</a></li><li>7/15/2007 -- <a href="http://b.mytears.org/2007/07/560" title="소스 공개: yuvplayer">소스 공개: yuvplayer (4)</a></li><li>6/4/2007 -- <a href="http://b.mytears.org/2007/06/542" title="OpenGL: texture vs glDrawPixels">OpenGL: texture vs glDrawPixels (2)</a></li><li>4/9/2009 -- <a href="http://b.mytears.org/2009/04/1912" title="제로보드 XE 관련 약간의 해명&#8230;">제로보드 XE 관련 약간의 해명&#8230; (1)</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://b.mytears.org/2007/06/541/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>처음 짜본 wavelet transform…</title>
		<link>http://b.mytears.org/2007/05/537</link>
		<comments>http://b.mytears.org/2007/05/537#comments</comments>
		<pubDate>Mon, 28 May 2007 14:06:28 +0000</pubDate>
		<dc:creator>정태영</dc:creator>
				<category><![CDATA[Computer]]></category>
		<category><![CDATA[energy compaction]]></category>
		<category><![CDATA[histogram]]></category>
		<category><![CDATA[lena]]></category>
		<category><![CDATA[Programing]]></category>
		<category><![CDATA[transform]]></category>
		<category><![CDATA[wavelet]]></category>

		<guid isPermaLink="false">http://b.mytears.org/2007/05/537</guid>
		<description><![CDATA[<p>화상처리기초 수업 과제 때문에 처음으로 wavelet transform 을 구현해보았습니다. 아래 이미지는 wavelet 으로 변환된 512&#215;512 사이즈의 lena</p>
<p></p>
<p>histogram 을 보면, 값들이 낮은 값들로 집중되어 있는걸 확인할 수 있습니다. 역시 이미지 압축을 위해 사용할만 하네요. ;) </p>
<p>    </p>
<p>    </p>
<p>    </p>
<p>    </p>
<p>    </p>
<p> ...</p>
<p><a href='http://b.mytears.org/2007/05/537'>Read the rest of this entry...</a></p>
<p><h3 style="clear:both;">Related Posts</h3><ul class="related_post"><li>10/24/2007 -- <a href="http://b.mytears.org/2007/10/609" title="sql injection 을 피하기위한 간단한 방법&#8230;">sql injection 을 피하기위한 간단한 방법&#8230; (2)</a></li><li>10/16/2007 -- <a href="http://b.mytears.org/2007/10/600" title="CG: 3D Image Rotation">CG: 3D Image Rotation (2)</a></li><li>10/14/2007 -- <a href="http://b.mytears.org/2007/10/599" title="CG: Perspective Projection">CG: Perspective Projection (6)</a></li><li>6/4/2007 -- <a href="http://b.mytears.org/2007/06/542" title="OpenGL: texture vs glDrawPixels">OpenGL: texture vs glDrawPixels (2)</a></li><li>6/4/2007 -- <a href="http://b.mytears.org/2007/06/541" title="내 첫 cocoa application: yuv player">내 첫 cocoa application: yuv player (5)</a></li></ul></p><div style="width: 180px; margin-left: auto; margin-right: auto; margin-bottom: 30px; margin-top: 30px; ">
    <object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0' width='73' height='79' align='left' style="border-bottom: 1px solid #CFD4DA; border-right: 1px solid #CFD4DA;">
    <param name='allowScriptAccess' value='always'/>
    <param name='movie' value='http://www.mixsh.com/widget/mixup/loader.html?muid=52225&guid=http%3A%2F%2Fb.mytears.org%2F2007%2F05%2F537&rdate=2007-05-28+23%3A06%3A28&rawhtml=&skin=1&showhitcnt=1&platform=5'/>
    <param name='quality' value='high'/>
    <param name='wmode' value='window'/>
    <embed src='http://www.mixsh.com/widget/mixup/loader.html?muid=52225&guid=http%3A%2F%2Fb.mytears.org%2F2007%2F05%2F537&rdate=2007-05-28+23%3A06%3A28&rawhtml=&skin=1&showhitcnt=1&platform=5' quality='high' wmode='window' width='73' height='79' allowScriptAccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer'/>
    </object>
		</div>]]></description>
			<content:encoded><![CDATA[<p>화상처리기초 수업 과제 때문에 처음으로 wavelet transform 을 구현해보았습니다. 아래 이미지는 wavelet 으로 변환된 512&#215;512 사이즈의 lena</p>
<p><img src='/wp-content/upload/w_lena.jpg' /></p>
<p>histogram 을 보면, 값들이 낮은 값들로 집중되어 있는걸 확인할 수 있습니다. 역시 이미지 압축을 위해 사용할만 하네요. ;) </p><div style="width: 180px; margin-left: auto; margin-right: auto; margin-bottom: 30px; margin-top: 30px; ">
    <object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0' width='73' height='79' align='left' style="border-bottom: 1px solid #CFD4DA; border-right: 1px solid #CFD4DA;">
    <param name='allowScriptAccess' value='always'/>
    <param name='movie' value='http://www.mixsh.com/widget/mixup/loader.html?muid=52225&guid=http%3A%2F%2Fb.mytears.org%2F2007%2F05%2F537&rdate=2007-05-28+23%3A06%3A28&rawhtml=&skin=1&showhitcnt=1&platform=5'/>
    <param name='quality' value='high'/>
    <param name='wmode' value='window'/>
    <embed src='http://www.mixsh.com/widget/mixup/loader.html?muid=52225&guid=http%3A%2F%2Fb.mytears.org%2F2007%2F05%2F537&rdate=2007-05-28+23%3A06%3A28&rawhtml=&skin=1&showhitcnt=1&platform=5' quality='high' wmode='window' width='73' height='79' allowScriptAccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer'/>
    </object>
		</div><h3 style="clear:both;">Related Posts</h3><ul class="related_post"><li>10/24/2007 -- <a href="http://b.mytears.org/2007/10/609" title="sql injection 을 피하기위한 간단한 방법&#8230;">sql injection 을 피하기위한 간단한 방법&#8230; (2)</a></li><li>10/16/2007 -- <a href="http://b.mytears.org/2007/10/600" title="CG: 3D Image Rotation">CG: 3D Image Rotation (2)</a></li><li>10/14/2007 -- <a href="http://b.mytears.org/2007/10/599" title="CG: Perspective Projection">CG: Perspective Projection (6)</a></li><li>6/4/2007 -- <a href="http://b.mytears.org/2007/06/542" title="OpenGL: texture vs glDrawPixels">OpenGL: texture vs glDrawPixels (2)</a></li><li>6/4/2007 -- <a href="http://b.mytears.org/2007/06/541" title="내 첫 cocoa application: yuv player">내 첫 cocoa application: yuv player (5)</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://b.mytears.org/2007/05/537/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
