1-Point perspective


Description
Generate orthogonal lines on uploaded room images to assist with accurate dimension calculations and room sizing visualizations of a 1-point perspective room image.
Use cases
Accurate space planning and furniture fitting.
Enhancing property listings with detailed room dimensions.
Credit
1 successful Space Design API call = 1 credit.
API
POST
https://api.spacely.ai/api/v1/generate/two-point-perspective
This endpoint is used to advance generate
Headers
X-API-KEY*
String
Request Body
imageUrl*
String
The URL of the image representing the room or space to visualize dimensions.
(e.g., "https://storage.googleapis.com/spacely/public/image/roomstyle3/bathroom-modern.jpg").
topLeftLine*
Object[]
An array of 2 coordinate objects representing the line on the top left orthogonal line (the connecting line between wall and ceiling at the upper left hand side of the room).
Where the first element is the point that is deeper inside the room. The last element is nearer to the camera.
e.g.
[{ "x": 0, "y": 0},{"x":100.2,"y":100.2}]
topRightLine*
Object[]
An array of 2 coordinate objects representing the line on the top right orthogonal line (the connecting line between wall and ceiling at the upper right hand side of the room).
Where the first element is the point that is deeper inside the room. The last element is nearer to the camera.
e.g.
[{ "x": 0, "y": 0},{"x":100.2,"y":100.2}]
roomHeight*
Float
The height of the room/space. Must be in meter.
bottomLeftLine*
Object[]
An array of 2 coordinate objects representing the line on the bottom left orthogonal line (the connecting line between wall and ceiling at the lower left hand side of the room).
Where the first element is the point that is deeper inside the room. The last element is nearer to the camera.
e.g.
[{ "x": 0, "y": 0},{"x":100.2,"y":100.2}]
bottomRightLine*
Object[]
An array of 2 coordinate objects representing the line on the bottom right orthogonal line (the connecting line between wall and ceiling at the lower right hand side of the room).
Where the first element is the point that is deeper inside the room. The last element is nearer to the camera.
e.g.
[{ "x": 0, "y": 0},{"x":100.2,"y":100.2}]
roomWidth
Float
The width of the room/space. Must be in meter.
referenceLine
Object[]
An array of 2 coordinate objects representing the 1-meter line on the bottom right orthogonal line
Where the first element is the point that is deeper inside the room. The last element is 1 meter from the former.
e.g.
[{ "x": 0, "y": 0},{"x":100.2,"y":100.2}]
{
"data": "63d17492-43d9-4161-0000-b067be1316dc"
}
Example
curl --location 'https://api.spacely.ai/api/v1/generate/one-point-perspective' \
--header 'X-API-KEY: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"imageUrl": "IMAGE_URL",
"topLeftLine": [
{
"x": 68.57142857142857,
"y": 28.4534351245777
},
{
"x": 33.38345864661654,
"y": -0.3753937042511261
}
],
"topRightLine": [
{
"x": 520.6015037593985,
"y": 28.716216216216218
},
{
"x": 555.7894736842105,
"y": 0.7882882882882883
}
],
"bottomLeftLine": [
{
"x": 65.86466165413533,
"y": 300.45045045045043
},
{
"x": 0,
"y": 340.0900900900901
}
],
"bottomRightLine": [
{
"x": 521.5037593984962,
"y": 297.1095729518581
},
{
"x": 599.0977443609023,
"y": 352.06452790681305
}
],
"referenceLine": [
{
"x": 520.6015037593985,
"y": 301.20118287232543
},
{
"x": 572.0300751879699,
"y": 334.5345162056588
}
],
"roomHeight": 3,
"roomWidth": 4
}'
Support
Any question? Contact us at [email protected]
Last updated