Ask Your Question

Revision history [back]

How to find a segment location after applying PyrMeanShiftFiltering. Please help me i am new user of opencv

I am using following code to differentiate between a blue region (required region) in my image C:\fakepath\input image.jpg and the background. I have applied PyrMeanShiftFiltering function to do segmentation of the image. After applying code the result C:\fakepath\result.jpg image have successfully segmented blue section but now i want to know the location of this blue region (mid point). Can any one help me how i can know the coordinates of this blue region in my image after doing this image segmentation.

///Code///

include "cv.h"

include "highgui.h"

include "math.h"

include <iostream.h>

int main(int argc, char* argv) { IplImage output_image;

IplImage* image = cvLoadImage("31.jpg",CV_LOAD_IMAGE_COLOR);

CvMemStorage* storage = cvCreateMemStorage(0); cvNamedWindow( "origional image", 1 ); cvShowImage( "origional image", image); cvWaitKey(0);

IplImage *filtered = cvCreateImage(cvGetSize(image),image->depth,image->nChannels);

    cvCopy(image,filtered,NULL);

int level = 3; int spatial_radius = 40; int color_radius = 40;

//Here comes the thing filtered->width &= -(1<<level); filtered-="">height &= -(1<<level);< p="">

//Now you are free to do your thing cvPyrMeanShiftFiltering(filtered, filtered,spatial_radius,color_radius,level); cvNamedWindow( "fourth", 1 ); cvShowImage( "fourth", filtered); cvWaitKey(0);

return 0; }

How to find a segment location after applying PyrMeanShiftFiltering. Please help me i am new user of opencv

I am using following code to differentiate between a blue region (required region) in my image C:\fakepath\input image.jpg and the background. I have applied PyrMeanShiftFiltering function to do segmentation of the image. After applying code the result C:\fakepath\result.jpg image have successfully segmented blue section but now i want to know the location of this blue region (mid point). Can any one help me how i can know the coordinates of this blue region in my image after doing this image segmentation.

///Code///

include "cv.h"

include "highgui.h"

include "math.h"

include <iostream.h>

int main(int argc, char* argv) { IplImage output_image;

IplImage* image = cvLoadImage("31.jpg",CV_LOAD_IMAGE_COLOR);

CvMemStorage* storage = cvCreateMemStorage(0); cvNamedWindow( "origional image", 1 ); cvShowImage( "origional image", image); cvWaitKey(0);

IplImage *filtered = cvCreateImage(cvGetSize(image),image->depth,image->nChannels);

    cvCopy(image,filtered,NULL);

int level = 3; int spatial_radius = 40; int color_radius = 40;

//Here comes the thing filtered->width &= -(1<<level); filtered-="">height &= -(1<<level);< p="">

//Now you are free to do your thing cvPyrMeanShiftFiltering(filtered, filtered,spatial_radius,color_radius,level); cvNamedWindow( "fourth", 1 ); cvShowImage( "fourth", filtered); cvWaitKey(0);

return 0; }

How to find a segment location after applying PyrMeanShiftFiltering. Please help me i am new user of opencv

I am using following code to differentiate between a blue region (required region) in my image C:\fakepath\input image.jpg and the background. I have applied PyrMeanShiftFiltering function to do segmentation of the image. After applying code the result C:\fakepath\result.jpg image have successfully segmented blue section but now i want to know the location of this blue region (mid point). Can any one help me how i can know the coordinates of this blue region in my image after doing this image segmentation.

///Code///

include "cv.h"

include "highgui.h"

include "math.h"

include <iostream.h>

int main(int argc, char* argv) { IplImage output_image;

IplImage* image = cvLoadImage("31.jpg",CV_LOAD_IMAGE_COLOR);

CvMemStorage* storage = cvCreateMemStorage(0); cvNamedWindow( "origional image", 1 ); cvShowImage( "origional image", image); cvWaitKey(0);

IplImage *filtered = cvCreateImage(cvGetSize(image),image->depth,image->nChannels);

    cvCopy(image,filtered,NULL);

int level = 3; int spatial_radius = 40; int color_radius = 40;

//Here comes the thing filtered->width &= -(1<<level); filtered-="">height &= -(1<<level);< p="">

cvPyrMeanShiftFiltering(filtered, filtered,spatial_radius,color_radius,level); cvNamedWindow( "fourth", 1 ); cvShowImage( "fourth", filtered); cvWaitKey(0);

return 0; }

How to find a segment location after applying PyrMeanShiftFiltering. Please help me i am new user of opencv

I am using following code to differentiate between a blue region (required region) in my image C:\fakepath\input image.jpg and the background. I have applied PyrMeanShiftFiltering function to do segmentation of the image. After applying code the result C:\fakepath\result.jpg image have successfully segmented blue section but now i want to know the location of this blue region (mid point). Can any one help me how i can know the coordinates of this blue region in my image after doing this image segmentation.

enter code here

///Code///

include "cv.h"

include "highgui.h"

include "math.h"

include <iostream.h>

int main(int argc, char* argv) { IplImage output_image;

IplImage* image = cvLoadImage("31.jpg",CV_LOAD_IMAGE_COLOR);

CvMemStorage* storage = cvCreateMemStorage(0); cvNamedWindow( "origional image", 1 ); cvShowImage( "origional image", image); cvWaitKey(0);

IplImage *filtered = cvCreateImage(cvGetSize(image),image->depth,image->nChannels);

    cvCopy(image,filtered,NULL);

int level = 3; int spatial_radius = 40; int color_radius = 40;

filtered->width &= -(1<<level); filtered-="">height &= -(1<<level);< p="">

cvPyrMeanShiftFiltering(filtered, filtered,spatial_radius,color_radius,level); cvNamedWindow( "fourth", 1 ); cvShowImage( "fourth", filtered); cvWaitKey(0);

return 0; }

How to find a segment location after applying PyrMeanShiftFiltering. Please help me i am new user of opencv

I am using following code to differentiate between a blue region (required region) in my image C:\fakepath\input image.jpg and the background. I have applied PyrMeanShiftFiltering function to do segmentation of the image. After applying code the result C:\fakepath\result.jpg image have successfully segmented blue section but now i want to know the location of this blue region (mid point). Can any one help me how i can know the coordinates of this blue region in my image after doing this image segmentation.

enter code here
///Code///

///Code///

include "cv.h"

include "highgui.h"

include "math.h"

include <iostream.h>

int main(int argc, char* argv) { IplImage output_image;

IplImage* image = cvLoadImage("31.jpg",CV_LOAD_IMAGE_COLOR);

CvMemStorage* storage = cvCreateMemStorage(0); cvNamedWindow( "origional image", 1 ); cvShowImage( "origional image", image); cvWaitKey(0);

IplImage *filtered = cvCreateImage(cvGetSize(image),image->depth,image->nChannels);

    cvCopy(image,filtered,NULL);

int level = 3; int spatial_radius = 40; int color_radius = 40;

filtered->width &= -(1<<level); filtered-="">height &= -(1<<level);< p="">

cvPyrMeanShiftFiltering(filtered, filtered,spatial_radius,color_radius,level); cvNamedWindow( "fourth", 1 ); cvShowImage( "fourth", filtered); cvWaitKey(0);

return 0; }

How to find a segment location after applying PyrMeanShiftFiltering. Please help me i am new user of opencv

I am using following code to differentiate between a blue region (required region) in my image C:\fakepath\input image.jpg and the background. I have applied PyrMeanShiftFiltering function to do segmentation of the image. After applying code the result C:\fakepath\result.jpg image have successfully segmented blue section but now i want to know the location of this blue region (mid point). Can any one help me how i can know the coordinates of this blue region in my image after doing this image segmentation.

///Code///
#include "cv.h"

include "cv.h"

include "highgui.h"

include "math.h"

include <iostream.h>

int main(int argc, char* argv) { IplImage output_image;

IplImage* image = cvLoadImage("31.jpg",CV_LOAD_IMAGE_COLOR);

CvMemStorage* storage = cvCreateMemStorage(0); cvNamedWindow( "origional image", 1 ); cvShowImage( "origional image", image); cvWaitKey(0);

IplImage *filtered = cvCreateImage(cvGetSize(image),image->depth,image->nChannels);

    cvCopy(image,filtered,NULL);

int level = 3; int spatial_radius = 40; int color_radius = 40;

filtered->width &= -(1<<level); filtered-="">height &= -(1<<level);< p="">

cvPyrMeanShiftFiltering(filtered, filtered,spatial_radius,color_radius,level); cvNamedWindow( "fourth", 1 ); cvShowImage( "fourth", filtered); cvWaitKey(0);

return 0; }

How to find a segment location after applying PyrMeanShiftFiltering. Please help me i am new user of opencv

I am using following code to differentiate between a blue region (required region) in my image C:\fakepath\input image.jpg and the background. I have applied PyrMeanShiftFiltering function to do segmentation of the image. After applying code the result C:\fakepath\result.jpg image have successfully segmented blue section but now i want to know the location of this blue region (mid point). Can any one help me how i can know the coordinates of this blue region in my image after doing this image segmentation.

#include "cv.h"

include "cv.h"

include "highgui.h"

include "math.h"

include <iostream.h>

int main(int argc, char* argv) { IplImage output_image;

IplImage* image = cvLoadImage("31.jpg",CV_LOAD_IMAGE_COLOR);

CvMemStorage* storage = cvCreateMemStorage(0); cvNamedWindow( "origional image", 1 ); cvShowImage( "origional image", image); cvWaitKey(0);

IplImage *filtered = cvCreateImage(cvGetSize(image),image->depth,image->nChannels);

    cvCopy(image,filtered,NULL);

int level = 3; int spatial_radius = 40; int color_radius = 40;

filtered->width &= -(1<<level); filtered-="">height &= -(1<<level);< p="">

cvPyrMeanShiftFiltering(filtered, filtered,spatial_radius,color_radius,level); cvNamedWindow( "fourth", 1 ); cvShowImage( "fourth", filtered); cvWaitKey(0);

return 0; }

click to hide/show revision 8
No.8 Revision

updated 2016-11-12 03:46:40 -0600

berak gravatar image

How to find a segment location after applying PyrMeanShiftFiltering. Please help me i am new user of opencv

I am using following code to differentiate between a blue region (required region) in my image C:\fakepath\input image.jpg and the background. I have applied PyrMeanShiftFiltering function to do segmentation of the image. After applying code the result C:\fakepath\result.jpg image have successfully segmented blue section but now i want to know the location of this blue region (mid point). Can any one help me how i can know the coordinates of this blue region in my image after doing this image segmentation.

include "cv.h"

include "highgui.h"

include "math.h"

include <iostream.h>

#include "cv.h"
#include "highgui.h"
#include "math.h"
#include <iostream.h>


int main(int argc, char* char** argv)
{
IplImage output_image;

IplImage* output_image;
IplImage* image = cvLoadImage("31.jpg",CV_LOAD_IMAGE_COLOR);

CvMemStorage* storage = cvCreateMemStorage(0); cvNamedWindow( "origional image", 1 ); cvShowImage( "origional image", image); cvWaitKey(0);

cvWaitKey(0);
IplImage *filtered = cvCreateImage(cvGetSize(image),image->depth,image->nChannels);
 cvCopy(image,filtered,NULL);

int level = 3; int spatial_radius = 40; int color_radius = 40;

40; filtered->width &= -(1<<level); filtered-="">height -(1<<level); filtered->height &= -(1<<level);< p="">

-(1<<level); cvPyrMeanShiftFiltering(filtered, filtered,spatial_radius,color_radius,level); cvNamedWindow( "fourth", 1 ); cvShowImage( "fourth", filtered); cvWaitKey(0);

cvWaitKey(0); return 0; }

}

How to find a segment location after applying PyrMeanShiftFiltering. Please help me i am new user of opencv

I am using following code to differentiate between a sky blue region (required region) in my image C:\fakepath\input image.jpg and the background. I have applied PyrMeanShiftFiltering function to do segmentation of the image. After applying code the result C:\fakepath\result.jpg image have successfully segmented sky blue section but now i want to know the location of this sky blue region (mid point). Can any one help me how i can know the coordinates of this blue region in my image after doing this image segmentation.

#include "cv.h"
#include "highgui.h"
#include "math.h"
#include <iostream.h>


int main(int argc, char** argv)
{
IplImage* output_image;

    IplImage* image = cvLoadImage("31.jpg",CV_LOAD_IMAGE_COLOR);
  CvMemStorage* storage = cvCreateMemStorage(0);
        cvNamedWindow( "origional image", 1 );
        cvShowImage( "origional image", image);
        cvWaitKey(0);

    IplImage *filtered = cvCreateImage(cvGetSize(image),image->depth,image->nChannels);

        cvCopy(image,filtered,NULL);

  int level = 3;
  int spatial_radius = 40;
  int color_radius  = 40;

  filtered->width &= -(1<<level);
  filtered->height &= -(1<<level);

  cvPyrMeanShiftFiltering(filtered, filtered,spatial_radius,color_radius,level);
  cvNamedWindow( "fourth", 1 );
        cvShowImage( "fourth", filtered);
        cvWaitKey(0);

   return 0;
}
click to hide/show revision 10
No.10 Revision

updated 2016-11-12 04:07:31 -0600

berak gravatar image

How to find a segment location after applying PyrMeanShiftFiltering. Please help me i am new user of opencv

I am using following code to differentiate between a sky blue region (required region) in my image C:\fakepath\input image.jpg C:\fakepath\input image.jpg

and the background. I have applied PyrMeanShiftFiltering function to do segmentation of the image. After applying code the result C:\fakepath\result.jpg

C:\fakepath\result.jpg

image have successfully segmented sky blue section but now i want to know the location of this sky blue region (mid point). Can any one help me how i can know the coordinates of this blue region in my image after doing this image segmentation.

#include "cv.h"
#include "highgui.h"
#include "math.h"
#include <iostream.h>


int main(int argc, char** argv)
{
IplImage* output_image;

    IplImage* image = cvLoadImage("31.jpg",CV_LOAD_IMAGE_COLOR);
  CvMemStorage* storage = cvCreateMemStorage(0);
        cvNamedWindow( "origional image", 1 );
        cvShowImage( "origional image", image);
        cvWaitKey(0);

    IplImage *filtered = cvCreateImage(cvGetSize(image),image->depth,image->nChannels);

        cvCopy(image,filtered,NULL);

  int level = 3;
  int spatial_radius = 40;
  int color_radius  = 40;

  filtered->width &= -(1<<level);
  filtered->height &= -(1<<level);

  cvPyrMeanShiftFiltering(filtered, filtered,spatial_radius,color_radius,level);
  cvNamedWindow( "fourth", 1 );
        cvShowImage( "fourth", filtered);
        cvWaitKey(0);

   return 0;
}
click to hide/show revision 11
retagged

updated 2016-11-12 09:31:59 -0600

berak gravatar image

How to find a segment location after applying PyrMeanShiftFiltering. Please help me i am new user of opencv

I am using following code to differentiate between a sky blue region (required region) in my image C:\fakepath\input image.jpg

and the background. I have applied PyrMeanShiftFiltering function to do segmentation of the image. After applying code the result

C:\fakepath\result.jpg

image have successfully segmented sky blue section but now i want to know the location of this sky blue region (mid point). Can any one help me how i can know the coordinates of this blue region in my image after doing this image segmentation.

#include "cv.h"
#include "highgui.h"
#include "math.h"
#include <iostream.h>


int main(int argc, char** argv)
{
IplImage* output_image;

    IplImage* image = cvLoadImage("31.jpg",CV_LOAD_IMAGE_COLOR);
  CvMemStorage* storage = cvCreateMemStorage(0);
        cvNamedWindow( "origional image", 1 );
        cvShowImage( "origional image", image);
        cvWaitKey(0);

    IplImage *filtered = cvCreateImage(cvGetSize(image),image->depth,image->nChannels);

        cvCopy(image,filtered,NULL);

  int level = 3;
  int spatial_radius = 40;
  int color_radius  = 40;

  filtered->width &= -(1<<level);
  filtered->height &= -(1<<level);

  cvPyrMeanShiftFiltering(filtered, filtered,spatial_radius,color_radius,level);
  cvNamedWindow( "fourth", 1 );
        cvShowImage( "fourth", filtered);
        cvWaitKey(0);

   return 0;
}

How to find a segment location after applying PyrMeanShiftFiltering. Please help me i am new user of opencvPyrMeanShiftFiltering.

I am using following code to differentiate between a sky blue region (required region) in my image C:\fakepath\input image.jpg

and the background. I have applied PyrMeanShiftFiltering function to do segmentation of the image. After applying code the result

C:\fakepath\result.jpg

image have successfully segmented sky blue section but now i want to know the location of this sky blue region (mid point). Can any one help me how i can know the coordinates of this blue region in my image after doing this image segmentation.

#include "cv.h"
#include "highgui.h"
#include "math.h"
#include <iostream.h>


int main(int argc, char** argv)
{
IplImage* output_image;

    IplImage* image = cvLoadImage("31.jpg",CV_LOAD_IMAGE_COLOR);
  CvMemStorage* storage = cvCreateMemStorage(0);
        cvNamedWindow( "origional image", 1 );
        cvShowImage( "origional image", image);
        cvWaitKey(0);

    IplImage *filtered = cvCreateImage(cvGetSize(image),image->depth,image->nChannels);

        cvCopy(image,filtered,NULL);

  int level = 3;
  int spatial_radius = 40;
  int color_radius  = 40;

  filtered->width &= -(1<<level);
  filtered->height &= -(1<<level);

  cvPyrMeanShiftFiltering(filtered, filtered,spatial_radius,color_radius,level);
  cvNamedWindow( "fourth", 1 );
        cvShowImage( "fourth", filtered);
        cvWaitKey(0);

   return 0;
}