jsfeat icon indicating copy to clipboard operation
jsfeat copied to clipboard

Warp perspective for RGBA images

Open vfateev opened this issue 10 years ago • 5 comments

I see warp perspective is implemented only for grayscale images. Is it hard to implement the same for standard color images? Want to hear your opinion before digging into Java JAI or OpenCV code. What was the reason why you implemented it for single channel source only?

vfateev avatar Dec 17 '15 15:12 vfateev

if you look into the warping code you will see it quite easy to adopt it to multichannel images. the reason it is done for single channel at the moment is performance. i dont know why u need this function for rgb(a) images but you might consider doing it with GL shader instead if its for pure render case and not further processing

inspirit avatar Dec 17 '15 16:12 inspirit

Hello, previously I did an adoption of warp_perspective for rgba images, you can find a function called warp_perspective_color in: https://github.com/josundin/magcut/blob/master/js/imagewarp.js It's not optimized for performance but I guess it does what you are looking for.

josundin avatar Dec 18 '15 09:12 josundin

I was going to use glfx.js lib perspective API based on Web GL, but hopefully Johan has already shared implementation I was looking for. It works pretty fast at least for 2mb image, looks very promising. So thanks a million to Johan!

vfateev avatar Dec 18 '15 14:12 vfateev

Cheers. Also thanks to inspirit making and sharing jsfeat!

josundin avatar Jan 30 '16 20:01 josundin

Hello,

I was trying to adapt the warping code to 4 channels (RGBA). But I'm struggling. Can someone help me?

Edit: Sorry, I'm dumb, didn't see the name of the function on the post of @josundin ... Thanks!

DouglasCostaPinheiro avatar Feb 24 '17 15:02 DouglasCostaPinheiro