Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Gradient operator #71

Closed
ghost opened this issue Aug 15, 2015 · 6 comments
Closed

Implement Gradient operator #71

ghost opened this issue Aug 15, 2015 · 6 comments
Milestone

Comments

@ghost
Copy link

ghost commented Aug 15, 2015

Application instantly crashes when i drag arrow to the gradient operator.

@l00mi
Copy link
Member

l00mi commented Aug 17, 2015

Aight, there seems to be a bug deeper in the alogrithm. We might put this process on hold and add it again after 6.0.0-rc.1.

@l00mi l00mi added this to the 6.1.0-beta.1 milestone Aug 17, 2015
@l00mi l00mi added the bug label Aug 17, 2015
@l00mi l00mi changed the title Gradient operator causes crash Implement Gradient operator Aug 19, 2015
@l00mi l00mi added enhancement and removed bug labels Aug 19, 2015
@l00mi
Copy link
Member

l00mi commented Aug 19, 2015

Make the IPLGradientOperator operator work.

@ladotonia
Copy link
Contributor

I've got a preliminary version with the gradient operators listed. I was not entirely sure what Cubic Spline was intended to be, so I opted to go with a bicubic interpolation and calculate the gradient based on that.

The original crasher was a bug in the constructor of an IMAGE_ORIENTED not having enough planes to support the data being inserted into it.

I also am not 100% sure how these should operate if useOpenCv is not set. Fast gradient doesn't use OpenCV at all, where all the others do. Sobel is an opencv function, Roberts is implemented using filter2D(), and the Bicubic interpolation only uses the matrix multiply/dot operations from OpenCV.

Here's a link to my branch with the code. I can create a pull request once I can incorporate some feedback on dealing with the OpenCV setting.
ladotonia/ImagePlay@32cb3af

@schmk2
Copy link

schmk2 commented Sep 3, 2015

A clarification for useOpenCv:
We originally had no opencv code, just our own implementation of algorithms. Then we added opencv and some algorithms now have 2 separate implementations. Even though opencv is almost always faster, want to leave our own implementation because it is generally more legible and thus better for learning from the source code.

The user can set in the GUI if he prefers the opencv or the custom implementation, which is then passed to you as the parameter useOpenCv.

Additionally, each IPLProcess can specify OPENCV_NONE, OPENCV_OPTIONAL or OPENCV_ONLY which is used for the GUI representation of the process.

In your case, the best way is to add in init():
setOpenCVSupport( IPLOpenCVSupport::OPENCV_ONLY );

And remove:
if( useOpenCV )

@schmk2 schmk2 closed this as completed Sep 8, 2015
@l00mi l00mi modified the milestones: 6.1.0-beta.1, 6.1.0 Dec 14, 2016
@drzraf
Copy link
Contributor

drzraf commented Jul 2, 2018

Checking "Cubic Spline" simply connected to "Camera > Convert to Grey' consistently segfault.
6.1.0, OpenCV 3.1, Qt 5.9.5

@l00mi
Copy link
Member

l00mi commented Jul 3, 2018

Do you see the same behaviour with Image > Convert to Grey > Cubic Spline ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants