16 Nov 2012 12:26 AM |
|
I want to extract the soil line by IDL, a scatter plot of red-NIR is needed. Although the following code is working, however, it's very slow for a large image or high resolution image because repeated drawing of many coincide points.
PLOT,B3,B4,LINESTYLE=1,PSYM=3
When I directly plot the red-NIR space in the ENVI, I found it very fast even for a very large image. Can you tell me how to solve this problem?
|
|
|
|
Deleted User New Member
Posts:81  
29 Nov 2012 08:31 PM |
|
Hi,
You might try plotting to the Z-buffer device, read the resulting image with TVRD() and then change back to the regular graphics device to display the resulting plot image. For example:
set_plot, 'z'
plot, a, b, linestyle=1,psym=3
data = tvrd()
set_plot, 'win'
tv, data
I hope this will help.
Regards,
Jim (Exelis VIS)
|
|
|
|
Deleted User New Member
Posts:  
30 Nov 2012 08:06 AM |
|
I'm sure what ENVI does, and what I would certainly do if I was going to make a scatter plot of two very large images, is to just take a much smaller random sampling of the pixel locations. Otherwise, your plot will look like something the dog did.
s = Size(NIRImage, /Dimensions)
indices = Round(RandomU(seed, 5000) * (s[0]*s[1]))
cgScatterPlot, NIRImage[indices], REDImage[indices], PSYM=3
Choose the number (e.g., 5000) to give you the best combination of speed and information.
|
|
|
|
Deleted User New Member
Posts:  
30 Nov 2012 03:32 PM |
|
I like David's suggestion, but what I might think to do instead (depending on what is in the images) is bin the large images (one pixel for every 5x5 window for instance) to obtain a subset, vs using an entirely random subset.
|
|
|
|
Deleted User New Member
Posts:  
30 Nov 2012 05:27 PM |
|
This was my first thought, too. But, when I am choosing not to display all the data I have, I think there is less chance to trick myself with a random selection of data, then there is with a systematic selection of data like this. Or, another way to say this, I think you will determine if your method is actually working correctly and giving you the results you expect much faster when you use a random selection. Maybe this is just a personal preference, but I choose it to avoid making systematic selection errors.
Another argument is that your "grid" method only works correctly for uniformly sampled grids. You will severely under-represent dense areas of the scatterplot and over-represent areas where you have fewer points. In a random selection, you should sample both areas of the image correctly.
|
|
|
|