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. smoothing issue

smoothing issue

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
3 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.
  • M Offline
    M Offline
    Member 13671328
    wrote on last edited by
    #1

    Dear Respected friends. good morning. i hope you are fine. I need your help. I have a problem with smoothing of output. I have this code .. it exports stair stepping. Can you help me.?

    int Imax = 10;
    for ( int I=0; I= sharpeningThreshold_percentage/2. && jstart == 0 ) {
    k0 = k;
    jstart = 1;
    }

        if ( 100. \* fabs(v2 -v1) / v1 >= sharpeningThreshold\_percentage ) {
          v1     = v2;
          k1     = k;
          jstart = 0;
          for ( int kk=k0; kk<=k; kk++ )
            v\[(iy\*nx+ix)\*nz + kk\] = v1;
          k0 = k1;
          break;
        }
        v\[(iy\*nx+ix)\*nz + k\] = v1;
          }
          if ( k >= nz-1 )
        break;
        }
      }
    }
    
    if ( I < Imax-1 )
      smooth(10, 1, v, nx, ny, nz);
    
      } // sharpening -smoothing I-loop closed
    
    } // if sharpeningThreshold\_percentage  closed
    

    }

    P 1 Reply Last reply
    0
    • M Member 13671328

      Dear Respected friends. good morning. i hope you are fine. I need your help. I have a problem with smoothing of output. I have this code .. it exports stair stepping. Can you help me.?

      int Imax = 10;
      for ( int I=0; I= sharpeningThreshold_percentage/2. && jstart == 0 ) {
      k0 = k;
      jstart = 1;
      }

          if ( 100. \* fabs(v2 -v1) / v1 >= sharpeningThreshold\_percentage ) {
            v1     = v2;
            k1     = k;
            jstart = 0;
            for ( int kk=k0; kk<=k; kk++ )
              v\[(iy\*nx+ix)\*nz + kk\] = v1;
            k0 = k1;
            break;
          }
          v\[(iy\*nx+ix)\*nz + k\] = v1;
            }
            if ( k >= nz-1 )
          break;
          }
        }
      }
      
      if ( I < Imax-1 )
        smooth(10, 1, v, nx, ny, nz);
      
        } // sharpening -smoothing I-loop closed
      
      } // if sharpeningThreshold\_percentage  closed
      

      }

      P Offline
      P Offline
      phil o
      wrote on last edited by
      #2

      You did not state what the problem is. What are you expecting from your code? What do you get instead that makes you say it is problematic?

      "I'm neither for nor against, on the contrary." John Middle

      M 1 Reply Last reply
      0
      • P phil o

        You did not state what the problem is. What are you expecting from your code? What do you get instead that makes you say it is problematic?

        "I'm neither for nor against, on the contrary." John Middle

        M Offline
        M Offline
        Member 13671328
        wrote on last edited by
        #3

        Dear Friend. The code works. But the output comes as stair steps. But, this is because of this sharpening .. and I want to alter . if you can give idea how to make the smoothing. v2 is the velocity of second layer. and v1 is velocity of first layer. maximum iterations is 10 with the percentage of threshold .. problem is that it gives sharp stair stepping. while I want to make like smooth signal in output. If you can guide.

        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