Ask Your Question

Costantino's profile - activity

2017-08-03 15:37:41 -0500 received badge  Notable Question (source)
2016-07-20 19:21:10 -0500 received badge  Popular Question (source)
2013-05-15 11:42:26 -0500 commented answer imread in iOS

I had not thought to read the image using UIImage. It works, thanks.

2013-05-14 13:25:33 -0500 asked a question imread in iOS

Hi all, I'm working with OpenCV 2.4.3 in iOS. I want to read an image, so I use imread() function, but result Mat image is always empty.

    NSString *nsFileName = [destPath stringByAppendingPathComponent:imgSVMList[i]];
    std::string fileName = std::string([nsFileName UTF8String]);
    img = imread(fileName,CV_LOAD_IMAGE_GRAYSCALE);
    if (!img.data) {
        NSLog(@"Errore nella lettura dell'immagine");
    } else {
        NSLog(@"Rows: %i; Cols: %i",img.rows,img.cols);
    }

destPath is a Documets subfolder (/Documents/ImgSVM/) and imgSVMLista[] is a vector with images filename. So, nsFileName is, for example, <...>/Documents/ImgSVM/Img1.jpg. Well, img is alway empty.

image description

image description

As you can see rows and cols are 0 (The screenshot of the log was taken after the reading of the image). This is an example of image I want to read:

image description

Any suggestion? Costantino

2013-05-14 13:04:56 -0500 commented answer Color constancy in different illumination condition

Thanks a lot Costantino

2013-04-22 14:15:21 -0500 received badge  Student (source)
2013-04-18 03:39:04 -0500 asked a question How to identify an image once in a video sequence?

Hi all.
In my application (iOS) I search circular and triangular red objects. To do this I do an analysis of the colors converting RGB space to HSV and search shapes using findContour(). If I find a red object (circular or triangular) cut the portion of the image that contains it using its contour to define the ROI. This happens for each frame, and the problem is that the same “object” is grabbed many times because its contour is found in multiple frames. So, If I take a red circle for 1 second by moving the iPad around this image and the acquisition takes place at 30 frames per second, at the end I will have 30 images of the same object, while I only want one. In the image below, in the upper left the captured video from the camera, at the top right the last image captured and in the lower the sequence of images captured. As you can see, the red circle is captured many times, but always refers to the same object, and this happens because the image I cut it based on the boundary identified. I think I have to use a tracking system, is that correct?

Any suggestions to solve this problem?

image description Best regards
Costantino

2013-04-12 13:43:09 -0500 received badge  Supporter (source)
2013-04-12 13:29:52 -0500 received badge  Scholar (source)
2013-04-12 13:29:47 -0500 commented answer How to show UIImage in processImage:(Mat&)image method

It works, thanks a lot.

2013-04-07 15:23:06 -0500 commented answer How to show UIImage in processImage:(Mat&)image method

processImage is called. In fact in this method I perform many operations (space color conversion from RGB to HVS, find contour, shape detection and grabCut) and I see result of operations.

2013-04-07 13:47:11 -0500 commented question How to show UIImage in processImage:(Mat&)image method

This is Objective-C code. I followed this tutorial http://docs.opencv.org/doc/tutorials/ios/video_processing/video_processing.html#opencviosvideoprocessing and in "processImage:(Mat&)image" method I used grabCut() function. So, I converted cv::Mat resulting image in UIImage structure to display it in UIImageView (imgViewSegnale in the code that I wrote before ). Well, the captured image is not displayed. So I tried to display a "static" image (testImage.png) instead of the captured image, but nothing.

(I'm sorry but I do not know English very well and I find it hard to express myself)

2013-04-07 12:50:15 -0500 received badge  Editor (source)
2013-04-07 12:49:23 -0500 asked a question How to show UIImage in processImage:(Mat&)image method

Hi all, I want to show a UIImage in processImage:(Mat&)image method, but it does not work. I used this code:

UIImage *imgSegnale = [UIImage imageNamed:@"testImage.png"];
self.imgViewSegnale.image = imgSegnale;

If I add this code in viewDidLod method, it works. Also work if I add this code in a (IBAction) method (using a button). But it don't work if I add this code in processImage:(Mat&)image method.

Any suggestion?

Best regards Costantino

2013-03-13 10:16:43 -0500 commented answer Color constancy in different illumination condition

Thanks for the reply.

Costantino

2013-03-13 10:16:07 -0500 answered a question Color constancy in different illumination condition

Thanks for the reply.

Costantino

2013-03-12 13:22:41 -0500 asked a question Color constancy in different illumination condition

Hi all. In a paper I'm reading is written: "RGB images taken from the camera are first passed through a pre-processing stage which helps to maintain the colour constancy in different illumination conditions." (focus is road signs recognition in a real time system). Is there a method in OpenCV to do this?

Best regards Costantino