X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 20 Mar 2014 09:17 AM by  anon
Specific histrogram generation
 1 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:19
New Member


--
20 Mar 2014 09:17 AM
    Hi everyone, I have a script that will run through a bunch of images and generate stats and histograms values for each image. I'm looking to speed this process up since it is quite slow. I'm really only interested in 2 histogram values: 0 and the highest histogram value (differs depending if 8-bit or 16-bit image). Is there anyway that I could get ENVI/IDL to only give me these values to speed things up? Thanks in advance

    Deleted User



    New Member


    Posts:
    New Member


    --
    27 Mar 2014 03:09 PM
    I not sure if I'm fully understanding your question, but if you want to generate a histogram with only two values, then using the WHERE function might be a possible. An example of how this can be done is shown below: pro test_two_value_hist compile_opt idl2 ;create some random data and convert it ;byte data raw_data = randomu(seed, 20,20) byt_data = byte(raw_data*50) ;Determine the max value in the data mx = max(byt_data,min=mn) ;Use where function to determine the ;number of times the max and min values ;occur in the data wmx = where(byt_data eq mx, countmx) wmn = where(byt_data eq mn, countmn) ;Generate a histogram with this information b =barplot([mn,mx],[countmn,countmx], /histogram,$ fill_color='blue',yrange=[0,max([countmx,countmn])+2]) end
    You are not authorized to post a reply.