Code Monkey home page Code Monkey logo

f2wang / objectdatasettools Goto Github PK

View Code? Open in Web Editor NEW
405.0 9.0 92.0 9.16 MB

Tools to create pixel-wise object masks, bounding box labels (2D and 3D) and 3D object model (PLY triangle mesh) for object sequences filmed with an RGB-D camera. This project prepares training and testing data for various deep learning projects such as 6D object pose estimation projects singleshotpose, as well as object detection and instance segmentation projects.

License: MIT License

Python 100.00%

objectdatasettools's Introduction

Object Dataset Tools

Introduction

This repository contains pure python scripts to create object masks, bounding box labels, and 3D reconstructed object mesh (.ply) for object sequences filmed with an RGB-D camera. This project can prepare training and testing data for various deep learning projects such as 6D object pose estimation projects singleshotpose, and many object detection (e.g., faster rcnn) and instance segmentation (e.g., mask rcnn) projects. Ideally, if you have realsense cameras and have some experience with MeshLab or Blender, creating your customized dataset should be as easy as executing a few command line arguments.

This codes in this repository implement a raw 3D model acquisition pipeline through aruco markers and ICP registration. The raw 3D model obtained needs to be processed and noise-removed in a mesh processing software. After this step, there are functions to generate required labels in automatically.

The codes are currently written for a single object of interest per frame. They can be modified to create a dataset that has several items within a frame.

cover mask

Installation

Installation of this repository has been tested on a fresh install of Ubuntu 16.04 with Python 2.7, but should be compatible with Python 3 as well. Installations on a wide range of intel realsense drivers and their python wrappers are included.

Create dataset on customized items

1. Preparation

Color print the pdf with the correctly sized aruco markers (with ID 1-13) in the arucomarkers folder. Affix the markers surrounding the object of interest, as shown in the picture, make sure that you don't have markers with dulplicate IDS .

BackFlow

2. Record an object sequence

Option 1: Record with a realsense camera (SR300 perfered)

The script is provided to record an object video sequence using a compatible realsense camera. Use record.py for legacy models and record2.py for librealsense SDK 2.0:

python record.py LINEMOD/OBJECTNAME

e.g.,

python record.py LINEMOD/sugar

to record a sequence of a sugar box. By default, the script records for 40 seconds after a countdown of 5. You can change the recording interval or exit the recording by pressing "q". Please steadily move the camera to get different views of the object while maintaining that 2-3 markers are within the field of view of the camera at any time.

Note that the project assumes all sequences are saved under the folder named "LINEMOD", use other folder names will cause an error to occur.

If you use record.py to create your sequence, color images, depth aligned to color images, and camera parameters will be automatically saved under the directory of the sequence.

Option 2: Use an existing sequence or record with other cameras

If you are using other cameras, please put color images (.jpg) in a folder named "JPEGImages" and the aligned depth images (uint16 pngs interpolated over a 8m range) in the "depth" folder. Please note that the algorithm assumes the depth images to be aligned to color images. Name your color images in sequential order from 0.jpg, 1.jpg ... 600.jpg and the corresponding depth images as 0.png ... 600.png, you should also create a file intrinsics.json under the sequence directory and manually input the camera parameters in the format like below:

{"fx": 614.4744262695312, "fy": 614.4745483398438, "height": 480, "width": 640, "ppy": 233.29214477539062, "ppx": 308.8282470703125, "ID": "620201000292"}

If you don't know your camera's intrinsic, you can put a rough estimation in. All parameters required are fx, fy, cx, cy, where commonly fx = fy and equals to the width of the image and cx and cy is the center of the image. For example, for a 640 x 480 resolution image, fx, fy = 640, cx = 320, cy = 240.

An example sequence can be download HERE, create a directory named "LINEMOD", unzip the example sequence, and put the extracted folder (timer) under LINEMOD.

3. Obtain frame transforms

Compute transforms for frames at the specified interval (interval can be changed in config/registrationParameters) against the first frame, save the transforms(4*4 homogenous transforms) as a numpy array (.npy).

python compute_gt_poses.py LINEMOD/sugar

4. Register all frames and create a mesh for the registered scene.

python register_scene.py LINEMOD/sugar

A raw registeredScene.ply will be saved under the specified directory (e.g., LINEMOD/sugar). The registeredScene.ply is a registered pointcloud of the scene that includes the table top, markers, and any other objects exposed during the scanning, with some level of noise removal. The generated mesh looks something like this and requires manual processing in step 5:

BackFlow

Alternatively, you can try skipping all manual efforts by trying register_segmented instead of register_scene.

python register_segmented.py LINEMOD/sugar

By default, register_segmented attempts to removes all unwanted backgrounds and performs surface reconstruction that converts the registered pointcloud into a triangular mesh. If MESHING is set to false, the script will only attempt to remove background and auto-complete the unseen bottom with a flat surface (If FILLBOTTOM is set to true), and you will need to do step 5.

However, register_segmented may fail as it uses some ad hoc methods for segmenting the background, therefore you may need to tune some parameters for it to work with your object. The most important knob to tune is "MAX_RADIUS", which cuts off any depth reading whose Euclidean distance to the center of the aruco markers observed is longer than the value specified. This value is currently set at 0.2 m, if you have a larger object, you may need to increase this value to not cut off parts of your object. Result from running register_segmented looks something like this:

BackFlow

5. Process the registered pointcloud manually (Optional)

(03/03/2019) You can skip step 5 if you are satisfied with the result from running register_segmented.

The registered pointcloud needs to be processed to

  1. Remove background that is not of interest,
  2. Perform surface reconstruction and complete the missing side or vice versa,
  3. Process the reconstructed mesh (you may need to cut parts off and recomplete the missing side),
  4. Make sure that the processed mesh is free of ANY isolated noise.

The end product is a triangular mesh instead of the registered pointcloud generated by the algorithm.

You may find these YouTube tutorials useful: Point cloud to mesh conversion, Point Cloud to Mesh Reconstruction (MeshLab), and this very basic one I recorded.

If you are creating the mesh as a by-product to obtain image masks, or use it for projects like singleshotpose. Only the exact mesh geometry is needed while the appearance is not useful. It's therefore acceptable to "close holes" as shown in the video for planar areas. Also, for symmetrical objects, complete the shape manually by symmetry. If you need the exact texture information for the missing side, you will need to film another sequence exposing the missing side and manually align 2 pointclouds.

6. Create image masks and label files

When you have completed step 1-4 for all customized objects, run

python create_label_files.py all

or

python create_label_files.py LINEMOD/sugar

This step creates a new mesh named foldername.ply (e.g., sugar.ply) whose AABB is centered at the origin and are the same dimensions as the OBB. It also produces image masks (saved under mask), 4 x 4 homogenious transforms in regards to the new mesh (saved under transforms), as well as labels files (saved under labels) which are projections of the 3D bounding box of the object onto the 2D images. The mask files can be used for training and testing purposes for a deep learning project (e.g., mask-rcnn)

Inspect the correctness of the created 3D bounding boxes and masks visually by running:

python inspectMasks.py LINEMOD/sugar

(Optional) Create additional files required by singleshotpose

If you create the mesh file for singleshot pose, you need to open those new mesh files in meshlab and save them again by unchecking the binary format option. Those meshes are used by singleshotpose for evaluation and pose estimation purpose, and singleshotpose cannot read mesh that is binary encoded.

Masks and labels created in step 6 are compatible with singleshotpose. Currently, class labels are assigned in a hacky way (e.g., by the order the folder is grabbed among all sequence folders), if you call create_label for each folder they will be assigned the same label, so please read the printout and change class label manually in create_label_files.py.

In addition, you need to create train and test images

python makeTrainTestfiles.py

and create other required path files

For each of the customized object, create an objectname.data file in the cfg folder

To get the object scale(max vertice distance), you can run

python getmeshscale.py

This should be everything you need for creating a customized dataset for singleshotpose, please don't forget to update the camera calibration parameters in singleshotpose as well.

(Optional) Create bounding box labels for object detection projects

After you complete step 6 (generated image masks). Run:

python get_BBs.py

This creates annotations.csv that contains class labels and bounding box information for all images under LINEMOD folder.

If you encounter any problems with the code, want to report bugs, etc. please contact me at faninedinburgh[at]gmail[dot]com.

objectdatasettools's People

Contributors

f2wang avatar paperstiger avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

objectdatasettools's Issues

error occured while read png with python3

It seems to be incompatible with python3.

I choose to read .png with PIL and seemingly repaired it.

reader = png.Reader(depth_file)
pngdata = reader.read()
depth = np.array(map(np.uint16, pngdata[2]))

swap all the fragments above with this:

depth = np.array(Image.open(depth_file))

Meanwhile, you need to typecast npcds to int:

int(npcds)

Changing of RGBD data

I would like to change the code where I can keep the real sense camera stationary and take a photo where each photo consists of a different pose of the object.

Would the rest of the steps still work with the above changes?

Can I use it for multi obj?

I tried to directly record pictures with four items in it, but the .ply ,especially the occluded sides of the items, is quite bad.

About 3D model from others way.

Hi, I want to know if I use a visualSFM to build an object's 3D model. Is this model can replace the file 'registeredScene.ply'? And I use this model to create the pose label.

To check ground truth and mesh generated

@F2Wang I was trying to project back the ground truth generated but somehow it is not correct. Can you please tell me how I can project the ground truth back onto the RGB image and check it is correctly generated or not?
Or if you have any other idea to cross check can you please tell me?

I am trying to generate real data set and use it to train Dense fusion.

How to draw 3D Bounding Boxes for predicted and ground-truth pose

Hello!

I am having trouble with figuring out how to draw 3D bounding boxes to compare the predicted and ground-truth 6D pose for my object of interest. I can't understand in which frame those 8 corners are given (image frame, since 2D), but why those values are so small (corner coordinates range between 0.1 to 1.3)?

Any suggestions or hints would be helpful. Thank you

Mask vs RGB image

Below is a generated mask with the respective RGB image, the mask does not seem to be a pixel perfect of the jpeg. Is there something I am doing wrong while recording with the Real Sense camera, should I be holding the camera in a certain way or moving it in a specific way?

0
0

Can I generate the new dataset with other kind camera?

Thank you very much for the great job for providing this job~
I only have two kinds of camera,one is kinectv2 , and another one is zed.
I follow the instruction to construct the environment for this project.
I wonder about what can I do at step 5?

#### Step 5:

Install librealsense and its python wrapper.

Issue with 2D and 3D corner coordinates

Hello!

Sorry for bothering you again, but I can't understand some moments. I have 2 questions:

  1. I am confused that 2D corner coordinates are not between 0-1, but bigger than 1.
    Don't you think this is because of the camera I am using? I am using Intel RealSense D435.

  2. In corners = compute_projection(transformed,K), transformed are 3D corner coordinates in world frame or in my model frame?

OpenCV Error: Assertion failed (scn == 3 || scn == 4) in cvtColor

Hello Fan,

while running compute_gt_pose.py I am getting 'OpenCV Error: Assertion failed (scn == 3 || scn == 4) in cvtColor' error, which I didn't get before. I thought this error is because of opencv version which I changed recently, but not. However I can run this code on my laptop with the same camera (RealSense). Currently I am using opencv -3.3.0.

What may cause such error? thank you.

Questions about step 3

In step 3: Obtain frame transforms
Compute transforms for frames at the specified interval

Why do we need frame transforms ?
The "frames" means the frame of the object ?
What does the specified interval mean ? time interval ?

Thank you

ArUco Markers

I came across this generator for generating the markers - is there a specific format I need to follow in terms of spacing, IDs, to correctly use along with this repository?

About the marker

Hi, you said "Color print the pdf with the correctly sized aruco markers in the arucomarkers folder.", is that mean print the pdf in a A4 paper? I print the marker in A4 and cut the marker to make the marker around the object, like
image
But the object I reconstructed is not right in scale.

another?

In my opinion, the multi obj' pose label whether it can come true or not from the object detection algorithms. we found the position of multi-objects from an image.

a little error in readme.txt

{"fx": 614.4744262695312, "fy": 614.4745483398438,(IT SEEMS CONFLICT WITH THE FOLLOWING EXPALNATION!) "height": 480, "width": 640, "ppy": 233.29214477539062, "ppx": 308.8282470703125, "ID": "620201000292"}

If you don't know your camera's intrinsic, you can put a rough estimation in. All parameters required are fx, fy, cx, cy, where commonly fx = fy and equals to the width of the image and cx and cy is the center of the image. For example, for a 640 x 480 resolution image, fx, fy = 480(HERE IS THE ERROR, COZ IT CONFLICTS WITH ABOVE EXPLAINATION), cx = 320, cy = 240.

AttributeError: 'NoneType' object has no attribute 'shape' while creating Image Masks

Hello! I am Akmaral.
First of all, thank you for this great job and sharing with us.

I am getting this error: " AttributeError: 'NoneType' object has no attribute 'shape'
" while running 'python3 create_label_files.py LINEMOD/xxx' (Step 6). I have successfulIy completed all previous steps, and have registeredScene.ply inside my folder. Even updating my trimesh version doesn't help. Please can you give me a hint to solve this problem.

Error occurs in step 6

Thanks a lot for this Repo!

However, have I completed steps 1 to 5, an error occurred when I try to create label files. Here is the error:

$ python3 create_label_files.py LINEMOD/lays
lays is assigned class label 0.
Traceback (most recent call last):
  File "create_label_files.py", line 96, in <module>
    mesh = trimesh.load(folder + "registeredScene.ply")
  File "/usr/local/lib/python3.5/dist-packages/trimesh/exchange/load.py", line 135, in load
    **kwargs)
  File "/usr/local/lib/python3.5/dist-packages/trimesh/constants.py", line 137, in timed
    result = method(*args, **kwargs)
  File "/usr/local/lib/python3.5/dist-packages/trimesh/exchange/load.py", line 205, in load_mesh
    **kwargs)
  File "/usr/local/lib/python3.5/dist-packages/trimesh/exchange/ply.py", line 76, in load_ply
    ply_ascii(elements, file_obj)
  File "/usr/local/lib/python3.5/dist-packages/trimesh/exchange/ply.py", line 485, in ply_ascii
    row = array[position]
IndexError: index 76862 is out of bounds for axis 0 with size 76862

I have also tried with python2.7, but the error appeared to be the same.

If the .ply is saved in ASCII, error would change into:

lays is assigned class label 0.
Traceback (most recent call last):
  File "create_label_files.py", line 96, in <module>
    mesh = trimesh.load(folder + "registeredScene.ply")
  File "/usr/local/lib/python3.5/dist-packages/trimesh/exchange/load.py", line 135, in load
    **kwargs)
  File "/usr/local/lib/python3.5/dist-packages/trimesh/constants.py", line 137, in timed
    result = method(*args, **kwargs)
  File "/usr/local/lib/python3.5/dist-packages/trimesh/exchange/load.py", line 205, in load_mesh
    **kwargs)
  File "/usr/local/lib/python3.5/dist-packages/trimesh/exchange/ply.py", line 78, in load_ply
    ply_binary(elements, file_obj)
  File "/usr/local/lib/python3.5/dist-packages/trimesh/exchange/ply.py", line 586, in ply_binary
    populate_listsize(file_obj, elements)
  File "/usr/local/lib/python3.5/dist-packages/trimesh/exchange/ply.py", line 551, in populate_listsize
    dtype=field_dtype)[0]
IndexError: index 0 is out of bounds for axis 0 with size 0

I really need some help, cause I have a deadline on July 31st💀

pose optimization

hello,i get a result that have big pose error between the images,the error in the back is greater than first few image,i think that is problem of optimization,but i don't know how to adjust,can you help me ?and,i want to know must to be stable when recording images?

how to create the 3D Location field for an object?

Hi,
recently, a lot methods try to regress the 3D Location field and get pretty results, and do you know how to create the 3D Location field from the pose and ply ?
image
e.g.Pose-guided Auto-Encoder and Feature-Based Refinement for 6-DoF Object Pose Regression

Correctness of labels

Dear Fan,

How can check the correctness of created labels (2D projections of the 3D BB from "labels" folder)?

I tried putting points on coordinates from .txt files (9 points for the center and 8 vertices) directly in the corresponding RGB image. Please have a look at the attached image.

Also, I noticed that some 2D vertices are with "-" (minus) sign.
I checked dimensions of my .ply 3D model, they look right.

17

Thank you.

where is the origin of word coordinates of point clouds produced by register_scene.py ?Is it related to the markers?

Hi, first thanks for your work.
For now I want to use RGBD Camera to take RGB and depth images around single or multiple still objects ,and I want to get a full point clouds of the secene or the only object.
BUT i NEED TO KNOW the origin of word coordinates of these point clouds ,because i need this information to do manipulation with UR5 robots.
Can u give me some instructions about that ?
Thanks.

Parameter or aruco makers adjustment on big Objects

Hi
I want to get big object datasets' masks and labels, such as luggage, but after registering scene computation, the point clouds look like this:
register_scene

I also tried to scan longer time, or use 9*4 aruco makers but get worse result.
Is there any parameter or the size of aruco makers need to adjust?

If I manually rotate the object in Meshlab, it seems the masks are not match with the jpg files. Is it a correct way to do that?

Thanks.

Installation issue

Hey,
first I would like to thank you for building such an amazing tool.
But I've got some problems with the correct installation at my windows-based system.
I am currently working with python3 and already got git, cmake and pkgconfilite (via chocolately). But if I understand it right libssl-dev and libgl1-mesa-glx packages are just for Ubuntu Users. Is there an alternative for windows?
Furthermore I can't install an older version of opencv, so I got the last release opencv-python 4.2.0.34 .

I would be very thankful if the developers (or anybody else here) could help me with that problem.

Confirmation of Extraction of R,t Matrix

    pose = np.load(folder)
    print(pose.shape)  # returns a 4 x 4 matrix

    pose = pose[:3]  # this drops the  [0,0,0,1] row

    R = pose.T[:3]
    t = pose.T[3]

I just want to confirm, if the above would be the correct way to extract the R,t matrx from each of the numpy transform folders. I am basing it off this transform matrix found in match_ransac:

transform = [[R[0][0],R[0][1],R[0][2],t[0]],
[R[1][0],R[1][1],R[1][2],t[1]],
[R[2][0],R[2][1],R[2][2],t[2]],
[0,0,0,1]]

How to have just one mesh for the same object at different pose

Hello,
First of all congrats for the tool, I have been used it extensively. You can checkout my branch "tommaso" where I have created few scripts for bypassing the meshlab step using open3d library.

Anyway I have a question regarding the following problem: I have recorded two video of the same object lying in different positions (once on one side, and the other time on the other side).
I hence I have created two different meshes.
And currently my naive implementation is to consider these two meshes as two separate entities. Do you know how could I merge them together (maybe through ICP?) and so that I have just one mesh?

Problems when generating mesh

We are met with a problem after running compose_gt_poses.py. 'Mesh saved' is printed but when we open the .ply in meshlab, we get this result.
Selection_006
The environment is like this:
TIM图片20190511111252
An example of color pictures from JPENImages folder is
72
Our camera is realsense D435
Camera depth intrinsic is:
{'fx':640.292, 'fy': 640.292, 'height':720, 'width':1280, 'coeffs':[0,0,0,0,0], 'ppy':357.747, 'ppx':647.852, 'model':2}
The resolution of color and depth are both 1280*720.

We think the reason is that markers are not Identified. But we don't know the ids of the markers. Can you provide them?
Thanks.

compatibility with python3

In order to run get_BBs.py succesfully with python3 the following is needed:
1)writer = csv.writer(open("annotations.csv", "wb"), delimiter=";") to writer = csv.writer(open("annotations.csv", "w"), delimiter=";") (at line 10)

  1. at line 16 in get_BBS change xrange to range.

depth image in xtion pro

I use Xtion Pro to get the depth image from scene, and i wonder if i need to do something on the png data to fit the 8m param? I am not sure the radio here.

to get highter precision dataset

@F2Wang Thank you for your excellent work.
I got unsatisfactory preformance when training singlehotpose with my own dataset. I guess it may be related to data annotation, I want you to give me some advice

  1. is there any skills for data annotation? Such as trim the mesh file
  2. except record.py and record2.py, have you tried to create datasets with higher precision parameters using realsense, such as with higher resolution?

singleshotpose not accept binary mesh file

hi I'm sorry to bother you again.
as ObjectDatasetTools is created for singleshotpose, I notice that the mesh file generation at step 6 is binary,but the singleshotpose seems to txt format compatible only, how to deal this problem?
It is feasible to manually convert binary files to txt format. ,but I not sure whether it takes performance loss

example sequence - timer result

The result is wrong. What did I do wrong?
thanks!


Step:

  1. install env (Ubuntu 18.04 Python3.6)
  2. download example sequence (timer)
  3. python3 order
python compute_gt_poses.py LINEMOD/timer
python register_segmented.py LINEMOD/timer
python create_label_files.py LINEMOD/timer
  1. result: timer.ply
    timer.ply.zip

image

Cannot run create_label_files.py

At line 98 of create_label_files I am getting the following error:

Traceback (most recent call last):
File "create_label_files.py", line 98, in
Tform = mesh.apply_obb()
File "/usr/local/lib/python3.6/dist-packages/trimesh/base.py", line 2066, in apply_obb
matrix = self.bounding_box_oriented.primitive.transform
File "/usr/local/lib/python3.6/dist-packages/trimesh/caching.py", line 99, in get_cached
value = function(*args, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/trimesh/parent.py", line 124, in bounding_box_oriented
to_origin, extents = bounds.oriented_bounds(self)
File "/usr/local/lib/python3.6/dist-packages/trimesh/bounds.py", line 132, in oriented_bounds
if hasattr(obj, 'convex_hull'):
File "/usr/local/lib/python3.6/dist-packages/trimesh/caching.py", line 99, in get_cached
value = function(*args, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/trimesh/base.py", line 1995, in convex_hull
hull = convex.convex_hull(self)
File "/usr/local/lib/python3.6/dist-packages/trimesh/convex.py", line 53, in convex_hull
qhull_options=qhull_options)
File "qhull.pyx", line 2428, in scipy.spatial.qhull.ConvexHull.init
File "qhull.pyx", line 357, in scipy.spatial.qhull._Qhull.init
scipy.spatial.qhull.QhullError: QH7023 qhull option warning: unknown 'Q' qhull option 'Qn', skip to next space
QH6035 qhull option error: see previous warnings, use 'Qw' to override: 'qhull i QJn Qt Pp QbB' (last offset 9)

While executing: | qhull i QJn Qt Pp QbB
Options selected for Qhull 2019.1.r 2019/06/21:
run-id 428483682 incidence Qtriangulate Pprecision-ignore
QbBound-unit-box 0.5 _maxoutside 0

A question about 3d reconstruction

Hi~
i wonder whether your code has used bundle adjustment to optimize the 3D reconstruction parts?
And why not use something, such as Elesticfution, to reconstruct the whole scene?

Citation

Hi,

first of, not really an issue. I found your code really helpfull for understanding the singleshotpose and it allowed me to test their recognition on my own dataset. I want to cite this toolbox in the project I'm working on and wanted to ask if you had any preferences on that.

Trimesh Version, AttributeError: 'PointCloud' object has no attribute 'visual'

I believe I am not using the same version of Trimesh as the authors, as I am using their sample provided dataset of a timer. Would this issue be because of the current version of Trimesh I do have, if so which would be the correct one to install?

(boom) bash-3.2$ python create_label_files.py LINEMOD/timer
timer is assigned class label 0.
Traceback (most recent call last):
File "create_label_files.py", line 100, in
mesh.export(file_obj = folder + folder[8:-1] +".ply")
File "/Users/ishangupta/.pyenv/versions/boom/lib/python3.6/site-packages/trimesh/points.py", line 620, in export
**kwargs)
File "/Users/ishangupta/.pyenv/versions/boom/lib/python3.6/site-packages/trimesh/exchange/export.py", line 68, in export_mesh
export = _mesh_exporters[file_type](mesh, **kwargs)
File "/Users/ishangupta/.pyenv/versions/boom/lib/python3.6/site-packages/trimesh/exchange/ply.py", line 150, in export_ply
if mesh.visual.kind == 'vertex' and encoding != 'ascii':
AttributeError: 'PointCloud' object has no attribute 'visual'

Question about step 5

  1. The registered pointcloud (manually) mentioned in step 5 is it the same thing generated by the register_scene.py ? (But it seems that register_scene.py already will generate the mesh )

  2. If the answer is yes in previous question, then can we just use the result from register_segmented.py without the need to do step 5 ?

  3. If we really need to use meshlab, is it ok to just use the same setting as what you did in your youtube video ?

Thank you

about register_scene.py

when i run register_scene.py ,The reconstruction result is relatively bad,I think it's the reason for the video,but i don't get a good result after several attempts , so about make a viedo,Do you have any guidance?or another reason?

RunTimeError in Step6

@F2Wang
when I try "python create_label_files.py all", I got an error below

timer is assigned class label 0.
0%| | 0/55 [00:00<?, ?it/s]
Traceback (most recent call last):
File "create_label_files.py", line 128, in
sample_points = mesh_copy.sample(10000)
AttributeError: 'PointCloud' object has no attribute 'sample'

Hope someone gives some hints

Tform = mesh.apply_obb()

When i reading the code in create_label_files.py , i have some question. what this code means? there already have a transforms.npy. why need this operate?

Some doubts about the code from create_label_files.py

image

I have some questions about "Tform = mesh.apply_obb()". What does it 'Tform' mean in this step. And why the final variable 'points_original' should convert by trimesh.transformations.transform_points?

Maybe my problem should be solved by query AABB and OBB means. But when I google its means still don't know what is means.

About the register_segmented.py

Hi, I tried to use the script register_segmented.py and adjust the MAX_RADIUS as you asked. But error happend:
Load and segment frames
0%| | 0/76 [00:00<?, ?it/s]/usr/local/lib/python2.7/dist-packages/numpy/core/fromnumeric.py:3118: RuntimeWarning: Mean of empty slice.
out=out, **kwargs)
/usr/local/lib/python2.7/dist-packages/numpy/core/_methods.py:85: RuntimeWarning: invalid value encountered in double_scalars
ret = ret.dtype.type(ret / rcount)

Traceback (most recent call last):
File "register_segmented.py", line 216, in
originals = load_pcds(path, downsample = False, interval = RECONSTRUCTION_INTERVAL)
File "register_segmented.py", line 126, in load_pcds
distance = point_to_plane(depth,sol)
File "/home/ghoshaw/usr/Detect3D/ObjectDatasetTools/utils/plane.py", line 55, in point_to_plane
plane_xyz = p[0:3]
TypeError: 'NoneType' object has no attribute 'getitem'

If I run register_scene.py, it was ok.
Is there any other parameter need to change or something? Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.