Scanned Points Come...
 
Notifications
Clear all

Scanned Points Come Out Wrong

2 Posts
1 Users
0 Likes
466 Views
marcuso
Posts: 11
Topic starter
(@marcuso)
Eminent Member
Joined: 2 years ago

I have My FabScanner built, and mechanically its working. I used an Arduino Uno with a Pi 3, a single laser and a Pi V2 camera. I built my box from some old 70s style mid century teak veneer which looks great. Even though the FabScan is mostly working (after fixing a few bugs in the Arduino FW - which I will submit later), I can not get the scan data points to look correct. Can someone help me !

I calibrated my system, and the config file can be seen below (post calibration). I changed a few things in the default.config.json file, because my NEMA stepper motor has a resolution of 200, and is in 1/16th mode - so 3200 per complete single revolution, and the diameter of the turntable is 14 cm, so 70 mm radius :

turntable": {
"steps": 3200,
"radius": 70,
"height": 15,
"degree_per_step": {
"low": 3.6,
"medium": 1.8,
"high": 0.8
}

One thing with the above though is that the fabScan wiki help pages don't mention what degree of step - low, medium, high are for, or the height is for ?

I also changed the number of laser to 1 - single laser.

The non default camera settings are these - as my camera shows the image sideways (rotated 90 degrees) - so I changed vflip to True.

"rotate": "True",
"hflip": "False",
"vflip": "True",

The calibration values are the default values, apart from the origin-distance, which is 47mm from the turntable to the top of the bottom chessboard row, so I changed it to this

"pattern": {
"square_size": 11,
"rows": 6,
"columns": 8,
"origin_distance": 47,
"type": "chessboard"
},

These settings match my chessbaord calibration I printed off.

Following are pictures from my scans of a tea pot. Here is the original image from the first phase of calibration

TeaPot ScanTarget

 

I noticed when I set the config to keep the scan images, that I can see the red laser outline and it looks correct - apart from the images are rotated 90 degrees - so imagine each picture is on its side 90 degrees rotated to the right with the top of the image on the right hand side of each picture.

t pot scan

Also the cloud points are the same, when I rotate the cloud points in the web browser they dont rotate around the centre of the turn table, they rotate around a side view.

3fabscan points t pot
2fabscan points t pot

Is there a bug when you change the vflip ? Shall I rotate the camera physically to the correct orientation ? Then put the vflip back to false ? 

This is the complete config file...

{
"folders": {
"www": "/usr/share/fabscanpi/",
"scans": "/home/pi/scans/"
},
"laser": {
"interleaved": "False",
"numbers": 1,
"color": "R (RGB)"
},
"scanner_type": "laserscanner",
"calibration": {
"weight_matrix": [],
"dist_camera_matrix": [],
"pattern": {
"square_size": 11,
"rows": 6,
"columns": 8,
"origin_distance": 47,
"type": "chessboard"
},
"camera_matrix": [
[
1523.29,
0.0,
625.986
],
[
0.0,
1532.168,
836.781
],
[
0.0,
0.0,
1.0
]
],
"distortion_vector": [
0.069,
1.188,
0.01,
0.002,
-5.062
],
"laser_planes": [
{
"distance": 137.20160911374415,
"normal": [
-0.5304927113828322,
0.00498085382173772,
0.8476748635325322
],
"deviation": 0.02480792209446897
}
],
"platform_translation": [
1.6427253799511443,
55.221398747460626,
161.43405393591323
],
"platform_rotation": [
[
0.0,
0.9999409321721393,
0.0108688622547649
],
[
0.002282825804996973,
0.010868833934311546,
-0.9999383266758267
],
[
-0.9999973943497773,
2.48117192261349e-05,
-0.0022826909634352877
]
],
"type": "chessboard"
},
"meshlab": {
"path": "/usr/bin/"
},
"process_numbers": 3,
"turntable": {
"steps": 3200,
"radius": 70,
"height": 15,
"degree_per_step": {
"low": 3.6,
"medium": 1.8,
"high": 0.8
}
},
"camera": {
"resolution": {
"width": 1640,
"height": 1232
},
"preview_resolution": {
"width": 800,
"height": 600
},
"rotate": "True",
"hflip": "False",
"vflip": "True",
"type": "PICAM",
"undistort": "False"
},
"connector": {
"type": "serial",
"firmware": "fabscanpi",
"baudrate": 57600,
"autoflash": "False",
"flash_baudrate": 115200,
"port": "/dev/ttyUSB0"
},
"texture_illumination": 160,
"keep_raw_images": "False",
"keep_calibration_raw_images": "False",
"discoverable": "True",
"online_lookup_ip": "8.8.8.8"
}

3fabscan points t pot
2fabscan points t pot
Reply
1 Reply
marcuso
(@marcuso)
Joined: 2 years ago

Eminent Member
Posts: 11

There are 2 more problems with the setup I have.

1. I have noticed that on the server backend software, the step function inside the Turntable class is being used to set the angle of movement for each step call. For example this function gets 64 for the number of steps, but the GUI assumes its 16. The problem is the scaler attribute is set to 4. When set to 1 the angle of scan points is correct. 

2. The height field in the turntable JSON struct inside the config file needs to be around 150 (the default is good), as this is actually the vertical height of each scan, above this no more points are taken - it looks like this is in mm. So if this is too low e.g. 15 like I had above, the points are ignored.

When dealing with any quanitifiable settings in config files (or even variable naming in code), its always more helpful to the consumer of the SDK/Settings to use the actual measurement system in the actual variable name, i.e. instead of height, it should be height_mm (can use any other naming convention as long as mm in name).

Here is my new scan with the

1. scaler set to 1 in FSTurntable.py

2. height set to 100 in config file

And then a new calibration, and a high res scan...

Screenshot FabScanPi v.0.10.2
Reply
Share: