How to get the bounding box of a CAD car?
-
I have some CAD cars and I need to project these 3D models to 2D images, is there a method to get the 2D bounding box coordinate of a car in each image? e.g., the 4 corner coordinates, (x1,y1), (x2,y2), (x3,y3), (x4,y4) of the green bounding box in the following attachment.
-
You would insert each car component onto a new layer, switch to that layer, and turn all other layers OFF, and zoom extents.
Then use
view.write_image
to create the image files. -
@dan rathbun said:
You would insert each car component onto a new layer, switch to that layer, and turn all other layers OFF, and zoom extents.
Then use
view.write_image
to create the image files.Suppose there is one car in a image, how to get the coordinates of the car's bounding rectangle?
-
You don't need to find those [even if you could] because the Zoom Extents on a single car does that in the view.
Of course depending on your screen's current proportions and the exact view of the car you will get some 'white space' around the image.
If you don't want all images to be the same size then that 'white space' is best removed with an Image editor [like Gimp] - where you can batch-open each file in turn and Auto-Crop it and save, to ensure that each car occupies as much of the image as possible... -
It is true you may not need bounding box corner coordinate of a car in each image to make 3D models to 2D images,
@unknownuser said:
by lbsswu » February 28th, 2013, 11:58 pm
I have some CAD cars and I need to project these 3D models to 2D images, is there a method to get the 2D bounding box coordinate of a car in each image? e.g., the 4 corner coordinates, (x1,y1), (x2,y2), (x3,y3), (x4,y4)
Yes You can turn 3D models to 2D images,
method 1) flatten it with scaleGroupFloat_dj Ver 1.6.5
Copyright Feb 15, 2013
DukeJazz: by James Cochran
when color leaves then it flat
recolor with in model texture
I use four boxpoints to four corner (boxPoint_dj)
then readed the c-point to target
method 2) a clip trxture - edit to transpaency background-input image
There is 2 methods beside mine above to get the 2D bounding box coordinate of a car.(x1,y1), (x2,y2), (x3,y3), (x4,y4)
method 1) Ruby ATI method is given here for bounding box coordinate
http://www.sketchup.com/intl/en/developer/docs/ourdoc/boundingbox#cornermethod 2) If you have the SU Pro save a export to VRML and open to notepad, lookie here coordinates
-
@dukejazz said:
It is true you may not need bounding box corner coordinate of a car in each image to make 3D models to 2D images,
...thanks for your kindly reply, I will try these method.
-
@tig said:
You don't need to find those [even if you could] because the Zoom Extents on a single car does that in the view.
Of course depending on your screen's current proportions and the exact view of the car you will get some 'white space' around the image.
If you don't want all images to be the same size then that 'white space' is best removed with an Image editor [like Gimp] - where you can batch-open each file in turn and Auto-Crop it and save, to ensure that each car occupies as much of the image as possible...thanks for your tip! maybe I will do that in the future.
Advertisement