Metal equivalent for glEnable(GL_LINE_SMOOTH) - metal

I cannot seem to find a similar feature to glEnable(GL_LINE_SMOOTH) in metal. Is it possible to do this in metal? If so, how?
Thanks!

Related

Sorting in a Metal compute shader

Does Metal have functionality similar to CUDA's thrust::sort or is one expected to write their own sort function?
Apple's Accelerate framework has useful vector operations in the vDSP package. Sorting, specifically, can be found here.
https://developer.apple.com/documentation/accelerate/vdsp/reversing_and_sorting_functions

Is possible to use Metal API for compute simultaneously with OpenGL ES 3.0 for graphics?

I would want to port some OpenCL sample using Metal as compute API (as iOS doesn't support ES 3.1 compute shaders still) and OpenGL ES as graphics API, as sample uses OCL/OGL interop seems easiest way to port..
questions is a app can make use of Metal and OpenGL ES APIs simultaneously and if and how interop is achieved i.e. OpenGL mapping a buffer object of data compute by Metal..
thanks..
Yes, you can use openGL and Metal API simultaneously, but keep in mind, any intercommunication between two layers leads to overhead of host/gpu memory traffic: you have to copy textures and buffers between Metal/OpenGL representations. I think the best way to utilize gpu is use one of these technology stack. Moreover all what you can do with opengl shaders you can do with metal kernels. In general, as i can judge after year of practice with Metal, it is more comfortable and convenient API then OpenGL. Enjoy with Metal, join us:)

very bad disparity map using Stereo SGBM

I'm using Stereo SGBM of openCV to generate disparity map from a couple of images satellite,
the result is very bad even when I change the parameters. what should I do ?
I developped a tool similar to the one given in Robst's answer, but a little more convenient, and cross-platform. You can find it here.
SGBM parameter tuner based on vmarquet's great QT GUI for BM:
https://github.com/hitimo/opencv-disparity-map-tuner
Might be helpful to find the correct parameter set.
You could try StereoBM to see if you can get better results. You could use the tool developed by Martin Peris found here to modify the parameters. It will be much easier with the GUI provided. You could do something similar for StereoSGBM. Make sure your images are properly rectified.
Regards

Linear Algebra library using OpenGL ES 2.0 for iOS

Does anyone know of a linear algebra library for iOS that uses OpenGL ES 2.0 under the covers?
Specifically, I am looking for a way to do matrix multiplication on arbitrary-sized matrices (e.g., much larger than 4x4, more like 5,000 x 100,000) using the GPUs on iOS devices.
Is there a specific reason you're asking for "uses OpenGL ES 2.0 under the covers?" Or do you just want a fast, hardware optimized linear algebra library such as BLAS, which is built into iOS?
MetalPerformanceShaders.framework provides some tuned BLAS-like functions. It is not GLES. It is metal and runs on the GPU. See MetalPerformanceShaders/MPSMatrixMultiplication.h
OpenGL on iOS is probably the wrong way to go. Metal support on iOS would be the better way to go if you're going GPU.
Metal
You could use Apple's support for Metal Compute shaders. I've written high-performance code for my PhD in it. An early experiment I made calculating some fractals using Metal might give you some ideas to start
Ultimately, this question is too broad. What do you intend to use the library for, or how do you intend to use it? Is it a one off multiplication? Have you tested with current libraries and found the performance to be too slow? If so, by how much?
In general, you can run educational or purely informational experiments on performance of algorithm X on CPU vs. GPU vs. specialized hardware, but most often you run up against Amdahl's law and your code vs. a team of experts in the field.
Accelerate
You can also look into the Accelerate framework which offers BLAS.
Apple, according to the WWDC 2014 talk What's new in the Accelerate Framework, has hand tuned the Linear Algebra libraries targeted at their current generation hardware. They aren't just fast, but energy efficient. There are newer talks as well.

Face Expression Change

I have seen numerous examples and sample code for detecting emotions from a human face. I am in desperate need of some algorithm to change expressions. I am a new OpenCV learner. I am also confused if this image manipulation can be done using opencv ? Can functions such as warpaffine() be used for this ? If shall be grateful if someone can guide me in steps how to perform this eg. input a neutral face emotion and convert it to smile ?
Try using FaceAPI, it is free to use for non-commercial purposes and works brilliantly. It is well documented and easy to use.

Resources