CHDK PTP interface - page 66 - General Discussion and Assistance - CHDK Forum

CHDK PTP interface

  • 1244 Replies
  • 533171 Views
*

Offline srsa_4c

  • ******
  • 4451
Re: CHDK PTP interface
« Reply #650 on: 12 / February / 2012, 18:32:29 »
Advertisements
I don't think there is a de-bayered version of the image outside of jpeg
On (at least) DIGIC II, when reduced image size is requested, the first phase of the picture creation process is a resampled YUV (UYVY) image. This does not happen when the target image is full size or cropped 16:9. Wrong: there's "recreview", a YUV image has to be available for instant review. Don't remember exactly where I saw this (would have to look into my notes).
Now I do: I checked out memory dumps of the A420 (RAM snapshot was created manually after the shot), and noticed the resized YUV version(s) of the recently shot picture.
Quote
, with the probable exception of the half res high ISO/fast modes
As I wrote in another thread a few days ago, modern CCDs (I read some Sony CCD product briefs) have a special readout mode which combines pixels (therefore the Bayer matrix arrangement probably gets lost), and is fast.
« Last Edit: 12 / February / 2012, 19:52:02 by srsa_4c »

Re: CHDK PTP interface
« Reply #651 on: 12 / February / 2012, 21:37:24 »

I rather think you are, unless you prefer the distortion-corrected,nicely colour-rendered JPG's.
Only drawback is white-balance has already been applied.


Eeeyup... Now I am.  :P
I'm not really enjoying the fact that jpeg compression would add even the tinyest artifacts to the original sample. I doubt Canon uses JPEG-LS or JPEG2000, so I'll continue to assume there is artifacts. But I'm not adamant to the point I'd transfer a complete sensor output dump each time. As reyalp mentioned (or was is you), returning the buffered jpeg would be the best compromise, both in access time and data weight.


Before you get too carried away with this can I ask for technical details of the proposed application ?


Yes, you can....  ::)
More seriously, I plan to achieve "static" vision, many leagues away from the "motion detection" or "mach-speed assembly line QC" people usually associate automation vision with.
Static vision is mostly used in punctual but thourough checks, such as machine tool inspections (what is the actual tap or drill bit dimensions, did the operator made a mistake), items counting (imagine a bed of Swarovski beads your machine has to pick and sort, or SMD components to be rotated precisely), perceptive tint aspect checks (does the hull a robot just painted has speckles or embedded dust ) .
Etc.
This can only be achieved with high-resolution devices. Canon camera over PTP are a great trade-off to handymen (as yours truly) when you consider the price of some secondhand ones on eB... an such trade site.


Based on what existing PTP clients can do (including my own) I cannot see that you need anything special, bearing in mind the constraints mentioned.


Fact is, I don't need anything complicated from the client app. I'd just like a DLL to offer me remote control options reacting as quick as CHDKPTP does, and direct snapshot downloading without messing with the flash card (this last part, however, may not be included in the PTP standard, so I may put it aside).
Ideally, all this would have to be acheivable on any platform ported to CHDK, trunk release.
Since C# would allow me to distribute this dll for free for both Windows (LibUSbDotNet) and Linux (MonoLibUsb) architectures, I though it was worth a try as an open-source project.
Moreover, C# makes pixel shaders easy to access on both platforms ( with DirectX or OpenGL), isn't prone to memory leaks, and a great non-commercial image manipulation Managed library exist, that some of you may already know : Aforge.Net  (http://www.aforgenet.com/).

Re: CHDK PTP interface
« Reply #652 on: 12 / February / 2012, 21:53:16 »
machine tool inspections (what is the actual tap or drill bit dimensions
This can only be achieved with high-resolution devices.

Well, if you are serious about such applications you need optics that are telecentric in object space, normally available in 'C' mount for machine vision cameras.

Quote
direct snapshot downloading without messing with the flash card

Yes, that is OK.

I was doing it yesterday with a stop-motion test.



Re: CHDK PTP interface
« Reply #653 on: 12 / February / 2012, 22:15:44 »

Well, if you are serious about such applications you need optics that are telecentric in object space, normally available in 'C' mount for machine vision cameras.


Hehe...  the "seriousness" of my hardware is inversely proportional to my wallet's contents. Don't forget what the 'H' in CHDK stands for.  :P

Wait... isn't that reyalp signature ?  :-[

Re: CHDK PTP interface
« Reply #654 on: 13 / February / 2012, 00:38:05 »
Hello lads !

Knowing we've just hit trunk1654, may I ask if the ptp handlers & usb descriptors are implemented generically, or does each platform (already ported) needs its own implementation of the CHDK ptp extension to enable live preview with mweerden's .Net app ? 
This question doesn't really make sense to me.

CHDK PTP protocol has certain commands. These are supported generically in CHDK code. A build for any camera should be compatible with with any CHDK PTP client implementing the matching protocol version. You don't need to worry about handlers and descriptors... although I suppose it's possible that the a430 is old enough that it's weird in some way. If you can upload/download with chdkptp or ptpcamgui, then CHDK PTP is implemented and working properly. Neither one will give you live view however.

The live view stuff is completely disabled in in the CHDK release branch, to avoid having an under development protocol "released". There is some of this code in the trunk, I don't know if it is compatible with whatever version of CHDKPTPRemote you are trying to use.

Properly supporting live view is on the list for the next release, but is not finished. The protocol will likely change from whats in the trunk. I keep meaning to do some work on this Real Soon Now. Maybe this weekend...


Thank you Reyalp, been meaning to hear that for quite a long time, as you probably know i have been keeping an eye on this thread and a "trunk" implementation of the live view for quite some time. for the time being mweerden's code and some of the patches provided by phil and you and other gurus work for me. i have frozen my version of ckdk to a few sub versions back, just for that purpose.


Re: CHDK PTP interface
« Reply #655 on: 13 / February / 2012, 01:00:46 »
Quote
Yes, that is OK.
I was doing it yesterday with a stop-motion test.

hello microfunguy, you did provide an explanation about it a few pages back, thank you, but i never got to doing that. at the moment i cannot switch to SDM (too dependent on other features of CHDK) - i think you mentioned that SDM is required.

can you tell me if direct capture to PC without the card is possible with CHDK ??

Re: CHDK PTP interface
« Reply #656 on: 13 / February / 2012, 06:16:07 »
at the moment i cannot switch to SDM

It is not available in the 'official' 1.85 version.
Spring is almost here in the Northern hemisphere so it is about time that I got this released.


Quote
too dependent on other features of CHDK

As a matter of interest, which features ?

Quote
can you tell me if direct capture to PC without the card is possible with CHDK ??

I do not know specifically about CHDK and it depends what you mean by 'without the card'.
With SDM, the best you can do is save a tiny jpg (which is later deleted) and download the raw data and instantly convert to DNG on the PC.


Re: CHDK PTP interface
« Reply #657 on: 13 / February / 2012, 18:05:55 »
Okay, so a bit of news.

I "noticed" the PTP is an INTERFACE class lads, not a device class.  ;)
Since a composite device MAY have several configurations, it MAY offer several PTP interfaces (which, in USB jargon is know as a function).

I've just implemented this case in the open-source DLL strain , since we don't know what tomorrow holds. (I'll avoid to call it "trunk" for obvious reasons) :-X
Maybe Canon will release 3D cameras, appearing as composite USB devices.  ???

More seriously, this should offer users the ability to choose a specific configuration amongst many on a single device in their client app.
« Last Edit: 13 / February / 2012, 18:07:28 by asmodyne »

Re: CHDK PTP interface
« Reply #658 on: 14 / February / 2012, 09:13:45 »
at the moment i cannot switch to SDM

It is not available in the 'official' 1.85 version.
Spring is almost here in the Northern hemisphere so it is about time that I got this released.


Quote
too dependent on other features of CHDK

As a matter of interest, which features ?
i am using mweerden's live preview code along with regular remote control, my application is actually simple the camera is inaccessible in a container(i open up the camera and solder the power connector, so applying power to the camera turns it on) and i need to control it via the pc - however  i need a preview,  i might use a A/V cable but live preview works ok.

in regular mode i just need high resolutions snaps, in the other mode i require a 5fps feed for an interval of 1-1.5 mins. at the moment i am  using the live view feed but the quality of the feed requires much to be desired.

i am contemplating doing this offline. capturing a video, downloading it and then saving every 6th frame would give a list of images at 5 fps and the quality of the video is sufficient for most of my purposes. ( the feed does not need to be live, i can just barely live with a downloaded video file )

Quote

Quote
can you tell me if direct capture to PC without the card is possible with CHDK ??

I do not know specifically about CHDK and it depends what you mean by 'without the card'.
With SDM, the best you can do is save a tiny jpg (which is later deleted) and download the raw data and instantly convert to DNG on the PC.
i do not know how much of a lag downloading and converting from DNG will introduce. but i dont think it will save me much time. at the moment capturing a picture and saving takes around 6-8 seconds with the preview constantly on (pauses during download). in your opinion is it worth the effort - i mean will direct capture to pc and its subsequent conversion to jpg (with the distortion correction) halve the process time, can i expect to download process to complete in aroud 3-4 seconds. that may justify my changing the application interface.

thank you, i always appreciate the opinions and help of everyone on this forum. pls let me know when the direct download capability is available in the official release of your SDM maker (hope i got the name right :) ). i would definitely like to play with it and see if i can implement it



Re: CHDK PTP interface
« Reply #659 on: 14 / February / 2012, 09:48:24 »
i am contemplating doing this offline. capturing a video

It is the only way you will get 5 fps.

as a matter of interest, I used 640x480 movie frames from a SINGLE rotating camera to create the top stereo panorama here :  http://www.stereomaker.net/panorama/panoramae.htm

Here are some technical details http://stereo.jpn.org/eng/stphmkr/help/file_27.htm


Quote
can i expect to download process to complete in aroud 3-4 seconds. that may justify my changing the application interface.

I have just tried on my old 6MP A620.
JPG and DNG both took three seconds, a certain amount of time for the JPG being the saving to the card.

Either you need 5 fps or you do not.

The only in-between is to run in burst-shooting mode at whatever resolution you wish.

So, you can have 5 fps, 0.3 fps or something in-between.

The accumulated images can be batch-downloaded at intervals via PTP.

Bear in mind that my A620 uses MJPEG encoding for the movies, every frame is a JPG.

With the more recent MOV files, most frames are interpolated.
I would use VirtualDub to change the framerate to 5 fps, save as an image sequence and then inspect them to determine the quality loss.
« Last Edit: 14 / February / 2012, 11:51:39 by Microfunguy »

 

Related Topics


SimplePortal © 2008-2014, SimplePortal