Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8012889
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T19:28:26+00:00 2026-06-04T19:28:26+00:00

I have the following code, which I am trying to normalize my images after

  • 0

I have the following code, which I am trying to normalize my images after filtering but the problem is that as soon as it get to line 5, it change everyting to 0 and it returns me black images. any idea ?

 for i=1:10     
     temp_imag = imag_test1{i}(:,:);
     t_max = max(max(temp_imag));
     t_min = min(min(temp_imag));
     temp_imag = (temp_imag-t_min).*double(((new_max-new_min)/(t_max-t_min)))+double(new_min);
     imag_test1{i}(:,:) = temp_imag;
 end
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T19:28:28+00:00Added an answer on June 4, 2026 at 7:28 pm

    You don’t tell which values new_max and new_min get, but anyway if every after line 5 (temp_imag = (temp_imag-t_min).*double(((new_max-new_min)/(t_max-t_min)))+double(new_min);
    ) everything becomes zero, there are a few possibilities:

    1. imga_test{i} (1 <= i <= 10) are all zeros and new_min is also zero. Have you checked the value of imga_test that they are not all zeros and that they vary? You can create example data for imga_test eg. by using rand or randi. If random data gives you non-zeros, the problem is in imga_test.

    2. new_max-new_min is zero, which means that new_max and new_min have same value. Have you tried changing values for new_max and new_min and changing their difference? If changing the values of new_max, new_min or both gives you non-zeros, the problem is in new_max and new_min.

    3. By using solve to solve the equation eg. for new_min:

      solve('temp_imag = (temp_imag-t_min)*(((new_max-new_min)/(t_max-t_min)))+(new_min)', 'new_min'):

      ans =
      (new_max*t_min - new_max*temp_imag - t_min*temp_imag + t_max*temp_imag)/(t_max - temp_imag)

    This third case is very improbable.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have following code which works for radio buttons but need to be changed
I have the following code, which I'm trying to only allow a maximum of
I have the following code, with which I am trying to create a seperated
I have the following code which i m trying to compile: #include <boost/filesystem/convenience.hpp> #include
I have the following code which you're able to see what I am trying
I have the following code which I'm trying to write a LRU Cache. I
I have the following C-code which I am trying to re-write in java. I
I have the following code which is trying to stop propagation, works every where
I have the following code which works under V2 and I am trying to
I have the following code which turns a string, that I pass into the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.