Category: Python

Digital Image Processing ด้วย Python (cs377)

Digital Image Processing ด้วย Python (cs377)

20 กรกฎาคม 2010

การบ้าน ตอนเรียน Digital Image Processing  ลองหัดด้วยเขียน python 

ลองเล่น python + Imaging + numpy

ลองเล่น python + Imaging + numpy

18 มกราคม 2010

มี Assignment Digital Image Processing เลยหาเครื่องมือที่จะเอามาใช้หน่อย   ตอนแรกกะจะใช้ opencv แต่ลองเอา wrapper ที่ทำให้ python ใช้ opencv มาลองดีกว่า เพื่อความมันส์(อยากเขียน python เป็น) google_protectAndRun(“ads_core.google_render_ad”, google_handleError, google_render_a เขียนไปเขียนมา ทำไปเกือบเสร็จ (python + opencv) เจอปัญหาเรื่อง datatype นิดหน่อย (ไม่รู้ว่ามัน cast ไปเป็น pointer to aligned image data ยังไง) ผสานกับเวลาที่เหลือน้อย  จึงคิดว่า กลับไปเขียน opencv + c ให้เสร็จก่อนดีกว่า ที่เขียนใน python มันเพี้ยนๆ พอเขียน opencv + c เสร็จ (แต่ไม่เรียบร้อย) แต่รู้สึกว่า ในการทำงานหลายๆส่วนกับ [...]

(Cache) Python 2.4 + numpy + matplotlib + Imaging

(Cache) Python 2.4 + numpy + matplotlib + Imaging

18 มกราคม 2010

จากความเดิมตอนที่แล้วที่ ใช้ python 2.5 กับ numpy แล้วก็ Imaging 1.1.6  ก็ทำงานไปได้ระดับหนึ่ง แต่เกิดอยากจะ plot histogram ขึ้นมาเลยไปมองที่ scipy เนื่องจากครั้งที่แล้วยังลงไม่ได้ แต่แล้วก็ได้พบพานกับ matplotlib-0.99.1.1 เคยเห็นใน superpack ก็เลยโหลดมาลองซะหน่อย

Unit Vectors – Normalizing ใช้ python และ numpy

Unit Vectors – Normalizing ใช้ python และ numpy

14 มกราคม 2010

  ก่อนที่เราจะ normalize vector ได้ เราต้องหา norm ( magnitude หรือ ขนาด) ของมันก่อน ซึ่งมันหาได้โดยการ ถอด Square root ของ ผลบวกกำลังสองครับ (sumsquare) length = sqrt((ax * ax) + (ay * ay) + (az * az)) length = sqrt(9 + 1 + 4) = 3.742 ซึ่ง 3.742 จะเป็น ขนาดของ Vector [1,2,3] ครับ ถ้าจะ normalize  vector  นี้ก็เอา magnitude ไปหารทุกตัวครับ x [...]

Get Adobe Flash playerPlugin by wpburn.com wordpress themes