croping jpeg image [message #91207] |
Wed, 17 June 2015 06:44  |
kpaapu123
Messages: 2 Registered: June 2015
|
Junior Member |
|
|
i have opened a jpeg image in idl using
tv,image,true=1
now i want to crop only the central region of the sun where sunspots are present.... for these i used the cursor command and placed it in low left and right---got the co-ordinates----and then placed the cursor at right top--got the x and y......then i used image=image[low x:topx,lowy:topy]
but im not getting the image croped....instead getting
% subscript range values of the form low:high must be >=0,<size,with low<=high:image
|
|
|
Re: croping jpeg image [message #91218 is a reply to message #91207] |
Wed, 17 June 2015 11:46   |
Phillip Bitzer
Messages: 223 Registered: June 2006
|
Senior Member |
|
|
On Wednesday, June 17, 2015 at 8:44:26 AM UTC-5, kpaa...@gmail.com wrote:
> i have opened a jpeg image in idl using
> tv,image,true=1
>
> now i want to crop only the central region of the sun where sunspots are present.... for these i used the cursor command and placed it in low left and right---got the co-ordinates----and then placed the cursor at right top--got the x and y......then i used image=image[low x:topx,lowy:topy]
>
> but im not getting the image croped....instead getting
> % subscript range values of the form low:high must be >=0,<size,with low<=high:image
What are the values for low_x, top_x, etc? What are the dimensions of image?
|
|
|
|
Re: croping jpeg image [message #91223 is a reply to message #91218] |
Wed, 17 June 2015 21:27   |
Shaktivel Pillai
Messages: 16 Registered: June 2015
|
Junior Member |
|
|
On Wednesday, June 17, 2015 at 11:46:34 PM UTC+5, Phillip Bitzer wrote:
> On Wednesday, June 17, 2015 at 8:44:26 AM UTC-5, kpaa...@gmail.com wrote:
>> i have opened a jpeg image in idl using
>> tv,image,true=1
>>
>> now i want to crop only the central region of the sun where sunspots are present.... for these i used the cursor command and placed it in low left and right---got the co-ordinates----and then placed the cursor at right top--got the x and y......then i used image=image[low x:topx,lowy:topy]
>>
>> but im not getting the image croped....instead getting
>> % subscript range values of the form low:high must be >=0,<size,with low<=high:image
>
> What are the values for low_x, top_x, etc? What are the dimensions of image?
low x=44.53
low y=359.79
top x=163.05
top y=435.64
still im not getting the image croped..please help me in this
|
|
|
Re: croping jpeg image [message #91224 is a reply to message #91220] |
Wed, 17 June 2015 21:27   |
Shaktivel Pillai
Messages: 16 Registered: June 2015
|
Junior Member |
|
|
On Thursday, June 18, 2015 at 4:27:49 AM UTC+5, jim...@gmail.com wrote:
> Considering:
>
>> i have opened a jpeg image in idl using
>> tv,image,true=1
>
> This means that the image array is pixel interleaved, with dimensions like:
>
> [3,n,m]
>
> To crop the image you need to specify all three dimension in the array, for example:
>
> image=image[*,lowx:topx,lowy:topy]
>
> I hope this helps.
>
> -Jim
low x=44.53
low y=359.79
top x=163.05
top y=435.64
still im not getting the image croped..please help me in this
|
|
|
Re: croping jpeg image [message #91226 is a reply to message #91223] |
Wed, 17 June 2015 21:41  |
Dick Jackson
Messages: 347 Registered: August 1998
|
Senior Member |
|
|
On Wednesday, 17 June 2015 21:27:12 UTC-7, Shaktivel Pillai wrote:
> On Wednesday, June 17, 2015 at 11:46:34 PM UTC+5, Phillip Bitzer wrote:
>> On Wednesday, June 17, 2015 at 8:44:26 AM UTC-5, kpaa...@gmail.com wrote:
>>> i have opened a jpeg image in idl using
>>> tv,image,true=1
>>>
>>> now i want to crop only the central region of the sun where sunspots are present.... for these i used the cursor command and placed it in low left and right---got the co-ordinates----and then placed the cursor at right top--got the x and y......then i used image=image[low x:topx,lowy:topy]
>>>
>>> but im not getting the image croped....instead getting
>>> % subscript range values of the form low:high must be >=0,<size,with low<=high:image
>>
>> What are the values for low_x, top_x, etc? What are the dimensions of image?
>
> low x=44.53
> low y=359.79
> top x=163.05
> top y=435.64
>
>
> still im not getting the image croped..please help me in this
On Wednesday, 17 June 2015 16:27:49 UTC-7, jim...@gmail.com wrote:
> Considering:
>
>> i have opened a jpeg image in idl using
>> tv,image,true=1
>
> This means that the image array is pixel interleaved, with dimensions like:
>
> [3,n,m]
>
> To crop the image you need to specify all three dimension in the array, for example:
>
> image=image[*,lowx:topx,lowy:topy]
>
> I hope this helps.
>
> -Jim
Hi,
May I gently assure you that all three of these are worth your full attention:
- the error message from IDL
- Phillip's *entire* reply to you (both questions--you didn't answer the second one)
- Jim's excellent insight
I'm quite certain that the answer will come when you take all of those to heart.
Cheers,
-Dick
Dick Jackson Software Consulting Inc.
Victoria, BC, Canada --- http://www.d-jackson.com
|
|
|