www.i4info.org

Would you like to react to this message? Create an account in a few clicks or log in to continue.
www.i4info.org

i4info Provides the best hacking Material. Latest hacking tutorials and tools are available here. It is the best place for hackers.

Latest topics

» Teen Patti Gold Hack & 3 Patti Chips Code Extra Bonus 2017
Color Detection on Images by Using MATLAB EmptySat Apr 29, 2017 10:50 am by ubedullah

» Group hackers
Color Detection on Images by Using MATLAB EmptySat Apr 15, 2017 2:37 pm by Group Hackers

» Hacker Needed
Color Detection on Images by Using MATLAB EmptySat Apr 15, 2017 3:57 am by Group Hackers

» Hacker Needed
Color Detection on Images by Using MATLAB EmptySat Apr 15, 2017 1:45 am by Group Hackers

» Hacker Needed
Color Detection on Images by Using MATLAB EmptyThu Apr 13, 2017 11:10 pm by Group Hackers

» Hacker Needed
Color Detection on Images by Using MATLAB EmptyTue Apr 11, 2017 2:07 pm by Group Hackers

» Hacker Needed
Color Detection on Images by Using MATLAB EmptyTue Apr 11, 2017 2:21 am by Group Hackers

» Hacker Needed
Color Detection on Images by Using MATLAB EmptyTue Apr 11, 2017 2:06 am by Group Hackers

» Hacker Needed
Color Detection on Images by Using MATLAB EmptyTue Apr 11, 2017 1:35 am by Group Hackers

May 2024

MonTueWedThuFriSatSun
  12345
6789101112
13141516171819
20212223242526
2728293031  

Calendar Calendar

Affiliates


free forum

Forumotion on Facebook Forumotion on Twitter Forumotion on YouTubeForumotion on Google+

Visitors Counter


Flag Counter


    Color Detection on Images by Using MATLAB

    Admin
    Admin
    Admin


    Posts : 474
    Reputation : 8
    Join date : 2014-12-10
    Age : 31
    Location : Pakistan

    Color Detection on Images by Using MATLAB Empty Color Detection on Images by Using MATLAB

    Post by Admin Sun Jun 05, 2016 5:06 pm

    Color Detection in Image by using MATLAB


     

    Hi everyone, I hope you are doing fine, Today I will share teach you how to detect images in MATLAB, in order to do so, I will share a step by step guide for Color Detection in MATLAB. I will share a project with you for better understanding and learning.
    [You must be registered and logged in to see this link.]

    • So as to do the Color Recognition in Images utilizing MATLAB, first of all, we require a Picture.


     

    • Therefore, I Designed a picture in paint that has diverse shapes in various hues as appeared in beneath picture:
      [You must be registered and logged in to see this link.]

    • There are distinctive shapes and colors in the picture, we will distinguish these shapes by their colors.


     

    • Copy/Paste the give code into your m File.


     

     

       data = imread('TEP.jpg');
       diff_im = imsubtract(data(:,:,2), rgb2gray(data));
       %Use a median filter to filter out noise
       diff_im = medfilt2(diff_im, [3 3]);
       diff_im = im2bw(diff_im,0.18);
       
       diff_im = bwareaopen(diff_im,300);
       
       bw = bwlabel(diff_im, Cool;
       
       stats = regionprops(bw, 'BoundingBox', 'Centroid');
       
       % Display the image
       imshow(data)
       
       hold on

       for object = 1:length(stats)
           bb = stats(object).BoundingBox;
           bc = stats(object).Centroid;
           rectangle('Position',bb,'EdgeColor','r','LineWidth',2)
           plot(bc(1),bc(2), '-m+')
           a=text(bc(1)+15,bc(2), strcat('X: ', num2str(round(bc(1))), ' Y: ', num2str(round(bc(2)))));
           set(a, 'FontName', 'Arial', 'FontWeight', 'bold', 'FontSize', 12, 'Color', 'black');
       end
       
       hold off

     

    • After implementing the code, Execute the m file, if there is no error, you will get the output.
      [You must be registered and logged in to see this link.]
      You can find in the above figure, we have just recognized the shapes with green shading.


    • The + sign demonstrates the focal point of each distinguished shape.


    • X and Y are the x,y directions of the mid point of every shape that are appeared in dark for every recognized shape.


    • Presently, We have distinguished red Shapes in the Pic, so keeping in mind the end goal to do as such what I have to do is to just change the third esteem in imsubtract capacity from 2 to 1.



    Download the complete code for Color detection.

    Download Full Code

    • If you run this code in MATLAB, then your output will be like that:


    • Now, it recognized the red shapes/Objectives in MATLAB.


     

    • Its x,y coordinates are in Dark Color.
      [You must be registered and logged in to see this link.]
      In the end we will identify the blue shading, to do so, you simply have to change the third parameter to 3 and it will distinguish the blue shading like this:


     

    That’s all for now, I hope it will help you a lot, For any kind of help ,about Color detection on image with MATLAB, Comment Below.

      Current date/time is Thu May 09, 2024 10:34 pm