ctypes-opencv.

CTYPES¸¦ »ç¿ëÇÏ´Â OPENCV ¿ë ÆÄÀ̽㠷¡ÆÛ
Áö±Ý ´Ù¿î·Îµå

ctypes-opencv. ¼øÀ§ ¹× ¿ä¾à

±¤°í

  • Rating:
  • ƯÇã:
  • BSD License
  • °¡°Ý:
  • FREE
  • °Ô½ÃÀÚ À̸§:
  • Minh-Tri Pham
  • °Ô½ÃÀÚ À¥»çÀÌÆ®:
  • http://code.google.com/u/pmtri80/

ctypes-opencv. ű×


ctypes-opencv. ¼³¸í

CTYPES¸¦ »ç¿ëÇÏ´Â OPENCV ¿ë ÆÄÀ̽㠷¡ÆÛ ctypes-opencv´Â IntelÀÇ ¿ÀÇ ¼Ò½º ÄÄÇ»ÅÍ ºñÀü ¶óÀ̺귯¸® (OpenCV)¸¦ ÆÄÀ̽㿡 °¡Á® ¿À´Â ¶óÀ̺귯¸®ÀÔ´Ï´Ù. OpenCV´Â ´Ù¾çÇÑ ÄÄÇ»ÅÍ ºñÀü ¹®Á¦¿¡ ´ëÇÑ ¾Ë°í¸®Áò ¹× »ùÇà ÄÚµåÀÇ ¸ðÀ½ÀÔ´Ï´Ù. ctypes-opencvÀÇ ¸ñÇ¥´Â opencv.advantagesÀÇ ¸ðµç ¹®¼­È­ µÈ ±â´É¿¡ ´ëÇÑ ÆÄÀ̽㠾׼¼½º¸¦ Á¦°øÇÏ´Â °ÍÀÔ´Ï´Ù. * OpenCVÀÇ Cxcore, CV, HighGui ±¸¼º ¿ä¼Ò¿¡ ´ëÇÑ ÀÎÅÍÆäÀ̽º¸¦ ¿Ï·áÇϽʽÿÀ. * Pythonic ÀÎÅÍÆäÀ̽º. OpenCVÀÇ °´Ã¼´Â »ç¿ëÇÏÁö ¾ÊÀ» ¶§ ¾ÈÀüÇÏ°Ô »èÁ¦µË´Ï´Ù. cvrelease ... ()¸¦ È£Ãâ ÇÒ ÇÊ¿ä°¡ ¾ø½À´Ï´Ù. * ¼ø¼öÇÑ ÆÄÀ̽ã ÆÐÅ°Áö. C / C ++ ÄÄÆÄÀÏ·¯µµ OpenCVÀÇ ¼Ò½º Äڵ尡 ÇÊ¿äÇÏÁö ¾Ê½À´Ï´Ù. * OpenCVÀÇ ¹öÀü 1.0 ¹× 1.1À» ¸ðµÎ Áö¿øÇÏÁö ¾Ê½À´Ï´Ù. opencv. * À©µµ¿ì, Linux ¹× Mac OS X.¸¦ Æ÷ÇÔÇÏ¿© OpenCV¸¦ ¼³Ä¡ÇÒ ¼öÀÖ´Â OpenCV¸¦ ¼³Ä¡ÇÒ ¼öÀÖ´Â OPEncv¿¡¼­ ½ÇÇàµË´Ï´Ù. * OpenCVÀÇ ML ±¸¼º ¿ä¼Ò¿¡ ´ëÇÑ Áö¿øÀÌ ¾ÆÁ÷ ¾ø½À´Ï´Ù. ÀÌ°ÍÀº ÇöÀç ctypes ÆÐÅ°ÁöÀÇ Á¦ÇÑÀÔ´Ï´Ù. ML ±¸¼º ¿ä¼Ò¿¡´Â ´ëºÎºÐ C ++ Ŭ·¡½º°¡ µé¾î ÀÖ½À´Ï´Ù. ÇöÀç CTYPES´Â C ++ Ŭ·¡½º¿Í ȸ¿ø ±â´ÉÀ» °¨½Ò ¼ö ¾ø½À´Ï´Ù. ÀÌ Á¦ÇÑÀº ¹Ì·¡¿¡ ±Øº¹ µÉ °ÍÀÔ´Ï´Ù. ÀÛ¾÷Àº ÀÌ¹Ì ½ÃÀ۵Ǿú½À´Ï´Ù. example : C ÄÚµå # ifdef _ch_ # pragma ÆÐÅ°Áö # endif # ifndef _eic # Æ÷ÇÔ "cv.h"#Include "highgui.h"#endifint main (int argc, char ** argv) {#define max_clusters 5 CVSCALAR COLOR_TAB ; iplimage * img = cvCreateImage (cvsize (500, 500), 8, 3); cvrng rng = cvrng (-1); CVPoint IPT; COLOR_TAB = CV_RGB (255,0,0); COLOR_TAB = CV_RGB (0,255,0); color_tab = CV_RGB (100,100,255); color_tab = CV_RGB (255,0,255); COLOR_TAB = CV_RGB (255,255,0); cvNamedWindow ( "Ŭ·¯½ºÅÍ", 1); (;;) {char Key; int k, cluster_count = cvrandint (rng) % max_clusters + 1; INT I, sample_count = cvrandint (RNG) 00 + 1; cvmat * points = cvCreatemat (sample_count, 1, cv_32fc2); cvmat * clusters = cvCreatemat (sample_count, 1, cv_32sc1); / * ¸ÖƼ ÀïÀÌ ºÐÆ÷ * / for (k = 0; k ³Êºñ; Center.y = cvrandint (RNG) % IMG-> ³ôÀÌ; cvgetrows (Æ÷ÀÎÆ®, point_chunk, k * sample_count / cluster_count, k == cluster_count - 1? sample_count : (k + 1) * sample_count / cluster_count, 1); cvrandarr (rng, point_chunk, cv_rand_normal, cv_rand_normal, cvscalar (center.x, center.y, 0,0), cvScalar (IMG-> Æø * 0.1, IMG-> ³ôÀÌ * 0.1,0,0)); } / * »ùÇà »ùÇà * / for (i = 0, i data.fl + cvrandint (RNG) % sample_count; cvpoint2d32f * pt2 = (cvpoint2d32f *) Æ÷ÀÎÆ® -> data.fl + cvrandint (RNG) % sample_count; CVPoint2D32F ¿Âµµ; cv_swap (* pt1, * pt2, temp); } cvkmeans2 (Æ÷ÀÎÆ®, cluster_count, clusters, cvtermcriteria (cv_termcrit_eps + cv_termcrit_iter, 10, 1.0)); cvzero (img); for (i = 0; i data.i ; IPT.X = (int) Æ÷ÀÎÆ® -> data.fl ; IPT.Y = (int) Æ÷ÀÎÆ® -> data.fl ; cvcircle (IMG, IPT, 2, COLOR_TAB , cv_filled, cv_aa, 0); } cvreleasemat (Æ÷ÀÎÆ®); cvreleasemat (Ŭ·¯½ºÅÍ); CVShowiMage ( "Ŭ·¯½ºÅÍ", img); Å° = (char) cvwaitkey (0); if (key == 27 || key == 'q'|| Å° == 'q') // 'ESC'ºê·¹ÀÌÅ©; } cvdestroyWindow ( "Ŭ·¯½ºÅÍ"); RETURN 0;} Python CodeFrom OpenCV °¡Á® ¿À±â randintmax_clusters = 5if __name__ == "__main__": color_tab = IMG = CVCREATEIMAGE (CVSIZE (500, 500), 8, 3) RNG = CVRNG (-1) CVNANDWINDOW ( "Ŭ·¯½ºÅÍ", 1) true : cluster_count = Randint (2, max_clusters) ) sample_count = randint (1, 1000) Æ÷ÀÎÆ® = CVCREATEMAT (sample_count, 1, cv_32fc2) clusters = cvcreatemat (sample_count, 1, cv_32sc1) # ¹üÀ§ in ¹üÀ§ÀÇ k ¿ë k ¿ë Multigaussian ¹èÆ÷¿¡¼­ ÀÓÀÇÀÇ »ùÇà »ý¼º : CENTER = CVPOINT (cvrandint (cvrandint) rng % img.width, cvrandint (rng) % img.height) first = k * sample_count / cluster_count last = sample_count k! = cluster_count : last = (k + 1) * sample_count / cluster_count first> = last : °è¼Ó point_chunk = cvgetrows (Æ÷ÀÎÆ®, ù°, ¸¶Áö¸·) cvrandarr (rng, point_chunk, cv_rand_normal, cvscalar (center.x, center.y, 0,0), cvscalar (img.width * 0.1, img.height * 0.1,0,0 )) # ¼ÅÇà »ùÇà cvrandshuffle ( Æ÷ÀÎÆ®, RNG) cvkmeans2 (Æ÷ÀÎÆ®, cluster_count, clusters, cvtermcriteria (cv_termcrit_eps + cv_termcrit_iter, 10, 1.0)) ¹üÀ§ in ¹üÀ§ (sample_count) : cluster_idx = clusters pt = points ] pt = cvPoint (cvRound (Pt ), cvRound (Pt )) CVCircle (IMG, PT, 2, COLOR_TAB , CV_FILLED, CV_AA, 0) CVSHOWIMAGE ( "Ŭ·¯½ºÅÍ", IMG) Å° = cvwaitkey (0) if (key == 'x1b'¶Ç´Â key == 'q'¶Ç´Â key == 'q') : # 'ESC'ºê·¹ÀÌÅ© ¿ä±¸ »çÇ× : ¡¤ ÆÄÀ̽ã


ctypes-opencv. °ü·Ã ¼ÒÇÁÆ®¿þ¾î

Libburnia Xorriso.

libburnia´Â ±¤ µð½ºÅ©¸¦ Àаí, ¸¶½ºÅÍ ¸µÇÏ°í ¾²´Â µ¥ ÇÊ¿äÇÑ µµ¼­°ü°ú ¹ÙÀ̳ʸ®·Î ±¸¼ºµÈ ÇÁ·ÎÁ§Æ®ÀÔ´Ï´Ù. ...

226

´Ù¿î·Îµå

°øºÎÇÏ´Ù

¸ÖƼ ÇÁ·Î¼¼½Ì°ú °°Àº ¹®Á¦¸¦ ÃÊ°úÇÏ´Â ÆÄÀÌÇÁ ¹× ÇÊÅÍ ½ºÅ¸ÀÏÀÇ µ¥ÀÌÅÍ ¿¬±¸¸¦À§ÇÑ ÇÁ·¹ÀÓ ¿öÅ© ...

188

´Ù¿î·Îµå