Using Dual-Camera to produce a stereostopic view in realtime - One (M8) General

Hey there,
I tried to create an app with the HTC One M8 and it´s Duallens "depthsensor".
The problem is that there is no way to activate the second rear camera in android.
In android.hardware.camera package there are some hidden methods like : enableSubCam...so I´ll tried to use java reflection to activate these SubCam, but it doesn´t work at all...
I need some depth information in realtime for my application and I thought with the new DualLens this would be possible.
Also I tried to understand the HTC DualLens SDK, but all this stuff works on an jpg format and without creating an new depthMap
So what do you think is the best method to access 1. the second rear camera or 2. directly some kind of depthMap with help from HTC SDK?

gurd123 said:
Hey there,
I tried to create an app with the HTC One M8 and it´s Duallens "depthsensor".
The problem is that there is no way to activate the second rear camera in android.
In android.hardware.camera package there are some hidden methods like : enableSubCam...so I´ll tried to use java reflection to activate these SubCam, but it doesn´t work at all...
I need some depth information in realtime for my application and I thought with the new DualLens this would be possible.
Also I tried to understand the HTC DualLens SDK, but all this stuff works on an jpg format and without creating an new depthMap
So what do you think is the best method to access 1. the second rear camera or 2. directly some kind of depthMap with help from HTC SDK?
Click to expand...
Click to collapse
i remember there was an app (german) that take 2 pictures at the same time from both rear cameras but the app was just to show that both work so it was like open app>automatic capture>save both pictures>exit.
got it : http://forum.xda-developers.com/showthread.php?t=2722352

yeah I´ve seen this app, but it´s hard coded on the linux kernel ...
and like I said I´ll try to calculate the depthMap in realtime, so a continious Depth-Matrix with opencv for example and not just a jpg
isn´t there a possibility to access the hardware components of an smartphone and activate them?

gurd123 said:
yeah I´ve seen this app, but it´s hard coded on the linux kernel ...
and like I said I´ll try to calculate the depthMap in realtime, so a continious Depth-Matrix with opencv for example and not just a jpg
isn´t there a possibility to access the hardware components of an smartphone and activate them?
Click to expand...
Click to collapse
Maybe this will help you
Code:
[URL="https://www.htcdev.com/devcenter/opensense-sdk/htc-dual-lens-api/htc-dual-lens-sdk-installation/"]https://www.htcdev.com/devcenter/opensense-sdk/htc-dual-lens-api/htc-dual-lens-sdk-installation/[/URL]

like I said in the first post, I´ve tried to understand the SDK, but in my oppinion it´s not for creating a file...
you´re just allowed to use the already created depth information of an jpg-file...
or has anyone made some other experiences with the SDK?

Have you solved the problem?
Hi,
I have the similar situation and would like to know if you have found a solution to this problem.
I agree with you that the SDK provided by the HTC website is for depth info extraction from already created image. The SDK is not viable for realtime depth processing.
Please let me know if you have the solution for this problem.
Thanks!
gurd123 said:
Hey there,
I tried to create an app with the HTC One M8 and it´s Duallens "depthsensor".
The problem is that there is no way to activate the second rear camera in android.
In android.hardware.camera package there are some hidden methods like : enableSubCam...so I´ll tried to use java reflection to activate these SubCam, but it doesn´t work at all...
I need some depth information in realtime for my application and I thought with the new DualLens this would be possible.
Also I tried to understand the HTC DualLens SDK, but all this stuff works on an jpg format and without creating an new depthMap
So what do you think is the best method to access 1. the second rear camera or 2. directly some kind of depthMap with help from HTC SDK?
Click to expand...
Click to collapse

Related

Extracting ROM files for third-party development?

Now that bal666's awesome utility gives us the ability to decrypt/encrypt the NBF file, we can view and/or extract the ROM files that are normally not available to us otherwise.
One big hoopla that Windows Mobile 5.0 was supposed to have was the native ability to access the camera through their APIs, so that third-party developers could create applications without having to deal with each and every different type of camera technology in different Pocket PC and Smartphone devices.
Of course, it's apparent that HTC has still used their own software and drivers and has not given access to anyone outside of HTC. Not like Microsoft had their own Camera application (I don't know if there ever was one, but there isn't a Microsoft one on the Universal).
Developers such as ComVu with their neat PocketCaster software, are having such a difficult time making a single Windows Mobile 5.0-ready application, and have resorted to making different versions for different devices.
So... where am I going with this? Simple. Let's dump out the contents of the NK.NBF file and see if we can make our own applications with the APIs and drivers that HTC has embedded in the ROM.
I, for one, am looking forward to a internet-based videoconferencing application, much like Microsoft Portrait. Skype also announced video calls on PCs with the new version 2.0. Perhaps someone could send them some code to get video capability on the Universal?
That front-facing camera is beckoning to be used...
On a sidenote, PPL: Pocket Programming Language, allows you to easily create applications (self-contained EXE files, as a matter of fact), and also allows direct access to DLLs and APIs...
Put these two concepts together, and you can see the potential.
Create an application to...
... toggle the camera flashlight.
... do internet videoconferencing.
... do face recognition security.
Create your own camera app, phone app, game using images from the camera, etc. etc.
Another thing, though I'm not sure, but perhaps it's possible to rebuild your own ROM... remove Voice Speed Dial? Embed Voice Command, Resco Explorer, remove stupid applications or unused portions? etc. etc.
What does anyone else think about this?
BtT,
This sounds great, even having only a magician which will likely not being supported in projects like this. I still want to create my own rom with at least all the patches installed in rom. Camera & Album are taking at least 1Mb from my precious storage & apps like resco explorer are indeed must haves.
So I'm looking rorward to progress & tips in this thread & when I succeed with simple magician rom cooking I'll let you know. Don't expect any new camera apps from me, no time & no development for anymore .
Regards, M
http://research.microsoft.com/workshops/FS2005/presentations/FacultySummit_2005_Lieberman.ppt
I just realized that Windows Mobile 5 SDK contains a "common camera API" which is likely the method that third-party developers will take (or have taken) to access the camera. I have emailed Skype to see if their new 2.0 desktop version that has Video Calling can be somehow implemented on the Pocket PC, now that it is technically feasible.
I'm surprised the guys behind Microsoft Portrait haven't jumped on this yet.

Kaiser (& Others) ROM Dual Camera Project {Dev Help Req.}

A few weeks ago I started skining the 5.04 Camera to look like 6.08. That was fairly successful, however the main issue, lag time, was of course not affected. I then started trying to hack AF into the 6.08 Camera version & had issues getting it to function as it relies on some different resources that I could not get functioning concurrently.
So, last night I started playing with a new idea. Renaming & resources from one of the two camera versions allowing for both cameras to be installed, having one called to initialization by a long camera keypress.
Anyone familar with widows mobile (Arm) executables & resource hacking willing to help out on this idea & test it?
Is this something people would like to see in a cooked rom? Would the ability to toggle the camera depending on what you need, Auto-Focus or Speed, be appealing?
It really wouldn't add too much weight to the ROM, as both Camera use primarily the same resources/DLL's. Would having a choice of a macro/micro (AF) mode bee something you'd like to see?
Hi man,
Realy great what you want to do but to be honest I don't like the camera atm cause the front camera isn't working with the 6.8 build (correct me if I'm wrong).
I would rather have both camera's supported on my Kaiser to use this build.
Together with the Opal dialer with videocall enabled that would be a awsom job!
Grtz,
Leo
Great Suggestion!
I have not looked into that at all, My last TYTNII is dead, so I am on a Tilt. If you are willing to give it a test since you have both cameras, I will look into implementing that as well.
BTW, I will be moving this into the Development & Hacking thread soon. I just wanted to start it here to see if any Kaiser users had any camera hacking experience or suggestions.
I would be glad to help you my friend.
Please let me know when you have something!
GSLEON3 said:
Great Suggestion!
I have not looked into that at all, My last TYTNII is dead, so I am on a Tilt. If you are willing to give it a test since you have both cameras, I will look into implementing that as well.
BTW, I will be moving this into the Development & Hacking thread soon. I just wanted to start it here to see if any Kaiser users had any camera hacking experience or suggestions.
Click to expand...
Click to collapse
I have been able to specifically locate the function handling the camera AF uysing IDA Pro, I also see that there appears to be some hard coding of FPS information/limits in the camera executable for the 5.04 Kaiser Camera.
This info is not present within the newer (Opal) camera as far as I can tell & may be a reason why it seems to outperform the Kaiser Stock Camera. There is also no information or AF calls within the Opal Camera executable. Hence, without a complete rewrite of the program I cannot simply integrate AF into the newer camera.
Lost...
Anyone???
I have tried renaming the resources & creating a new registry tree all to no Avail.
I seem to have enough resources available to operate trhe second camera, however I cannot get it to initialize. Anyone have any suggestions?
GSLEON3 said:
I have been able to specifically locate the function handling the camera AF uysing IDA Pro, I also see that there appears to be some hard coding of FPS information/limits in the camera executable for the 5.04 Kaiser Camera.
This info is not present within the newer (Opal) camera as far as I can tell & may be a reason why it seems to outperform the Kaiser Stock Camera. There is also no information or AF calls within the Opal Camera executable. Hence, without a complete rewrite of the program I cannot simply integrate AF into the newer camera.
Click to expand...
Click to collapse
Have you found many functions involved in the AF management, in the old version ? I'm a bit busy with the Dialer, but since we're both using IDA Pro, I may take a look to what you've documented so far in the IDA database... I'm not a big expert in camera apps, but who knows...
BJK
There are about 6 or so references. Both cameras use primarily the same resource files, so it appears to me that the AF function is coded into the executable.
I had pretty much given up on the addition of AF to the new 6.8 camera & had decided it would be easier for a novice like me to just add support for a second camera program.
However, that task is also throwing me at the moment. I have built a new cab, with renamed files & some hacks to point to the renamed files, I have also created a moddified registry tree to co-exist with the one for the OEM camera, yet when I select the newly moddified camera it tries to launch, but won't initialize.
Missing something somewhere...
GSLEON3 said:
There are about 6 or so references. Both cameras use primarily the same resource files, so it appears to me that the AF function is coded into the executable.
Click to expand...
Click to collapse
No external reference to a shared .dll ?
I had pretty much given up on the addition of AF to the new 6.8 camera & had decided it would be easier for a novice like me to just add support for a second camera program.
However, that task is also throwing me at the moment. I have built a new cab, with renamed files & some hacks to point to the renamed files, I have also created a moddified registry tree to co-exist with the one for the OEM camera, yet when I select the newly moddified camera it tries to launch, but won't initialize.
Click to expand...
Click to collapse
That's why I asked. It seems a single-threaded apartment issue. If it is an external .dll, maybe it could not be designed for multiple concurrency...
BJK
DupinBJK said:
No external reference to a shared .dll ?
That's why I asked. It seems a single-threaded apartment issue. If it is an external .dll, maybe it could not be designed for multiple concurrency...
BJK
Click to expand...
Click to collapse
When I get a moment I will post what I have found, the differences in the executables & the AF refernces & coding.
It may all be moot however, as I take a look at the Raphael camera, which allegedly has AF as well as a newer camera. We shall see.
GSLEON3 said:
When I get a moment I will post what I have found, the differences in the executables & the AF refernces & coding.
It may all be moot however, as I take a look at the Raphael camera, which allegedly has AF as well as a newer camera. We shall see.
Click to expand...
Click to collapse
Good, thanks !
Again, need to reiterate that arm executables are not my thing, however, I have hacked the Ralph Camera & it uses the same icons & resource (Mostly) as the Kaiser & Opal.
However when I build a new cab just to see if the AF is working already on the new Fuze ROM Camera I get an unsigned error message.
Can one of you ARM pros give me some insight?
Fuze Camera is new version & definitely has AutoFocus support!
Works with the existing hacked QVGA .mui & icon files, but when trying to create the cab I still get unsigned error.
Anyone???
Here is the start of an OEM QVGA package. Exe still won't launch.
Anyone want to take a look? Do I need to resign the app, the exe?
It includes all files & images resized & hacked for QVGA including the .mui files. The exe is throwing me badly though.
The OEM can be found here: http://rapidshare.com/files/159104147/HTC_Camera_6_Fuze_OEM_QVGA.rar
However, it seems the sensorSDK references are giving me the issues. Maybe need to find a way to null them out or default landscape.
If I'm understanding correctly, you'd like a switch to use the camera version with AF and the camera version without AF. Correct or am I completely missing something here? If I AM understanding correctly, then I would be all for this, as this would really make the camera on the Kaiser at least sort of useful, as opposed to only usable in certain conditions.
GSLEON3 said:
Here is the start of an OEM QVGA package. Exe still won't launch.
Anyone want to take a look? Do I need to resign the app, the exe?
It includes all files & images resized & hacked for QVGA including the .mui files. The exe is throwing me badly though.
The OEM can be found here: http://rapidshare.com/files/159104147/HTC_Camera_6_Fuze_OEM_QVGA.rar
However, it seems the sensorSDK references are giving me the issues. Maybe need to find a way to null them out or default landscape.
Click to expand...
Click to collapse
Sorry for being late...
Have you removed the signature before patching the files ? You have to remove it from each signed file you're going to patch, to be able to use it. I can do it for you, if you wish...
BJK
met3ora said:
If I'm understanding correctly, you'd like a switch to use the camera version with AF and the camera version without AF. Correct or am I completely missing something here? If I AM understanding correctly, then I would be all for this, as this would really make the camera on the Kaiser at least sort of useful, as opposed to only usable in certain conditions.
Click to expand...
Click to collapse
YES. That was the original intention of this thread.
DupinBJK said:
Sorry for being late...
Have you removed the signature before patching the files ? You have to remove it from each signed file you're going to patch, to be able to use it. I can do it for you, if you wish...
BJK
Click to expand...
Click to collapse
BJK, I would be eternally gratefull if you'd do that for me, then I can see if I can find a way to null out or hack a SensorSDK.DLL to aways import the landscape value as a return & maybe see if the results are succesful.
OT: gsleon03...dude im your neighbor lol...i live in Torrance and im up in PV once in a while.
id like to see this project come true
Hi
first, sorry that I interrupt this thread and asking about improvement of frame rate for shooting video throw HTC camera, am have Cruise and has low frame rate in video recording and I think that Kaiser has the same issue, am using the famous camera trick " run camera program, hiding the lens, power off devise and waiting for Sec's, then power on again" which rising the frame rate from 4 to 19 frame/sec in video shooting but with darkens pic, did any one analysis this trick and try to get solution for camera low rate problem or found why 6.08 camera is faster than 5.04
finaly i hope that see this project come true
secoseco said:
Hi
first, sorry that I interrupt this thread and asking about improvement of frame rate for shooting video throw HTC camera, am have Cruise and has low frame rate in video recording and I think that Kaiser has the same issue, am using the famous camera trick " run camera program, hiding the lens, power off devise and waiting for Sec's, then power on again" which rising the frame rate from 4 to 19 frame/sec in video shooting but with darkens pic, did any one analysis this trick and try to get solution for camera low rate problem or found why 6.08 camera is faster than 5.04
finaly i hope that see this project come true
Click to expand...
Click to collapse
I second that. ist there still any development?

[C#/C++] Camera Access with DirectShow

Hi Guys,
Because the standard API's to use the camera aren't flexible enough I need to use directshow.
Unfortunately I'm not a very good C++ programmer (more C# ;-))
I found this solution. Wich compiles a C++ DLL and can be called from C#.
Perfect! Except the C++ code doesn't really do what I want to. (And I have no idea how to change it)
See attachement for the C++ project
Dll does: Capture one frame from the camera and store it as a file. (with 320x240 resolution, not great quality)
I'd prefer to use the best available quality, or mayby choose the quality I want.
Also I'd prefer not saving/storing the file but return a stream / bitmap / image
Because I only want to show it on screen (actualy let a mobile webserver respond an image with as much frames per sec as possible)
(Saves a step, storing and deleting everytime)
Any Help?
PS. I also tried Directshow.Net Library But it doesn't seem to work on Windows Mobile.
C# Code
Btw, this is the code I use in C# to create the functions:
[DllImport("CameraCaptureDLL.DLL")]
private static extern bool CaptureStill(string Path);
[DllImport("CameraCaptureDLL.DLL")]
private static extern bool InitializeGraph(IntPtr hWnd);
Just to keep y'all posted, I'm now looking @ this solution (CodeProject.com)
They rewrote the DLL file, and I think it's gonna do what I want, but I first need to install Windows CE 5.0 wich takes alot of time....
I met same problem with you.
I just want to show the camera sight, like the Camera app's Preview function.
I don't know if there is a HTC's Camera SDK.
Please keep contract, if I have any improvment, I will tell you.
I had fun with camera but not using directshow or the preview...I'm just launching the camera app (using sample camera in SDK).
If anyone find an easy way to have "embedded camera display" in an application I'm really interested!! (like a pictureBox having camera as image source)
If I found something I'll tell...
DarkAngelFR said:
I had fun with camera but not using directshow or the preview...I'm just launching the camera app (using sample camera in SDK).
If anyone find an easy way to have "embedded camera display" in an application I'm really interested!! (like a pictureBox having camera as image source)
If I found something I'll tell...
Click to expand...
Click to collapse
I found functions and its parameters by sniffig camera calls on my VOX
Captured data is stored as UYVY.
m32
m32 said:
I found functions and its parameters by sniffig camera calls on my VOX
Captured data is stored as UYVY.
m32
Click to expand...
Click to collapse
Could you provide the compiled version of the htccamera dll ?
Will try to build this later (@work don't have cc compiler, just VS2008)
Thanks!
An in-memory capture would almost certainly improve the live-scan mode in Barcorama also! I could really use that in-memory capable CameraCaptureDll.dll.
Many users seem to have successfully compiled the source at http://www.codeproject.com/KB/mobile/samplegrabberfilter-wm6.aspx, but I can't find the compiled dll somewhere .
I fail to compile it myself as it needs the WindowsCE Platform Builder and VS2008...
Anybody that comes across the DLL, please share!
have fun,
hypest
Hello,
working on it ^^ I will upload the dll here later today
Here you go : download (if fails : try here)
is the source code compiled (look in /bin/Release). Tested and works nice (deploy the dll then the sample app).
Hope this helps!
Thanx!!
will try it!
UPDATE:
The sample opens up but seems to do nothing on my kaiser. <-UPDATE: wrong! it works OK.
I have managed to use the DLL directly though. The capturing works fine but the capture-stop seems to fail: the Stop() function hangs. I use the Shutdown() that seems to be OK, but then I have trouble re-initializing the whole procedure. Also, there seem to be a sensitivity on manually using the garbage collector.
Thanks again anyway!!
Cannot seem to import the dll into another project
@DarkAngelFR
Thanks very much for the sample app for video streaming, was very helpful.
However I really need to use the dll or even the import the CameraCaptureDLL c++ code into our project. I have already read over the ReadMe text file but need further help on how to create this object? Have already tried the Ignore Input Library property and that does not work sadly. Any help would be great!
Thanks,
John
m32 said:
I found functions and its parameters by sniffig camera calls on my VOX
Captured data is stored as UYVY.
m32
Click to expand...
Click to collapse
I have build the camerasniffer dll (and called it htccamera.dll) with mingw32ce, but how do I use it?
I tried copying it to "/windows" and rebooted the phone (hermes) but I do not get a log file on the storage card. Any hints?
Thanks a lot!
Hi,
I got this error when I try to debug this application on my mobile (HTC HD2)
"An unhandled exception of type 'System.MissingMethodException' occurred in TestCameraCapture.exe
Additional information: Can't find PInvoke DLL 'CameraCaptureDLL.DLL'."
But it seem to works fine on the Emulator.
How can I test it on my mobile then?
EDIT
Problem solved, I just had to copy the 'CameraCaptureDLL.DLL' file to the folder where the application is running.

Image processing with diamond's camera

Hi everybody,
I want to develop a software using diamond camera. This software will process image by image the camera output. I reach for source code to get image by image the camera output. In windows mobile sdk we have a class cameracapture but also launch the htc diamond tool for it.
Thanks in advance.
Siav
try to make a sort of "suirvellance" camera, wich make photos & videos when movement is detected....
there aren't similar apps
for the question... i haven't understood it.. and however cannot help you... just an hint.
good work!
kuochsia said:
Hi everybody,
I want to develop a software using diamond camera. This software will process image by image the camera output. I reach for source code to get image by image the camera output. In windows mobile sdk we have a class cameracapture but also launch the htc diamond tool for it.
Thanks in advance.
Siav
Click to expand...
Click to collapse
Not understood what you want to do....
explanation
I want to acquire images from the camera, Image by image to process each of them. For exemple, i want to try a traffic sign recognition or face detection algorithm. But I can't get the video image by image.
More clear or not?
perhaps this one can help you:
Barcorama
the other one I can think of would be 'Dark Ruler'
both process images from camera in some way...

Split Video with NDK for Android...

Hello,
I have to do a task, that is more specific than a pure android development. I have to create an android application with a core module written in C or C++ language, doesn't matter, to do some video processing stuff. For example, the scenario is as follows:
1. The Android application captures 10sec video clip from the camera of an Android device;
2. Pass the captured file to the core of the android application;
The core should do the following:
3. Waits for the file, gets the file and opens it;
4. Splits the file into frames - for example, if the camera captures 30fps for 10 seconds video - 300 pictures in png or jpg format;
5. Do some calculations - for example it makes a histogram of a single image and stores it somewhere (db or file, doesn't matter);
6. Returns the result to the Android Code/Java/ which will render it on the default output - e.g. Screen, Console, etc...
How can I do this? I have searched how to split the video file into frames on linux, and I found that it could be done with ffmpeg, but I never dealt with ffmpeg and video/image processing... Could you help me somehow? I don't know what to do and where to start from...
Thanks in advance!
Best Regards,
v4o4ev
Possibly OpenCV / JavaCV
i dont know the exact code but i am sure you can get histograms and stuff with it.
try looking here
http://code.google.com/p/javacv/
Pvy.
pvyParts said:
Possibly OpenCV / JavaCV
i dont know the exact code but i am sure you can get histograms and stuff with it.
try looking here
http://code.google.com/p/javacv/
Pvy.
Click to expand...
Click to collapse
Thank you! The problem now is how to split the video into frames... I am searching about ffmpeg compatibilities, but for now I'm just researching... And one thing - I don't need the code, just the help to find some information about how to do it better and so on thank you so much for the reply - I will take a look now
Thanks!
Best Regards
v4o4ev said:
Thank you! The problem now is how to split the video into frames... I am searching about ffmpeg compatibilities, but for now I'm just researching... And one thing - I don't need the code, just the help to find some information about how to do it better and so on thank you so much for the reply - I will take a look now
Thanks!
Best Regards
Click to expand...
Click to collapse
In java I use the highgui classes, createframegrabber or something like that. I grab each frame and process it for item/motion detection. Then save a movie from it. Works well enough.
Sent from my Galaxy Nexus using xda premium

Categories

Resources