Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. How work with images in C# [modified]

How work with images in C# [modified]

Scheduled Pinned Locked Moved C#
helpcsharptutorial
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    signimage
    wrote on last edited by
    #1

    Hello iam of student of BS compSc ,im working on my final project that is"Histogram-Based Fuzzy Filter" trying to implement research paper, but i m facing alot of problem do not know how to encode in C#, i have done some work on image like conversion of rgb image into grayscale ,and also draw its histogram but no succes towards implementing this papper, i have to complete this project in a 15 days plz help me -- modified at 1:50 Tuesday 29th August, 2006

    N 1 Reply Last reply
    0
    • S signimage

      Hello iam of student of BS compSc ,im working on my final project that is"Histogram-Based Fuzzy Filter" trying to implement research paper, but i m facing alot of problem do not know how to encode in C#, i have done some work on image like conversion of rgb image into grayscale ,and also draw its histogram but no succes towards implementing this papper, i have to complete this project in a 15 days plz help me -- modified at 1:50 Tuesday 29th August, 2006

      N Offline
      N Offline
      Nader Elshehabi
      wrote on last edited by
      #2

      Hello Your title was quite clear in stating that you are facing a problem with images -and this is the C# forum BTW. Welcome:-D- Yet, your post itself didn't specify what exactly are you stuck with??

      Asma Saleem wrote:

      i m facing alot of problem do not know how to encode in C#

      At All?!!:omg: And what exactly are you expecting??

      Asma Saleem wrote:

      plz help me

      We realy want to help -that's why we are here after all-, but how??

      Regards:rose:

      S 1 Reply Last reply
      0
      • N Nader Elshehabi

        Hello Your title was quite clear in stating that you are facing a problem with images -and this is the C# forum BTW. Welcome:-D- Yet, your post itself didn't specify what exactly are you stuck with??

        Asma Saleem wrote:

        i m facing alot of problem do not know how to encode in C#

        At All?!!:omg: And what exactly are you expecting??

        Asma Saleem wrote:

        plz help me

        We realy want to help -that's why we are here after all-, but how??

        Regards:rose:

        S Offline
        S Offline
        signimage
        wrote on last edited by
        #3

        plz help in converting code from matlab to C#, i m sending u code as i told im working in image processing , ihave done all work in matlab but now i hve convert it in to C# Code is below %Reading image file and storing it in a variable. imagex=imread('D:\MS_courses\ece655\Project\test_images\test_image3.jpg'); %RGB2GRAY converts RGB images to grayscale by eliminating the %hue and saturation information while retaining the luminance. %im2double takes an image as input, and returns an image of class double. f = im2double(rgb2gray(imagex)); %f=[.1,.2,.3;.4,.5,.6;.7,.8,.9]; %Storing the number of rows and columns in separate output variables [sizeM, sizeN] = size(f); %Counter is used just to check the status of the program at all times. counter = 0; %for k=1:1:256 %gvalue_f(k) = 0; %gvalue_N(k) = 0; %end %-------------------------------------------------------------------------- %This loops makes a window of 3*3 and scans over the image from left to %right and top to bottom to get those pixel values that are most probably %a function of Impulse, called Nimp. for x=2:1:(sizeM-1) for y=2:1:(sizeN-1) k = x; l = y; x1 = f(k-1, l-1); x2 = f(k-1, l); x3 = f(k-1, l+1); x4 = f(k, l-1); x5 = f(k, l); x6 = f(k, l+1); x7 = f(k+1, l-1); x8 = f(k+1, l); x9 = f(k+1, l+1); W = [x1,x2,x3,x4,x5,x6,x7,x8,x9]; x_sum = 0; count = 0; x_temp = 0; wind(1,1) = W(1); wind(1,2) = W(2); wind(1,3) = W(3); wind(2,1) = W(4); wind(2,2) = W(5); wind(2,3) = W(6); wind(3,1) = W(7); wind(3,2) = W(8); wind(3,3) = W(9); for m=1:1:3 for n=1:1:3 x_temp = wind(m,n); if((x_temp == min(W)) | (x_temp == max(W)))% | (x_temp <= 10) | (x_temp >= 230)) Nimp_sub(m, n) = x_temp; else count = count + 1; x_sum = x_sum + x_temp; Nimp_sub(m, n) = 0; end end end %Nimp=size(f); Nimp(k-1:k+1,l-1:l+1) = Nimp_sub; counter = counter + 1 end end %--------------------------------------------------------------------------- %for k=2:1:sizeM-1 % for k=2:1:sizeN-1 % gvalue_f(f(k, l)) = gvalue_f(f(k, l)) + 1; % Nimp_db = im2uint8(Nimp(k, l)) + 1; % gvalue_N(Nimp_db(k, l)

        N 1 Reply Last reply
        0
        • S signimage

          plz help in converting code from matlab to C#, i m sending u code as i told im working in image processing , ihave done all work in matlab but now i hve convert it in to C# Code is below %Reading image file and storing it in a variable. imagex=imread('D:\MS_courses\ece655\Project\test_images\test_image3.jpg'); %RGB2GRAY converts RGB images to grayscale by eliminating the %hue and saturation information while retaining the luminance. %im2double takes an image as input, and returns an image of class double. f = im2double(rgb2gray(imagex)); %f=[.1,.2,.3;.4,.5,.6;.7,.8,.9]; %Storing the number of rows and columns in separate output variables [sizeM, sizeN] = size(f); %Counter is used just to check the status of the program at all times. counter = 0; %for k=1:1:256 %gvalue_f(k) = 0; %gvalue_N(k) = 0; %end %-------------------------------------------------------------------------- %This loops makes a window of 3*3 and scans over the image from left to %right and top to bottom to get those pixel values that are most probably %a function of Impulse, called Nimp. for x=2:1:(sizeM-1) for y=2:1:(sizeN-1) k = x; l = y; x1 = f(k-1, l-1); x2 = f(k-1, l); x3 = f(k-1, l+1); x4 = f(k, l-1); x5 = f(k, l); x6 = f(k, l+1); x7 = f(k+1, l-1); x8 = f(k+1, l); x9 = f(k+1, l+1); W = [x1,x2,x3,x4,x5,x6,x7,x8,x9]; x_sum = 0; count = 0; x_temp = 0; wind(1,1) = W(1); wind(1,2) = W(2); wind(1,3) = W(3); wind(2,1) = W(4); wind(2,2) = W(5); wind(2,3) = W(6); wind(3,1) = W(7); wind(3,2) = W(8); wind(3,3) = W(9); for m=1:1:3 for n=1:1:3 x_temp = wind(m,n); if((x_temp == min(W)) | (x_temp == max(W)))% | (x_temp <= 10) | (x_temp >= 230)) Nimp_sub(m, n) = x_temp; else count = count + 1; x_sum = x_sum + x_temp; Nimp_sub(m, n) = 0; end end end %Nimp=size(f); Nimp(k-1:k+1,l-1:l+1) = Nimp_sub; counter = counter + 1 end end %--------------------------------------------------------------------------- %for k=2:1:sizeM-1 % for k=2:1:sizeN-1 % gvalue_f(f(k, l)) = gvalue_f(f(k, l)) + 1; % Nimp_db = im2uint8(Nimp(k, l)) + 1; % gvalue_N(Nimp_db(k, l)

          N Offline
          N Offline
          Nader Elshehabi
          wrote on last edited by
          #4

          Hello I've never worked in Matlab -I'm a C++, C# developer-, so the code above is very unfamiliar. Yet I can get a grasp of what you are trying to do. One Question: Did you ever program in C#?? If you're asking someone to build your program from the scratch!! It's highly unlikely to find him here!! Sorry!

          Regards:rose:

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups