comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » croping jpeg image
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
croping jpeg image [message #91207] Wed, 17 June 2015 06:44 Go to next message
kpaapu123 is currently offline  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 Go to previous messageGo to next message
Phillip Bitzer is currently offline  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 #91220 is a reply to message #91207] Wed, 17 June 2015 16:27 Go to previous messageGo to next message
jimuba is currently offline  jimuba
Messages: 9
Registered: February 2009
Junior Member
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
Re: croping jpeg image [message #91223 is a reply to message #91218] Wed, 17 June 2015 21:27 Go to previous messageGo to next message
Shaktivel Pillai is currently offline  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 Go to previous messageGo to next message
Shaktivel Pillai is currently offline  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 Go to previous message
Dick Jackson is currently offline  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
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Issue using the XROI command
Next Topic: cgWindow - what am I doing wrong that makes winID change values?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 09:15:29 PDT 2025

Total time taken to generate the page: 0.00525 seconds