question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

img from analysis functions empty

See original GitHub issue

Really nice job with the VIS tutorial! 1.5 things that stuck out to me: at the very end, for the analysis, the code posted doesn’t actually run in a jupyter cell because 1. indentation 2. args does not exist.

I removed those problems but then found that analyze_object(), analyze_bound(), analyze_color() all return empty arrays for the images. Looks like you only output the image if area and filename are defined. any reason for this? I realized pcv.params.debug = 'plot' also shows the plots but it be nice to have this flexibility to see the plots separately. As presented one would expect the images be output, even if filename (in my case) are not defined. If area is not defined you might actually consider a warning message.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
nfahlgrencommented, Nov 30, 2018

It depends on your preference, but what will happen functionally is this. Let’s say I put filename=test.png. pcv.analyze_object will output two images, test_shapes.jpg and test_mask.jpg, into the current working directory. If you run this analysis on multiple images this is probably not desirable because all the output images will have the same name. So as you said, I would generally use the filename variable that is output by the pcv.readimage function because you can then link the output image names to the input image name. The same goes for the output directory. You can either code this directly into your script or you can use an input variable to set the output directory. In your case you could set outfile = "C:\Users\Dominik Schneider\Downloads\" + filename to put all the output files in Downloads with the original image name plus the new suffix.

0reactions
nfahlgrencommented, Dec 11, 2018

@dschneiderch, no worries, this is awesome! In order to make the function available after import you have to add it to the __init__.py file one directory up: https://github.com/dschneiderch/plantcv/blob/readbayer/plantcv/plantcv/__init__.py

Read more comments on GitHub >

github_iconTop Results From Across the Web

What is an image of empty set? - Mathematics Stack Exchange
As known, empty set is a subset of each set, so my question is: Is it proper to write f(∅)=∅? analysis · elementary-set-theory...
Read more >
Analysis of images in folder by macro stops if image is empty
I am trying to analyze (morphology,skeletal and fractal dimension) multiple images (about 500) containing particles.
Read more >
Check if the image is empty using Python - OpenCV
In this article, we'll try to check if the opened image is empty or not by using OpenCV (Open Source Computer Vision).
Read more >
Error: !_img.empty() in function 'imwrite' - python - Stack Overflow
The cause may be that image is empty, so, You should check weather video is opened correctly before read frames by: cap.isOpened() ....
Read more >
Built-in Macro Functions - ImageJ
Returns the directory that the current image was loaded from, or an empty string if the directory is not available. getInfo("image.filename")
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found