Hello! I am a novice. Please help.
Task: find the distance from the camera to the paper with the text.
The camera automatically adjusts the sharpness of text. Setting the focus is the focal distance change.
How to convert the signification of the camera.GetFocusDistances (for example [F@42032d78) value in mm?
Thanks.
I'm ashamed to ask primitive questions, but I don't know how to determine the components CamEx.GetFocusDistances.
How to work with Log (f(0)), Log (f(1)), Log (f(2))?
Thank you.
f(0) gives you near focus distance
f(1): optimal focus distance
f(2): far focus distance
f(2) - f(0) gives you depth of field...
Log("Anything...") means to give output to the LOG...in this case I would suggest to start with: https://www.b4x.com/android/forum/threads/b4a-beginners-guide.9578/
Thanks for the quick reply, but unfortunately, there is no continuous focus.
Sub Camera1_Ready (Success As Boolean)
If Success Then
camEx.SetJpegQuality(90) camEx.SetContinuousAutoFocus
camEx.CommitParameters
camEx.StartPreview
Log(camEx.GetPreviewSize)
Else
ToastMessageShow("Cannot open camera.", True)
End If
End Sub
Public Sub GetSupportedFocusModes As List
r.target = parameters
Return r.RunMethod("getSupportedFocusModes")
End Sub
Public Sub SetContinuousAutoFocus
Dim modes As List = GetSupportedFocusModes
If modes.IndexOf("continuous-picture") > -1 Then
SetFocusMode("continuous-picture")
Else If modes.IndexOf("continuous-video") > -1 Then
SetFocusMode("continuous-video")
Else
Log("Continuous focus mode is not available")
End If
End Sub
Public Sub SetFocusMode(Mode As String)
r.target = parameters
r.RunMethod2("setFocusMode", Mode, "java.lang.String")
End Sub
Thank you. I use code CameraExClass. At the start of the program Log:"Continuous focus mode is not available"
The command "camEx.FocusAndTakePicture" takes effect, appears autofocus. But "camEx.SetContinuousAutoFocus" - no autofocus. Why?
The problem in the code or in Sumsung GT P1000 ? Or in me?
I think to go from CameraExClass to ACL. But ACL has no FocusDistance?