Skip to content

Commit

Permalink
fixed a bug related to #28
Browse files Browse the repository at this point in the history
  • Loading branch information
mlampros committed Jul 8, 2023
1 parent 5f0b92b commit 59b3c72
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 17 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: OpenImageR
Type: Package
Title: An Image Processing Toolkit
Version: 1.2.9
Date: 2023-05-23
Version: 1.3.0
Date: 2023-07-08
Authors@R: c( person("Lampros", "Mouselimis", email = "mouselimislampros@gmail.com", role = c("aut", "cre"), comment = c(ORCID = "https://orcid.org/0000-0002-8024-1546")), person("Sight", "Machine", role = "cph", comment = "findHOGFeatures function of the SimpleCV computer vision platform"), person("Johannes", "Buchner", role = "cph", comment = "average_hash, dhash and phash functions of the ImageHash python library"), person("Mohammad", "Haghighat", email = "haghighat@ieee.org", role = "cph", comment = "Gabor Feature Extraction"), person("Radhakrishna", "Achanta", email = "Radhakrishna.Achanta@epfl.ch", role = "cph", comment = "Author of the C++ code of the SLIC and SLICO algorithms (for commercial use please contact the author)"), person("Oleh", "Onyshchak", role = "cph", comment = "Author of the Python code of the WarpAffine function") )
Maintainer: Lampros Mouselimis <mouselimislampros@gmail.com>
BugReports: https://github.com/mlampros/OpenImageR/issues
Expand Down
6 changes: 6 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@

## OpenImageR 1.3.0

* I updated the README.md file related to "[[Rcpp::plugins(cpp11)]]", which was removed in the previous version
* I fixed a bug in the internal *'func_chech_range()'* function (see issue: https://github.com/mlampros/OpenImageR/issues/28)


## OpenImageR 1.2.9

* I added an exception in the test-file *"test-norm_matrix_range.R"* related to Mac OSx and Power-PC (see issue: https://github.com/mlampros/OpenImageR/issues/27)
Expand Down
22 changes: 10 additions & 12 deletions R/open_image_rscript.R
Original file line number Diff line number Diff line change
Expand Up @@ -151,20 +151,18 @@ switch_filter = function(kernel, conv_mod, gaussian_dims = 5, sigma = 1.0, lapla
#' @keywords internal

func_chech_range = function(image) {

if (inherits(image, 'matrix') && (max(image) != 1.0 || min(image) != 0.0)) {

image = Normalize_matrix(image)
}
else if (inherits(image, 'array') && (max(Array_range(image, 1)) != 1.0 || min(Array_range(image, 2)) != 0.0)) {

image = Normalize_array(image)
}
else {


if (inherits(image, 'matrix')) {
if ((max(image) != 1.0 || min(image) != 0.0)) {
image = Normalize_matrix(image)
}
} else if (inherits(image, 'array') && dim(image)[3] == 3) {
if (max(Array_range(image, 1)) != 1.0 || min(Array_range(image, 2)) != 0.0) {
image = Normalize_array(image)
}
} else {
return(image)
}

return(image)
}

Expand Down
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ LinkingTo: OpenImageR
# include <OpenImageRheader.h>
// [[Rcpp::depends("RcppArmadillo")]]
// [[Rcpp::depends(OpenImageR)]]
// [[Rcpp::plugins(cpp11)]]


```
Expand All @@ -94,7 +93,6 @@ A *complete minimal example* would be :
# include <OpenImageRheader.h>
// [[Rcpp::depends("RcppArmadillo")]]
// [[Rcpp::depends(OpenImageR)]]
// [[Rcpp::plugins(cpp11)]]


// [[Rcpp::export]]
Expand Down Expand Up @@ -226,7 +224,7 @@ If you use the code of this repository in your paper or research please cite bot
title = {{OpenImageR}: An Image Processing Toolkit},
author = {Lampros Mouselimis},
year = {2023},
note = {R package version 1.2.9},
note = {R package version 1.3.0},
url = {https://CRAN.R-project.org/package=OpenImageR},
}
```
Expand Down

0 comments on commit 59b3c72

Please sign in to comment.