Dear DAVID Community,

As you are probably aware, the entire DAVID company, team and product range has been integrated into HP Inc.
This forum is now read-only. Relevant content has been migrated to HP and merged into HP's Support Forums on November 1, 2016.

To start new discussions for 3D Scanning, please register and post your new topic at the HP Support Forums

DAVID 4?

Discussions about latest DAVID developments, beta versions...

Re: DAVID 4?

Postby Anti » Wed Mar 11, 2015 7:45 am

So far ... any idea how to obtain if David completes a task (e.g. alignment of two scans)? As time needed to finish a task depends on the scans itself, a recorded routine of mouse actions have to be time-adjusted. This could be done by adding a few seconds after every action (which is dissatisfying) or via synchronizing David software and macros ...
Anti
 
Posts: 55
Joined: Sun May 11, 2014 9:20 am

Re: DAVID 4?

Postby NARMELLA » Wed Mar 11, 2015 8:19 am

Hi Anti,

I agree with Gunter.
There are different ways to use to have a good alignment.
Even most expensive software like Geomagic design x is using different ways to align single scans together correctly.
You can't use a simple macro or even david sdk to align all kind of geometries toghether :(

My suggestion:
You can control david laser scanner via communication port ; Lots of commands are available in david settings window .
For my own use i wrote the software " Lets scan " to have automatized scanning process like sending command to change any scanning environment , starting scanning , adding scans to the list of shape fusion , controlling turntable and more

Good luck
NARMELLA
Data projector : NEC VE 281
Camera(s) : Canon eos 600D (3x)
Software : Lets scan 2.5 + David laser scanner 3.9
گشتاور صنعت تبریز
User avatar
NARMELLA
 
Posts: 354
Joined: Thu May 29, 2014 9:18 am

Re: DAVID 4?

Postby Anti » Wed Mar 11, 2015 8:55 am

Hi Narmella,

thanks for your comment. Of course I know that it won't be possible to create perfect models just by align one scan to another. Further steps are needed. But it would help a lot to automate the time consuming process of coarse alignment of that scans. (I scanned about 1400 human skulls within 3 months last year. Now since 4 months I sit in front of my computer and do that stupid and very time consuming click-work while there would be thousands of less annoying works could be done simultaneous. And I just finished about 60 %.)

Anti
Anti
 
Posts: 55
Joined: Sun May 11, 2014 9:20 am

Re: DAVID 4?

Postby hunkatibor2 » Sat Mar 14, 2015 5:56 pm

Hi Simon
The two managed to work at the same time my camera Basler possess .The solution is to install two control cards. Now David checked the fourth panel. Global registration.
Tibor
Attachments
2015-03-01_17-36-41.png
2015-03-01_17-39-14.png
Global fine registration 200
Intel Xeon E5410 2.33GHZ 16GB RAM Windows 7 64bit David 4.5.0
2 Basler A622F camera 2 Tamron Asfirical AF 28-80mm lense
LG DLP Projector PF1500G Canon D40 Tokina 17-70mm 1:2.8-4,5
Humanti Calibration panel system and Alignmed&Two camera
hunkatibor2
 
Posts: 1408
Joined: Tue Mar 16, 2010 4:26 pm
Location: Hungary

Re: DAVID 4?

Postby hunkatibor2 » Sat Mar 14, 2015 6:30 pm

Hi
Hardware
Tibor
Attachments
004.JPG
003.JPG
Intel Xeon E5410 2.33GHZ 16GB RAM Windows 7 64bit David 4.5.0
2 Basler A622F camera 2 Tamron Asfirical AF 28-80mm lense
LG DLP Projector PF1500G Canon D40 Tokina 17-70mm 1:2.8-4,5
Humanti Calibration panel system and Alignmed&Two camera
hunkatibor2
 
Posts: 1408
Joined: Tue Mar 16, 2010 4:26 pm
Location: Hungary

Re: DAVID 4?

Postby ar_kid » Tue Mar 17, 2015 9:10 am

It's been a while since I've used Windows API's but SendMessage or PostMessage will control a running application by obtaining the window-handle of David then the button-handle within that window. They will even run from the VBA editor within Excel.

Example code… http://www.vbforums.com/showthread.php?345259-Use-API-to-programmatically-click-button-of-another-app

Also if you obtain the process-handle you can wait for that process to finish before continuing.
ar_kid
 
Posts: 28
Joined: Tue Jan 03, 2012 11:18 am
Location: NWUK

Re: DAVID 4?

Postby hunkatibor2 » Sat Mar 21, 2015 7:15 am

Hi
:D :D
Tibor
Attachments
david_4.png
Intel Xeon E5410 2.33GHZ 16GB RAM Windows 7 64bit David 4.5.0
2 Basler A622F camera 2 Tamron Asfirical AF 28-80mm lense
LG DLP Projector PF1500G Canon D40 Tokina 17-70mm 1:2.8-4,5
Humanti Calibration panel system and Alignmed&Two camera
hunkatibor2
 
Posts: 1408
Joined: Tue Mar 16, 2010 4:26 pm
Location: Hungary

Re: DAVID 4?

Postby Ingo » Sun Mar 22, 2015 5:52 pm

ar_kid wrote:It's been a while since I've used Windows API's but SendMessage or PostMessage will control a running application by obtaining the window-handle of David then the button-handle within that window. They will even run from the VBA editor within Excel.

Example code… http://www.vbforums.com/showthread.php?345259-Use-API-to-programmatically-click-button-of-another-app

Also if you obtain the process-handle you can wait for that process to finish before continuing.



Hi ar_kid,

I tried to obtain informations on buttons in David using WinSpy++.
As far as I could see, there are no distinguishable buttons in David.
Have you any other idea, or did I something wrong?

Best regards
Ingo
SLS-1
SLS-2
Turntable
Ingo
 
Posts: 29
Joined: Thu Jan 15, 2015 12:02 pm
Location: Germany

Re: DAVID 4?

Postby ar_kid » Mon Mar 23, 2015 11:39 am

Hi Ingo, I've only a mobile device here so cannot try but I've used similar to this code in the past instead of WinSpy...
http://www.vbaexpress.com/kb/getarticle.php?kb_id=52

Rgrds
ar_kid
 
Posts: 28
Joined: Tue Jan 03, 2012 11:18 am
Location: NWUK

Re: DAVID 4?

Postby Ingo » Mon Mar 23, 2015 10:21 pm

Hi ar_kid,
thanks a lot for your suggestion.
I tried it, but there are no results, I can attribute to any DAVID buttons.
It seems, the DAVID GUI is programmed differently.
Best regards
Ingo
SLS-1
SLS-2
Turntable
Ingo
 
Posts: 29
Joined: Thu Jan 15, 2015 12:02 pm
Location: Germany

Re: DAVID 4?

Postby ar_kid » Tue Mar 24, 2015 8:26 am

How about using SetCursorPos and mouse_event? It's not a very elegant way of doing it, example on this page...

http://www.siddharthrout.com/2011/10/23/vbavb-netvb6click-opensavecancel-button-on-ie-download-window/

Rgrds
ar_kid
 
Posts: 28
Joined: Tue Jan 03, 2012 11:18 am
Location: NWUK

Re: DAVID 4?

Postby Ingo » Wed Mar 25, 2015 8:58 am

Thanks ar_kid, I have to experiment a bit.

Best regards
Ingo
SLS-1
SLS-2
Turntable
Ingo
 
Posts: 29
Joined: Thu Jan 15, 2015 12:02 pm
Location: Germany

Re: DAVID 4?

Postby Sven » Fri Mar 27, 2015 1:54 pm

Hi,
We are using WPF and XAML (.NET 4) for our GUI. I'm not sure about those macros, simulating mouse clicks and buttons... Feel free to do that. We are not preventing those things, I have no idea why it doesn't work. Please understand that we don't actively support that.
Sven
User avatar
Sven
DAVID Developer
 
Posts: 1541
Joined: Mon Jan 22, 2007 8:59 am
Location: Braunschweig, Germany

Re: DAVID 4?

Postby Ingo » Mon Mar 30, 2015 8:37 pm

Thank you Sven for your explanation.
I am no programming expert, so I did not know the difference between WPF and WinForms.
But with a little utility named Snoop I was now able to have an insight into the, David controls.
Using this for macro programming is altogether different.

Meanwhile I tried macro programming David 3.10 with the software AutoIt v3.
Together with the editor SciTE it is perfect for remote controlling software via mouse clicks and keyboard commands.
Obviously this only the second choice to a direct control of the software.
Anyway I accopmlished the task and the script is more or less doing its work satisfying so I thougt I present it here for further discussion.

AutoIt v3 script:
Code: Select all
#region --- Au3Recorder generated code Start (v3.3.9.5 KeyboardLayout=00000407)  ---

#include <FileConstants.au3>
#include <MsgBoxConstants.au3>
#include <Array.au3>
#include <File.au3>

Func _WinWaitActivate($title,$text,$timeout=0) ;function generated by Au3Recorder, does only work with main David-window or David-dialogs wich are Win-API-calls
   WinWait($title,$text,$timeout)
   If Not WinActive($title,$text) Then WinActivate($title,$text)
   WinWaitActive($title,$text,$timeout)
EndFunc

Func _DavidWaitActive($xvalue, $yvalue) ;function for waiting until David finishes calculations, uses the availaibility of choosing the working directory button
   Do
      Sleep(200)
      MouseClick("left",$xvalue, $yvalue,1)
   Until WinExists("Please select the working directory","Namespacestrukturste")
   Sleep(200)
   Send("{ESC}")
EndFunc

Func _DavidWaitActive1($xvalue, $yvalue);same as _DavidWaitActive, considers possibility, that there is an alignment error otherwise the loop running forever
   Do
      Sleep(200)
      MouseClick("left",$xvalue, $yvalue,1)
      If WinGetTitle("[active]")="Alignment" Then ;necessary in case coarse alignment does not find a solution
         WinClose("[ACTIVE]", "")
      EndIf
      If WinExists("Alignment","Namespacestrukturste") then Return
   Until WinExists("Please select the working directory","Namespacestrukturste")
   Sleep(200)
   Send("{ESC}")
EndFunc

Func _AlignmentFreeSwitchOn() ; chooses free alignment and switches Align Scans on
   MouseClick("left",370,390,1)
   MouseClick("left",302,434,1)
   MouseClick("left",173,555,1)
EndFunc

Func _ScansLoad($ScanArray) ;load multiple scans, the parameter is a onedimensional array of the scans
   Local $sendText=Chr(034) & $ScanArray[0] & Chr(034)
   For $i=1 to UBound($ScanArray)-1
      $sendText=$sendText & " " & Chr(034) & $ScanArray[$i] & Chr(034)
   Next
   MouseClick("left",2299,207,1)
   _WinWaitActivate("Add scans to list","Namespacestrukturste")
   send($sendText)
   Send("{ENTER}")
   $yPos=Round(30.67*$i+498) ;position of button "Choose working directory" depending on the number of scans, will not work for more than 30 scans on this screen resolution!
   _DavidWaitActive(2487,$yPos)
EndFunc

Func _AlignStrategy($yPos)
   MouseClick("left",2196,128,1) ;select all scans
   MouseClick("left",2201,$yPos,1) ;deselect last scan
   MouseClick("right",2289,164,1) ;choose context menu
   MouseClick("left",2096,302,1) ;group (combine) scans
   Sleep(200)
   _AlignmentFreeSwitchOn()
   MouseClick("left",2305,202,1) ;aligne scan to_
   MouseClick("left",2304,164,1) ;group
   _DavidWaitActive1(2487,560)
   _WinWaitActivate("DAVID-LASERSCANNER v3.10.4","")
   MouseClick("right",2279,164,1) ;choose context menu
   MouseClick("left",1953,349,1) ;ungroup (uncombine) scans
   Sleep(200)
EndFunc
;----------------------------------------------------------------------------------------------------------------------------------

;developed for a screen resolution of 2560x1440, has to be adapted for all other resolutions
Local $sFilePath = $CmdLine[1] ;file with scans and path, handed over via command line, use View->Parameters (Shift+F8) in text editor (SciTE) to define command line parameters
Local $arrayScans ;array for scans

If Not _FileReadToArray($sFilePath, $arrayScans, Default, ";") Then ;reading of file with scans
   MsgBox($MB_SYSTEMMODAL, "Error loading file", "An error occurred when reading the control file. Script execution stopped!")
   Exit
EndIf

_WinWaitActivate("DAVID-LASERSCANNER v3.10.4","")
Local $aExtract = _ArrayExtract($arrayScans, 1, UBound($arrayScans)-1, 1, 1) ;transfer of data (scans) in a 1D-array
_ScansLoad($aExtract)

_WinWaitActivate("DAVID-LASERSCANNER v3.10.4","")
MouseClick("left",911,105,1) ;Arrange visible scans 2D, might be on a different position in another language (differs between german and english!)

For $i=1 to UBound($arrayScans)-1
   _AlignStrategy(Round(30.67*(UBound($arrayScans)-1)+130.2)) ;parameter for the position of the button "Choose working directory" depending on the number of scans
Next

;save all scans
MouseClick("left",2196,128,1) ;select all scans
MouseClick("left",2483,Round(30.67*(UBound($arrayScans)-1)+179.3),1) ;button "Fast save/overwrite"
_WinWaitActivate("Please choose the save folder for all scans","")
Send("{ENTER}")
Sleep(200)
Send("{ENTER}")
_WinWaitActivate("Save","")
Send("{TAB}")
Sleep(200)
Send("{ENTER}")
MouseClick("left",2345,Round(30.67*(UBound($arrayScans)-1)+179.3),1) ;Button "Remove selected scans from list"

#endregion --- Au3Recorder generated code End ---

The script reads the scans to be aligned from a textfile, which is handed over via command line (path and filename of the textfile).
Use View->Parameters (Shift+F8) in text editor (SciTE) to define the command line parameters in case you want to start the script within the editor (<F5>).
The structure of the file is:
Code: Select all
;filename1.obj
;filename2.obj
...

The script can either be compiled or started via <F5> from the editor.
It is in implementation of Gunters Grouping Align Strategy
http://forum.david-3d.com/viewtopic.php?f=5931&p=32173
The scans are of a table tennis ball with alignment markers surrounding it.
I did 12 scans (30° each) on a turntable and cleaned the scans.
Afterwards I started the script on the scans.
To have an idea how it works, please see a video on youtube:
https://www.youtube.com/watch?v=DtQuMujvY_I

The script is started from within the text editor and finishes the work with saving the files at 4:39.
Afterwards the scans are loaded manually to display the result.
In principle the workflow is:
1. loading all scans
2. grouping all but the last scan
3. free alignment of the last scan to the group
4. ungrouping
repetition of steps 2-4 for all scans.
This workflow utilizes the way David sorts scans and groups after ungrouping. The last (single) scan appears on top of the list after ungrouping of the group.
5. saving the results.

Best regards
Ingo
SLS-1
SLS-2
Turntable
Ingo
 
Posts: 29
Joined: Thu Jan 15, 2015 12:02 pm
Location: Germany

Re: DAVID 4?

Postby Ingo » Mon Mar 30, 2015 8:49 pm

I forgot some details:

The screen resolution of my laptop is 2560x1440. I do not know, how much effort is necessary to adjust the script to other resolutions.
Furthermore there are differences between the button positions in different languages due to different word lengthes.
In this particular case it is also necessary to have at least 28 scans in the working directory for the correct position of the buttons on the right side.
Altogether a lot of drawbacks, so I am not convinced, that this is a perfect way for automation.

Best regards
Ingo
SLS-1
SLS-2
Turntable
Ingo
 
Posts: 29
Joined: Thu Jan 15, 2015 12:02 pm
Location: Germany

PreviousNext

Return to DAVID Development

Who is online

Users browsing this forum: No registered users and 1 guest

cron