Skip to content
This repository has been archived by the owner on Sep 17, 2021. It is now read-only.

WIP: Towards a more "Julian" package #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

timholy
Copy link
Contributor

@timholy timholy commented Sep 12, 2021

This is a proposed redesign that may be a bit more natural to work
with from the Julia perspective. The principal differences are:

This has not been tested (I don't know how, see JuliaImages/OpenCV.jl#3), so don't merge this unquestioningly.

This is a proposed redesign that may be a bit more natural to work
with from the Julia perspective. The principal difference are:

- Support eltypes of the form `SVector{T,N}`: this makes this wrapper
  behave more like OpenCV itself, which (unlike Python) does not use
  an array dimension to encode the number of color channels.

- Support `N0f8` and `N0f16`, JuliaImages preferred interpretation of
  8- and 16-bit unsigned intensity data. (See FixedPointNumbers and
  https://juliaimages.org/latest/tutorials/arrays_colors/#fixedpoint;
  interestingly, OpenCV itself suffers from the exact same problem, see
  https://stackoverflow.com/questions/14539498/change-type-of-mat-object-from-cv-32f-to-cv-8u
  for an example of a user who got bit by the "divide by 255" rule.)

- Work towards support for multidimensional arrays (see
  JuliaImages/OpenCV.jl#4)

- Validate arguments more carefully and improve correctness in a few
  key places
@timholy
Copy link
Contributor Author

timholy commented Sep 12, 2021

CC @johnnychen94

@timholy
Copy link
Contributor Author

timholy commented Sep 12, 2021

Note that I didn't put colorspace into the Mat type: that's because OpenCV itself seemingly doesn't tell you how to interpret the values stored in the array. (IMO, this choice is troubling: since when has there been a recent computer language that says "here's 64 bits, good luck guessing whether it's a Float64 or an Int64. But now go ahead and do some math on it despite the fact that those two have totally different rules for the bit-level representation of their math.")

@archit120
Copy link
Owner

Hi Tim,

I should probably have archived this repository and will do that rn to avoid confusion. The changes that you made should go into https://github.com/opencv/opencv_contrib/tree/master/modules/julia/gen/jl_cxx_files instead

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

Successfully merging this pull request may close these issues.

2 participants