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 / C++ / MFC
  4. [Message Deleted]

[Message Deleted]

Scheduled Pinned Locked Moved C / C++ / MFC
7 Posts 4 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.
  • U Offline
    U Offline
    umai
    wrote on last edited by
    #1

    [Message Deleted]

    CPalliniC 1 Reply Last reply
    0
    • U umai

      [Message Deleted]

      CPalliniC Offline
      CPalliniC Offline
      CPallini
      wrote on last edited by
      #2

      umai wrote:

      however i got problem to do the looping as my lecturer want me to...can anyone teach me how to do it?

      Please detail your problem: what exactly do you need to accomplish and what is your trouble about?

      If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
      This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke

      In testa che avete, signor di Ceprano?

      U 1 Reply Last reply
      0
      • CPalliniC CPallini

        umai wrote:

        however i got problem to do the looping as my lecturer want me to...can anyone teach me how to do it?

        Please detail your problem: what exactly do you need to accomplish and what is your trouble about?

        If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
        This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke

        U Offline
        U Offline
        umai
        wrote on last edited by
        #3

        //////////////////////////////RGB CHANGE TO GREY SCALE COLOR///////////////////////// for(x=X_START;x<=X_END;x+=X_SKIP) //ORIGINAL IMAGE SIZE-X AXIS { for(y=Y_START_SE;y<=Y_END_SE;y+=Y_SKIP) //SELECTED SCAN AREA-Y AXIS(FR ORI SIZE) { color=pDC->GetPixel(x,y); m = 0.5*x; n = 0.5*y; r_image[m][n] = GetRValue(color); g_image[m][n] = GetGValue(color); b_image[m][n] = GetBValue(color); brightness_image[m][n] = ((222*r_image[m][n]+707*g_image[m][n]+71*b_image[m][n])/1000); if(brightness_image[m][n]<0) brightness_image[m][n] = 0; if(brightness_image[m][n]>255) brightness_image[m][n] = 255; Haugh_image[m][n]=0;//Haugh_image INITIALIZATION } } for(x=X_START;x<=X_END;x+=X_SKIP) //ORIGINAL IMAGE SIZE-X AXIS { for(y=Y_START_SE2;y<=Y_END_SE2;y+=Y_SKIP) //SELECTED SCAN AREA-Y AXIS(FR ORI SIZE) { color=pDC->GetPixel(x,y); m = 0.5*x; n = 0.5*y; r_image[m][n] = GetRValue(color); g_image[m][n] = GetGValue(color); b_image[m][n] = GetBValue(color); brightness_image[m][n] = ((222*r_image[m][n]+707*g_image[m][n]+71*b_image[m][n])/1000); if(brightness_image[m][n]<0) brightness_image[m][n] = 0; if(brightness_image[m][n]>255) brightness_image[m][n] = 255; Haugh_image[m][n]=0;//Haugh_image INITIALIZATION } } //////////////////EDGE DETACTION BY SOBEL FILTER & DENSITY CONVERSION/////////////////// //UPPER LEFT AREA for(x=X_START_L1+1;x<=X_END_L1-1;x++) { for(y=Y_START_TH+1;y<=Y_END_TH-1;y++) { d[0]=brightness_image[x-1][y-1]; d[1]=brightness_image[x-1][y]; d[2]=brightness_image[x-1][y+1]; d[3]=brightness_image[x][y-1]; d[4]=brightness_image[x][y]; d[5]=brightness_image[x][y+1]; d[6]=brightness_image[x+1][y-1]; d[7]=brightness_image[x+1][y]; d[8]=brightness_image[x+1][y+1]; yyy=(float)(cy[0]*d[0] + cy[1]*d[1] + cy[2]*d[2] +cy[3]*d[3] +cy[4]*d[4] +cy[5]*d[5] +cy[6]*d[6] + cy[7]*d[7] + cy[8]*d[8]); zzz=(float)(sqrt(yyy*yyy)); dat=(int)zzz; if(dat>255) dat= 255; sobel_image[x][y] = 255-(char)dat; a = sobel_image[x][y]; pDC->SetPixel(x,y,RGB(a,a,a)); } } //UPPER RIGHT AREA for(x=X_START_R1+1;x<=X_END_R1-1;x++) { for(y=Y_START_TH+1;y<=Y_END_TH-1;y++) { d[0]=brightness_image[x-1][y-1]; d[1]=brightness_image[x-1][y]; d[2]=brightness_image[x-1][y+1]; d[3]=brightness_image[x][y-1]; d[4]=brightness_image[x][y]; d[5]=bri

        CPalliniC 1 Reply Last reply
        0
        • U umai

          //////////////////////////////RGB CHANGE TO GREY SCALE COLOR///////////////////////// for(x=X_START;x<=X_END;x+=X_SKIP) //ORIGINAL IMAGE SIZE-X AXIS { for(y=Y_START_SE;y<=Y_END_SE;y+=Y_SKIP) //SELECTED SCAN AREA-Y AXIS(FR ORI SIZE) { color=pDC->GetPixel(x,y); m = 0.5*x; n = 0.5*y; r_image[m][n] = GetRValue(color); g_image[m][n] = GetGValue(color); b_image[m][n] = GetBValue(color); brightness_image[m][n] = ((222*r_image[m][n]+707*g_image[m][n]+71*b_image[m][n])/1000); if(brightness_image[m][n]<0) brightness_image[m][n] = 0; if(brightness_image[m][n]>255) brightness_image[m][n] = 255; Haugh_image[m][n]=0;//Haugh_image INITIALIZATION } } for(x=X_START;x<=X_END;x+=X_SKIP) //ORIGINAL IMAGE SIZE-X AXIS { for(y=Y_START_SE2;y<=Y_END_SE2;y+=Y_SKIP) //SELECTED SCAN AREA-Y AXIS(FR ORI SIZE) { color=pDC->GetPixel(x,y); m = 0.5*x; n = 0.5*y; r_image[m][n] = GetRValue(color); g_image[m][n] = GetGValue(color); b_image[m][n] = GetBValue(color); brightness_image[m][n] = ((222*r_image[m][n]+707*g_image[m][n]+71*b_image[m][n])/1000); if(brightness_image[m][n]<0) brightness_image[m][n] = 0; if(brightness_image[m][n]>255) brightness_image[m][n] = 255; Haugh_image[m][n]=0;//Haugh_image INITIALIZATION } } //////////////////EDGE DETACTION BY SOBEL FILTER & DENSITY CONVERSION/////////////////// //UPPER LEFT AREA for(x=X_START_L1+1;x<=X_END_L1-1;x++) { for(y=Y_START_TH+1;y<=Y_END_TH-1;y++) { d[0]=brightness_image[x-1][y-1]; d[1]=brightness_image[x-1][y]; d[2]=brightness_image[x-1][y+1]; d[3]=brightness_image[x][y-1]; d[4]=brightness_image[x][y]; d[5]=brightness_image[x][y+1]; d[6]=brightness_image[x+1][y-1]; d[7]=brightness_image[x+1][y]; d[8]=brightness_image[x+1][y+1]; yyy=(float)(cy[0]*d[0] + cy[1]*d[1] + cy[2]*d[2] +cy[3]*d[3] +cy[4]*d[4] +cy[5]*d[5] +cy[6]*d[6] + cy[7]*d[7] + cy[8]*d[8]); zzz=(float)(sqrt(yyy*yyy)); dat=(int)zzz; if(dat>255) dat= 255; sobel_image[x][y] = 255-(char)dat; a = sobel_image[x][y]; pDC->SetPixel(x,y,RGB(a,a,a)); } } //UPPER RIGHT AREA for(x=X_START_R1+1;x<=X_END_R1-1;x++) { for(y=Y_START_TH+1;y<=Y_END_TH-1;y++) { d[0]=brightness_image[x-1][y-1]; d[1]=brightness_image[x-1][y]; d[2]=brightness_image[x-1][y+1]; d[3]=brightness_image[x][y-1]; d[4]=brightness_image[x][y]; d[5]=bri

          CPalliniC Offline
          CPalliniC Offline
          CPallini
          wrote on last edited by
          #4

          First of all, please, use <pre> tags around code snippets. Why don't you wrap that code inside a function and then iteratively call it?

          If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
          This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke

          In testa che avete, signor di Ceprano?

          C 1 Reply Last reply
          0
          • CPalliniC CPallini

            First of all, please, use <pre> tags around code snippets. Why don't you wrap that code inside a function and then iteratively call it?

            If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
            This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke

            C Offline
            C Offline
            Christian Graus
            wrote on last edited by
            #5

            Because that adds the cost of a function call to every pixel that is processed ?

            Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

            CPalliniC M 2 Replies Last reply
            0
            • C Christian Graus

              Because that adds the cost of a function call to every pixel that is processed ?

              Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

              CPalliniC Offline
              CPalliniC Offline
              CPallini
              wrote on last edited by
              #6

              Actually he needs to loop over images. :)

              If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
              This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke

              In testa che avete, signor di Ceprano?

              1 Reply Last reply
              0
              • C Christian Graus

                Because that adds the cost of a function call to every pixel that is processed ?

                Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

                M Offline
                M Offline
                Mark Salsbery
                wrote on last edited by
                #7

                :((

                Mark Salsbery Microsoft MVP - Visual C++ :java:

                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