Merge work done by aavogt over the last two years#10
Open
sinelaw wants to merge 140 commits into
Open
Conversation
- Fixed types in foreign imports. - Added a wrapper for cvErode. - Moved more memory management into Haskell. - Added reference to github fork to the .cabal file (this may be removed).
The HIplImage data type includes the features from the IplImage struct that OpenCV makes use of. This simplifies the job of inspecting an IplImage obtained from OpenCV for further processing in Haskell. Added the PixelUtils module for working with OpenCV's image packing style. The primary issue is that the image data buffer in an IplImage will sometimes contain room for four color channels even if only three are used. This is good for considering an image on a row-by-row basis, but complicates the view of image data as a single vector.
- Added an HIplImage smart constructor from image dimensions and a vector of pixel data. - Added a functional inteface for OpenCV dilation and erosion on HIplImage values.
…nels. These changes are to improve usability of HIplImage in a pure Haskell context. The nSize field, in parcticular, is a constant that is of no interest from within Haskell.
Added a helper for mutating a new HIplImage value in-place.
To support this, there is now functionality for duplicating images.
…s OpenCV functions on images.
Implemented in-place fusion compiler rules. Made the houghStandard output type match houghProbabilistic's. The in-place optimizations are all using unsafePerformIO at the moment, and this will have to change as it is, of course, totally unsafe. While the RULES pragma is firing correctly, other optimizations are killing the operations. They will have to be moved into ST or explicitly marked as IO.
The OpenCV documentation for cvSaveImage is incorrect: it takes a third parameter that should be set to zero. Still working out how to do the allocation fusing rules. The difficulty is in keeping the interface looking like functions but being able to recognize when fusable operations are composed.
Added a note about the current state of the unsafe operation fusion rules.
The intent is that we will sometimes perform in-place updates when composing an operation with a function whose return type explicitly indicates that it is returning a fresh image. This gets around the issue of fully parametric types like the identity function getting picked up for allocation fusion.
Added a bit of HIplImage to the export list of HighCV in the hope that HighCV can be the sole entrypoint to the library for a typical client.
The distinction between MonoChromatic and TriChromatic, as well as 8bpp or 16bpp, can now be determined through types. This makes various image processing procedures that, for example, require a monochromatic 8bpp image safe to call.
The parametricity over pixel depth can lead to generic paths through Data.Vector code. That is horribly slow, so such functions must be compiled with the concrete type they are used at. Marking them as INLINE addresses this, but it is something that needs minding.
Split parts of HIplImage into HIplUtils. Split parts of HighCV into HighColorConv. The main entrypoint is still HighCV, but the implementation is a bit more broken up now as some of the modules have gotten quite unwieldy.
This replaces the old dropAlpha as it is faster and more general. The idea is to trim OpenCV images that have a stride that is larger than strictly necessary. Such images have their valid pixel data copied and placed into a Vector that can be sent on the network faster than the padded version.
Returns a list of pixel values (of the appropriate depth and number of channels) sampled from a line in an image.
- Improved video capture from file interface. - Fixed bug in mkHIplImage related to the new image's size. - Fixed support for HIplImage's with floating point data.
…ndings, if present, prevent GHCi from linking with HOpenCV so the flag defaults to False (no bindings).
Several unsafe approaches to passing structs by value have been fixed using more extensive hsc2hs wrapping.
…dress warnings in GHC 7.4.
…r (<>) with base >= 4.5.
This new type uses data kinds to more succinctly enforce type-level properties of images.
Some code is simplified with the new Image type, and we admit fewer absurd types with tighter kinds.
This version of the library now needs GHC 7.6.1 or newer, so the base dependency is a signal that older GHC/base combinations won't work.
Added unsafePixelVector to return a Vector that shares storage with an Image. Added a type synonym for monochromatic floating point images.
Changed argument order on withPixelVector to take the Vector last.
Certain parameters, like origin, were not being properly loaded from the C structure into Haskell.
supposedly the old way (two CInt arguments) used to work in some cases, but this did not work (cvVideoWriter returned a null pointer) for my system. Note that there are similar wrappers pre-existing in HOpenCV_wrap.c
add a cvCreateVideo wrapper
Grab video from a webcam, show it on screen and write it to a compressed video file.
* http://docs.opencv.org/modules/highgui/doc/reading_and_writing_images_and_video.html#videowriter-videowriter * the error in https://gist.github.com/aavogt/59da0e98bfeaac0c9f1b becomes a type error with this change
working functions for contours & restrict createVideoWriter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.