Draw 3D objects over 2D images in Python Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) The Ask Question Wizard is Live! Data science time! April 2019 and salary with experienceCalling an external command in PythonWhat are metaclasses in Python?Finding the index of an item given a list containing it in PythonDifference between append vs. extend list methods in PythonHow can I safely create a nested directory in Python?Does Python have a ternary conditional operator?Lazy load of images in ListViewProper way to declare custom exceptions in modern Python?Iterating over dictionaries using 'for' loopsDoes Python have a string 'contains' substring method?
How to pour concrete for curved walkway to prevent cracking?
How to market an anarchic city as a tourism spot to people living in civilized areas?
Array/tabular for long multiplication
Why does tar appear to skip file contents when output file is /dev/null?
Two different pronunciation of "понял"
Statistical model of ligand substitution
Geometric mean and geometric standard deviation
Problem when applying foreach loop
Limit for e and 1/e
The following signatures were invalid: EXPKEYSIG 1397BC53640DB551
Do working physicists consider Newtonian mechanics to be "falsified"?
Antler Helmet: Can it work?
Who can trigger ship-wide alerts in Star Trek?
Why don't the Weasley twins use magic outside of school if the Trace can only find the location of spells cast?
Can a zero nonce be safely used with AES-GCM if the key is random and never used again?
What would be Julian Assange's expected punishment, on the current English criminal law?
What do you call the holes in a flute?
Unable to start mainnet node docker container
How can I protect witches in combat who wear limited clothing?
What's the difference between (size_t)-1 and ~0?
Active filter with series inductor and resistor - do these exist?
Can't figure this one out.. What is the missing box?
How did the aliens keep their waters separated?
Why is "Captain Marvel" translated as male in Portugal?
Draw 3D objects over 2D images in Python
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)
The Ask Question Wizard is Live!
Data science time! April 2019 and salary with experienceCalling an external command in PythonWhat are metaclasses in Python?Finding the index of an item given a list containing it in PythonDifference between append vs. extend list methods in PythonHow can I safely create a nested directory in Python?Does Python have a ternary conditional operator?Lazy load of images in ListViewProper way to declare custom exceptions in modern Python?Iterating over dictionaries using 'for' loopsDoes Python have a string 'contains' substring method?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
There are many ways to draw objects over 2d images. There are also many ways to draw 3D objects, as graphs over plots.
However, I did not find a way to draw 3D objects over 2D images. For example, let's say I want to draw a black cube over a picture:

Is there any Python package that enables this?
python image 3d
add a comment |
There are many ways to draw objects over 2d images. There are also many ways to draw 3D objects, as graphs over plots.
However, I did not find a way to draw 3D objects over 2D images. For example, let's say I want to draw a black cube over a picture:

Is there any Python package that enables this?
python image 3d
add a comment |
There are many ways to draw objects over 2d images. There are also many ways to draw 3D objects, as graphs over plots.
However, I did not find a way to draw 3D objects over 2D images. For example, let's say I want to draw a black cube over a picture:

Is there any Python package that enables this?
python image 3d
There are many ways to draw objects over 2d images. There are also many ways to draw 3D objects, as graphs over plots.
However, I did not find a way to draw 3D objects over 2D images. For example, let's say I want to draw a black cube over a picture:

Is there any Python package that enables this?
python image 3d
python image 3d
asked Mar 8 at 15:01
MattSMattS
1,03611118
1,03611118
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
Never saw this in matplotlib to be honest. So here a littl workaround:
write 2 independent scripts, one for the plain background and one for the 3D object. Then you could merge them via Gimp, photoshop etc.
#for the background
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
plt.axis('off')
image = mpimg.imread("C:pathtoimagexyz.jpg")
plt.imshow(image)
plt.show()
What script is needed for the background? It is just a plain image... Anyway I need a programmatic solution, doesn't have to be in Python but it can't be manual with Photoshop
– MattS
Mar 8 at 15:36
plt.axis("off");plt.imshow(path);plt.show()
– Richard Lenkiewicz
Mar 8 at 15:41
Can you please provide a working example? Instead of seeing the background image I am seeing a constant color image, with the most dominant color in the image...
– MattS
Mar 8 at 15:54
import matplotlib.pyplot as plt; import matplotlib.image as mpimg; plt.axis('off'); image = mpimg.imread("C:........figure.jpg"); #(windows) plt.imshow(image); plt.show()
– Richard Lenkiewicz
Mar 8 at 16:05
That is exactly what I am doing, after I generated the 3D object
– MattS
Mar 8 at 16:15
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55065865%2fdraw-3d-objects-over-2d-images-in-python%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Never saw this in matplotlib to be honest. So here a littl workaround:
write 2 independent scripts, one for the plain background and one for the 3D object. Then you could merge them via Gimp, photoshop etc.
#for the background
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
plt.axis('off')
image = mpimg.imread("C:pathtoimagexyz.jpg")
plt.imshow(image)
plt.show()
What script is needed for the background? It is just a plain image... Anyway I need a programmatic solution, doesn't have to be in Python but it can't be manual with Photoshop
– MattS
Mar 8 at 15:36
plt.axis("off");plt.imshow(path);plt.show()
– Richard Lenkiewicz
Mar 8 at 15:41
Can you please provide a working example? Instead of seeing the background image I am seeing a constant color image, with the most dominant color in the image...
– MattS
Mar 8 at 15:54
import matplotlib.pyplot as plt; import matplotlib.image as mpimg; plt.axis('off'); image = mpimg.imread("C:........figure.jpg"); #(windows) plt.imshow(image); plt.show()
– Richard Lenkiewicz
Mar 8 at 16:05
That is exactly what I am doing, after I generated the 3D object
– MattS
Mar 8 at 16:15
add a comment |
Never saw this in matplotlib to be honest. So here a littl workaround:
write 2 independent scripts, one for the plain background and one for the 3D object. Then you could merge them via Gimp, photoshop etc.
#for the background
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
plt.axis('off')
image = mpimg.imread("C:pathtoimagexyz.jpg")
plt.imshow(image)
plt.show()
What script is needed for the background? It is just a plain image... Anyway I need a programmatic solution, doesn't have to be in Python but it can't be manual with Photoshop
– MattS
Mar 8 at 15:36
plt.axis("off");plt.imshow(path);plt.show()
– Richard Lenkiewicz
Mar 8 at 15:41
Can you please provide a working example? Instead of seeing the background image I am seeing a constant color image, with the most dominant color in the image...
– MattS
Mar 8 at 15:54
import matplotlib.pyplot as plt; import matplotlib.image as mpimg; plt.axis('off'); image = mpimg.imread("C:........figure.jpg"); #(windows) plt.imshow(image); plt.show()
– Richard Lenkiewicz
Mar 8 at 16:05
That is exactly what I am doing, after I generated the 3D object
– MattS
Mar 8 at 16:15
add a comment |
Never saw this in matplotlib to be honest. So here a littl workaround:
write 2 independent scripts, one for the plain background and one for the 3D object. Then you could merge them via Gimp, photoshop etc.
#for the background
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
plt.axis('off')
image = mpimg.imread("C:pathtoimagexyz.jpg")
plt.imshow(image)
plt.show()
Never saw this in matplotlib to be honest. So here a littl workaround:
write 2 independent scripts, one for the plain background and one for the 3D object. Then you could merge them via Gimp, photoshop etc.
#for the background
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
plt.axis('off')
image = mpimg.imread("C:pathtoimagexyz.jpg")
plt.imshow(image)
plt.show()
edited Mar 8 at 16:12
answered Mar 8 at 15:34
Richard LenkiewiczRichard Lenkiewicz
594
594
What script is needed for the background? It is just a plain image... Anyway I need a programmatic solution, doesn't have to be in Python but it can't be manual with Photoshop
– MattS
Mar 8 at 15:36
plt.axis("off");plt.imshow(path);plt.show()
– Richard Lenkiewicz
Mar 8 at 15:41
Can you please provide a working example? Instead of seeing the background image I am seeing a constant color image, with the most dominant color in the image...
– MattS
Mar 8 at 15:54
import matplotlib.pyplot as plt; import matplotlib.image as mpimg; plt.axis('off'); image = mpimg.imread("C:........figure.jpg"); #(windows) plt.imshow(image); plt.show()
– Richard Lenkiewicz
Mar 8 at 16:05
That is exactly what I am doing, after I generated the 3D object
– MattS
Mar 8 at 16:15
add a comment |
What script is needed for the background? It is just a plain image... Anyway I need a programmatic solution, doesn't have to be in Python but it can't be manual with Photoshop
– MattS
Mar 8 at 15:36
plt.axis("off");plt.imshow(path);plt.show()
– Richard Lenkiewicz
Mar 8 at 15:41
Can you please provide a working example? Instead of seeing the background image I am seeing a constant color image, with the most dominant color in the image...
– MattS
Mar 8 at 15:54
import matplotlib.pyplot as plt; import matplotlib.image as mpimg; plt.axis('off'); image = mpimg.imread("C:........figure.jpg"); #(windows) plt.imshow(image); plt.show()
– Richard Lenkiewicz
Mar 8 at 16:05
That is exactly what I am doing, after I generated the 3D object
– MattS
Mar 8 at 16:15
What script is needed for the background? It is just a plain image... Anyway I need a programmatic solution, doesn't have to be in Python but it can't be manual with Photoshop
– MattS
Mar 8 at 15:36
What script is needed for the background? It is just a plain image... Anyway I need a programmatic solution, doesn't have to be in Python but it can't be manual with Photoshop
– MattS
Mar 8 at 15:36
plt.axis("off");plt.imshow(path);plt.show()
– Richard Lenkiewicz
Mar 8 at 15:41
plt.axis("off");plt.imshow(path);plt.show()
– Richard Lenkiewicz
Mar 8 at 15:41
Can you please provide a working example? Instead of seeing the background image I am seeing a constant color image, with the most dominant color in the image...
– MattS
Mar 8 at 15:54
Can you please provide a working example? Instead of seeing the background image I am seeing a constant color image, with the most dominant color in the image...
– MattS
Mar 8 at 15:54
import matplotlib.pyplot as plt; import matplotlib.image as mpimg; plt.axis('off'); image = mpimg.imread("C:........figure.jpg"); #(windows) plt.imshow(image); plt.show()
– Richard Lenkiewicz
Mar 8 at 16:05
import matplotlib.pyplot as plt; import matplotlib.image as mpimg; plt.axis('off'); image = mpimg.imread("C:........figure.jpg"); #(windows) plt.imshow(image); plt.show()
– Richard Lenkiewicz
Mar 8 at 16:05
That is exactly what I am doing, after I generated the 3D object
– MattS
Mar 8 at 16:15
That is exactly what I am doing, after I generated the 3D object
– MattS
Mar 8 at 16:15
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55065865%2fdraw-3d-objects-over-2d-images-in-python%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown