DISP_ROI_GROW_REGION [message #59447] |
Wed, 26 March 2008 08:31  |
Leonardo R. Sbaraini
Messages: 26 Registered: October 2007
|
Junior Member |
|
|
Hello all,
Example of the problem:
I need to resize a ROI (oversample) obtained from image1 (100x100)
and show it in image2 (200x200).
I had success in creating a tool to downsample the ROI (the inverse
problem), but do oversample, the ROI is not exactly what I want, have
somr borders problem.
Well, seeing the file "envi_all_functions.txt" that I dont know from
where it cames, theres is method with a sintaxe:
DISP_ROI_GROW_REGION, p_data, /ASK, /GROUP, /REDO
I ask if someone had used this routine, and dont know how to initiate
p_data.
Maybe I can help showing my code here (to oversample):
; ***************************
; Growing for x axis
; ***************************
; x is a long array with the xaxis positions
xSize = n_elements(x)
xNewSize = xSize * intScaleFactor * intScaleFactor
xNew = lonarr(xNewSize)
xNew[*] = -1
currentXnewIndex = 0
for xi=0, xSize-1 do begin
numberToWrite = x[xi]
; The box side for every x
for sfRepeater = 0, intScaleFactor-1 do begin
; The box side for current element of x (xi)
for sfRepeaterNested = 0, intScaleFactor-1 do begin
; Verifying the image limit
if numberToWrite lt lngDestinationWidth then begin
xNew[currentXnewIndex++] =
numberToWrite
endif
endfor
numberToWrite++
endfor
endfor
; Removing invalid indexes
goodIndex = where(xNew ne -1)
if goodIndex[0] ne -1 then xNew = xNew[goodIndex]
x = temporary(xNew)
;
************************************************************ ***********************
|
|
|
Re: DISP_ROI_GROW_REGION [message #59656 is a reply to message #59447] |
Fri, 04 April 2008 04:14  |
Leonardo R. Sbaraini
Messages: 26 Registered: October 2007
|
Junior Member |
|
|
It's me again.
The problem do not have a good solution because when you downsample an
image you lost information and when you oversample an image you put
wrong information. So, the roi indexes will never match exactly the
coherence expected. The nearest solution is oversample/downsample and
verify later where we can really withdraw data from modified indexes.
(There must be exist a data value marker signing the no valid data)
|
|
|