Drawing an image using Vulkan - vulkan

I'm stuck so I took my code and wrote a smallish example to illustrate my issue. The texture renders all black. The target is vkwayland, but I exported my buffers and created vktest to make testing simpler.
Edit: links to sources and renderdocs:
https://www.reddit.com/r/vulkan/comments/abp7re/a_smallish_example_of_drawing_an_image_that/ed977in
Validation layers silent.
Much discussion here: https://www.reddit.com/r/vulkan/comments/abp7re/a_smallish_example_of_drawing_an_image_that/ed4r5br

So, as resolved on reddit:
You are using obsolete SDK (and Validation layers), therefore you get no error in this case.
And you are reading UINT image format through FLOAT sampler, which yields undefined values (in your case zeroes, i.e. black).

Related

How to sculpt with odd linear artefacts

I am currently learning how to sculpt in Blender; working on my own projects after completing BlenderGuru's Beginner & Intermediate classes, and some of Grant Abbitts videos with pleasing results. I am trying to sculpt a plasmapistol with a skull on it, which can be seen in the reference photo that I have provided.
However, when I sculpt, I get these really odd linear artefacts (See picture below, circled in black). I added a Subsurf Modifier to the primitive UV Sphere, with the Viewport and Render Values set to 4, so it is a fairly fine mesh. However, these still artefacts occur.
I assume it is due to the stretching of the polygons when I grab the sphere with the Snake Hook tool and deform it to encompass the frontal part of the skull.
EDIT: Whilst writing this comment I went back, and switched on Dynamic Topology with Relative Detail selected.
It appears that I am no longer getting the issues that I was getting last night with the linear artefacts.
Can I confirm that these problems are a result of having the incorrect Dynamic Topology settings for using the Snake Hook Tool; I was using Constant Detail instead of Relative Detail, or is this being caused by another issue?
Also, any advice on avoiding common pitfalls when choosing the settings in sculpting would be most appreciated.
I will continue to ask this question incase anyone has a similar problem and it can be resolved by reading this.
Sculpt, showing lineations
Experimenting with Dynamic Topology
In Object Mode, does the object have uniform X, Y, & Z scaling? If not, you can apply the scale from the object menu.
Object ‣ Apply ‣ Scale / Rotation & Scale

Problem with direction sensitive image-data

I´m new here, so please be kind and teach me if I did not provide all the information you need :)
I need to detect objects by object detection. Everything works fine for most of my object classes, but there is a problem:
I have some objects that are sensitive to their direction on the image. More precisely: I have objects that are aligned as "to the right" or "to the left" and should be recognized as such.
I already know that TensorFlow reflects the images randomly - which destroys my alignment, because left is right and right left. I come to this conclusion because all other objects are detected in a good amount and quality.
Therefore I want to "forbid" TensorFlow to mirror the images and only to rotate them instead.
I have already searched the Python classes and identified the function "tf.image.flip_left_right" which does the mirroring.
Now I don't know which of the many many files and places, where this method is called, I have to change (none of the scripts are mine, they all come natively with TensorFlow!)
Here are the scripts the method was called:
...\models\research\object_detection\core\preprocessor.py (1 hit)
...\models\research\object_detection\core\__pycache__\preprocessor.cpython-36.pyc (1 hit)
...\models\research\object_detection\training\events.out.tfevents.1559030641.R233689 (60 hits)
...\models\research\object_detection\training\graph.pbtxt (24 hits)
...above that: 36 Hits in every model.ckpt-XXXXX.meta-file
(which I dont think they are important for this problem?)
Has anyone had any experience with it and can give me any advice?
EDIT: I´m using TF in version 1.13
You should have a .config file somewhere which defines the augmentation applied to your images. See for example this file.
Just remove random_horizontal_flip {} and you are done.

Given a pair of images, how to automatically create an animation sequence morphing one image into the other?

Is there a programmatic way to convert two images into an animation sequence (e.g., an animated GIF) like the following example?
This image sequence, taken from a http://memrise.com course, doesn't seem to have manually-edited frames, but seems automatically transformed using some kind shape morphing algorithm. Is there a common term used to describe such an animation or algorithm? Is there a feature in ImageMagick or Photoshop/Gimp that generates such animations, given a pair of images?
Ideally the technique could be scriptable so I could create animations for several pairs of start-end images.
Edit: I have just been told about Gimp's tool under Filters->Animation->Blend, which appears to do the same thing as jQuery morph: each frame i is start + (finish - start)/N*i. In other words, you're transitioning each pixel independently from the start value to the finish value, without any shape morphing. The example gives is more complicated, as it modifies the contours of both images to achieve its compelling effect.
Other examples:
http://static.memrise.com/uploads/mems/32000121024054535.gif
http://static.memrise.com/uploads/mems/225428000121109232837.gif
I have written a tool that doesn't require setting manual keypoints and is not restricted to a domain (like faces). Anyway, the images have to be similar (e.g. two faces or two cars from the same perspective).
https://github.com/kallaballa/Poppy
There is also a web-version created with emscripten.
I generated the above animation using following command line:
poppy flame.png glyph.png flame.png
Although this is an old question, since ImageMagick is mentioned, for anyone who comes here from google it may be worth looking at this imagemagick plugin called shapemorph.
GIMP can't do that directly, but over the years a series of (now poorly maintaind) plug-ins to do that where released by third parties. The keyword for searching for this is "morph" - you should find a bunch of stand alone programs to do that as well, from "gratis" to full fledged Free Software, such as xmorph
Given pairs of vector files (.wmf extension) it is possible to use linear interpolation of shapenodes in Visual Basic for Applications to create frames for GIF animations , though this would take along time to explain. For some examples see
http://www.giless.co.uk/animatorMorphGIFs.htm (it is like a slideshow)
I have made some improvements since then, as well!

How to determine when PNG24 converted to PNG8 is lossless?

Hey, i'm using a program called pngquant to convert 24 bit PNGs to 8-bit PNGs. Everything seems to work fine, and I don't notice any loss of quality for icons and other images that don't contain too much colors. Now when I feed it a PNG photo with zillions of colours, it produces a PNG8 where I can see some quality loss.
I'd like to determine that quality loss programmatically. I'd like to know when converting a PNG24 to PNG8 is safe or not. Sort of what webpagetest.org does -- they tell you that this specific image will be smaller in size if converted to PNG8 and will not loose quality.
Any ideas?
Thanks.
This sounds like a full-reference image quality assessment problem.
The simplest way to approach this is to try computing the PSNR between the PNG24 and PNG8 images. This is a measure of the difference between the two images. The higher the PSNR, the less different the images are. After using your color quantization software, check if the PSNR is above some threshold (you'll have to determine that empirically), and if it is, then the quantization was "safe".
PSNR has its down sides, namely the fact that it doesn't always correspond to the way the human visual system works (for example, it neglects the phenomenon of spatial and contrast masking). Another metric, SSIM, attempts to take care of that problem, but is slightly more difficult to compute (here is an OpenCV implementation, though). You can use SSIM instead of PSNR in the thresholding approach I described above.
Here's another thread which you might find useful.
Quite simple. If the image you are converting from PNG24 to PNG8 has more thant 256 colors, you gonna loose quality. Do I missed something?
For development of pngquant I use my own SSIM tool, since the OpenCV-based one didn't seem to support gamma correction nor alpha channel properly.
When you run pngquant -v it will output amount of error introduced as MSE=n (n is mean square error — 0 is perfect quality).
The latest version has --quality setting which lets you set minimum required quality. If it can't achieve it, it won't save the file.

How to give best chance of success to an OCR software?

I am using Tesseract OCR (via pytesser) and PIL (Python Image Library) for automated test of an application.
I am checking that the displayed text is ok by making a screenshot and getting the text thanks to tesseract.
I had some issues in the beginning and it seems to work better since I have increased the size of the screenshot thanks to the bicubic interpolation of PIL.
Unfortunatelly, I still have some mistakes like confusion between '0' and 'O'. I can imagine that I will have other similar issues in the future.
I would like to know if there are some techniques to prepare an image in order to help the OCR. Any idea is welcomed.
Thanks in advance
Shameless plug and disclaimer: my company packages Tesseract for use in .NET
Tesseract is an OK OCR engine. It can miss a lot and gets readily confused by non-text. The best thing you can do for it is to make sure it gets text only. The next best thing is to give it something sanely binarized (adaptive or dynamic threshold to get there) or grayscale and let it try to do binarization.
Train tesseract to recognize your font
Make image extra clean and with enough free space around characters
Profit :)
Here are few real world examples.
First image is original image (croped power meter numbers)
Second image is slightly cleaned up image in GIMP, around 50% OCR accuracy in tesseract
Third image is completely cleaned image - 100% OCR recognized without any training!
Even under the best conditions OCR variants will sneak up on you. Your best option will be to design your tests to be aware of them.
For distinguishing between 0 and O, one simple solution is to choose a font that distinguishes between both (eg: 0 has a dash or dot in its middle). Would that be acceptable in your application?
Another solution is to apply a dictionary-based step after the character-by-character analysis of the text - feeding the recognized text into some form of spell-checker or validator to differentiate between difficult characters.
For instance, a round symbol followed by other numbers is most likely to be a zero, while the same symbol followed by letters is most likely to be a capital o. It's a trivial example, but it shows how context is necessary to make a more reliable OCR system.