PowerShot SX220 HS - Porting Thread - page 52 - General Discussion and Assistance - CHDK Forum

PowerShot SX220 HS - Porting Thread

  • 563 Replies
  • 202511 Views
*

Offline fe50

  • ******
  • 3147
  • IXUS50 & 860, SX10 Star WARs-Star RAWs
    • fe50
Re: PowerShot SX220 HS - Porting Thread
« Reply #510 on: 15 / April / 2012, 03:20:46 »
Advertisements
Is it possible to use bracketing in continuous mode with enabled RAW?
Yes.
Just set the RAW Exceptions from the CHDK menu to your needs...
* http://chdk.wikia.com/wiki/CHDK_User_Manual#Exceptions

Re: PowerShot SX220 HS - Porting Thread
« Reply #511 on: 06 / June / 2012, 13:41:39 »
Hi all,
I have an SX220HS (firmware 1.01C, CHDK sx220hs-101c-1.1.0-1868-full_BETA) mounted on a microscope.

---not so relevant details, maybe continue below ---
I have been using an IXUS70 so far but changed to the SX220HS to record videos at higher resolution. I mostly control the camera through the "ptpcam --chdk" client on linux. There is a major advantage of the SX220HS over the IXUS70 as ptp communication still reacts while recording a video sequence, enabling me to stop recording once the microscope has performed its job. On the IXUS70 I had to submit a lua script that would press "stop", i.e. click("shoot") after a predefined amount of sleep(). On the SX220HS, click("video") just works fine over ptp.
--- here's the thing ---

There are a couple of things that I believe are "bugs" or rather unfinished porting issues. I have set up a compiler CHDK, but I don't see myself capable of usefully altering the source code so that the community could profit. In the end, I would have to try, but I am for now listing the issues that don't work with the above-mentioned camera-FW-CHDK combination. All of these issues occur when controlling the camera via ptp. I am not using the camera's "keyboard".

1. wheel_left(), wheel_right(): no effect in various capturing modes, which is mostly impairing in manual mode.

2. crash after zooming unless "mode selector wheel" is in P position:
-When booting the camera in P position, CHDK boots with a white-on-red startup text. When booting in other modes, e.g. auto, video, it's white-on-organge. Well, this does not really impair functionality, but might help figuring out what's going wrong. As soon as the camera is not booted in P position, switching to record mode still works. However, executing a "set_zoom()" will crash the camera. Thus, to get to manual mode via ptp, I have to send and run the following script:

send "mode 1" via ptpcam

sleep(3000)
set_zoom(115)
capmode=require("capmode")
print("started")
capmode.set(capmode.name_to_mode["M"])


Once this is set (I need a zoom of 115 due to the optics of my microscope), any further zoom change in this mode mostly results in a camera crash.

3. I have been looking through the RAM of the camera and identified some potentially interesting "regions". One might have to do with the image stabilizer.  If you dump the RAM from 0x9A32DD with a size of 68215 bytes using ptpcam (with a tiny modification I could post if anyone wants it), one gets a BW-image (320x ca.200), every 4 bytes are in reverse row order. This image is frequently updated and changes size (crops away information from the edges) as soon as the object in focus is moving. Maybe this RAM location could be of interest to someone.

4. viewport size via "video out": The viewport size via video out is not the same as on the display, it's sort of 4:3. I have connected the camera via one of those dual usb/video-out plugs (can post the pinout) to have usb and video simultaneously. Two of the video pins are short-circuited by the original video plug, telling the camera to change the viewport size. I did not yet figure out how this affects RAM locations. However, all the menus and the viewfinder "bitmap" overlay are changed by the original firmware while CHDK ignores the change and gets clipped off on the right side of the image. This, in turn, would suggest that the viewport RAM locations don't change. All this, however, seems to cause some disturbance in "md_detect_motion()" as the coordinates of the definable viewport regions are not following original conventions. As I need access to the viewport data (with as high framerate as possible), either on the camera or via ptp, I would like to ask whether anyone figured out where to grab the YUV image from the viewport while in "video out display  mode". Here are the approximate potential regions within the RAM that I dumped and that seem to contain some relevant data:

start byte h9A32DD1A9B81F1AD23A61B0B53E   1B446D61B7B25D2001CB429436D84001357
size to read68215155920165665155920155920165665321585487250331330

Any suggestion which buffer I should dump?

5. Does anyone know how to extract the coordinates determined by the "tracking AF"? This feature would be neat in my setup as it could help me track some changes in my specimens. I get a rather high contrast image on the microscope which is "easy" for the canon tracking af.

If anyone would be willing to resolve the above mentioned issues I would do the testing of the code and give feedback. I am working in a scientific setting so I am mostly interested in getting my system to work where the camera is just a part but plays an essential role. I am glad there is CHDK and it already helped me a lot so far. I could compile the code here, set up a svn client to fetch changes but could also test built versions. Ideally, the achievements would find their way into both CHDK and "chdkptp" so that we all could profit.


Re: PowerShot SX220 HS - Porting Thread
« Reply #512 on: 06 / June / 2012, 17:23:46 »
I have an SX220HS (firmware 1.01C, CHDK sx220hs-101c-1.1.0-1868-full_BETA) mounted on a microscope.

I cannot help with your specific questions but I am interested in your microscopy setup.

Can you provide further details and how you couple the camera to the microscope ?

I have one of these http://earth2geologists.net/Microscopes/photogallery/Zeiss_UltraphotII.jpg

(I actually have two but the second body is in a shed).

It is equipped for nearly all techniques including Nomarski incident and transmitted, UV incident, phase contrast transmitted, phase-contrast incident (!), light field, dark field, epi bright field, epi darkfield, etc.



David

Re: PowerShot SX220 HS - Porting Thread
« Reply #513 on: 07 / June / 2012, 02:25:56 »
Hi! This microscope indeed looks great and I am sure you'd profit from a CHDK camera. This is what you can do, if you have a 10x or similar eyepiece.
  • The most suitable optics are those found in ixus60,ixus70, and alike.
  • You have to get an eyepice onto your c-mount have the camera needs to be suspended above (check attached image). The distance has to be empirically determined, however, it is helpful to turn the microscope on with bright light so you can see projected image falling onto the lid of the closed camera objective.
  • Make yourself a battery adapter, e.g. from a piece of wood or plastic, using 2 wires. You can use an old PC power supply with the 3.3V pins. Check the polarity and voltage first before use, this can damage your camera!
  • You'll need to zoom in a bit to get rid of the dark circle around your image. This can be automated using a CHDK script.
  • Once you get an image, play with the adjustments and enjoy CHDK. This tends to give you equivalent, if not more functionality than microscope cameras.
  • For computer connectivity, get yourself an old TV digitizer card to bring the image of the viewport to the computer screen from where you could also send "shoot()" commands via ptpcam. The USB and video connector are too tight to fit both, however you can grind of a little of the USB plug's plastic and both will just fit fine in an ixus60/70.
  • For the SX220HS, the optics are a bit more complicated :(. You'll need an about 2x "eyepiece", a component I found in a box of old camera mount accessories in our institute. I am sure you can buy a 2x lens of about 4 cm diameter, but this could be expensive.

I hope this helps. All I can tell is that the effort you put into the camera mount pays off. There is a company selling professional mounts (google for lmscope). These things work very well, but they're expensive. And you'll need to really match the lens in the adapter with your particular camera. However, they guys there are very cooperative.

Good luck with your project!


Re: PowerShot SX220 HS - Porting Thread
« Reply #514 on: 07 / June / 2012, 12:54:45 »
I am sure you'd profit from a CHDK camera

Yes, thanks, I already have this connected to my microscope and even download images via PTP.

Quote
changed to the SX220HS to record videos at higher resolution.

Well, the videos may be larger but not necessarily higher resolution.
By their nature, microscope images do not include a lot of detail.
The higher the magnification, the less the resolution (even though you can 'detect' smaller details).

Quote
-When booting the camera in P position, CHDK boots with a white-on-red startup text. When booting in other modes, e.g. auto, video, it's white-on-organge.

Does the camera remain in Playback mode in both cases ?

Quote
I would like to ask whether anyone figured out where to grab the YUV image from the viewport while in "video out display  mode".


Let us do it another way  ...  describe exactly what you would like the application to do and if there are alternative solutions.
« Last Edit: 07 / June / 2012, 12:56:45 by Microfunguy »

Re: PowerShot SX220 HS - Porting Thread
« Reply #515 on: 12 / June / 2012, 06:00:06 »
Hi microfunguy

I noticed the forum was down but now it seems to work again. Thanks for your reply.

Certainly, the resolution of the microscope won't change. However, having more pixels available allows me to see the details I need to see. The low-res video of the ixus70 was just not enough for proper representation of neuronal processes which get basically depicted as 1-pixel lines. This changes to 1-3 pixels on the SD220 and I'm happy. I certainly agree taking 10MP images on microscopes is nonsense even though I know quite some people who think that's useful...

Did you also mount the camera with an eyepiece? Do you have a better solution? Do you have a picture of your setup?

Now back to CHDK on the SD220:

>> -When booting the camera in P position, CHDK boots with a white-on-red startup text. When booting in other modes, e.g. auto, video, it's white-on-organge.
> Does the camera remain in Playback mode in both cases ?

Yes. The camera stays in Playback mode. It only switches to Record mode once I either press a button related to shooting, turn the mode selection wheel, or issue "mode 1" via ptpcam. Then the lens moves out and I am in Record mode.


>>    I would like to ask whether anyone figured out where to grab the YUV image from the viewport while in "video out display  mode".
>Let us do it another way  ...  describe exactly what you would like the application to do and if there are alternative solutions.

I am trying to do motion tracking with the camera. I know some people have done rather advanced tracking using CHDK as a base, but I am worried about simple portability. There are many scientists in my field who would profit from a tracking software that could run on a variety of CHDK cameras that can be mounted on essentially any microscope.

Here are the 2 things I need the camera to do:
1. idendify a contrast-rich moving object (an organism crawling on a slide)
2. move the slide using a motorized stage

part 2 is solved. Part 1 is possible in lua on the ixus70, however I run into "out of memory" errors on the SD220HS. As I need to compare a certain amount of frames "backwards" in time I need quite a buffer. Alternatively, I could split work and send pre-processed data via ptpcam to the PC that moves the stage. That's what I wanted to grab the live view for, either to calculate something from it in lua or after sending it to the PC.

I know I could just go ahead and write everything in C, but then it becomes very uninteresting for most of my biologist colleagues that don't hack electronic devices in their free time. And adding such software into CHDK is probably not interesting to the majority of CHDK users. Thus, making a small application that could (by just defining the viewport characteristics, i.e. start, length, width, height) work with any ptp CHDK camera, would be the most portable thing at the moment. Certainly, I am open for any suggestions!


*

urbazon

Re: PowerShot SX220 HS - Porting Thread
« Reply #516 on: 09 / July / 2012, 12:30:42 »
Hello! Sorry if this question was raised before, I tried searching but didn't find anything related.

I'm using (or at least trying to use :) ) CHDK on my sx220 hs, with GM1.01E firmware. I installed CHDK and it works (I played games :P ) but when it comes to using scripts, my camera "freezes" after the first shot - no matter what script I use. For example, when using Motion Detection script (I used both the simple one from CHDK and AdaptiveMD) it takes one photo, shows it and 'freezes' there, I can't do anything but turn my camera off... It's the same with other scripts... Do I have a problem, or am I doing something wrong?

And one more question, while we're at it: how come I can only activate my camera (after manually starting CHDK) by turning mode-selection wheel - no other button can make the camera to "open" and put out lenses and be ready for using... Again, am I doing something wrong?

Thanks a lot in advance, I really hope that I can figure these out, CHDK sounds very promising!

*

Offline msl

  • *****
  • 1280
  • A720 IS, SX220 HS 1.01a
    • CHDK-DE links
Re: PowerShot SX220 HS - Porting Thread
« Reply #517 on: 09 / July / 2012, 14:28:13 »
I'm using (or at least trying to use :) ) CHDK on my sx220 hs, with GM1.01E firmware. I installed CHDK and it works (I played games :P ) but when it comes to using scripts, my camera "freezes" after the first shot - no matter what script I use. For example, when using Motion Detection script (I used both the simple one from CHDK and AdaptiveMD) it takes one photo, shows it and 'freezes' there, I can't do anything but turn my camera off... It's the same with other scripts... Do I have a problem, or am I doing something wrong?

Try to turn off the automatic review after shooting in Canon menu.

And one more question, while we're at it: how come I can only activate my camera (after manually starting CHDK) by turning mode-selection wheel - no other button can make the camera to "open" and put out lenses and be ready for using... Again, am I doing something wrong?

Press the shutter half,  when you are in playback mode.

msl
CHDK-DE:  CHDK-DE links


*

urbazon

Re: PowerShot SX220 HS - Porting Thread
« Reply #518 on: 09 / July / 2012, 15:23:28 »
@msl - Thanks a lot! Both of your advices helped (although I don't know how/why pressing the shutter didn't work before... but it doesn't matter, now I got it all workin' ;)

Now I have a new "toy" to play with ;) Cheers!

Re: PowerShot SX220 HS - Porting Thread
« Reply #519 on: 17 / August / 2012, 08:48:48 »
Hi Guys
I am trying to use this camera with raw but if i use dng extension all those bad pixels show as back dots, 100's of them, in acdsee. Anyway round this? if u use the crw extension neither the dpp or acdsee can read the file.

on another note, anyway to get super fine for jpegs on this. My camera is firmware A version with the latest chdk.

tx.

 

Related Topics