{"id":41,"date":"2015-11-28T16:38:47","date_gmt":"2015-11-28T13:08:47","guid":{"rendered":"http:\/\/imageyar.ir\/?p=41"},"modified":"2017-06-15T14:06:15","modified_gmt":"2017-06-15T10:36:15","slug":"%db%8c%d8%af%d8%a7-%da%a9%d8%b1%d8%af%d9%86-%d8%aa%d8%b9%d8%af%d8%a7%d8%af-objects-%d8%aa%d8%b5%d9%88%db%8c%d8%b1-%d8%af%d8%b1-matlab","status":"publish","type":"post","link":"https:\/\/imageyar.ir\/%db%8c%d8%af%d8%a7-%da%a9%d8%b1%d8%af%d9%86-%d8%aa%d8%b9%d8%af%d8%a7%d8%af-objects-%d8%aa%d8%b5%d9%88%db%8c%d8%b1-%d8%af%d8%b1-matlab\/","title":{"rendered":"\u06cc\u062f\u0627 \u06a9\u0631\u062f\u0646 \u062a\u0639\u062f\u0627\u062f objects \u062a\u0635\u0648\u06cc\u0631 \u062f\u0631 MATLAB"},"content":{"rendered":"

\u06cc\u062f\u0627 \u06a9\u0631\u062f\u0646 \u062a\u0639\u062f\u0627\u062f <\/em><\/strong>objects<\/strong><\/em> \u062a\u0635\u0648\u06cc\u0631 \u062f\u0631 MATLAB<\/strong><\/em><\/p>\n

\u0627\u06cc\u0646 \u0628\u0631\u0646\u0627\u0645\u0647 \u062a\u0646\u0647\u0627 \u062f\u0631 \u0635\u0648\u0631\u062a\u06cc \u062f\u0631\u0633\u062a \u06a9\u0627\u0631 \u0645\u06cc \u06a9\u0646\u062f \u06a9\u0647 \u067e\u0634\u062a \u0632\u0645\u06cc\u0646\u0647 \u0622\u0646 \u062a\u06cc\u0631\u0647 \u0628\u0627\u0634\u062f \u0645\u062b\u0644\u0627 \u06cc\u06a9 \u0635\u0641\u062d\u0647 \u0645\u0634\u06a9\u06cc \u0628\u0627 \u0686\u0646\u062f \u0634\u06a9\u0644 \u0647\u0646\u062f\u0633\u06cc<\/p>\n

\u0642\u0633\u0645\u062a \u0627\u0648\u0644\u00a0:\u00a0\u062a\u0635\u0648\u06cc\u0631 \u0631\u0627 \u062f\u0631 \u0645\u0637\u0644\u0628 \u0644\u0648\u062f \u0645\u06cc \u06a9\u0646\u062f \u0648 \u0646\u0645\u0627\u06cc\u0634\u00a0\u00a0\u0645\u06cc \u062f\u0647\u062f.<\/p>\n

\u0642\u0633\u0645\u062a \u062f\u0648\u0645\u00a0:\u00a0rgb2gray\u00a0\u062a\u0635\u0648\u06cc\u0631 \u0631\u0627 \u0633\u06cc\u0627\u0647 \u0648 \u0633\u0641\u06cc\u062f \u0645\u06cc \u06a9\u0646\u062f .\u00a0Threshold\u0645\u0631\u0632\u0647\u0627 \u0631\u0627 \u0645\u0634\u062e\u0635 \u0645\u06cc \u06a9\u0646\u062f \u060c \u06a9\u0647 \u0628\u0631\u0627\u06cc \u0627\u06cc\u0646 \u06a9\u0627\u0631 \u0628\u0627\u06cc\u062f \u0627\u0632 \u062a\u0627\u0628\u0639\u00a0graythresh\u00a0\u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u06a9\u0631\u062f .im2bw\u00a0\u062a\u0635\u0648\u06cc\u0631 \u0631\u0627 \u0628\u0627\u06cc\u0646\u0631\u06cc \u0645\u06cc \u06a9\u0646\u062f.<\/p>\n

\u0642\u0633\u0645\u062a \u0633\u0648\u0645 :\u00a0\u00a0\u0646\u0648\u06cc\u0632 \u062a\u0635\u0648\u06cc\u0631 \u0631\u0627 \u0627\u0632 \u0628\u06cc\u0646 \u0645\u06cc \u0628\u0631\u062f .\u00a0bwareaopen\u00a0\u067e\u06cc\u06a9\u0633\u0644 \u0647\u0627\u06cc \u06a9\u0645\u062a\u0631 \u0627\u0632 \u06f3\u06f0 \u0631\u0627 \u067e\u0627\u06a9 \u0645\u06cc \u06a9\u0646\u062f \u0648 \u0641\u0648\u0627\u0635\u0644 \u062e\u0627\u0644\u06cc (Gap) \u0631\u0627 \u0628\u0627 \u062a\u0627\u0628\u0639\u00a0strel\u00a0\u067e\u0631 \u0645\u06cc \u06a9\u0646\u062f<\/p>\n

strel(‘disk’,2)<\/p>\n

\u06cc\u06a9 \u062f\u0627\u06cc\u0631\u0647 \u0628\u0647 \u0634\u0639\u0627\u0639 \u06f2 \u062a\u0634\u06a9\u06cc\u0644 \u0645\u06cc \u062f\u0647\u062f \u06a9\u0647 \u0634\u0639\u0627\u0639 \u0639\u062f\u062f\u06cc \u063a\u06cc\u0631 \u0645\u0646\u0641\u06cc \u0628\u0627\u06cc\u062f \u0628\u0627\u0634\u062f \u0648 \u0639\u062f\u062f \u0648\u0633\u0637 \u0622\u0646 \u062f\u0627\u06cc\u0631\u0647\u00a0\u00a0\u0631\u0627 \u0627\u0646\u062a\u062e\u0627\u0628 \u0645\u06cc \u06a9\u0646\u062f .\u00a0imfill\u00a0\u0686\u0627\u0644\u0647 \u0647\u0627 \u0631\u0627 \u067e\u0631 \u0645\u06cc \u06a9\u0646\u062f \u0648 \u0645\u0631\u0632\u0647\u0627 \u0631\u0627 \u0645\u0634\u062e\u0635 \u0645\u06cc \u06a9\u0646\u062f \u0647\u0631 \u0645\u062d\u062f\u0648\u062f\u0647 \u0628\u0633\u062a\u0647 \u0631\u0627 \u0628\u0627holes\u0646\u0627\u0645\u06af\u0630\u0627\u0631\u06cc \u0645\u06cc \u06a9\u0646\u062f .<\/p>\n

\u0642\u0633\u0645\u062a \u0686\u0647\u0627\u0631\u0645 : \u0645\u062d\u062f\u0648\u062f\u0647 \u0647\u0627 \u0631\u0627 \u067e\u06cc\u062f\u0627 \u0645\u06cc \u06a9\u0646\u062f \u0645\u0646\u0627\u0637\u0642 \u0645\u0631\u0632\u06cc \u0631\u0627 \u062f\u0646\u0628\u0627\u0644 \u0645\u06cc \u06a9\u0646\u062f \u0648 \u062a\u0639\u062f\u0627\u062f \u0622\u0646\u0647\u0627 \u0631\u0627 \u0646\u0634\u0627\u0646 \u0645\u06cc \u062f\u0647\u062f . \u0628\u0627 \u06af\u0630\u0627\u0634\u062a\u0646\u00a0noholes\u00a0\u0628\u0627\u0639\u062b \u0645\u06cc \u0634\u0648\u062f \u067e\u0631\u062f\u0627\u0632\u0634 \u0633\u0631\u06cc\u0639 \u062a\u0631 \u0634\u0648\u062f label2rgb\u00a0\u062a\u0635\u0648\u06cc\u0631 \u0631\u0627 \u0631\u0646\u06af\u06cc \u0645\u06cc \u06a9\u0646\u062f.<\/p>\n

\u062f\u0631 \u0627\u0646\u062a\u0647\u0627 \u062a\u0639\u062f\u0627\u062f \u0627\u0634\u06a9\u0627\u0644 \u0645\u0648\u062c\u0648\u062f \u062f\u0631 \u0645\u062a\u063a\u06cc\u0631 Count\u00a0 \u0642\u0631\u0627\u0631 \u0645\u06cc \u06af\u06cc\u0631\u062f .<\/p>\n

\u06a9\u062f \u0628\u0631\u0646\u0627\u0645\u0647:<\/p>\n

 <\/p>\n

 <\/p>\n

RGB = imread(‘d:\\test4.jpg’);\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u06f1<\/p>\n

figure , imshow(RGB)\u00a0,title(‘Orginal image’)<\/p>\n

 <\/p>\n

I = rgb2gray(RGB);\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u06f2<\/p>\n

threshold = graythresh(I);<\/p>\n

bw = im2bw(I,threshold);<\/p>\n

imshow(bw)\u00a0, title(‘threshold image’)<\/p>\n

\u06f3<\/p>\n

bw = bwareaopen(bw,30);<\/p>\n

se = strel(‘disk’,2);<\/p>\n

bw = imclose(bw,se);<\/p>\n

bw = imfill(bw,’holes’);<\/p>\n

figure , imshow(bw)\u00a0, title(‘fill image’)<\/p>\n

[B,L] = bwboundaries(bw,’noholes’);\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u06f4<\/p>\n

Count=length(B)<\/p>\n

figure , imshow(label2rgb(L)),title(‘RGB’)<\/p>\n

\n

\u0645\u0646\u0628\u0639 :\u00a0http:\/\/programmer.blogsky.com<\/p>\n","protected":false},"excerpt":{"rendered":"

\u06cc\u062f\u0627 \u06a9\u0631\u062f\u0646 \u062a\u0639\u062f\u0627\u062f objects \u062a\u0635\u0648\u06cc\u0631 \u062f\u0631 MATLAB \u0627\u06cc\u0646 \u0628\u0631\u0646\u0627\u0645\u0647 \u062a\u0646\u0647\u0627 \u062f\u0631 \u0635\u0648\u0631\u062a\u06cc \u062f\u0631\u0633\u062a \u06a9\u0627\u0631 \u0645\u06cc \u06a9\u0646\u062f \u06a9\u0647 \u067e\u0634\u062a \u0632\u0645\u06cc\u0646\u0647 \u0622\u0646 \u062a\u06cc\u0631\u0647 \u0628\u0627\u0634\u062f \u0645\u062b\u0644\u0627 \u06cc\u06a9 \u0635\u0641\u062d\u0647 \u0645\u0634\u06a9\u06cc \u0628\u0627 \u0686\u0646\u062f \u0634\u06a9\u0644 \u0647\u0646\u062f\u0633\u06cc \u0642\u0633\u0645\u062a \u0627\u0648\u0644\u00a0:\u00a0\u062a\u0635\u0648\u06cc\u0631 \u0631\u0627 \u062f\u0631 \u0645\u0637\u0644\u0628 \u0644\u0648\u062f \u0645\u06cc \u06a9\u0646\u062f \u0648 \u0646\u0645\u0627\u06cc\u0634\u00a0\u00a0\u0645\u06cc \u062f\u0647\u062f. \u0642\u0633\u0645\u062a \u062f\u0648\u0645\u00a0:\u00a0rgb2gray\u00a0\u062a\u0635\u0648\u06cc\u0631 \u0631\u0627 \u0633\u06cc\u0627\u0647 \u0648 \u0633\u0641\u06cc\u062f \u0645\u06cc \u06a9\u0646\u062f .\u00a0Threshold\u0645\u0631\u0632\u0647\u0627 \u0631\u0627 \u0645\u0634\u062e\u0635 \u0645\u06cc \u06a9\u0646\u062f \u060c<\/p>\n","protected":false},"author":1,"featured_media":45,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[7],"tags":[17],"yoast_head":"\n\u06cc\u062f\u0627 \u06a9\u0631\u062f\u0646 \u062a\u0639\u062f\u0627\u062f objects \u062a\u0635\u0648\u06cc\u0631 \u062f\u0631 MATLAB ~ \u0648\u0628 \u0633\u0627\u06cc\u062a \u062a\u062e\u0635\u0635\u06cc \u067e\u0631\u062f\u0627\u0632\u0634 \u062a\u0635\u0648\u06cc\u0631<\/title>\n<meta name=\"description\" content=\"\u06cc\u062f\u0627 \u06a9\u0631\u062f\u0646 \u062a\u0639\u062f\u0627\u062f objects \u062a\u0635\u0648\u06cc\u0631 \u062f\u0631 MATLAB\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/imageyar.ir\/\u06cc\u062f\u0627-\u06a9\u0631\u062f\u0646-\u062a\u0639\u062f\u0627\u062f-objects-\u062a\u0635\u0648\u06cc\u0631-\u062f\u0631-matlab\/\" \/>\n<meta property=\"og:locale\" content=\"fa_IR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u06cc\u062f\u0627 \u06a9\u0631\u062f\u0646 \u062a\u0639\u062f\u0627\u062f objects \u062a\u0635\u0648\u06cc\u0631 \u062f\u0631 MATLAB ~ \u0648\u0628 \u0633\u0627\u06cc\u062a \u062a\u062e\u0635\u0635\u06cc \u067e\u0631\u062f\u0627\u0632\u0634 \u062a\u0635\u0648\u06cc\u0631\" \/>\n<meta property=\"og:description\" content=\"\u06cc\u062f\u0627 \u06a9\u0631\u062f\u0646 \u062a\u0639\u062f\u0627\u062f objects \u062a\u0635\u0648\u06cc\u0631 \u062f\u0631 MATLAB\" \/>\n<meta property=\"og:url\" content=\"https:\/\/imageyar.ir\/\u06cc\u062f\u0627-\u06a9\u0631\u062f\u0646-\u062a\u0639\u062f\u0627\u062f-objects-\u062a\u0635\u0648\u06cc\u0631-\u062f\u0631-matlab\/\" \/>\n<meta property=\"og:site_name\" content=\"\u0648\u0628 \u0633\u0627\u06cc\u062a \u062a\u062e\u0635\u0635\u06cc \u067e\u0631\u062f\u0627\u0632\u0634 \u062a\u0635\u0648\u06cc\u0631\" \/>\n<meta property=\"article:published_time\" content=\"2015-11-28T13:08:47+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2017-06-15T10:36:15+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/imageyar.ir\/wp-content\/uploads\/2017\/02\/www.imageyar.irLogo.gif\" \/>\n\t<meta property=\"og:image:width\" content=\"580\" \/>\n\t<meta property=\"og:image:height\" content=\"325\" \/>\n<meta name=\"twitter:card\" content=\"summary\" \/>\n<meta name=\"twitter:label1\" content=\"\u0632\u0645\u0627\u0646 \u062a\u0642\u0631\u06cc\u0628\u06cc \u0628\u0631\u0627\u06cc \u062e\u0648\u0627\u0646\u062f\u0646\">\n\t<meta name=\"twitter:data1\" content=\"0 \u062f\u0642\u06cc\u0642\u0647\">\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/imageyar.ir\/#website\",\"url\":\"https:\/\/imageyar.ir\/\",\"name\":\"\\u0648\\u0628 \\u0633\\u0627\\u06cc\\u062a \\u062a\\u062e\\u0635\\u0635\\u06cc \\u067e\\u0631\\u062f\\u0627\\u0632\\u0634 \\u062a\\u0635\\u0648\\u06cc\\u0631\",\"description\":\"\\u0622\\u0645\\u0648\\u0632\\u0634 \\u0648 \\u067e\\u06cc\\u0627\\u062f\\u0647 \\u0633\\u0627\\u0632\\u06cc \\u062a\\u06a9\\u0646\\u06cc\\u06a9 \\u0647\\u0627\\u06cc \\u067e\\u0631\\u062f\\u0627\\u0632\\u0634 \\u062a\\u0635\\u0648\\u06cc\\u0631- \\u0645\\u0634\\u0627\\u0648\\u0631\\u0647 \\u0648 \\u0645\\u0634\\u0627\\u0631\\u06a9\\u062a \\u062f\\u0631 \\u067e\\u0631\\u0648\\u0698\\u0647 \\u0647\\u0627\\u06cc \\u0622\\u0645\\u0648\\u0632\\u0634\\u06cc \\u0648 \\u062a\\u062c\\u0627\\u0631\\u06cc\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":\"https:\/\/imageyar.ir\/?s={search_term_string}\",\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"fa-IR\"},{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/imageyar.ir\/%db%8c%d8%af%d8%a7-%da%a9%d8%b1%d8%af%d9%86-%d8%aa%d8%b9%d8%af%d8%a7%d8%af-objects-%d8%aa%d8%b5%d9%88%db%8c%d8%b1-%d8%af%d8%b1-matlab\/#primaryimage\",\"inLanguage\":\"fa-IR\",\"url\":\"https:\/\/imageyar.ir\/wp-content\/uploads\/2017\/02\/www.imageyar.irLogo.gif\",\"width\":580,\"height\":325},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/imageyar.ir\/%db%8c%d8%af%d8%a7-%da%a9%d8%b1%d8%af%d9%86-%d8%aa%d8%b9%d8%af%d8%a7%d8%af-objects-%d8%aa%d8%b5%d9%88%db%8c%d8%b1-%d8%af%d8%b1-matlab\/#webpage\",\"url\":\"https:\/\/imageyar.ir\/%db%8c%d8%af%d8%a7-%da%a9%d8%b1%d8%af%d9%86-%d8%aa%d8%b9%d8%af%d8%a7%d8%af-objects-%d8%aa%d8%b5%d9%88%db%8c%d8%b1-%d8%af%d8%b1-matlab\/\",\"name\":\"\\u06cc\\u062f\\u0627 \\u06a9\\u0631\\u062f\\u0646 \\u062a\\u0639\\u062f\\u0627\\u062f objects \\u062a\\u0635\\u0648\\u06cc\\u0631 \\u062f\\u0631 MATLAB ~ \\u0648\\u0628 \\u0633\\u0627\\u06cc\\u062a \\u062a\\u062e\\u0635\\u0635\\u06cc \\u067e\\u0631\\u062f\\u0627\\u0632\\u0634 \\u062a\\u0635\\u0648\\u06cc\\u0631\",\"isPartOf\":{\"@id\":\"https:\/\/imageyar.ir\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/imageyar.ir\/%db%8c%d8%af%d8%a7-%da%a9%d8%b1%d8%af%d9%86-%d8%aa%d8%b9%d8%af%d8%a7%d8%af-objects-%d8%aa%d8%b5%d9%88%db%8c%d8%b1-%d8%af%d8%b1-matlab\/#primaryimage\"},\"datePublished\":\"2015-11-28T13:08:47+00:00\",\"dateModified\":\"2017-06-15T10:36:15+00:00\",\"author\":{\"@id\":\"https:\/\/imageyar.ir\/#\/schema\/person\/a8197f96a537e5fcc69f079f43186f01\"},\"description\":\"\\u06cc\\u062f\\u0627 \\u06a9\\u0631\\u062f\\u0646 \\u062a\\u0639\\u062f\\u0627\\u062f objects \\u062a\\u0635\\u0648\\u06cc\\u0631 \\u062f\\u0631 MATLAB\",\"inLanguage\":\"fa-IR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/imageyar.ir\/%db%8c%d8%af%d8%a7-%da%a9%d8%b1%d8%af%d9%86-%d8%aa%d8%b9%d8%af%d8%a7%d8%af-objects-%d8%aa%d8%b5%d9%88%db%8c%d8%b1-%d8%af%d8%b1-matlab\/\"]}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/imageyar.ir\/#\/schema\/person\/a8197f96a537e5fcc69f079f43186f01\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/imageyar.ir\/#personlogo\",\"inLanguage\":\"fa-IR\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/843ea380b26fbc2dbddc37ff8441449b?s=96&d=mm&r=g\",\"caption\":\"admin\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","_links":{"self":[{"href":"https:\/\/imageyar.ir\/wp-json\/wp\/v2\/posts\/41"}],"collection":[{"href":"https:\/\/imageyar.ir\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/imageyar.ir\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/imageyar.ir\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/imageyar.ir\/wp-json\/wp\/v2\/comments?post=41"}],"version-history":[{"count":1,"href":"https:\/\/imageyar.ir\/wp-json\/wp\/v2\/posts\/41\/revisions"}],"predecessor-version":[{"id":42,"href":"https:\/\/imageyar.ir\/wp-json\/wp\/v2\/posts\/41\/revisions\/42"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/imageyar.ir\/wp-json\/wp\/v2\/media\/45"}],"wp:attachment":[{"href":"https:\/\/imageyar.ir\/wp-json\/wp\/v2\/media?parent=41"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/imageyar.ir\/wp-json\/wp\/v2\/categories?post=41"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/imageyar.ir\/wp-json\/wp\/v2\/tags?post=41"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}